fakebase-studio 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +85 -0
- package/bin/fakebase.js +92 -0
- package/package.json +44 -0
- package/server/dist/db.d.ts +18 -0
- package/server/dist/db.d.ts.map +1 -0
- package/server/dist/db.js +83 -0
- package/server/dist/db.js.map +1 -0
- package/server/dist/index.d.ts +2 -0
- package/server/dist/index.d.ts.map +1 -0
- package/server/dist/index.js +62 -0
- package/server/dist/index.js.map +1 -0
- package/server/dist/routes/connect.d.ts +6 -0
- package/server/dist/routes/connect.d.ts.map +1 -0
- package/server/dist/routes/connect.js +40 -0
- package/server/dist/routes/connect.js.map +1 -0
- package/server/dist/routes/connections.d.ts +3 -0
- package/server/dist/routes/connections.d.ts.map +1 -0
- package/server/dist/routes/connections.js +106 -0
- package/server/dist/routes/connections.js.map +1 -0
- package/server/dist/routes/index.d.ts +6 -0
- package/server/dist/routes/index.d.ts.map +1 -0
- package/server/dist/routes/index.js +16 -0
- package/server/dist/routes/index.js.map +1 -0
- package/server/dist/routes/indexes.d.ts +6 -0
- package/server/dist/routes/indexes.d.ts.map +1 -0
- package/server/dist/routes/indexes.js +38 -0
- package/server/dist/routes/indexes.js.map +1 -0
- package/server/dist/routes/schema.d.ts +6 -0
- package/server/dist/routes/schema.d.ts.map +1 -0
- package/server/dist/routes/schema.js +41 -0
- package/server/dist/routes/schema.js.map +1 -0
- package/server/dist/routes/tables.d.ts +6 -0
- package/server/dist/routes/tables.d.ts.map +1 -0
- package/server/dist/routes/tables.js +121 -0
- package/server/dist/routes/tables.js.map +1 -0
- package/server/dist/services/connections.service.d.ts +31 -0
- package/server/dist/services/connections.service.d.ts.map +1 -0
- package/server/dist/services/connections.service.js +125 -0
- package/server/dist/services/connections.service.js.map +1 -0
- package/server/dist/services/indexes.service.d.ts +8 -0
- package/server/dist/services/indexes.service.d.ts.map +1 -0
- package/server/dist/services/indexes.service.js +54 -0
- package/server/dist/services/indexes.service.js.map +1 -0
- package/server/dist/services/schema.service.d.ts +7 -0
- package/server/dist/services/schema.service.d.ts.map +1 -0
- package/server/dist/services/schema.service.js +165 -0
- package/server/dist/services/schema.service.js.map +1 -0
- package/server/dist/types/api.d.ts +36 -0
- package/server/dist/types/api.d.ts.map +1 -0
- package/server/dist/types/api.js +5 -0
- package/server/dist/types/api.js.map +1 -0
- package/server/dist/types/database.d.ts +29 -0
- package/server/dist/types/database.d.ts.map +1 -0
- package/server/dist/types/database.js +5 -0
- package/server/dist/types/database.js.map +1 -0
- package/server/dist/utils/errors.d.ts +15 -0
- package/server/dist/utils/errors.d.ts.map +1 -0
- package/server/dist/utils/errors.js +63 -0
- package/server/dist/utils/errors.js.map +1 -0
- package/ui/dist/assets/index-D3BM4q8p.js +70 -0
- package/ui/dist/assets/index-DvydtHdZ.css +1 -0
- package/ui/dist/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/ui/dist/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/ui/dist/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/ui/dist/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/ui/dist/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/ui/dist/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/ui/dist/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/ui/dist/index.html +14 -0
- package/ui/dist/vite.svg +1 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
function Q3(t,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in t)){const i=Object.getOwnPropertyDescriptor(o,a);i&&Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function u0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wg={exports:{}},ec={};var bb;function J3(){if(bb)return ec;bb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(o,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:t,type:o,key:l,ref:a!==void 0?a:null,props:i}}return ec.Fragment=e,ec.jsx=n,ec.jsxs=n,ec}var wb;function eT(){return wb||(wb=1,wg.exports=J3()),wg.exports}var y=eT(),Sg={exports:{}},it={};var Sb;function tT(){if(Sb)return it;Sb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),p=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function M(I,z,H){this.props=I,this.context=z,this.refs=S,this.updater=H||w}M.prototype.isReactComponent={},M.prototype.setState=function(I,z){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,z,"setState")},M.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function N(){}N.prototype=M.prototype;function C(I,z,H){this.props=I,this.context=z,this.refs=S,this.updater=H||w}var R=C.prototype=new N;R.constructor=C,E(R,M.prototype),R.isPureReactComponent=!0;var D=Array.isArray;function T(){}var k={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function $(I,z,H){var G=H.ref;return{$$typeof:t,type:I,key:z,ref:G!==void 0?G:null,props:H}}function K(I,z){return $(I.type,z,I.props)}function U(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function Y(I){var z={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(H){return z[H]})}var Z=/\/+/g;function P(I,z){return typeof I=="object"&&I!==null&&I.key!=null?Y(""+I.key):z.toString(36)}function q(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(T,T):(I.status="pending",I.then(function(z){I.status==="pending"&&(I.status="fulfilled",I.value=z)},function(z){I.status==="pending"&&(I.status="rejected",I.reason=z)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function A(I,z,H,G,J){var ae=typeof I;(ae==="undefined"||ae==="boolean")&&(I=null);var W=!1;if(I===null)W=!0;else switch(ae){case"bigint":case"string":case"number":W=!0;break;case"object":switch(I.$$typeof){case t:case e:W=!0;break;case g:return W=I._init,A(W(I._payload),z,H,G,J)}}if(W)return J=J(I),W=G===""?"."+P(I,0):G,D(J)?(H="",W!=null&&(H=W.replace(Z,"$&/")+"/"),A(J,z,H,"",function(de){return de})):J!=null&&(U(J)&&(J=K(J,H+(J.key==null||I&&I.key===J.key?"":(""+J.key).replace(Z,"$&/")+"/")+W)),z.push(J)),1;W=0;var ee=G===""?".":G+":";if(D(I))for(var oe=0;oe<I.length;oe++)G=I[oe],ae=ee+P(G,oe),W+=A(G,z,H,ae,J);else if(oe=x(I),typeof oe=="function")for(I=oe.call(I),oe=0;!(G=I.next()).done;)G=G.value,ae=ee+P(G,oe++),W+=A(G,z,H,ae,J);else if(ae==="object"){if(typeof I.then=="function")return A(q(I),z,H,G,J);throw z=String(I),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return W}function B(I,z,H){if(I==null)return I;var G=[],J=0;return A(I,G,"","",function(ae){return z.call(H,ae,J++)}),G}function L(I){if(I._status===-1){var z=I._result;z=z(),z.then(function(H){(I._status===0||I._status===-1)&&(I._status=1,I._result=H)},function(H){(I._status===0||I._status===-1)&&(I._status=2,I._result=H)}),I._status===-1&&(I._status=0,I._result=z)}if(I._status===1)return I._result.default;throw I._result}var F=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},X={map:B,forEach:function(I,z,H){B(I,function(){z.apply(this,arguments)},H)},count:function(I){var z=0;return B(I,function(){z++}),z},toArray:function(I){return B(I,function(z){return z})||[]},only:function(I){if(!U(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return it.Activity=m,it.Children=X,it.Component=M,it.Fragment=n,it.Profiler=a,it.PureComponent=C,it.StrictMode=o,it.Suspense=d,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,it.__COMPILER_RUNTIME={__proto__:null,c:function(I){return k.H.useMemoCache(I)}},it.cache=function(I){return function(){return I.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(I,z,H){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var G=E({},I.props),J=I.key;if(z!=null)for(ae in z.key!==void 0&&(J=""+z.key),z)!j.call(z,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&z.ref===void 0||(G[ae]=z[ae]);var ae=arguments.length-2;if(ae===1)G.children=H;else if(1<ae){for(var W=Array(ae),ee=0;ee<ae;ee++)W[ee]=arguments[ee+2];G.children=W}return $(I.type,J,G)},it.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:i,_context:I},I},it.createElement=function(I,z,H){var G,J={},ae=null;if(z!=null)for(G in z.key!==void 0&&(ae=""+z.key),z)j.call(z,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(J[G]=z[G]);var W=arguments.length-2;if(W===1)J.children=H;else if(1<W){for(var ee=Array(W),oe=0;oe<W;oe++)ee[oe]=arguments[oe+2];J.children=ee}if(I&&I.defaultProps)for(G in W=I.defaultProps,W)J[G]===void 0&&(J[G]=W[G]);return $(I,ae,J)},it.createRef=function(){return{current:null}},it.forwardRef=function(I){return{$$typeof:u,render:I}},it.isValidElement=U,it.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:L}},it.memo=function(I,z){return{$$typeof:f,type:I,compare:z===void 0?null:z}},it.startTransition=function(I){var z=k.T,H={};k.T=H;try{var G=I(),J=k.S;J!==null&&J(H,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(T,F)}catch(ae){F(ae)}finally{z!==null&&H.types!==null&&(z.types=H.types),k.T=z}},it.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},it.use=function(I){return k.H.use(I)},it.useActionState=function(I,z,H){return k.H.useActionState(I,z,H)},it.useCallback=function(I,z){return k.H.useCallback(I,z)},it.useContext=function(I){return k.H.useContext(I)},it.useDebugValue=function(){},it.useDeferredValue=function(I,z){return k.H.useDeferredValue(I,z)},it.useEffect=function(I,z){return k.H.useEffect(I,z)},it.useEffectEvent=function(I){return k.H.useEffectEvent(I)},it.useId=function(){return k.H.useId()},it.useImperativeHandle=function(I,z,H){return k.H.useImperativeHandle(I,z,H)},it.useInsertionEffect=function(I,z){return k.H.useInsertionEffect(I,z)},it.useLayoutEffect=function(I,z){return k.H.useLayoutEffect(I,z)},it.useMemo=function(I,z){return k.H.useMemo(I,z)},it.useOptimistic=function(I,z){return k.H.useOptimistic(I,z)},it.useReducer=function(I,z,H){return k.H.useReducer(I,z,H)},it.useRef=function(I){return k.H.useRef(I)},it.useState=function(I){return k.H.useState(I)},it.useSyncExternalStore=function(I,z,H){return k.H.useSyncExternalStore(I,z,H)},it.useTransition=function(){return k.H.useTransition()},it.version="19.2.4",it}var Cb;function el(){return Cb||(Cb=1,Sg.exports=tT()),Sg.exports}var v=el();const ue=u0(v),yC=Q3({__proto__:null,default:ue},[v]);var Cg={exports:{}},tc={},Eg={exports:{}},_g={};var Eb;function nT(){return Eb||(Eb=1,(function(t){function e(A,B){var L=A.length;A.push(B);e:for(;0<L;){var F=L-1>>>1,X=A[F];if(0<a(X,B))A[F]=B,A[L]=X,L=F;else break e}}function n(A){return A.length===0?null:A[0]}function o(A){if(A.length===0)return null;var B=A[0],L=A.pop();if(L!==B){A[0]=L;e:for(var F=0,X=A.length,I=X>>>1;F<I;){var z=2*(F+1)-1,H=A[z],G=z+1,J=A[G];if(0>a(H,L))G<X&&0>a(J,H)?(A[F]=J,A[G]=L,F=G):(A[F]=H,A[z]=L,F=z);else if(G<X&&0>a(J,L))A[F]=J,A[G]=L,F=G;else break e}}return B}function a(A,B){var L=A.sortIndex-B.sortIndex;return L!==0?L:A.id-B.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var d=[],f=[],g=1,m=null,p=3,x=!1,w=!1,E=!1,S=!1,M=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function R(A){for(var B=n(f);B!==null;){if(B.callback===null)o(f);else if(B.startTime<=A)o(f),B.sortIndex=B.expirationTime,e(d,B);else break;B=n(f)}}function D(A){if(E=!1,R(A),!w)if(n(d)!==null)w=!0,T||(T=!0,Y());else{var B=n(f);B!==null&&q(D,B.startTime-A)}}var T=!1,k=-1,j=5,$=-1;function K(){return S?!0:!(t.unstable_now()-$<j)}function U(){if(S=!1,T){var A=t.unstable_now();$=A;var B=!0;try{e:{w=!1,E&&(E=!1,N(k),k=-1),x=!0;var L=p;try{t:{for(R(A),m=n(d);m!==null&&!(m.expirationTime>A&&K());){var F=m.callback;if(typeof F=="function"){m.callback=null,p=m.priorityLevel;var X=F(m.expirationTime<=A);if(A=t.unstable_now(),typeof X=="function"){m.callback=X,R(A),B=!0;break t}m===n(d)&&o(d),R(A)}else o(d);m=n(d)}if(m!==null)B=!0;else{var I=n(f);I!==null&&q(D,I.startTime-A),B=!1}}break e}finally{m=null,p=L,x=!1}B=void 0}}finally{B?Y():T=!1}}}var Y;if(typeof C=="function")Y=function(){C(U)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,P=Z.port2;Z.port1.onmessage=U,Y=function(){P.postMessage(null)}}else Y=function(){M(U,0)};function q(A,B){k=M(function(){A(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(A){A.callback=null},t.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<A?Math.floor(1e3/A):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(A){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var L=p;p=B;try{return A()}finally{p=L}},t.unstable_requestPaint=function(){S=!0},t.unstable_runWithPriority=function(A,B){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var L=p;p=A;try{return B()}finally{p=L}},t.unstable_scheduleCallback=function(A,B,L){var F=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?F+L:F):L=F,A){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=L+X,A={id:g++,callback:B,priorityLevel:A,startTime:L,expirationTime:X,sortIndex:-1},L>F?(A.sortIndex=L,e(f,A),n(d)===null&&A===n(f)&&(E?(N(k),k=-1):E=!0,q(D,L-F))):(A.sortIndex=X,e(d,A),w||x||(w=!0,T||(T=!0,Y()))),A},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(A){var B=p;return function(){var L=p;p=B;try{return A.apply(this,arguments)}finally{p=L}}}})(_g)),_g}var _b;function oT(){return _b||(_b=1,Eg.exports=nT()),Eg.exports}var Mg={exports:{}},Gn={};var Mb;function rT(){if(Mb)return Gn;Mb=1;var t=el();function e(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(d,f,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:d,containerInfo:f,implementation:g}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Gn.createPortal=function(d,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return i(d,f,null,g)},Gn.flushSync=function(d){var f=l.T,g=o.p;try{if(l.T=null,o.p=2,d)return d()}finally{l.T=f,o.p=g,o.d.f()}},Gn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,o.d.C(d,f))},Gn.prefetchDNS=function(d){typeof d=="string"&&o.d.D(d)},Gn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var g=f.as,m=u(g,f.crossOrigin),p=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?o.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:p,fetchPriority:x}):g==="script"&&o.d.X(d,{crossOrigin:m,integrity:p,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Gn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=u(f.as,f.crossOrigin);o.d.M(d,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&o.d.M(d)},Gn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,m=u(g,f.crossOrigin);o.d.L(d,g,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Gn.preloadModule=function(d,f){if(typeof d=="string")if(f){var g=u(f.as,f.crossOrigin);o.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else o.d.m(d)},Gn.requestFormReset=function(d){o.d.r(d)},Gn.unstable_batchedUpdates=function(d,f){return d(f)},Gn.useFormState=function(d,f,g){return l.H.useFormState(d,f,g)},Gn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Gn.version="19.2.4",Gn}var Nb;function vC(){if(Nb)return Mg.exports;Nb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Mg.exports=rT(),Mg.exports}var Rb;function aT(){if(Rb)return tc;Rb=1;var t=oT(),e=el(),n=vC();function o(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function i(r){var s=r,c=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(c=s.return),r=s.return;while(r)}return s.tag===3?c:null}function l(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function u(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function d(r){if(i(r)!==r)throw Error(o(188))}function f(r){var s=r.alternate;if(!s){if(s=i(r),s===null)throw Error(o(188));return s!==r?null:r}for(var c=r,h=s;;){var b=c.return;if(b===null)break;var _=b.alternate;if(_===null){if(h=b.return,h!==null){c=h;continue}break}if(b.child===_.child){for(_=b.child;_;){if(_===c)return d(b),r;if(_===h)return d(b),s;_=_.sibling}throw Error(o(188))}if(c.return!==h.return)c=b,h=_;else{for(var O=!1,V=b.child;V;){if(V===c){O=!0,c=b,h=_;break}if(V===h){O=!0,h=b,c=_;break}V=V.sibling}if(!O){for(V=_.child;V;){if(V===c){O=!0,c=_,h=b;break}if(V===h){O=!0,h=_,c=b;break}V=V.sibling}if(!O)throw Error(o(189))}}if(c.alternate!==h)throw Error(o(190))}if(c.tag!==3)throw Error(o(188));return c.stateNode.current===c?r:s}function g(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=g(r),s!==null)return s;r=r.sibling}return null}var m=Object.assign,p=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),C=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function Y(r){return r===null||typeof r!="object"?null:(r=U&&r[U]||r["@@iterator"],typeof r=="function"?r:null)}var Z=Symbol.for("react.client.reference");function P(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Z?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case E:return"Fragment";case M:return"Profiler";case S:return"StrictMode";case D:return"Suspense";case T:return"SuspenseList";case $:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case w:return"Portal";case C:return r.displayName||"Context";case N:return(r._context.displayName||"Context")+".Consumer";case R:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case k:return s=r.displayName||null,s!==null?s:P(r.type)||"Memo";case j:s=r._payload,r=r._init;try{return P(r(s))}catch{}}return null}var q=Array.isArray,A=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},F=[],X=-1;function I(r){return{current:r}}function z(r){0>X||(r.current=F[X],F[X]=null,X--)}function H(r,s){X++,F[X]=r.current,r.current=s}var G=I(null),J=I(null),ae=I(null),W=I(null);function ee(r,s){switch(H(ae,s),H(J,r),H(G,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?V1(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=V1(s),r=U1(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}z(G),H(G,r)}function oe(){z(G),z(J),z(ae)}function de(r){r.memoizedState!==null&&H(W,r);var s=G.current,c=U1(s,r.type);s!==c&&(H(J,r),H(G,c))}function ge(r){J.current===r&&(z(G),z(J)),W.current===r&&(z(W),Xl._currentValue=L)}var ne,_e;function De(r){if(ne===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);ne=s&&s[1]||"",_e=-1<c.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ne+r+_e}var Ye=!1;function Pe(r,s){if(!r||Ye)return"";Ye=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(me){var he=me}Reflect.construct(r,[],Se)}else{try{Se.call()}catch(me){he=me}r.call(Se.prototype)}}else{try{throw Error()}catch(me){he=me}(Se=r())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(me){if(me&&he&&typeof me.stack=="string")return[me.stack,he.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),O=_[0],V=_[1];if(O&&V){var te=O.split(`
|
|
4
|
+
`),fe=V.split(`
|
|
5
|
+
`);for(b=h=0;h<te.length&&!te[h].includes("DetermineComponentFrameRoot");)h++;for(;b<fe.length&&!fe[b].includes("DetermineComponentFrameRoot");)b++;if(h===te.length||b===fe.length)for(h=te.length-1,b=fe.length-1;1<=h&&0<=b&&te[h]!==fe[b];)b--;for(;1<=h&&0<=b;h--,b--)if(te[h]!==fe[b]){if(h!==1||b!==1)do if(h--,b--,0>b||te[h]!==fe[b]){var pe=`
|
|
6
|
+
`+te[h].replace(" at new "," at ");return r.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",r.displayName)),pe}while(1<=h&&0<=b);break}}}finally{Ye=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?De(c):""}function mt(r,s){switch(r.tag){case 26:case 27:case 5:return De(r.type);case 16:return De("Lazy");case 13:return r.child!==s&&s!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Pe(r.type,!1);case 11:return Pe(r.type.render,!1);case 1:return Pe(r.type,!0);case 31:return De("Activity");default:return""}}function sn(r){try{var s="",c=null;do s+=mt(r,c),c=r,r=r.return;while(r);return s}catch(h){return`
|
|
7
|
+
Error generating stack: `+h.message+`
|
|
8
|
+
`+h.stack}}var ft=Object.prototype.hasOwnProperty,xn=t.unstable_scheduleCallback,ln=t.unstable_cancelCallback,Ft=t.unstable_shouldYield,fn=t.unstable_requestPaint,zt=t.unstable_now,Nn=t.unstable_getCurrentPriorityLevel,gn=t.unstable_ImmediatePriority,In=t.unstable_UserBlockingPriority,jn=t.unstable_NormalPriority,Ce=t.unstable_LowPriority,Ve=t.unstable_IdlePriority,Et=t.log,Xe=t.unstable_setDisableYieldValue,at=null,gt=null;function qt(r){if(typeof Et=="function"&&Xe(r),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(at,r)}catch{}}var Wt=Math.clz32?Math.clz32:Be,Qn=Math.log,_t=Math.LN2;function Be(r){return r>>>=0,r===0?32:31-(Qn(r)/_t|0)|0}var nt=256,Ue=262144,st=4194304;function Lt(r){var s=r&42;if(s!==0)return s;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Te(r,s,c){var h=r.pendingLanes;if(h===0)return 0;var b=0,_=r.suspendedLanes,O=r.pingedLanes;r=r.warmLanes;var V=h&134217727;return V!==0?(h=V&~_,h!==0?b=Lt(h):(O&=V,O!==0?b=Lt(O):c||(c=V&~r,c!==0&&(b=Lt(c))))):(V=h&~_,V!==0?b=Lt(V):O!==0?b=Lt(O):c||(c=h&~r,c!==0&&(b=Lt(c)))),b===0?0:s!==0&&s!==b&&(s&_)===0&&(_=b&-b,c=s&-s,_>=c||_===32&&(c&4194048)!==0)?s:b}function Ot(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Kt(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 cn(){var r=st;return st<<=1,(st&62914560)===0&&(st=4194304),r}function Pn(r){for(var s=[],c=0;31>c;c++)s.push(r);return s}function Dt(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Rn(r,s,c,h,b,_){var O=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var V=r.entanglements,te=r.expirationTimes,fe=r.hiddenUpdates;for(c=O&~c;0<c;){var pe=31-Wt(c),Se=1<<pe;V[pe]=0,te[pe]=-1;var he=fe[pe];if(he!==null)for(fe[pe]=null,pe=0;pe<he.length;pe++){var me=he[pe];me!==null&&(me.lane&=-536870913)}c&=~Se}h!==0&&Yo(r,h,0),_!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=_&~(O&~s))}function Yo(r,s,c){r.pendingLanes|=s,r.suspendedLanes&=~s;var h=31-Wt(s);r.entangledLanes|=s,r.entanglements[h]=r.entanglements[h]|1073741824|c&261930}function vt(r,s){var c=r.entangledLanes|=s;for(r=r.entanglements;c;){var h=31-Wt(c),b=1<<h;b&s|r[h]&s&&(r[h]|=s),c&=~b}}function Dn(r,s){var c=s&-s;return c=(c&42)!==0?1:To(c),(c&(r.suspendedLanes|s))!==0?0:c}function To(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Un(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function co(){var r=B.p;return r!==0?r:(r=window.event,r===void 0?32:hb(r.type))}function Dr(r,s){var c=B.p;try{return B.p=r,s()}finally{B.p=c}}var uo=Math.random().toString(36).slice(2),un="__reactFiber$"+uo,Tn="__reactProps$"+uo,ko="__reactContainer$"+uo,Tr="__reactEvents$"+uo,os="__reactListeners$"+uo,Q="__reactHandles$"+uo,re="__reactResources$"+uo,le="__reactMarker$"+uo;function ye(r){delete r[un],delete r[Tn],delete r[Tr],delete r[os],delete r[Q]}function xe(r){var s=r[un];if(s)return s;for(var c=r.parentNode;c;){if(s=c[ko]||c[un]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(r=Z1(r);r!==null;){if(c=r[un])return c;r=Z1(r)}return s}r=c,c=r.parentNode}return null}function Me(r){if(r=r[un]||r[ko]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function Ie(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(o(33))}function je(r){var s=r[re];return s||(s=r[re]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function be(r){r[le]=!0}var Re=new Set,ke={};function Ae(r,s){ve(r,s),ve(r+"Capture",s)}function ve(r,s){for(ke[r]=s,r=0;r<s.length;r++)Re.add(s[r])}var Oe=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]*$"),ot={},St={};function Mt(r){return ft.call(St,r)?!0:ft.call(ot,r)?!1:Oe.test(r)?St[r]=!0:(ot[r]=!0,!1)}function lt(r,s,c){if(Mt(s))if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+c)}}function It(r,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+c)}}function rt(r,s,c,h){if(h===null)r.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(s,c,""+h)}}function ht(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Pt(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Yn(r,s,c){var h=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,_=h.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return b.call(this)},set:function(O){c=""+O,_.call(this,O)}}),Object.defineProperty(r,s,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(O){c=""+O},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function kn(r){if(!r._valueTracker){var s=Pt(r)?"checked":"value";r._valueTracker=Yn(r,s,""+r[s])}}function Ln(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var c=s.getValue(),h="";return r&&(h=Pt(r)?r.checked?"true":"false":r.value),r=h,r!==c?(s.setValue(r),!0):!1}function Qt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var kr=/[\n"\\]/g;function Ze(r){return r.replace(kr,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function fo(r,s,c,h,b,_,O,V){r.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.type=O:r.removeAttribute("type"),s!=null?O==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+ht(s)):r.value!==""+ht(s)&&(r.value=""+ht(s)):O!=="submit"&&O!=="reset"||r.removeAttribute("value"),s!=null?rs(r,O,ht(s)):c!=null?rs(r,O,ht(c)):h!=null&&r.removeAttribute("value"),b==null&&_!=null&&(r.defaultChecked=!!_),b!=null&&(r.checked=b&&typeof b!="function"&&typeof b!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?r.name=""+ht(V):r.removeAttribute("name")}function lr(r,s,c,h,b,_,O,V){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(r.type=_),s!=null||c!=null){if(!(_!=="submit"&&_!=="reset"||s!=null)){kn(r);return}c=c!=null?""+ht(c):"",s=s!=null?""+ht(s):c,V||s===r.value||(r.value=s),r.defaultValue=s}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,r.checked=V?r.checked:!!h,r.defaultChecked=!!h,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(r.name=O),kn(r)}function rs(r,s,c){s==="number"&&Qt(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function At(r,s,c,h){if(r=r.options,s){s={};for(var b=0;b<c.length;b++)s["$"+c[b]]=!0;for(c=0;c<r.length;c++)b=s.hasOwnProperty("$"+r[c].value),r[c].selected!==b&&(r[c].selected=b),b&&h&&(r[c].defaultSelected=!0)}else{for(c=""+ht(c),s=null,b=0;b<r.length;b++){if(r[b].value===c){r[b].selected=!0,h&&(r[b].defaultSelected=!0);return}s!==null||r[b].disabled||(s=r[b])}s!==null&&(s.selected=!0)}}function Jn(r,s,c){if(s!=null&&(s=""+ht(s),s!==r.value&&(r.value=s),c==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=c!=null?""+ht(c):""}function Xt(r,s,c,h){if(s==null){if(h!=null){if(c!=null)throw Error(o(92));if(q(h)){if(1<h.length)throw Error(o(93));h=h[0]}c=h}c==null&&(c=""),s=c}c=ht(s),r.defaultValue=c,h=r.textContent,h===c&&h!==""&&h!==null&&(r.value=h),kn(r)}function Nt(r,s){if(s){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=s;return}}r.textContent=s}var fa=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 Or(r,s,c){var h=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":h?r.setProperty(s,c):typeof c!="number"||c===0||fa.has(s)?s==="float"?r.cssFloat=c:r[s]=(""+c).trim():r[s]=c+"px"}function uu(r,s,c){if(s!=null&&typeof s!="object")throw Error(o(62));if(r=r.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?r.setProperty(h,""):h==="float"?r.cssFloat="":r[h]="");for(var b in s)h=s[b],s.hasOwnProperty(b)&&c[b]!==h&&Or(r,b,h)}else for(var _ in s)s.hasOwnProperty(_)&&Or(r,_,s[_])}function yh(r){if(r.indexOf("-")===-1)return!1;switch(r){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 WR=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"]]),KR=/^[\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 du(r){return KR.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ar(){}var vh=null;function xh(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ys=null,Gs=null;function Fy(r){var s=Me(r);if(s&&(r=s.stateNode)){var c=r[Tn]||null;e:switch(r=s.stateNode,s.type){case"input":if(fo(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Ze(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var h=c[s];if(h!==r&&h.form===r.form){var b=h[Tn]||null;if(!b)throw Error(o(90));fo(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<c.length;s++)h=c[s],h.form===r.form&&Ln(h)}break e;case"textarea":Jn(r,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&At(r,!!c.multiple,s,!1)}}}var bh=!1;function Vy(r,s,c){if(bh)return r(s,c);bh=!0;try{var h=r(s);return h}finally{if(bh=!1,(Ys!==null||Gs!==null)&&(Qu(),Ys&&(s=Ys,r=Gs,Gs=Ys=null,Fy(s),r)))for(s=0;s<r.length;s++)Fy(r[s])}}function hl(r,s){var c=r.stateNode;if(c===null)return null;var h=c[Tn]||null;if(h===null)return null;c=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(r=r.type,h=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!h;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(o(231,s,typeof c));return c}var jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),wh=!1;if(jr)try{var ml={};Object.defineProperty(ml,"passive",{get:function(){wh=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{wh=!1}var ha=null,Sh=null,fu=null;function Uy(){if(fu)return fu;var r,s=Sh,c=s.length,h,b="value"in ha?ha.value:ha.textContent,_=b.length;for(r=0;r<c&&s[r]===b[r];r++);var O=c-r;for(h=1;h<=O&&s[c-h]===b[_-h];h++);return fu=b.slice(r,1<h?1-h:void 0)}function hu(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function mu(){return!0}function Yy(){return!1}function eo(r){function s(c,h,b,_,O){this._reactName=c,this._targetInst=b,this.type=h,this.nativeEvent=_,this.target=O,this.currentTarget=null;for(var V in r)r.hasOwnProperty(V)&&(c=r[V],this[V]=c?c(_):_[V]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?mu:Yy,this.isPropagationStopped=Yy,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=mu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=mu)},persist:function(){},isPersistent:mu}),s}var as={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gu=eo(as),gl=m({},as,{view:0,detail:0}),XR=eo(gl),Ch,Eh,pl,pu=m({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mh,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==pl&&(pl&&r.type==="mousemove"?(Ch=r.screenX-pl.screenX,Eh=r.screenY-pl.screenY):Eh=Ch=0,pl=r),Ch)},movementY:function(r){return"movementY"in r?r.movementY:Eh}}),Gy=eo(pu),ZR=m({},pu,{dataTransfer:0}),QR=eo(ZR),JR=m({},gl,{relatedTarget:0}),_h=eo(JR),eD=m({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),tD=eo(eD),nD=m({},as,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),oD=eo(nD),rD=m({},as,{data:0}),qy=eo(rD),aD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sD={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"},iD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lD(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=iD[r])?!!s[r]:!1}function Mh(){return lD}var cD=m({},gl,{key:function(r){if(r.key){var s=aD[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=hu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?sD[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mh,charCode:function(r){return r.type==="keypress"?hu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?hu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),uD=eo(cD),dD=m({},pu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wy=eo(dD),fD=m({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mh}),hD=eo(fD),mD=m({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),gD=eo(mD),pD=m({},pu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),yD=eo(pD),vD=m({},as,{newState:0,oldState:0}),xD=eo(vD),bD=[9,13,27,32],Nh=jr&&"CompositionEvent"in window,yl=null;jr&&"documentMode"in document&&(yl=document.documentMode);var wD=jr&&"TextEvent"in window&&!yl,Ky=jr&&(!Nh||yl&&8<yl&&11>=yl),Xy=" ",Zy=!1;function Qy(r,s){switch(r){case"keyup":return bD.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jy(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var qs=!1;function SD(r,s){switch(r){case"compositionend":return Jy(s);case"keypress":return s.which!==32?null:(Zy=!0,Xy);case"textInput":return r=s.data,r===Xy&&Zy?null:r;default:return null}}function CD(r,s){if(qs)return r==="compositionend"||!Nh&&Qy(r,s)?(r=Uy(),fu=Sh=ha=null,qs=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Ky&&s.locale!=="ko"?null:s.data;default:return null}}var ED={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 ev(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!ED[r.type]:s==="textarea"}function tv(r,s,c,h){Ys?Gs?Gs.push(h):Gs=[h]:Ys=h,s=ad(s,"onChange"),0<s.length&&(c=new gu("onChange","change",null,c,h),r.push({event:c,listeners:s}))}var vl=null,xl=null;function _D(r){P1(r,0)}function yu(r){var s=Ie(r);if(Ln(s))return r}function nv(r,s){if(r==="change")return s}var ov=!1;if(jr){var Rh;if(jr){var Dh="oninput"in document;if(!Dh){var rv=document.createElement("div");rv.setAttribute("oninput","return;"),Dh=typeof rv.oninput=="function"}Rh=Dh}else Rh=!1;ov=Rh&&(!document.documentMode||9<document.documentMode)}function av(){vl&&(vl.detachEvent("onpropertychange",sv),xl=vl=null)}function sv(r){if(r.propertyName==="value"&&yu(xl)){var s=[];tv(s,xl,r,xh(r)),Vy(_D,s)}}function MD(r,s,c){r==="focusin"?(av(),vl=s,xl=c,vl.attachEvent("onpropertychange",sv)):r==="focusout"&&av()}function ND(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return yu(xl)}function RD(r,s){if(r==="click")return yu(s)}function DD(r,s){if(r==="input"||r==="change")return yu(s)}function TD(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var ho=typeof Object.is=="function"?Object.is:TD;function bl(r,s){if(ho(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),h=Object.keys(s);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var b=c[h];if(!ft.call(s,b)||!ho(r[b],s[b]))return!1}return!0}function iv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function lv(r,s){var c=iv(r);r=0;for(var h;c;){if(c.nodeType===3){if(h=r+c.textContent.length,r<=s&&h>=s)return{node:c,offset:s-r};r=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=iv(c)}}function cv(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?cv(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function uv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=Qt(r.document);s instanceof r.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)r=s.contentWindow;else break;s=Qt(r.document)}return s}function Th(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var kD=jr&&"documentMode"in document&&11>=document.documentMode,Ws=null,kh=null,wl=null,Oh=!1;function dv(r,s,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Oh||Ws==null||Ws!==Qt(h)||(h=Ws,"selectionStart"in h&&Th(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),wl&&bl(wl,h)||(wl=h,h=ad(kh,"onSelect"),0<h.length&&(s=new gu("onSelect","select",null,s,c),r.push({event:s,listeners:h}),s.target=Ws)))}function ss(r,s){var c={};return c[r.toLowerCase()]=s.toLowerCase(),c["Webkit"+r]="webkit"+s,c["Moz"+r]="moz"+s,c}var Ks={animationend:ss("Animation","AnimationEnd"),animationiteration:ss("Animation","AnimationIteration"),animationstart:ss("Animation","AnimationStart"),transitionrun:ss("Transition","TransitionRun"),transitionstart:ss("Transition","TransitionStart"),transitioncancel:ss("Transition","TransitionCancel"),transitionend:ss("Transition","TransitionEnd")},Ah={},fv={};jr&&(fv=document.createElement("div").style,"AnimationEvent"in window||(delete Ks.animationend.animation,delete Ks.animationiteration.animation,delete Ks.animationstart.animation),"TransitionEvent"in window||delete Ks.transitionend.transition);function is(r){if(Ah[r])return Ah[r];if(!Ks[r])return r;var s=Ks[r],c;for(c in s)if(s.hasOwnProperty(c)&&c in fv)return Ah[r]=s[c];return r}var hv=is("animationend"),mv=is("animationiteration"),gv=is("animationstart"),OD=is("transitionrun"),AD=is("transitionstart"),jD=is("transitioncancel"),pv=is("transitionend"),yv=new Map,jh="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(" ");jh.push("scrollEnd");function Go(r,s){yv.set(r,s),Ae(s,[r])}var vu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Oo=[],Xs=0,zh=0;function xu(){for(var r=Xs,s=zh=Xs=0;s<r;){var c=Oo[s];Oo[s++]=null;var h=Oo[s];Oo[s++]=null;var b=Oo[s];Oo[s++]=null;var _=Oo[s];if(Oo[s++]=null,h!==null&&b!==null){var O=h.pending;O===null?b.next=b:(b.next=O.next,O.next=b),h.pending=b}_!==0&&vv(c,b,_)}}function bu(r,s,c,h){Oo[Xs++]=r,Oo[Xs++]=s,Oo[Xs++]=c,Oo[Xs++]=h,zh|=h,r.lanes|=h,r=r.alternate,r!==null&&(r.lanes|=h)}function Ih(r,s,c,h){return bu(r,s,c,h),wu(r)}function ls(r,s){return bu(r,null,null,s),wu(r)}function vv(r,s,c){r.lanes|=c;var h=r.alternate;h!==null&&(h.lanes|=c);for(var b=!1,_=r.return;_!==null;)_.childLanes|=c,h=_.alternate,h!==null&&(h.childLanes|=c),_.tag===22&&(r=_.stateNode,r===null||r._visibility&1||(b=!0)),r=_,_=_.return;return r.tag===3?(_=r.stateNode,b&&s!==null&&(b=31-Wt(c),r=_.hiddenUpdates,h=r[b],h===null?r[b]=[s]:h.push(s),s.lane=c|536870912),_):null}function wu(r){if(50<Vl)throw Vl=0,Ym=null,Error(o(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var Zs={};function zD(r,s,c,h){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mo(r,s,c,h){return new zD(r,s,c,h)}function Ph(r){return r=r.prototype,!(!r||!r.isReactComponent)}function zr(r,s){var c=r.alternate;return c===null?(c=mo(r.tag,s,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=s,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,s=r.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function xv(r,s){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,s=c.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function Su(r,s,c,h,b,_){var O=0;if(h=r,typeof r=="function")Ph(r)&&(O=1);else if(typeof r=="string")O=H3(r,c,G.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case $:return r=mo(31,c,s,b),r.elementType=$,r.lanes=_,r;case E:return cs(c.children,b,_,s);case S:O=8,b|=24;break;case M:return r=mo(12,c,s,b|2),r.elementType=M,r.lanes=_,r;case D:return r=mo(13,c,s,b),r.elementType=D,r.lanes=_,r;case T:return r=mo(19,c,s,b),r.elementType=T,r.lanes=_,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case C:O=10;break e;case N:O=9;break e;case R:O=11;break e;case k:O=14;break e;case j:O=16,h=null;break e}O=29,c=Error(o(130,r===null?"null":typeof r,"")),h=null}return s=mo(O,c,s,b),s.elementType=r,s.type=h,s.lanes=_,s}function cs(r,s,c,h){return r=mo(7,r,h,s),r.lanes=c,r}function Lh(r,s,c){return r=mo(6,r,null,s),r.lanes=c,r}function bv(r){var s=mo(18,null,null,0);return s.stateNode=r,s}function $h(r,s,c){return s=mo(4,r.children!==null?r.children:[],r.key,s),s.lanes=c,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var wv=new WeakMap;function Ao(r,s){if(typeof r=="object"&&r!==null){var c=wv.get(r);return c!==void 0?c:(s={value:r,source:s,stack:sn(s)},wv.set(r,s),s)}return{value:r,source:s,stack:sn(s)}}var Qs=[],Js=0,Cu=null,Sl=0,jo=[],zo=0,ma=null,cr=1,ur="";function Ir(r,s){Qs[Js++]=Sl,Qs[Js++]=Cu,Cu=r,Sl=s}function Sv(r,s,c){jo[zo++]=cr,jo[zo++]=ur,jo[zo++]=ma,ma=r;var h=cr;r=ur;var b=32-Wt(h)-1;h&=~(1<<b),c+=1;var _=32-Wt(s)+b;if(30<_){var O=b-b%5;_=(h&(1<<O)-1).toString(32),h>>=O,b-=O,cr=1<<32-Wt(s)+b|c<<b|h,ur=_+r}else cr=1<<_|c<<b|h,ur=r}function Hh(r){r.return!==null&&(Ir(r,1),Sv(r,1,0))}function Bh(r){for(;r===Cu;)Cu=Qs[--Js],Qs[Js]=null,Sl=Qs[--Js],Qs[Js]=null;for(;r===ma;)ma=jo[--zo],jo[zo]=null,ur=jo[--zo],jo[zo]=null,cr=jo[--zo],jo[zo]=null}function Cv(r,s){jo[zo++]=cr,jo[zo++]=ur,jo[zo++]=ma,cr=s.id,ur=s.overflow,ma=r}var $n=null,Jt=null,wt=!1,ga=null,Io=!1,Fh=Error(o(519));function pa(r){var s=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cl(Ao(s,r)),Fh}function Ev(r){var s=r.stateNode,c=r.type,h=r.memoizedProps;switch(s[un]=r,s[Tn]=h,c){case"dialog":yt("cancel",s),yt("close",s);break;case"iframe":case"object":case"embed":yt("load",s);break;case"video":case"audio":for(c=0;c<Yl.length;c++)yt(Yl[c],s);break;case"source":yt("error",s);break;case"img":case"image":case"link":yt("error",s),yt("load",s);break;case"details":yt("toggle",s);break;case"input":yt("invalid",s),lr(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":yt("invalid",s);break;case"textarea":yt("invalid",s),Xt(s,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||h.suppressHydrationWarning===!0||B1(s.textContent,c)?(h.popover!=null&&(yt("beforetoggle",s),yt("toggle",s)),h.onScroll!=null&&yt("scroll",s),h.onScrollEnd!=null&&yt("scrollend",s),h.onClick!=null&&(s.onclick=Ar),s=!0):s=!1,s||pa(r,!0)}function _v(r){for($n=r.return;$n;)switch($n.tag){case 5:case 31:case 13:Io=!1;return;case 27:case 3:Io=!0;return;default:$n=$n.return}}function ei(r){if(r!==$n)return!1;if(!wt)return _v(r),wt=!0,!1;var s=r.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||sg(r.type,r.memoizedProps)),c=!c),c&&Jt&&pa(r),_v(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));Jt=X1(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));Jt=X1(r)}else s===27?(s=Jt,Ta(r.type)?(r=dg,dg=null,Jt=r):Jt=s):Jt=$n?Lo(r.stateNode.nextSibling):null;return!0}function us(){Jt=$n=null,wt=!1}function Vh(){var r=ga;return r!==null&&(ro===null?ro=r:ro.push.apply(ro,r),ga=null),r}function Cl(r){ga===null?ga=[r]:ga.push(r)}var Uh=I(null),ds=null,Pr=null;function ya(r,s,c){H(Uh,s._currentValue),s._currentValue=c}function Lr(r){r._currentValue=Uh.current,z(Uh)}function Yh(r,s,c){for(;r!==null;){var h=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),r===c)break;r=r.return}}function Gh(r,s,c,h){var b=r.child;for(b!==null&&(b.return=r);b!==null;){var _=b.dependencies;if(_!==null){var O=b.child;_=_.firstContext;e:for(;_!==null;){var V=_;_=b;for(var te=0;te<s.length;te++)if(V.context===s[te]){_.lanes|=c,V=_.alternate,V!==null&&(V.lanes|=c),Yh(_.return,c,r),h||(O=null);break e}_=V.next}}else if(b.tag===18){if(O=b.return,O===null)throw Error(o(341));O.lanes|=c,_=O.alternate,_!==null&&(_.lanes|=c),Yh(O,c,r),O=null}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===r){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}}function ti(r,s,c,h){r=null;for(var b=s,_=!1;b!==null;){if(!_){if((b.flags&524288)!==0)_=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var O=b.alternate;if(O===null)throw Error(o(387));if(O=O.memoizedProps,O!==null){var V=b.type;ho(b.pendingProps.value,O.value)||(r!==null?r.push(V):r=[V])}}else if(b===W.current){if(O=b.alternate,O===null)throw Error(o(387));O.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(r!==null?r.push(Xl):r=[Xl])}b=b.return}r!==null&&Gh(s,r,c,h),s.flags|=262144}function Eu(r){for(r=r.firstContext;r!==null;){if(!ho(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function fs(r){ds=r,Pr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Hn(r){return Mv(ds,r)}function _u(r,s){return ds===null&&fs(r),Mv(r,s)}function Mv(r,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},Pr===null){if(r===null)throw Error(o(308));Pr=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else Pr=Pr.next=s;return c}var ID=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(c,h){r.push(h)}};this.abort=function(){s.aborted=!0,r.forEach(function(c){return c()})}},PD=t.unstable_scheduleCallback,LD=t.unstable_NormalPriority,bn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qh(){return{controller:new ID,data:new Map,refCount:0}}function El(r){r.refCount--,r.refCount===0&&PD(LD,function(){r.controller.abort()})}var _l=null,Wh=0,ni=0,oi=null;function $D(r,s){if(_l===null){var c=_l=[];Wh=0,ni=Zm(),oi={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Wh++,s.then(Nv,Nv),s}function Nv(){if(--Wh===0&&_l!==null){oi!==null&&(oi.status="fulfilled");var r=_l;_l=null,ni=0,oi=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function HD(r,s){var c=[],h={status:"pending",value:null,reason:null,then:function(b){c.push(b)}};return r.then(function(){h.status="fulfilled",h.value=s;for(var b=0;b<c.length;b++)(0,c[b])(s)},function(b){for(h.status="rejected",h.reason=b,b=0;b<c.length;b++)(0,c[b])(void 0)}),h}var Rv=A.S;A.S=function(r,s){d1=zt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&$D(r,s),Rv!==null&&Rv(r,s)};var hs=I(null);function Kh(){var r=hs.current;return r!==null?r:Zt.pooledCache}function Mu(r,s){s===null?H(hs,hs.current):H(hs,s.pool)}function Dv(){var r=Kh();return r===null?null:{parent:bn._currentValue,pool:r}}var ri=Error(o(460)),Xh=Error(o(474)),Nu=Error(o(542)),Ru={then:function(){}};function Tv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function kv(r,s,c){switch(c=r[c],c===void 0?r.push(s):c!==s&&(s.then(Ar,Ar),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Av(r),r;default:if(typeof s.status=="string")s.then(Ar,Ar);else{if(r=Zt,r!==null&&100<r.shellSuspendCounter)throw Error(o(482));r=s,r.status="pending",r.then(function(h){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=h}},function(h){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Av(r),r}throw gs=s,ri}}function ms(r){try{var s=r._init;return s(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(gs=c,ri):c}}var gs=null;function Ov(){if(gs===null)throw Error(o(459));var r=gs;return gs=null,r}function Av(r){if(r===ri||r===Nu)throw Error(o(483))}var ai=null,Ml=0;function Du(r){var s=Ml;return Ml+=1,ai===null&&(ai=[]),kv(ai,r,s)}function Nl(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Tu(r,s){throw s.$$typeof===p?Error(o(525)):(r=Object.prototype.toString.call(s),Error(o(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function jv(r){function s(ie,se){if(r){var ce=ie.deletions;ce===null?(ie.deletions=[se],ie.flags|=16):ce.push(se)}}function c(ie,se){if(!r)return null;for(;se!==null;)s(ie,se),se=se.sibling;return null}function h(ie){for(var se=new Map;ie!==null;)ie.key!==null?se.set(ie.key,ie):se.set(ie.index,ie),ie=ie.sibling;return se}function b(ie,se){return ie=zr(ie,se),ie.index=0,ie.sibling=null,ie}function _(ie,se,ce){return ie.index=ce,r?(ce=ie.alternate,ce!==null?(ce=ce.index,ce<se?(ie.flags|=67108866,se):ce):(ie.flags|=67108866,se)):(ie.flags|=1048576,se)}function O(ie){return r&&ie.alternate===null&&(ie.flags|=67108866),ie}function V(ie,se,ce,we){return se===null||se.tag!==6?(se=Lh(ce,ie.mode,we),se.return=ie,se):(se=b(se,ce),se.return=ie,se)}function te(ie,se,ce,we){var We=ce.type;return We===E?pe(ie,se,ce.props.children,we,ce.key):se!==null&&(se.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===j&&ms(We)===se.type)?(se=b(se,ce.props),Nl(se,ce),se.return=ie,se):(se=Su(ce.type,ce.key,ce.props,null,ie.mode,we),Nl(se,ce),se.return=ie,se)}function fe(ie,se,ce,we){return se===null||se.tag!==4||se.stateNode.containerInfo!==ce.containerInfo||se.stateNode.implementation!==ce.implementation?(se=$h(ce,ie.mode,we),se.return=ie,se):(se=b(se,ce.children||[]),se.return=ie,se)}function pe(ie,se,ce,we,We){return se===null||se.tag!==7?(se=cs(ce,ie.mode,we,We),se.return=ie,se):(se=b(se,ce),se.return=ie,se)}function Se(ie,se,ce){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=Lh(""+se,ie.mode,ce),se.return=ie,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case x:return ce=Su(se.type,se.key,se.props,null,ie.mode,ce),Nl(ce,se),ce.return=ie,ce;case w:return se=$h(se,ie.mode,ce),se.return=ie,se;case j:return se=ms(se),Se(ie,se,ce)}if(q(se)||Y(se))return se=cs(se,ie.mode,ce,null),se.return=ie,se;if(typeof se.then=="function")return Se(ie,Du(se),ce);if(se.$$typeof===C)return Se(ie,_u(ie,se),ce);Tu(ie,se)}return null}function he(ie,se,ce,we){var We=se!==null?se.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return We!==null?null:V(ie,se,""+ce,we);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return ce.key===We?te(ie,se,ce,we):null;case w:return ce.key===We?fe(ie,se,ce,we):null;case j:return ce=ms(ce),he(ie,se,ce,we)}if(q(ce)||Y(ce))return We!==null?null:pe(ie,se,ce,we,null);if(typeof ce.then=="function")return he(ie,se,Du(ce),we);if(ce.$$typeof===C)return he(ie,se,_u(ie,ce),we);Tu(ie,ce)}return null}function me(ie,se,ce,we,We){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return ie=ie.get(ce)||null,V(se,ie,""+we,We);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case x:return ie=ie.get(we.key===null?ce:we.key)||null,te(se,ie,we,We);case w:return ie=ie.get(we.key===null?ce:we.key)||null,fe(se,ie,we,We);case j:return we=ms(we),me(ie,se,ce,we,We)}if(q(we)||Y(we))return ie=ie.get(ce)||null,pe(se,ie,we,We,null);if(typeof we.then=="function")return me(ie,se,ce,Du(we),We);if(we.$$typeof===C)return me(ie,se,ce,_u(se,we),We);Tu(se,we)}return null}function Le(ie,se,ce,we){for(var We=null,Tt=null,Fe=se,ut=se=0,bt=null;Fe!==null&&ut<ce.length;ut++){Fe.index>ut?(bt=Fe,Fe=null):bt=Fe.sibling;var kt=he(ie,Fe,ce[ut],we);if(kt===null){Fe===null&&(Fe=bt);break}r&&Fe&&kt.alternate===null&&s(ie,Fe),se=_(kt,se,ut),Tt===null?We=kt:Tt.sibling=kt,Tt=kt,Fe=bt}if(ut===ce.length)return c(ie,Fe),wt&&Ir(ie,ut),We;if(Fe===null){for(;ut<ce.length;ut++)Fe=Se(ie,ce[ut],we),Fe!==null&&(se=_(Fe,se,ut),Tt===null?We=Fe:Tt.sibling=Fe,Tt=Fe);return wt&&Ir(ie,ut),We}for(Fe=h(Fe);ut<ce.length;ut++)bt=me(Fe,ie,ut,ce[ut],we),bt!==null&&(r&&bt.alternate!==null&&Fe.delete(bt.key===null?ut:bt.key),se=_(bt,se,ut),Tt===null?We=bt:Tt.sibling=bt,Tt=bt);return r&&Fe.forEach(function(za){return s(ie,za)}),wt&&Ir(ie,ut),We}function Ke(ie,se,ce,we){if(ce==null)throw Error(o(151));for(var We=null,Tt=null,Fe=se,ut=se=0,bt=null,kt=ce.next();Fe!==null&&!kt.done;ut++,kt=ce.next()){Fe.index>ut?(bt=Fe,Fe=null):bt=Fe.sibling;var za=he(ie,Fe,kt.value,we);if(za===null){Fe===null&&(Fe=bt);break}r&&Fe&&za.alternate===null&&s(ie,Fe),se=_(za,se,ut),Tt===null?We=za:Tt.sibling=za,Tt=za,Fe=bt}if(kt.done)return c(ie,Fe),wt&&Ir(ie,ut),We;if(Fe===null){for(;!kt.done;ut++,kt=ce.next())kt=Se(ie,kt.value,we),kt!==null&&(se=_(kt,se,ut),Tt===null?We=kt:Tt.sibling=kt,Tt=kt);return wt&&Ir(ie,ut),We}for(Fe=h(Fe);!kt.done;ut++,kt=ce.next())kt=me(Fe,ie,ut,kt.value,we),kt!==null&&(r&&kt.alternate!==null&&Fe.delete(kt.key===null?ut:kt.key),se=_(kt,se,ut),Tt===null?We=kt:Tt.sibling=kt,Tt=kt);return r&&Fe.forEach(function(Z3){return s(ie,Z3)}),wt&&Ir(ie,ut),We}function Yt(ie,se,ce,we){if(typeof ce=="object"&&ce!==null&&ce.type===E&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:e:{for(var We=ce.key;se!==null;){if(se.key===We){if(We=ce.type,We===E){if(se.tag===7){c(ie,se.sibling),we=b(se,ce.props.children),we.return=ie,ie=we;break e}}else if(se.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===j&&ms(We)===se.type){c(ie,se.sibling),we=b(se,ce.props),Nl(we,ce),we.return=ie,ie=we;break e}c(ie,se);break}else s(ie,se);se=se.sibling}ce.type===E?(we=cs(ce.props.children,ie.mode,we,ce.key),we.return=ie,ie=we):(we=Su(ce.type,ce.key,ce.props,null,ie.mode,we),Nl(we,ce),we.return=ie,ie=we)}return O(ie);case w:e:{for(We=ce.key;se!==null;){if(se.key===We)if(se.tag===4&&se.stateNode.containerInfo===ce.containerInfo&&se.stateNode.implementation===ce.implementation){c(ie,se.sibling),we=b(se,ce.children||[]),we.return=ie,ie=we;break e}else{c(ie,se);break}else s(ie,se);se=se.sibling}we=$h(ce,ie.mode,we),we.return=ie,ie=we}return O(ie);case j:return ce=ms(ce),Yt(ie,se,ce,we)}if(q(ce))return Le(ie,se,ce,we);if(Y(ce)){if(We=Y(ce),typeof We!="function")throw Error(o(150));return ce=We.call(ce),Ke(ie,se,ce,we)}if(typeof ce.then=="function")return Yt(ie,se,Du(ce),we);if(ce.$$typeof===C)return Yt(ie,se,_u(ie,ce),we);Tu(ie,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,se!==null&&se.tag===6?(c(ie,se.sibling),we=b(se,ce),we.return=ie,ie=we):(c(ie,se),we=Lh(ce,ie.mode,we),we.return=ie,ie=we),O(ie)):c(ie,se)}return function(ie,se,ce,we){try{Ml=0;var We=Yt(ie,se,ce,we);return ai=null,We}catch(Fe){if(Fe===ri||Fe===Nu)throw Fe;var Tt=mo(29,Fe,null,ie.mode);return Tt.lanes=we,Tt.return=ie,Tt}}}var ps=jv(!0),zv=jv(!1),va=!1;function Zh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qh(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function xa(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ba(r,s,c){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,(jt&2)!==0){var b=h.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),h.pending=s,s=wu(r),vv(r,null,c),s}return bu(r,h,s,c),wu(r)}function Rl(r,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var h=s.lanes;h&=r.pendingLanes,c|=h,s.lanes=c,vt(r,c)}}function Jh(r,s){var c=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var b=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var O={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};_===null?b=_=O:_=_.next=O,c=c.next}while(c!==null);_===null?b=_=s:_=_.next=s}else b=_=s;c={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:_,shared:h.shared,callbacks:h.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=s:r.next=s,c.lastBaseUpdate=s}var em=!1;function Dl(){if(em){var r=oi;if(r!==null)throw r}}function Tl(r,s,c,h){em=!1;var b=r.updateQueue;va=!1;var _=b.firstBaseUpdate,O=b.lastBaseUpdate,V=b.shared.pending;if(V!==null){b.shared.pending=null;var te=V,fe=te.next;te.next=null,O===null?_=fe:O.next=fe,O=te;var pe=r.alternate;pe!==null&&(pe=pe.updateQueue,V=pe.lastBaseUpdate,V!==O&&(V===null?pe.firstBaseUpdate=fe:V.next=fe,pe.lastBaseUpdate=te))}if(_!==null){var Se=b.baseState;O=0,pe=fe=te=null,V=_;do{var he=V.lane&-536870913,me=he!==V.lane;if(me?(xt&he)===he:(h&he)===he){he!==0&&he===ni&&(em=!0),pe!==null&&(pe=pe.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});e:{var Le=r,Ke=V;he=s;var Yt=c;switch(Ke.tag){case 1:if(Le=Ke.payload,typeof Le=="function"){Se=Le.call(Yt,Se,he);break e}Se=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Ke.payload,he=typeof Le=="function"?Le.call(Yt,Se,he):Le,he==null)break e;Se=m({},Se,he);break e;case 2:va=!0}}he=V.callback,he!==null&&(r.flags|=64,me&&(r.flags|=8192),me=b.callbacks,me===null?b.callbacks=[he]:me.push(he))}else me={lane:he,tag:V.tag,payload:V.payload,callback:V.callback,next:null},pe===null?(fe=pe=me,te=Se):pe=pe.next=me,O|=he;if(V=V.next,V===null){if(V=b.shared.pending,V===null)break;me=V,V=me.next,me.next=null,b.lastBaseUpdate=me,b.shared.pending=null}}while(!0);pe===null&&(te=Se),b.baseState=te,b.firstBaseUpdate=fe,b.lastBaseUpdate=pe,_===null&&(b.shared.lanes=0),_a|=O,r.lanes=O,r.memoizedState=Se}}function Iv(r,s){if(typeof r!="function")throw Error(o(191,r));r.call(s)}function Pv(r,s){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)Iv(c[r],s)}var si=I(null),ku=I(0);function Lv(r,s){r=qr,H(ku,r),H(si,s),qr=r|s.baseLanes}function tm(){H(ku,qr),H(si,si.current)}function nm(){qr=ku.current,z(si),z(ku)}var go=I(null),Po=null;function wa(r){var s=r.alternate;H(pn,pn.current&1),H(go,r),Po===null&&(s===null||si.current!==null||s.memoizedState!==null)&&(Po=r)}function om(r){H(pn,pn.current),H(go,r),Po===null&&(Po=r)}function $v(r){r.tag===22?(H(pn,pn.current),H(go,r),Po===null&&(Po=r)):Sa()}function Sa(){H(pn,pn.current),H(go,go.current)}function po(r){z(go),Po===r&&(Po=null),z(pn)}var pn=I(0);function Ou(r){for(var s=r;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||cg(c)||ug(c)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var $r=0,ct=null,Vt=null,wn=null,Au=!1,ii=!1,ys=!1,ju=0,kl=0,li=null,BD=0;function hn(){throw Error(o(321))}function rm(r,s){if(s===null)return!1;for(var c=0;c<s.length&&c<r.length;c++)if(!ho(r[c],s[c]))return!1;return!0}function am(r,s,c,h,b,_){return $r=_,ct=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,A.H=r===null||r.memoizedState===null?Sx:bm,ys=!1,_=c(h,b),ys=!1,ii&&(_=Bv(s,c,h,b)),Hv(r),_}function Hv(r){A.H=jl;var s=Vt!==null&&Vt.next!==null;if($r=0,wn=Vt=ct=null,Au=!1,kl=0,li=null,s)throw Error(o(300));r===null||Sn||(r=r.dependencies,r!==null&&Eu(r)&&(Sn=!0))}function Bv(r,s,c,h){ct=r;var b=0;do{if(ii&&(li=null),kl=0,ii=!1,25<=b)throw Error(o(301));if(b+=1,wn=Vt=null,r.updateQueue!=null){var _=r.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}A.H=Cx,_=s(c,h)}while(ii);return _}function FD(){var r=A.H,s=r.useState()[0];return s=typeof s.then=="function"?Ol(s):s,r=r.useState()[0],(Vt!==null?Vt.memoizedState:null)!==r&&(ct.flags|=1024),s}function sm(){var r=ju!==0;return ju=0,r}function im(r,s,c){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~c}function lm(r){if(Au){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Au=!1}$r=0,wn=Vt=ct=null,ii=!1,kl=ju=0,li=null}function Xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?ct.memoizedState=wn=r:wn=wn.next=r,wn}function yn(){if(Vt===null){var r=ct.alternate;r=r!==null?r.memoizedState:null}else r=Vt.next;var s=wn===null?ct.memoizedState:wn.next;if(s!==null)wn=s,Vt=r;else{if(r===null)throw ct.alternate===null?Error(o(467)):Error(o(310));Vt=r,r={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},wn===null?ct.memoizedState=wn=r:wn=wn.next=r}return wn}function zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ol(r){var s=kl;return kl+=1,li===null&&(li=[]),r=kv(li,r,s),s=ct,(wn===null?s.memoizedState:wn.next)===null&&(s=s.alternate,A.H=s===null||s.memoizedState===null?Sx:bm),r}function Iu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ol(r);if(r.$$typeof===C)return Hn(r)}throw Error(o(438,String(r)))}function cm(r){var s=null,c=ct.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var h=ct.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=zu(),ct.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(r),h=0;h<r;h++)c[h]=K;return s.index++,c}function Hr(r,s){return typeof s=="function"?s(r):s}function Pu(r){var s=yn();return um(s,Vt,r)}function um(r,s,c){var h=r.queue;if(h===null)throw Error(o(311));h.lastRenderedReducer=c;var b=r.baseQueue,_=h.pending;if(_!==null){if(b!==null){var O=b.next;b.next=_.next,_.next=O}s.baseQueue=b=_,h.pending=null}if(_=r.baseState,b===null)r.memoizedState=_;else{s=b.next;var V=O=null,te=null,fe=s,pe=!1;do{var Se=fe.lane&-536870913;if(Se!==fe.lane?(xt&Se)===Se:($r&Se)===Se){var he=fe.revertLane;if(he===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Se===ni&&(pe=!0);else if(($r&he)===he){fe=fe.next,he===ni&&(pe=!0);continue}else Se={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},te===null?(V=te=Se,O=_):te=te.next=Se,ct.lanes|=he,_a|=he;Se=fe.action,ys&&c(_,Se),_=fe.hasEagerState?fe.eagerState:c(_,Se)}else he={lane:Se,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},te===null?(V=te=he,O=_):te=te.next=he,ct.lanes|=Se,_a|=Se;fe=fe.next}while(fe!==null&&fe!==s);if(te===null?O=_:te.next=V,!ho(_,r.memoizedState)&&(Sn=!0,pe&&(c=oi,c!==null)))throw c;r.memoizedState=_,r.baseState=O,r.baseQueue=te,h.lastRenderedState=_}return b===null&&(h.lanes=0),[r.memoizedState,h.dispatch]}function dm(r){var s=yn(),c=s.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=r;var h=c.dispatch,b=c.pending,_=s.memoizedState;if(b!==null){c.pending=null;var O=b=b.next;do _=r(_,O.action),O=O.next;while(O!==b);ho(_,s.memoizedState)||(Sn=!0),s.memoizedState=_,s.baseQueue===null&&(s.baseState=_),c.lastRenderedState=_}return[_,h]}function Fv(r,s,c){var h=ct,b=yn(),_=wt;if(_){if(c===void 0)throw Error(o(407));c=c()}else c=s();var O=!ho((Vt||b).memoizedState,c);if(O&&(b.memoizedState=c,Sn=!0),b=b.queue,mm(Yv.bind(null,h,b,r),[r]),b.getSnapshot!==s||O||wn!==null&&wn.memoizedState.tag&1){if(h.flags|=2048,ci(9,{destroy:void 0},Uv.bind(null,h,b,c,s),null),Zt===null)throw Error(o(349));_||($r&127)!==0||Vv(h,s,c)}return c}function Vv(r,s,c){r.flags|=16384,r={getSnapshot:s,value:c},s=ct.updateQueue,s===null?(s=zu(),ct.updateQueue=s,s.stores=[r]):(c=s.stores,c===null?s.stores=[r]:c.push(r))}function Uv(r,s,c,h){s.value=c,s.getSnapshot=h,Gv(s)&&qv(r)}function Yv(r,s,c){return c(function(){Gv(s)&&qv(r)})}function Gv(r){var s=r.getSnapshot;r=r.value;try{var c=s();return!ho(r,c)}catch{return!0}}function qv(r){var s=ls(r,2);s!==null&&ao(s,r,2)}function fm(r){var s=Xn();if(typeof r=="function"){var c=r;if(r=c(),ys){qt(!0);try{c()}finally{qt(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:r},s}function Wv(r,s,c,h){return r.baseState=c,um(r,Vt,typeof h=="function"?h:Hr)}function VD(r,s,c,h,b){if(Hu(r))throw Error(o(485));if(r=s.action,r!==null){var _={payload:b,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){_.listeners.push(O)}};A.T!==null?c(!0):_.isTransition=!1,h(_),c=s.pending,c===null?(_.next=s.pending=_,Kv(s,_)):(_.next=c.next,s.pending=c.next=_)}}function Kv(r,s){var c=s.action,h=s.payload,b=r.state;if(s.isTransition){var _=A.T,O={};A.T=O;try{var V=c(b,h),te=A.S;te!==null&&te(O,V),Xv(r,s,V)}catch(fe){hm(r,s,fe)}finally{_!==null&&O.types!==null&&(_.types=O.types),A.T=_}}else try{_=c(b,h),Xv(r,s,_)}catch(fe){hm(r,s,fe)}}function Xv(r,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){Zv(r,s,h)},function(h){return hm(r,s,h)}):Zv(r,s,c)}function Zv(r,s,c){s.status="fulfilled",s.value=c,Qv(s),r.state=c,s=r.pending,s!==null&&(c=s.next,c===s?r.pending=null:(c=c.next,s.next=c,Kv(r,c)))}function hm(r,s,c){var h=r.pending;if(r.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=c,Qv(s),s=s.next;while(s!==h)}r.action=null}function Qv(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function Jv(r,s){return s}function ex(r,s){if(wt){var c=Zt.formState;if(c!==null){e:{var h=ct;if(wt){if(Jt){t:{for(var b=Jt,_=Io;b.nodeType!==8;){if(!_){b=null;break t}if(b=Lo(b.nextSibling),b===null){b=null;break t}}_=b.data,b=_==="F!"||_==="F"?b:null}if(b){Jt=Lo(b.nextSibling),h=b.data==="F!";break e}}pa(h)}h=!1}h&&(s=c[0])}}return c=Xn(),c.memoizedState=c.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jv,lastRenderedState:s},c.queue=h,c=xx.bind(null,ct,h),h.dispatch=c,h=fm(!1),_=xm.bind(null,ct,!1,h.queue),h=Xn(),b={state:s,dispatch:null,action:r,pending:null},h.queue=b,c=VD.bind(null,ct,b,_,c),b.dispatch=c,h.memoizedState=r,[s,c,!1]}function tx(r){var s=yn();return nx(s,Vt,r)}function nx(r,s,c){if(s=um(r,s,Jv)[0],r=Pu(Hr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=Ol(s)}catch(O){throw O===ri?Nu:O}else h=s;s=yn();var b=s.queue,_=b.dispatch;return c!==s.memoizedState&&(ct.flags|=2048,ci(9,{destroy:void 0},UD.bind(null,b,c),null)),[h,_,r]}function UD(r,s){r.action=s}function ox(r){var s=yn(),c=Vt;if(c!==null)return nx(s,c,r);yn(),s=s.memoizedState,c=yn();var h=c.queue.dispatch;return c.memoizedState=r,[s,h,!1]}function ci(r,s,c,h){return r={tag:r,create:c,deps:h,inst:s,next:null},s=ct.updateQueue,s===null&&(s=zu(),ct.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=r.next=r:(h=c.next,c.next=r,r.next=h,s.lastEffect=r),r}function rx(){return yn().memoizedState}function Lu(r,s,c,h){var b=Xn();ct.flags|=r,b.memoizedState=ci(1|s,{destroy:void 0},c,h===void 0?null:h)}function $u(r,s,c,h){var b=yn();h=h===void 0?null:h;var _=b.memoizedState.inst;Vt!==null&&h!==null&&rm(h,Vt.memoizedState.deps)?b.memoizedState=ci(s,_,c,h):(ct.flags|=r,b.memoizedState=ci(1|s,_,c,h))}function ax(r,s){Lu(8390656,8,r,s)}function mm(r,s){$u(2048,8,r,s)}function YD(r){ct.flags|=4;var s=ct.updateQueue;if(s===null)s=zu(),ct.updateQueue=s,s.events=[r];else{var c=s.events;c===null?s.events=[r]:c.push(r)}}function sx(r){var s=yn().memoizedState;return YD({ref:s,nextImpl:r}),function(){if((jt&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}function ix(r,s){return $u(4,2,r,s)}function lx(r,s){return $u(4,4,r,s)}function cx(r,s){if(typeof s=="function"){r=r();var c=s(r);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function ux(r,s,c){c=c!=null?c.concat([r]):null,$u(4,4,cx.bind(null,s,r),c)}function gm(){}function dx(r,s){var c=yn();s=s===void 0?null:s;var h=c.memoizedState;return s!==null&&rm(s,h[1])?h[0]:(c.memoizedState=[r,s],r)}function fx(r,s){var c=yn();s=s===void 0?null:s;var h=c.memoizedState;if(s!==null&&rm(s,h[1]))return h[0];if(h=r(),ys){qt(!0);try{r()}finally{qt(!1)}}return c.memoizedState=[h,s],h}function pm(r,s,c){return c===void 0||($r&1073741824)!==0&&(xt&261930)===0?r.memoizedState=s:(r.memoizedState=c,r=h1(),ct.lanes|=r,_a|=r,c)}function hx(r,s,c,h){return ho(c,s)?c:si.current!==null?(r=pm(r,c,h),ho(r,s)||(Sn=!0),r):($r&42)===0||($r&1073741824)!==0&&(xt&261930)===0?(Sn=!0,r.memoizedState=c):(r=h1(),ct.lanes|=r,_a|=r,s)}function mx(r,s,c,h,b){var _=B.p;B.p=_!==0&&8>_?_:8;var O=A.T,V={};A.T=V,xm(r,!1,s,c);try{var te=b(),fe=A.S;if(fe!==null&&fe(V,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var pe=HD(te,h);Al(r,s,pe,xo(r))}else Al(r,s,h,xo(r))}catch(Se){Al(r,s,{then:function(){},status:"rejected",reason:Se},xo())}finally{B.p=_,O!==null&&V.types!==null&&(O.types=V.types),A.T=O}}function GD(){}function ym(r,s,c,h){if(r.tag!==5)throw Error(o(476));var b=gx(r).queue;mx(r,b,s,L,c===null?GD:function(){return px(r),c(h)})}function gx(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:L},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:c},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function px(r){var s=gx(r);s.next===null&&(s=r.alternate.memoizedState),Al(r,s.next.queue,{},xo())}function vm(){return Hn(Xl)}function yx(){return yn().memoizedState}function vx(){return yn().memoizedState}function qD(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var c=xo();r=xa(c);var h=ba(s,r,c);h!==null&&(ao(h,s,c),Rl(h,s,c)),s={cache:qh()},r.payload=s;return}s=s.return}}function WD(r,s,c){var h=xo();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Hu(r)?bx(s,c):(c=Ih(r,s,c,h),c!==null&&(ao(c,r,h),wx(c,s,h)))}function xx(r,s,c){var h=xo();Al(r,s,c,h)}function Al(r,s,c,h){var b={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Hu(r))bx(s,b);else{var _=r.alternate;if(r.lanes===0&&(_===null||_.lanes===0)&&(_=s.lastRenderedReducer,_!==null))try{var O=s.lastRenderedState,V=_(O,c);if(b.hasEagerState=!0,b.eagerState=V,ho(V,O))return bu(r,s,b,0),Zt===null&&xu(),!1}catch{}if(c=Ih(r,s,b,h),c!==null)return ao(c,r,h),wx(c,s,h),!0}return!1}function xm(r,s,c,h){if(h={lane:2,revertLane:Zm(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Hu(r)){if(s)throw Error(o(479))}else s=Ih(r,c,h,2),s!==null&&ao(s,r,2)}function Hu(r){var s=r.alternate;return r===ct||s!==null&&s===ct}function bx(r,s){ii=Au=!0;var c=r.pending;c===null?s.next=s:(s.next=c.next,c.next=s),r.pending=s}function wx(r,s,c){if((c&4194048)!==0){var h=s.lanes;h&=r.pendingLanes,c|=h,s.lanes=c,vt(r,c)}}var jl={readContext:Hn,use:Iu,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useLayoutEffect:hn,useInsertionEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useSyncExternalStore:hn,useId:hn,useHostTransitionStatus:hn,useFormState:hn,useActionState:hn,useOptimistic:hn,useMemoCache:hn,useCacheRefresh:hn};jl.useEffectEvent=hn;var Sx={readContext:Hn,use:Iu,useCallback:function(r,s){return Xn().memoizedState=[r,s===void 0?null:s],r},useContext:Hn,useEffect:ax,useImperativeHandle:function(r,s,c){c=c!=null?c.concat([r]):null,Lu(4194308,4,cx.bind(null,s,r),c)},useLayoutEffect:function(r,s){return Lu(4194308,4,r,s)},useInsertionEffect:function(r,s){Lu(4,2,r,s)},useMemo:function(r,s){var c=Xn();s=s===void 0?null:s;var h=r();if(ys){qt(!0);try{r()}finally{qt(!1)}}return c.memoizedState=[h,s],h},useReducer:function(r,s,c){var h=Xn();if(c!==void 0){var b=c(s);if(ys){qt(!0);try{c(s)}finally{qt(!1)}}}else b=s;return h.memoizedState=h.baseState=b,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:b},h.queue=r,r=r.dispatch=WD.bind(null,ct,r),[h.memoizedState,r]},useRef:function(r){var s=Xn();return r={current:r},s.memoizedState=r},useState:function(r){r=fm(r);var s=r.queue,c=xx.bind(null,ct,s);return s.dispatch=c,[r.memoizedState,c]},useDebugValue:gm,useDeferredValue:function(r,s){var c=Xn();return pm(c,r,s)},useTransition:function(){var r=fm(!1);return r=mx.bind(null,ct,r.queue,!0,!1),Xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,c){var h=ct,b=Xn();if(wt){if(c===void 0)throw Error(o(407));c=c()}else{if(c=s(),Zt===null)throw Error(o(349));(xt&127)!==0||Vv(h,s,c)}b.memoizedState=c;var _={value:c,getSnapshot:s};return b.queue=_,ax(Yv.bind(null,h,_,r),[r]),h.flags|=2048,ci(9,{destroy:void 0},Uv.bind(null,h,_,c,s),null),c},useId:function(){var r=Xn(),s=Zt.identifierPrefix;if(wt){var c=ur,h=cr;c=(h&~(1<<32-Wt(h)-1)).toString(32)+c,s="_"+s+"R_"+c,c=ju++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=BD++,s="_"+s+"r_"+c.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:vm,useFormState:ex,useActionState:ex,useOptimistic:function(r){var s=Xn();s.memoizedState=s.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=xm.bind(null,ct,!0,c),c.dispatch=s,[r,s]},useMemoCache:cm,useCacheRefresh:function(){return Xn().memoizedState=qD.bind(null,ct)},useEffectEvent:function(r){var s=Xn(),c={impl:r};return s.memoizedState=c,function(){if((jt&2)!==0)throw Error(o(440));return c.impl.apply(void 0,arguments)}}},bm={readContext:Hn,use:Iu,useCallback:dx,useContext:Hn,useEffect:mm,useImperativeHandle:ux,useInsertionEffect:ix,useLayoutEffect:lx,useMemo:fx,useReducer:Pu,useRef:rx,useState:function(){return Pu(Hr)},useDebugValue:gm,useDeferredValue:function(r,s){var c=yn();return hx(c,Vt.memoizedState,r,s)},useTransition:function(){var r=Pu(Hr)[0],s=yn().memoizedState;return[typeof r=="boolean"?r:Ol(r),s]},useSyncExternalStore:Fv,useId:yx,useHostTransitionStatus:vm,useFormState:tx,useActionState:tx,useOptimistic:function(r,s){var c=yn();return Wv(c,Vt,r,s)},useMemoCache:cm,useCacheRefresh:vx};bm.useEffectEvent=sx;var Cx={readContext:Hn,use:Iu,useCallback:dx,useContext:Hn,useEffect:mm,useImperativeHandle:ux,useInsertionEffect:ix,useLayoutEffect:lx,useMemo:fx,useReducer:dm,useRef:rx,useState:function(){return dm(Hr)},useDebugValue:gm,useDeferredValue:function(r,s){var c=yn();return Vt===null?pm(c,r,s):hx(c,Vt.memoizedState,r,s)},useTransition:function(){var r=dm(Hr)[0],s=yn().memoizedState;return[typeof r=="boolean"?r:Ol(r),s]},useSyncExternalStore:Fv,useId:yx,useHostTransitionStatus:vm,useFormState:ox,useActionState:ox,useOptimistic:function(r,s){var c=yn();return Vt!==null?Wv(c,Vt,r,s):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:cm,useCacheRefresh:vx};Cx.useEffectEvent=sx;function wm(r,s,c,h){s=r.memoizedState,c=c(h,s),c=c==null?s:m({},s,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Sm={enqueueSetState:function(r,s,c){r=r._reactInternals;var h=xo(),b=xa(h);b.payload=s,c!=null&&(b.callback=c),s=ba(r,b,h),s!==null&&(ao(s,r,h),Rl(s,r,h))},enqueueReplaceState:function(r,s,c){r=r._reactInternals;var h=xo(),b=xa(h);b.tag=1,b.payload=s,c!=null&&(b.callback=c),s=ba(r,b,h),s!==null&&(ao(s,r,h),Rl(s,r,h))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var c=xo(),h=xa(c);h.tag=2,s!=null&&(h.callback=s),s=ba(r,h,c),s!==null&&(ao(s,r,c),Rl(s,r,c))}};function Ex(r,s,c,h,b,_,O){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,_,O):s.prototype&&s.prototype.isPureReactComponent?!bl(c,h)||!bl(b,_):!0}function _x(r,s,c,h){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,h),s.state!==r&&Sm.enqueueReplaceState(s,s.state,null)}function vs(r,s){var c=s;if("ref"in s){c={};for(var h in s)h!=="ref"&&(c[h]=s[h])}if(r=r.defaultProps){c===s&&(c=m({},c));for(var b in r)c[b]===void 0&&(c[b]=r[b])}return c}function Mx(r){vu(r)}function Nx(r){console.error(r)}function Rx(r){vu(r)}function Bu(r,s){try{var c=r.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function Dx(r,s,c){try{var h=r.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Cm(r,s,c){return c=xa(c),c.tag=3,c.payload={element:null},c.callback=function(){Bu(r,s)},c}function Tx(r){return r=xa(r),r.tag=3,r}function kx(r,s,c,h){var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var _=h.value;r.payload=function(){return b(_)},r.callback=function(){Dx(s,c,h)}}var O=c.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(r.callback=function(){Dx(s,c,h),typeof b!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var V=h.stack;this.componentDidCatch(h.value,{componentStack:V!==null?V:""})})}function KD(r,s,c,h,b){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=c.alternate,s!==null&&ti(s,c,b,!0),c=go.current,c!==null){switch(c.tag){case 31:case 13:return Po===null?Ju():c.alternate===null&&mn===0&&(mn=3),c.flags&=-257,c.flags|=65536,c.lanes=b,h===Ru?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([h]):s.add(h),Wm(r,h,b)),!1;case 22:return c.flags|=65536,h===Ru?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([h]):c.add(h)),Wm(r,h,b)),!1}throw Error(o(435,c.tag))}return Wm(r,h,b),Ju(),!1}if(wt)return s=go.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,h!==Fh&&(r=Error(o(422),{cause:h}),Cl(Ao(r,c)))):(h!==Fh&&(s=Error(o(423),{cause:h}),Cl(Ao(s,c))),r=r.current.alternate,r.flags|=65536,b&=-b,r.lanes|=b,h=Ao(h,c),b=Cm(r.stateNode,h,b),Jh(r,b),mn!==4&&(mn=2)),!1;var _=Error(o(520),{cause:h});if(_=Ao(_,c),Fl===null?Fl=[_]:Fl.push(_),mn!==4&&(mn=2),s===null)return!0;h=Ao(h,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,r=b&-b,c.lanes|=r,r=Cm(c.stateNode,h,r),Jh(c,r),!1;case 1:if(s=c.type,_=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Ma===null||!Ma.has(_))))return c.flags|=65536,b&=-b,c.lanes|=b,b=Tx(b),kx(b,r,c,h),Jh(c,b),!1}c=c.return}while(c!==null);return!1}var Em=Error(o(461)),Sn=!1;function Bn(r,s,c,h){s.child=r===null?zv(s,null,c,h):ps(s,r.child,c,h)}function Ox(r,s,c,h,b){c=c.render;var _=s.ref;if("ref"in h){var O={};for(var V in h)V!=="ref"&&(O[V]=h[V])}else O=h;return fs(s),h=am(r,s,c,O,_,b),V=sm(),r!==null&&!Sn?(im(r,s,b),Br(r,s,b)):(wt&&V&&Hh(s),s.flags|=1,Bn(r,s,h,b),s.child)}function Ax(r,s,c,h,b){if(r===null){var _=c.type;return typeof _=="function"&&!Ph(_)&&_.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=_,jx(r,s,_,h,b)):(r=Su(c.type,null,h,s,s.mode,b),r.ref=s.ref,r.return=s,s.child=r)}if(_=r.child,!Om(r,b)){var O=_.memoizedProps;if(c=c.compare,c=c!==null?c:bl,c(O,h)&&r.ref===s.ref)return Br(r,s,b)}return s.flags|=1,r=zr(_,h),r.ref=s.ref,r.return=s,s.child=r}function jx(r,s,c,h,b){if(r!==null){var _=r.memoizedProps;if(bl(_,h)&&r.ref===s.ref)if(Sn=!1,s.pendingProps=h=_,Om(r,b))(r.flags&131072)!==0&&(Sn=!0);else return s.lanes=r.lanes,Br(r,s,b)}return _m(r,s,c,h,b)}function zx(r,s,c,h){var b=h.children,_=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(_=_!==null?_.baseLanes|c:c,r!==null){for(h=s.child=r.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~_}else h=0,s.child=null;return Ix(r,s,_,c,h)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&Mu(s,_!==null?_.cachePool:null),_!==null?Lv(s,_):tm(),$v(s);else return h=s.lanes=536870912,Ix(r,s,_!==null?_.baseLanes|c:c,c,h)}else _!==null?(Mu(s,_.cachePool),Lv(s,_),Sa(),s.memoizedState=null):(r!==null&&Mu(s,null),tm(),Sa());return Bn(r,s,b,c),s.child}function zl(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Ix(r,s,c,h,b){var _=Kh();return _=_===null?null:{parent:bn._currentValue,pool:_},s.memoizedState={baseLanes:c,cachePool:_},r!==null&&Mu(s,null),tm(),$v(s),r!==null&&ti(r,s,h,!0),s.childLanes=b,null}function Fu(r,s){return s=Uu({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function Px(r,s,c){return ps(s,r.child,null,c),r=Fu(s,s.pendingProps),r.flags|=2,po(s),s.memoizedState=null,r}function XD(r,s,c){var h=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(wt){if(h.mode==="hidden")return r=Fu(s,h),s.lanes=536870912,zl(null,r);if(om(s),(r=Jt)?(r=K1(r,Io),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:ma!==null?{id:cr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},c=bv(r),c.return=s,s.child=c,$n=s,Jt=null)):r=null,r===null)throw pa(s);return s.lanes=536870912,null}return Fu(s,h)}var _=r.memoizedState;if(_!==null){var O=_.dehydrated;if(om(s),b)if(s.flags&256)s.flags&=-257,s=Px(r,s,c);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(o(558));else if(Sn||ti(r,s,c,!1),b=(c&r.childLanes)!==0,Sn||b){if(h=Zt,h!==null&&(O=Dn(h,c),O!==0&&O!==_.retryLane))throw _.retryLane=O,ls(r,O),ao(h,r,O),Em;Ju(),s=Px(r,s,c)}else r=_.treeContext,Jt=Lo(O.nextSibling),$n=s,wt=!0,ga=null,Io=!1,r!==null&&Cv(s,r),s=Fu(s,h),s.flags|=4096;return s}return r=zr(r.child,{mode:h.mode,children:h.children}),r.ref=s.ref,s.child=r,r.return=s,r}function Vu(r,s){var c=s.ref;if(c===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(o(284));(r===null||r.ref!==c)&&(s.flags|=4194816)}}function _m(r,s,c,h,b){return fs(s),c=am(r,s,c,h,void 0,b),h=sm(),r!==null&&!Sn?(im(r,s,b),Br(r,s,b)):(wt&&h&&Hh(s),s.flags|=1,Bn(r,s,c,b),s.child)}function Lx(r,s,c,h,b,_){return fs(s),s.updateQueue=null,c=Bv(s,h,c,b),Hv(r),h=sm(),r!==null&&!Sn?(im(r,s,_),Br(r,s,_)):(wt&&h&&Hh(s),s.flags|=1,Bn(r,s,c,_),s.child)}function $x(r,s,c,h,b){if(fs(s),s.stateNode===null){var _=Zs,O=c.contextType;typeof O=="object"&&O!==null&&(_=Hn(O)),_=new c(h,_),s.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Sm,s.stateNode=_,_._reactInternals=s,_=s.stateNode,_.props=h,_.state=s.memoizedState,_.refs={},Zh(s),O=c.contextType,_.context=typeof O=="object"&&O!==null?Hn(O):Zs,_.state=s.memoizedState,O=c.getDerivedStateFromProps,typeof O=="function"&&(wm(s,c,O,h),_.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(O=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),O!==_.state&&Sm.enqueueReplaceState(_,_.state,null),Tl(s,h,_,b),Dl(),_.state=s.memoizedState),typeof _.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(r===null){_=s.stateNode;var V=s.memoizedProps,te=vs(c,V);_.props=te;var fe=_.context,pe=c.contextType;O=Zs,typeof pe=="object"&&pe!==null&&(O=Hn(pe));var Se=c.getDerivedStateFromProps;pe=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function",V=s.pendingProps!==V,pe||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(V||fe!==O)&&_x(s,_,h,O),va=!1;var he=s.memoizedState;_.state=he,Tl(s,h,_,b),Dl(),fe=s.memoizedState,V||he!==fe||va?(typeof Se=="function"&&(wm(s,c,Se,h),fe=s.memoizedState),(te=va||Ex(s,c,te,h,he,fe,O))?(pe||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(s.flags|=4194308)):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=fe),_.props=h,_.state=fe,_.context=O,h=te):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{_=s.stateNode,Qh(r,s),O=s.memoizedProps,pe=vs(c,O),_.props=pe,Se=s.pendingProps,he=_.context,fe=c.contextType,te=Zs,typeof fe=="object"&&fe!==null&&(te=Hn(fe)),V=c.getDerivedStateFromProps,(fe=typeof V=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==Se||he!==te)&&_x(s,_,h,te),va=!1,he=s.memoizedState,_.state=he,Tl(s,h,_,b),Dl();var me=s.memoizedState;O!==Se||he!==me||va||r!==null&&r.dependencies!==null&&Eu(r.dependencies)?(typeof V=="function"&&(wm(s,c,V,h),me=s.memoizedState),(pe=va||Ex(s,c,pe,h,he,me,te)||r!==null&&r.dependencies!==null&&Eu(r.dependencies))?(fe||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(h,me,te),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(h,me,te)),typeof _.componentDidUpdate=="function"&&(s.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof _.componentDidUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=me),_.props=h,_.state=me,_.context=te,h=pe):(typeof _.componentDidUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=1024),h=!1)}return _=h,Vu(r,s),h=(s.flags&128)!==0,_||h?(_=s.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:_.render(),s.flags|=1,r!==null&&h?(s.child=ps(s,r.child,null,b),s.child=ps(s,null,c,b)):Bn(r,s,c,b),s.memoizedState=_.state,r=s.child):r=Br(r,s,b),r}function Hx(r,s,c,h){return us(),s.flags|=256,Bn(r,s,c,h),s.child}var Mm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nm(r){return{baseLanes:r,cachePool:Dv()}}function Rm(r,s,c){return r=r!==null?r.childLanes&~c:0,s&&(r|=vo),r}function Bx(r,s,c){var h=s.pendingProps,b=!1,_=(s.flags&128)!==0,O;if((O=_)||(O=r!==null&&r.memoizedState===null?!1:(pn.current&2)!==0),O&&(b=!0,s.flags&=-129),O=(s.flags&32)!==0,s.flags&=-33,r===null){if(wt){if(b?wa(s):Sa(),(r=Jt)?(r=K1(r,Io),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:ma!==null?{id:cr,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},c=bv(r),c.return=s,s.child=c,$n=s,Jt=null)):r=null,r===null)throw pa(s);return ug(r)?s.lanes=32:s.lanes=536870912,null}var V=h.children;return h=h.fallback,b?(Sa(),b=s.mode,V=Uu({mode:"hidden",children:V},b),h=cs(h,b,c,null),V.return=s,h.return=s,V.sibling=h,s.child=V,h=s.child,h.memoizedState=Nm(c),h.childLanes=Rm(r,O,c),s.memoizedState=Mm,zl(null,h)):(wa(s),Dm(s,V))}var te=r.memoizedState;if(te!==null&&(V=te.dehydrated,V!==null)){if(_)s.flags&256?(wa(s),s.flags&=-257,s=Tm(r,s,c)):s.memoizedState!==null?(Sa(),s.child=r.child,s.flags|=128,s=null):(Sa(),V=h.fallback,b=s.mode,h=Uu({mode:"visible",children:h.children},b),V=cs(V,b,c,null),V.flags|=2,h.return=s,V.return=s,h.sibling=V,s.child=h,ps(s,r.child,null,c),h=s.child,h.memoizedState=Nm(c),h.childLanes=Rm(r,O,c),s.memoizedState=Mm,s=zl(null,h));else if(wa(s),ug(V)){if(O=V.nextSibling&&V.nextSibling.dataset,O)var fe=O.dgst;O=fe,h=Error(o(419)),h.stack="",h.digest=O,Cl({value:h,source:null,stack:null}),s=Tm(r,s,c)}else if(Sn||ti(r,s,c,!1),O=(c&r.childLanes)!==0,Sn||O){if(O=Zt,O!==null&&(h=Dn(O,c),h!==0&&h!==te.retryLane))throw te.retryLane=h,ls(r,h),ao(O,r,h),Em;cg(V)||Ju(),s=Tm(r,s,c)}else cg(V)?(s.flags|=192,s.child=r.child,s=null):(r=te.treeContext,Jt=Lo(V.nextSibling),$n=s,wt=!0,ga=null,Io=!1,r!==null&&Cv(s,r),s=Dm(s,h.children),s.flags|=4096);return s}return b?(Sa(),V=h.fallback,b=s.mode,te=r.child,fe=te.sibling,h=zr(te,{mode:"hidden",children:h.children}),h.subtreeFlags=te.subtreeFlags&65011712,fe!==null?V=zr(fe,V):(V=cs(V,b,c,null),V.flags|=2),V.return=s,h.return=s,h.sibling=V,s.child=h,zl(null,h),h=s.child,V=r.child.memoizedState,V===null?V=Nm(c):(b=V.cachePool,b!==null?(te=bn._currentValue,b=b.parent!==te?{parent:te,pool:te}:b):b=Dv(),V={baseLanes:V.baseLanes|c,cachePool:b}),h.memoizedState=V,h.childLanes=Rm(r,O,c),s.memoizedState=Mm,zl(r.child,h)):(wa(s),c=r.child,r=c.sibling,c=zr(c,{mode:"visible",children:h.children}),c.return=s,c.sibling=null,r!==null&&(O=s.deletions,O===null?(s.deletions=[r],s.flags|=16):O.push(r)),s.child=c,s.memoizedState=null,c)}function Dm(r,s){return s=Uu({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function Uu(r,s){return r=mo(22,r,null,s),r.lanes=0,r}function Tm(r,s,c){return ps(s,r.child,null,c),r=Dm(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Fx(r,s,c){r.lanes|=s;var h=r.alternate;h!==null&&(h.lanes|=s),Yh(r.return,s,c)}function km(r,s,c,h,b,_){var O=r.memoizedState;O===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:b,treeForkCount:_}:(O.isBackwards=s,O.rendering=null,O.renderingStartTime=0,O.last=h,O.tail=c,O.tailMode=b,O.treeForkCount=_)}function Vx(r,s,c){var h=s.pendingProps,b=h.revealOrder,_=h.tail;h=h.children;var O=pn.current,V=(O&2)!==0;if(V?(O=O&1|2,s.flags|=128):O&=1,H(pn,O),Bn(r,s,h,c),h=wt?Sl:0,!V&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Fx(r,c,s);else if(r.tag===19)Fx(r,c,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(b){case"forwards":for(c=s.child,b=null;c!==null;)r=c.alternate,r!==null&&Ou(r)===null&&(b=c),c=c.sibling;c=b,c===null?(b=s.child,s.child=null):(b=c.sibling,c.sibling=null),km(s,!1,b,c,_,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,b=s.child,s.child=null;b!==null;){if(r=b.alternate,r!==null&&Ou(r)===null){s.child=b;break}r=b.sibling,b.sibling=c,c=b,b=r}km(s,!0,c,null,_,h);break;case"together":km(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Br(r,s,c){if(r!==null&&(s.dependencies=r.dependencies),_a|=s.lanes,(c&s.childLanes)===0)if(r!==null){if(ti(r,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(o(153));if(s.child!==null){for(r=s.child,c=zr(r,r.pendingProps),s.child=c,c.return=s;r.sibling!==null;)r=r.sibling,c=c.sibling=zr(r,r.pendingProps),c.return=s;c.sibling=null}return s.child}function Om(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Eu(r)))}function ZD(r,s,c){switch(s.tag){case 3:ee(s,s.stateNode.containerInfo),ya(s,bn,r.memoizedState.cache),us();break;case 27:case 5:de(s);break;case 4:ee(s,s.stateNode.containerInfo);break;case 10:ya(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,om(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(wa(s),s.flags|=128,null):(c&s.child.childLanes)!==0?Bx(r,s,c):(wa(s),r=Br(r,s,c),r!==null?r.sibling:null);wa(s);break;case 19:var b=(r.flags&128)!==0;if(h=(c&s.childLanes)!==0,h||(ti(r,s,c,!1),h=(c&s.childLanes)!==0),b){if(h)return Vx(r,s,c);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),H(pn,pn.current),h)break;return null;case 22:return s.lanes=0,zx(r,s,c,s.pendingProps);case 24:ya(s,bn,r.memoizedState.cache)}return Br(r,s,c)}function Ux(r,s,c){if(r!==null)if(r.memoizedProps!==s.pendingProps)Sn=!0;else{if(!Om(r,c)&&(s.flags&128)===0)return Sn=!1,ZD(r,s,c);Sn=(r.flags&131072)!==0}else Sn=!1,wt&&(s.flags&1048576)!==0&&Sv(s,Sl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(r=ms(s.elementType),s.type=r,typeof r=="function")Ph(r)?(h=vs(r,h),s.tag=1,s=$x(null,s,r,h,c)):(s.tag=0,s=_m(null,s,r,h,c));else{if(r!=null){var b=r.$$typeof;if(b===R){s.tag=11,s=Ox(null,s,r,h,c);break e}else if(b===k){s.tag=14,s=Ax(null,s,r,h,c);break e}}throw s=P(r)||r,Error(o(306,s,""))}}return s;case 0:return _m(r,s,s.type,s.pendingProps,c);case 1:return h=s.type,b=vs(h,s.pendingProps),$x(r,s,h,b,c);case 3:e:{if(ee(s,s.stateNode.containerInfo),r===null)throw Error(o(387));h=s.pendingProps;var _=s.memoizedState;b=_.element,Qh(r,s),Tl(s,h,null,c);var O=s.memoizedState;if(h=O.cache,ya(s,bn,h),h!==_.cache&&Gh(s,[bn],c,!0),Dl(),h=O.element,_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:O.cache},s.updateQueue.baseState=_,s.memoizedState=_,s.flags&256){s=Hx(r,s,h,c);break e}else if(h!==b){b=Ao(Error(o(424)),s),Cl(b),s=Hx(r,s,h,c);break e}else for(r=s.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Jt=Lo(r.firstChild),$n=s,wt=!0,ga=null,Io=!0,c=zv(s,null,h,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(us(),h===b){s=Br(r,s,c);break e}Bn(r,s,h,c)}s=s.child}return s;case 26:return Vu(r,s),r===null?(c=tb(s.type,null,s.pendingProps,null))?s.memoizedState=c:wt||(c=s.type,r=s.pendingProps,h=sd(ae.current).createElement(c),h[un]=s,h[Tn]=r,Fn(h,c,r),be(h),s.stateNode=h):s.memoizedState=tb(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return de(s),r===null&&wt&&(h=s.stateNode=Q1(s.type,s.pendingProps,ae.current),$n=s,Io=!0,b=Jt,Ta(s.type)?(dg=b,Jt=Lo(h.firstChild)):Jt=b),Bn(r,s,s.pendingProps.children,c),Vu(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&wt&&((b=h=Jt)&&(h=N3(h,s.type,s.pendingProps,Io),h!==null?(s.stateNode=h,$n=s,Jt=Lo(h.firstChild),Io=!1,b=!0):b=!1),b||pa(s)),de(s),b=s.type,_=s.pendingProps,O=r!==null?r.memoizedProps:null,h=_.children,sg(b,_)?h=null:O!==null&&sg(b,O)&&(s.flags|=32),s.memoizedState!==null&&(b=am(r,s,FD,null,null,c),Xl._currentValue=b),Vu(r,s),Bn(r,s,h,c),s.child;case 6:return r===null&&wt&&((r=c=Jt)&&(c=R3(c,s.pendingProps,Io),c!==null?(s.stateNode=c,$n=s,Jt=null,r=!0):r=!1),r||pa(s)),null;case 13:return Bx(r,s,c);case 4:return ee(s,s.stateNode.containerInfo),h=s.pendingProps,r===null?s.child=ps(s,null,h,c):Bn(r,s,h,c),s.child;case 11:return Ox(r,s,s.type,s.pendingProps,c);case 7:return Bn(r,s,s.pendingProps,c),s.child;case 8:return Bn(r,s,s.pendingProps.children,c),s.child;case 12:return Bn(r,s,s.pendingProps.children,c),s.child;case 10:return h=s.pendingProps,ya(s,s.type,h.value),Bn(r,s,h.children,c),s.child;case 9:return b=s.type._context,h=s.pendingProps.children,fs(s),b=Hn(b),h=h(b),s.flags|=1,Bn(r,s,h,c),s.child;case 14:return Ax(r,s,s.type,s.pendingProps,c);case 15:return jx(r,s,s.type,s.pendingProps,c);case 19:return Vx(r,s,c);case 31:return XD(r,s,c);case 22:return zx(r,s,c,s.pendingProps);case 24:return fs(s),h=Hn(bn),r===null?(b=Kh(),b===null&&(b=Zt,_=qh(),b.pooledCache=_,_.refCount++,_!==null&&(b.pooledCacheLanes|=c),b=_),s.memoizedState={parent:h,cache:b},Zh(s),ya(s,bn,b)):((r.lanes&c)!==0&&(Qh(r,s),Tl(s,null,null,c),Dl()),b=r.memoizedState,_=s.memoizedState,b.parent!==h?(b={parent:h,cache:h},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),ya(s,bn,h)):(h=_.cache,ya(s,bn,h),h!==b.cache&&Gh(s,[bn],c,!0))),Bn(r,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(o(156,s.tag))}function Fr(r){r.flags|=4}function Am(r,s,c,h,b){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(b&335544128)===b)if(r.stateNode.complete)r.flags|=8192;else if(y1())r.flags|=8192;else throw gs=Ru,Xh}else r.flags&=-16777217}function Yx(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!sb(s))if(y1())r.flags|=8192;else throw gs=Ru,Xh}function Yu(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?cn():536870912,r.lanes|=s,hi|=s)}function Il(r,s){if(!wt)switch(r.tailMode){case"hidden":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:h.sibling=null}}function en(r){var s=r.alternate!==null&&r.alternate.child===r.child,c=0,h=0;if(s)for(var b=r.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=r,b=b.sibling;else for(b=r.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=r,b=b.sibling;return r.subtreeFlags|=h,r.childLanes=c,s}function QD(r,s,c){var h=s.pendingProps;switch(Bh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return en(s),null;case 1:return en(s),null;case 3:return c=s.stateNode,h=null,r!==null&&(h=r.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Lr(bn),oe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(ei(s)?Fr(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Vh())),en(s),null;case 26:var b=s.type,_=s.memoizedState;return r===null?(Fr(s),_!==null?(en(s),Yx(s,_)):(en(s),Am(s,b,null,h,c))):_?_!==r.memoizedState?(Fr(s),en(s),Yx(s,_)):(en(s),s.flags&=-16777217):(r=r.memoizedProps,r!==h&&Fr(s),en(s),Am(s,b,r,h,c)),null;case 27:if(ge(s),c=ae.current,b=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==h&&Fr(s);else{if(!h){if(s.stateNode===null)throw Error(o(166));return en(s),null}r=G.current,ei(s)?Ev(s):(r=Q1(b,h,c),s.stateNode=r,Fr(s))}return en(s),null;case 5:if(ge(s),b=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==h&&Fr(s);else{if(!h){if(s.stateNode===null)throw Error(o(166));return en(s),null}if(_=G.current,ei(s))Ev(s);else{var O=sd(ae.current);switch(_){case 1:_=O.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:_=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":_=O.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":_=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":_=O.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof h.is=="string"?O.createElement("select",{is:h.is}):O.createElement("select"),h.multiple?_.multiple=!0:h.size&&(_.size=h.size);break;default:_=typeof h.is=="string"?O.createElement(b,{is:h.is}):O.createElement(b)}}_[un]=s,_[Tn]=h;e:for(O=s.child;O!==null;){if(O.tag===5||O.tag===6)_.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===s)break e;for(;O.sibling===null;){if(O.return===null||O.return===s)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}s.stateNode=_;e:switch(Fn(_,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Fr(s)}}return en(s),Am(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,c),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==h&&Fr(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(o(166));if(r=ae.current,ei(s)){if(r=s.stateNode,c=s.memoizedProps,h=null,b=$n,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}r[un]=s,r=!!(r.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||B1(r.nodeValue,c)),r||pa(s,!0)}else r=sd(r).createTextNode(h),r[un]=s,s.stateNode=r}return en(s),null;case 31:if(c=s.memoizedState,r===null||r.memoizedState!==null){if(h=ei(s),c!==null){if(r===null){if(!h)throw Error(o(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(557));r[un]=s}else us(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;en(s),r=!1}else c=Vh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return s.flags&256?(po(s),s):(po(s),null);if((s.flags&128)!==0)throw Error(o(558))}return en(s),null;case 13:if(h=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(b=ei(s),h!==null&&h.dehydrated!==null){if(r===null){if(!b)throw Error(o(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(o(317));b[un]=s}else us(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;en(s),b=!1}else b=Vh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(po(s),s):(po(s),null)}return po(s),(s.flags&128)!==0?(s.lanes=c,s):(c=h!==null,r=r!==null&&r.memoizedState!==null,c&&(h=s.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),_=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(_=h.memoizedState.cachePool.pool),_!==b&&(h.flags|=2048)),c!==r&&c&&(s.child.flags|=8192),Yu(s,s.updateQueue),en(s),null);case 4:return oe(),r===null&&tg(s.stateNode.containerInfo),en(s),null;case 10:return Lr(s.type),en(s),null;case 19:if(z(pn),h=s.memoizedState,h===null)return en(s),null;if(b=(s.flags&128)!==0,_=h.rendering,_===null)if(b)Il(h,!1);else{if(mn!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(_=Ou(r),_!==null){for(s.flags|=128,Il(h,!1),r=_.updateQueue,s.updateQueue=r,Yu(s,r),s.subtreeFlags=0,r=c,c=s.child;c!==null;)xv(c,r),c=c.sibling;return H(pn,pn.current&1|2),wt&&Ir(s,h.treeForkCount),s.child}r=r.sibling}h.tail!==null&&zt()>Xu&&(s.flags|=128,b=!0,Il(h,!1),s.lanes=4194304)}else{if(!b)if(r=Ou(_),r!==null){if(s.flags|=128,b=!0,r=r.updateQueue,s.updateQueue=r,Yu(s,r),Il(h,!0),h.tail===null&&h.tailMode==="hidden"&&!_.alternate&&!wt)return en(s),null}else 2*zt()-h.renderingStartTime>Xu&&c!==536870912&&(s.flags|=128,b=!0,Il(h,!1),s.lanes=4194304);h.isBackwards?(_.sibling=s.child,s.child=_):(r=h.last,r!==null?r.sibling=_:s.child=_,h.last=_)}return h.tail!==null?(r=h.tail,h.rendering=r,h.tail=r.sibling,h.renderingStartTime=zt(),r.sibling=null,c=pn.current,H(pn,b?c&1|2:c&1),wt&&Ir(s,h.treeForkCount),r):(en(s),null);case 22:case 23:return po(s),nm(),h=s.memoizedState!==null,r!==null?r.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(c&536870912)!==0&&(s.flags&128)===0&&(en(s),s.subtreeFlags&6&&(s.flags|=8192)):en(s),c=s.updateQueue,c!==null&&Yu(s,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048),r!==null&&z(hs),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),Lr(bn),en(s),null;case 25:return null;case 30:return null}throw Error(o(156,s.tag))}function JD(r,s){switch(Bh(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return Lr(bn),oe(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return ge(s),null;case 31:if(s.memoizedState!==null){if(po(s),s.alternate===null)throw Error(o(340));us()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(po(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(o(340));us()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return z(pn),null;case 4:return oe(),null;case 10:return Lr(s.type),null;case 22:case 23:return po(s),nm(),r!==null&&z(hs),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return Lr(bn),null;case 25:return null;default:return null}}function Gx(r,s){switch(Bh(s),s.tag){case 3:Lr(bn),oe();break;case 26:case 27:case 5:ge(s);break;case 4:oe();break;case 31:s.memoizedState!==null&&po(s);break;case 13:po(s);break;case 19:z(pn);break;case 10:Lr(s.type);break;case 22:case 23:po(s),nm(),r!==null&&z(hs);break;case 24:Lr(bn)}}function Pl(r,s){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var b=h.next;c=b;do{if((c.tag&r)===r){h=void 0;var _=c.create,O=c.inst;h=_(),O.destroy=h}c=c.next}while(c!==b)}}catch(V){Ht(s,s.return,V)}}function Ca(r,s,c){try{var h=s.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var _=b.next;h=_;do{if((h.tag&r)===r){var O=h.inst,V=O.destroy;if(V!==void 0){O.destroy=void 0,b=s;var te=c,fe=V;try{fe()}catch(pe){Ht(b,te,pe)}}}h=h.next}while(h!==_)}}catch(pe){Ht(s,s.return,pe)}}function qx(r){var s=r.updateQueue;if(s!==null){var c=r.stateNode;try{Pv(s,c)}catch(h){Ht(r,r.return,h)}}}function Wx(r,s,c){c.props=vs(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(h){Ht(r,s,h)}}function Ll(r,s){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var h=r.stateNode;break;case 30:h=r.stateNode;break;default:h=r.stateNode}typeof c=="function"?r.refCleanup=c(h):c.current=h}}catch(b){Ht(r,s,b)}}function dr(r,s){var c=r.ref,h=r.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(b){Ht(r,s,b)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(b){Ht(r,s,b)}else c.current=null}function Kx(r){var s=r.type,c=r.memoizedProps,h=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(b){Ht(r,r.return,b)}}function jm(r,s,c){try{var h=r.stateNode;w3(h,r.type,c,s),h[Tn]=s}catch(b){Ht(r,r.return,b)}}function Xx(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ta(r.type)||r.tag===4}function zm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Xx(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ta(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Im(r,s,c){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(r),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=Ar));else if(h!==4&&(h===27&&Ta(r.type)&&(c=r.stateNode,s=null),r=r.child,r!==null))for(Im(r,s,c),r=r.sibling;r!==null;)Im(r,s,c),r=r.sibling}function Gu(r,s,c){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?c.insertBefore(r,s):c.appendChild(r);else if(h!==4&&(h===27&&Ta(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Gu(r,s,c),r=r.sibling;r!==null;)Gu(r,s,c),r=r.sibling}function Zx(r){var s=r.stateNode,c=r.memoizedProps;try{for(var h=r.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);Fn(s,h,c),s[un]=r,s[Tn]=c}catch(_){Ht(r,r.return,_)}}var Vr=!1,Cn=!1,Pm=!1,Qx=typeof WeakSet=="function"?WeakSet:Set,zn=null;function e3(r,s){if(r=r.containerInfo,rg=hd,r=uv(r),Th(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var b=h.anchorOffset,_=h.focusNode;h=h.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var O=0,V=-1,te=-1,fe=0,pe=0,Se=r,he=null;t:for(;;){for(var me;Se!==c||b!==0&&Se.nodeType!==3||(V=O+b),Se!==_||h!==0&&Se.nodeType!==3||(te=O+h),Se.nodeType===3&&(O+=Se.nodeValue.length),(me=Se.firstChild)!==null;)he=Se,Se=me;for(;;){if(Se===r)break t;if(he===c&&++fe===b&&(V=O),he===_&&++pe===h&&(te=O),(me=Se.nextSibling)!==null)break;Se=he,he=Se.parentNode}Se=me}c=V===-1||te===-1?null:{start:V,end:te}}else c=null}c=c||{start:0,end:0}}else c=null;for(ag={focusedElem:r,selectionRange:c},hd=!1,zn=s;zn!==null;)if(s=zn,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,zn=r;else for(;zn!==null;){switch(s=zn,_=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)b=r[c],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&_!==null){r=void 0,c=s,b=_.memoizedProps,_=_.memoizedState,h=c.stateNode;try{var Le=vs(c.type,b);r=h.getSnapshotBeforeUpdate(Le,_),h.__reactInternalSnapshotBeforeUpdate=r}catch(Ke){Ht(c,c.return,Ke)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,c=r.nodeType,c===9)lg(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":lg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(o(163))}if(r=s.sibling,r!==null){r.return=s.return,zn=r;break}zn=s.return}}function Jx(r,s,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Yr(r,c),h&4&&Pl(5,c);break;case 1:if(Yr(r,c),h&4)if(r=c.stateNode,s===null)try{r.componentDidMount()}catch(O){Ht(c,c.return,O)}else{var b=vs(c.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(b,s,r.__reactInternalSnapshotBeforeUpdate)}catch(O){Ht(c,c.return,O)}}h&64&&qx(c),h&512&&Ll(c,c.return);break;case 3:if(Yr(r,c),h&64&&(r=c.updateQueue,r!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{Pv(r,s)}catch(O){Ht(c,c.return,O)}}break;case 27:s===null&&h&4&&Zx(c);case 26:case 5:Yr(r,c),s===null&&h&4&&Kx(c),h&512&&Ll(c,c.return);break;case 12:Yr(r,c);break;case 31:Yr(r,c),h&4&&n1(r,c);break;case 13:Yr(r,c),h&4&&o1(r,c),h&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=c3.bind(null,c),D3(r,c))));break;case 22:if(h=c.memoizedState!==null||Vr,!h){s=s!==null&&s.memoizedState!==null||Cn,b=Vr;var _=Cn;Vr=h,(Cn=s)&&!_?Gr(r,c,(c.subtreeFlags&8772)!==0):Yr(r,c),Vr=b,Cn=_}break;case 30:break;default:Yr(r,c)}}function e1(r){var s=r.alternate;s!==null&&(r.alternate=null,e1(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&ye(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var nn=null,to=!1;function Ur(r,s,c){for(c=c.child;c!==null;)t1(r,s,c),c=c.sibling}function t1(r,s,c){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(at,c)}catch{}switch(c.tag){case 26:Cn||dr(c,s),Ur(r,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Cn||dr(c,s);var h=nn,b=to;Ta(c.type)&&(nn=c.stateNode,to=!1),Ur(r,s,c),ql(c.stateNode),nn=h,to=b;break;case 5:Cn||dr(c,s);case 6:if(h=nn,b=to,nn=null,Ur(r,s,c),nn=h,to=b,nn!==null)if(to)try{(nn.nodeType===9?nn.body:nn.nodeName==="HTML"?nn.ownerDocument.body:nn).removeChild(c.stateNode)}catch(_){Ht(c,s,_)}else try{nn.removeChild(c.stateNode)}catch(_){Ht(c,s,_)}break;case 18:nn!==null&&(to?(r=nn,q1(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),wi(r)):q1(nn,c.stateNode));break;case 4:h=nn,b=to,nn=c.stateNode.containerInfo,to=!0,Ur(r,s,c),nn=h,to=b;break;case 0:case 11:case 14:case 15:Ca(2,c,s),Cn||Ca(4,c,s),Ur(r,s,c);break;case 1:Cn||(dr(c,s),h=c.stateNode,typeof h.componentWillUnmount=="function"&&Wx(c,s,h)),Ur(r,s,c);break;case 21:Ur(r,s,c);break;case 22:Cn=(h=Cn)||c.memoizedState!==null,Ur(r,s,c),Cn=h;break;default:Ur(r,s,c)}}function n1(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{wi(r)}catch(c){Ht(s,s.return,c)}}}function o1(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{wi(r)}catch(c){Ht(s,s.return,c)}}function t3(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new Qx),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new Qx),s;default:throw Error(o(435,r.tag))}}function qu(r,s){var c=t3(r);s.forEach(function(h){if(!c.has(h)){c.add(h);var b=u3.bind(null,r,h);h.then(b,b)}})}function no(r,s){var c=s.deletions;if(c!==null)for(var h=0;h<c.length;h++){var b=c[h],_=r,O=s,V=O;e:for(;V!==null;){switch(V.tag){case 27:if(Ta(V.type)){nn=V.stateNode,to=!1;break e}break;case 5:nn=V.stateNode,to=!1;break e;case 3:case 4:nn=V.stateNode.containerInfo,to=!0;break e}V=V.return}if(nn===null)throw Error(o(160));t1(_,O,b),nn=null,to=!1,_=b.alternate,_!==null&&(_.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)r1(s,r),s=s.sibling}var qo=null;function r1(r,s){var c=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:no(s,r),oo(r),h&4&&(Ca(3,r,r.return),Pl(3,r),Ca(5,r,r.return));break;case 1:no(s,r),oo(r),h&512&&(Cn||c===null||dr(c,c.return)),h&64&&Vr&&(r=r.updateQueue,r!==null&&(h=r.callbacks,h!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var b=qo;if(no(s,r),oo(r),h&512&&(Cn||c===null||dr(c,c.return)),h&4){var _=c!==null?c.memoizedState:null;if(h=r.memoizedState,c===null)if(h===null)if(r.stateNode===null){e:{h=r.type,c=r.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":_=b.getElementsByTagName("title")[0],(!_||_[le]||_[un]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=b.createElement(h),b.head.insertBefore(_,b.querySelector("head > title"))),Fn(_,h,c),_[un]=r,be(_),h=_;break e;case"link":var O=rb("link","href",b).get(h+(c.href||""));if(O){for(var V=0;V<O.length;V++)if(_=O[V],_.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&_.getAttribute("rel")===(c.rel==null?null:c.rel)&&_.getAttribute("title")===(c.title==null?null:c.title)&&_.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){O.splice(V,1);break t}}_=b.createElement(h),Fn(_,h,c),b.head.appendChild(_);break;case"meta":if(O=rb("meta","content",b).get(h+(c.content||""))){for(V=0;V<O.length;V++)if(_=O[V],_.getAttribute("content")===(c.content==null?null:""+c.content)&&_.getAttribute("name")===(c.name==null?null:c.name)&&_.getAttribute("property")===(c.property==null?null:c.property)&&_.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&_.getAttribute("charset")===(c.charSet==null?null:c.charSet)){O.splice(V,1);break t}}_=b.createElement(h),Fn(_,h,c),b.head.appendChild(_);break;default:throw Error(o(468,h))}_[un]=r,be(_),h=_}r.stateNode=h}else ab(b,r.type,r.stateNode);else r.stateNode=ob(b,h,r.memoizedProps);else _!==h?(_===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):_.count--,h===null?ab(b,r.type,r.stateNode):ob(b,h,r.memoizedProps)):h===null&&r.stateNode!==null&&jm(r,r.memoizedProps,c.memoizedProps)}break;case 27:no(s,r),oo(r),h&512&&(Cn||c===null||dr(c,c.return)),c!==null&&h&4&&jm(r,r.memoizedProps,c.memoizedProps);break;case 5:if(no(s,r),oo(r),h&512&&(Cn||c===null||dr(c,c.return)),r.flags&32){b=r.stateNode;try{Nt(b,"")}catch(Le){Ht(r,r.return,Le)}}h&4&&r.stateNode!=null&&(b=r.memoizedProps,jm(r,b,c!==null?c.memoizedProps:b)),h&1024&&(Pm=!0);break;case 6:if(no(s,r),oo(r),h&4){if(r.stateNode===null)throw Error(o(162));h=r.memoizedProps,c=r.stateNode;try{c.nodeValue=h}catch(Le){Ht(r,r.return,Le)}}break;case 3:if(cd=null,b=qo,qo=id(s.containerInfo),no(s,r),qo=b,oo(r),h&4&&c!==null&&c.memoizedState.isDehydrated)try{wi(s.containerInfo)}catch(Le){Ht(r,r.return,Le)}Pm&&(Pm=!1,a1(r));break;case 4:h=qo,qo=id(r.stateNode.containerInfo),no(s,r),oo(r),qo=h;break;case 12:no(s,r),oo(r);break;case 31:no(s,r),oo(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,qu(r,h)));break;case 13:no(s,r),oo(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Ku=zt()),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,qu(r,h)));break;case 22:b=r.memoizedState!==null;var te=c!==null&&c.memoizedState!==null,fe=Vr,pe=Cn;if(Vr=fe||b,Cn=pe||te,no(s,r),Cn=pe,Vr=fe,oo(r),h&8192)e:for(s=r.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(c===null||te||Vr||Cn||xs(r)),c=null,s=r;;){if(s.tag===5||s.tag===26){if(c===null){te=c=s;try{if(_=te.stateNode,b)O=_.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{V=te.stateNode;var Se=te.memoizedProps.style,he=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;V.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Le){Ht(te,te.return,Le)}}}else if(s.tag===6){if(c===null){te=s;try{te.stateNode.nodeValue=b?"":te.memoizedProps}catch(Le){Ht(te,te.return,Le)}}}else if(s.tag===18){if(c===null){te=s;try{var me=te.stateNode;b?W1(me,!0):W1(te.stateNode,!1)}catch(Le){Ht(te,te.return,Le)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=r.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,qu(r,c))));break;case 19:no(s,r),oo(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,qu(r,h)));break;case 30:break;case 21:break;default:no(s,r),oo(r)}}function oo(r){var s=r.flags;if(s&2){try{for(var c,h=r.return;h!==null;){if(Xx(h)){c=h;break}h=h.return}if(c==null)throw Error(o(160));switch(c.tag){case 27:var b=c.stateNode,_=zm(r);Gu(r,_,b);break;case 5:var O=c.stateNode;c.flags&32&&(Nt(O,""),c.flags&=-33);var V=zm(r);Gu(r,V,O);break;case 3:case 4:var te=c.stateNode.containerInfo,fe=zm(r);Im(r,fe,te);break;default:throw Error(o(161))}}catch(pe){Ht(r,r.return,pe)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function a1(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;a1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function Yr(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Jx(r,s.alternate,s),s=s.sibling}function xs(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Ca(4,s,s.return),xs(s);break;case 1:dr(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&Wx(s,s.return,c),xs(s);break;case 27:ql(s.stateNode);case 26:case 5:dr(s,s.return),xs(s);break;case 22:s.memoizedState===null&&xs(s);break;case 30:xs(s);break;default:xs(s)}r=r.sibling}}function Gr(r,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,b=r,_=s,O=_.flags;switch(_.tag){case 0:case 11:case 15:Gr(b,_,c),Pl(4,_);break;case 1:if(Gr(b,_,c),h=_,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(fe){Ht(h,h.return,fe)}if(h=_,b=h.updateQueue,b!==null){var V=h.stateNode;try{var te=b.shared.hiddenCallbacks;if(te!==null)for(b.shared.hiddenCallbacks=null,b=0;b<te.length;b++)Iv(te[b],V)}catch(fe){Ht(h,h.return,fe)}}c&&O&64&&qx(_),Ll(_,_.return);break;case 27:Zx(_);case 26:case 5:Gr(b,_,c),c&&h===null&&O&4&&Kx(_),Ll(_,_.return);break;case 12:Gr(b,_,c);break;case 31:Gr(b,_,c),c&&O&4&&n1(b,_);break;case 13:Gr(b,_,c),c&&O&4&&o1(b,_);break;case 22:_.memoizedState===null&&Gr(b,_,c),Ll(_,_.return);break;case 30:break;default:Gr(b,_,c)}s=s.sibling}}function Lm(r,s){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&El(c))}function $m(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&El(r))}function Wo(r,s,c,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)s1(r,s,c,h),s=s.sibling}function s1(r,s,c,h){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Wo(r,s,c,h),b&2048&&Pl(9,s);break;case 1:Wo(r,s,c,h);break;case 3:Wo(r,s,c,h),b&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&El(r)));break;case 12:if(b&2048){Wo(r,s,c,h),r=s.stateNode;try{var _=s.memoizedProps,O=_.id,V=_.onPostCommit;typeof V=="function"&&V(O,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(te){Ht(s,s.return,te)}}else Wo(r,s,c,h);break;case 31:Wo(r,s,c,h);break;case 13:Wo(r,s,c,h);break;case 23:break;case 22:_=s.stateNode,O=s.alternate,s.memoizedState!==null?_._visibility&2?Wo(r,s,c,h):$l(r,s):_._visibility&2?Wo(r,s,c,h):(_._visibility|=2,ui(r,s,c,h,(s.subtreeFlags&10256)!==0||!1)),b&2048&&Lm(O,s);break;case 24:Wo(r,s,c,h),b&2048&&$m(s.alternate,s);break;default:Wo(r,s,c,h)}}function ui(r,s,c,h,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var _=r,O=s,V=c,te=h,fe=O.flags;switch(O.tag){case 0:case 11:case 15:ui(_,O,V,te,b),Pl(8,O);break;case 23:break;case 22:var pe=O.stateNode;O.memoizedState!==null?pe._visibility&2?ui(_,O,V,te,b):$l(_,O):(pe._visibility|=2,ui(_,O,V,te,b)),b&&fe&2048&&Lm(O.alternate,O);break;case 24:ui(_,O,V,te,b),b&&fe&2048&&$m(O.alternate,O);break;default:ui(_,O,V,te,b)}s=s.sibling}}function $l(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=r,h=s,b=h.flags;switch(h.tag){case 22:$l(c,h),b&2048&&Lm(h.alternate,h);break;case 24:$l(c,h),b&2048&&$m(h.alternate,h);break;default:$l(c,h)}s=s.sibling}}var Hl=8192;function di(r,s,c){if(r.subtreeFlags&Hl)for(r=r.child;r!==null;)i1(r,s,c),r=r.sibling}function i1(r,s,c){switch(r.tag){case 26:di(r,s,c),r.flags&Hl&&r.memoizedState!==null&&B3(c,qo,r.memoizedState,r.memoizedProps);break;case 5:di(r,s,c);break;case 3:case 4:var h=qo;qo=id(r.stateNode.containerInfo),di(r,s,c),qo=h;break;case 22:r.memoizedState===null&&(h=r.alternate,h!==null&&h.memoizedState!==null?(h=Hl,Hl=16777216,di(r,s,c),Hl=h):di(r,s,c));break;default:di(r,s,c)}}function l1(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function Bl(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];zn=h,u1(h,r)}l1(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)c1(r),r=r.sibling}function c1(r){switch(r.tag){case 0:case 11:case 15:Bl(r),r.flags&2048&&Ca(9,r,r.return);break;case 3:Bl(r);break;case 12:Bl(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,Wu(r)):Bl(r);break;default:Bl(r)}}function Wu(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];zn=h,u1(h,r)}l1(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ca(8,s,s.return),Wu(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,Wu(s));break;default:Wu(s)}r=r.sibling}}function u1(r,s){for(;zn!==null;){var c=zn;switch(c.tag){case 0:case 11:case 15:Ca(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:El(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,zn=h;else e:for(c=r;zn!==null;){h=zn;var b=h.sibling,_=h.return;if(e1(h),h===c){zn=null;break e}if(b!==null){b.return=_,zn=b;break e}zn=_}}}var n3={getCacheForType:function(r){var s=Hn(bn),c=s.data.get(r);return c===void 0&&(c=r(),s.data.set(r,c)),c},cacheSignal:function(){return Hn(bn).controller.signal}},o3=typeof WeakMap=="function"?WeakMap:Map,jt=0,Zt=null,pt=null,xt=0,$t=0,yo=null,Ea=!1,fi=!1,Hm=!1,qr=0,mn=0,_a=0,bs=0,Bm=0,vo=0,hi=0,Fl=null,ro=null,Fm=!1,Ku=0,d1=0,Xu=1/0,Zu=null,Ma=null,On=0,Na=null,mi=null,Wr=0,Vm=0,Um=null,f1=null,Vl=0,Ym=null;function xo(){return(jt&2)!==0&&xt!==0?xt&-xt:A.T!==null?Zm():co()}function h1(){if(vo===0)if((xt&536870912)===0||wt){var r=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),vo=r}else vo=536870912;return r=go.current,r!==null&&(r.flags|=32),vo}function ao(r,s,c){(r===Zt&&($t===2||$t===9)||r.cancelPendingCommit!==null)&&(gi(r,0),Ra(r,xt,vo,!1)),Dt(r,c),((jt&2)===0||r!==Zt)&&(r===Zt&&((jt&2)===0&&(bs|=c),mn===4&&Ra(r,xt,vo,!1)),fr(r))}function m1(r,s,c){if((jt&6)!==0)throw Error(o(327));var h=!c&&(s&127)===0&&(s&r.expiredLanes)===0||Ot(r,s),b=h?s3(r,s):qm(r,s,!0),_=h;do{if(b===0){fi&&!h&&Ra(r,s,0,!1);break}else{if(c=r.current.alternate,_&&!r3(c)){b=qm(r,s,!1),_=!1;continue}if(b===2){if(_=s,r.errorRecoveryDisabledLanes&_)var O=0;else O=r.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){s=O;e:{var V=r;b=Fl;var te=V.current.memoizedState.isDehydrated;if(te&&(gi(V,O).flags|=256),O=qm(V,O,!1),O!==2){if(Hm&&!te){V.errorRecoveryDisabledLanes|=_,bs|=_,b=4;break e}_=ro,ro=b,_!==null&&(ro===null?ro=_:ro.push.apply(ro,_))}b=O}if(_=!1,b!==2)continue}}if(b===1){gi(r,0),Ra(r,s,0,!0);break}e:{switch(h=r,_=b,_){case 0:case 1:throw Error(o(345));case 4:if((s&4194048)!==s)break;case 6:Ra(h,s,vo,!Ea);break e;case 2:ro=null;break;case 3:case 5:break;default:throw Error(o(329))}if((s&62914560)===s&&(b=Ku+300-zt(),10<b)){if(Ra(h,s,vo,!Ea),Te(h,0,!0)!==0)break e;Wr=s,h.timeoutHandle=Y1(g1.bind(null,h,c,ro,Zu,Fm,s,vo,bs,hi,Ea,_,"Throttled",-0,0),b);break e}g1(h,c,ro,Zu,Fm,s,vo,bs,hi,Ea,_,null,-0,0)}}break}while(!0);fr(r)}function g1(r,s,c,h,b,_,O,V,te,fe,pe,Se,he,me){if(r.timeoutHandle=-1,Se=s.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ar},i1(s,_,Se);var Le=(_&62914560)===_?Ku-zt():(_&4194048)===_?d1-zt():0;if(Le=F3(Se,Le),Le!==null){Wr=_,r.cancelPendingCommit=Le(C1.bind(null,r,s,_,c,h,b,O,V,te,pe,Se,null,he,me)),Ra(r,_,O,!fe);return}}C1(r,s,_,c,h,b,O,V,te)}function r3(r){for(var s=r;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var b=c[h],_=b.getSnapshot;b=b.value;try{if(!ho(_(),b))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ra(r,s,c,h){s&=~Bm,s&=~bs,r.suspendedLanes|=s,r.pingedLanes&=~s,h&&(r.warmLanes|=s),h=r.expirationTimes;for(var b=s;0<b;){var _=31-Wt(b),O=1<<_;h[_]=-1,b&=~O}c!==0&&Yo(r,c,s)}function Qu(){return(jt&6)===0?(Ul(0),!1):!0}function Gm(){if(pt!==null){if($t===0)var r=pt.return;else r=pt,Pr=ds=null,lm(r),ai=null,Ml=0,r=pt;for(;r!==null;)Gx(r.alternate,r),r=r.return;pt=null}}function gi(r,s){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,E3(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Wr=0,Gm(),Zt=r,pt=c=zr(r.current,null),xt=s,$t=0,yo=null,Ea=!1,fi=Ot(r,s),Hm=!1,hi=vo=Bm=bs=_a=mn=0,ro=Fl=null,Fm=!1,(s&8)!==0&&(s|=s&32);var h=r.entangledLanes;if(h!==0)for(r=r.entanglements,h&=s;0<h;){var b=31-Wt(h),_=1<<b;s|=r[b],h&=~_}return qr=s,xu(),c}function p1(r,s){ct=null,A.H=jl,s===ri||s===Nu?(s=Ov(),$t=3):s===Xh?(s=Ov(),$t=4):$t=s===Em?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,yo=s,pt===null&&(mn=1,Bu(r,Ao(s,r.current)))}function y1(){var r=go.current;return r===null?!0:(xt&4194048)===xt?Po===null:(xt&62914560)===xt||(xt&536870912)!==0?r===Po:!1}function v1(){var r=A.H;return A.H=jl,r===null?jl:r}function x1(){var r=A.A;return A.A=n3,r}function Ju(){mn=4,Ea||(xt&4194048)!==xt&&go.current!==null||(fi=!0),(_a&134217727)===0&&(bs&134217727)===0||Zt===null||Ra(Zt,xt,vo,!1)}function qm(r,s,c){var h=jt;jt|=2;var b=v1(),_=x1();(Zt!==r||xt!==s)&&(Zu=null,gi(r,s)),s=!1;var O=mn;e:do try{if($t!==0&&pt!==null){var V=pt,te=yo;switch($t){case 8:Gm(),O=6;break e;case 3:case 2:case 9:case 6:go.current===null&&(s=!0);var fe=$t;if($t=0,yo=null,pi(r,V,te,fe),c&&fi){O=0;break e}break;default:fe=$t,$t=0,yo=null,pi(r,V,te,fe)}}a3(),O=mn;break}catch(pe){p1(r,pe)}while(!0);return s&&r.shellSuspendCounter++,Pr=ds=null,jt=h,A.H=b,A.A=_,pt===null&&(Zt=null,xt=0,xu()),O}function a3(){for(;pt!==null;)b1(pt)}function s3(r,s){var c=jt;jt|=2;var h=v1(),b=x1();Zt!==r||xt!==s?(Zu=null,Xu=zt()+500,gi(r,s)):fi=Ot(r,s);e:do try{if($t!==0&&pt!==null){s=pt;var _=yo;t:switch($t){case 1:$t=0,yo=null,pi(r,s,_,1);break;case 2:case 9:if(Tv(_)){$t=0,yo=null,w1(s);break}s=function(){$t!==2&&$t!==9||Zt!==r||($t=7),fr(r)},_.then(s,s);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:Tv(_)?($t=0,yo=null,w1(s)):($t=0,yo=null,pi(r,s,_,7));break;case 5:var O=null;switch(pt.tag){case 26:O=pt.memoizedState;case 5:case 27:var V=pt;if(O?sb(O):V.stateNode.complete){$t=0,yo=null;var te=V.sibling;if(te!==null)pt=te;else{var fe=V.return;fe!==null?(pt=fe,ed(fe)):pt=null}break t}}$t=0,yo=null,pi(r,s,_,5);break;case 6:$t=0,yo=null,pi(r,s,_,6);break;case 8:Gm(),mn=6;break e;default:throw Error(o(462))}}i3();break}catch(pe){p1(r,pe)}while(!0);return Pr=ds=null,A.H=h,A.A=b,jt=c,pt!==null?0:(Zt=null,xt=0,xu(),mn)}function i3(){for(;pt!==null&&!Ft();)b1(pt)}function b1(r){var s=Ux(r.alternate,r,qr);r.memoizedProps=r.pendingProps,s===null?ed(r):pt=s}function w1(r){var s=r,c=s.alternate;switch(s.tag){case 15:case 0:s=Lx(c,s,s.pendingProps,s.type,void 0,xt);break;case 11:s=Lx(c,s,s.pendingProps,s.type.render,s.ref,xt);break;case 5:lm(s);default:Gx(c,s),s=pt=xv(s,qr),s=Ux(c,s,qr)}r.memoizedProps=r.pendingProps,s===null?ed(r):pt=s}function pi(r,s,c,h){Pr=ds=null,lm(s),ai=null,Ml=0;var b=s.return;try{if(KD(r,b,s,c,xt)){mn=1,Bu(r,Ao(c,r.current)),pt=null;return}}catch(_){if(b!==null)throw pt=b,_;mn=1,Bu(r,Ao(c,r.current)),pt=null;return}s.flags&32768?(wt||h===1?r=!0:fi||(xt&536870912)!==0?r=!1:(Ea=r=!0,(h===2||h===9||h===3||h===6)&&(h=go.current,h!==null&&h.tag===13&&(h.flags|=16384))),S1(s,r)):ed(s)}function ed(r){var s=r;do{if((s.flags&32768)!==0){S1(s,Ea);return}r=s.return;var c=QD(s.alternate,s,qr);if(c!==null){pt=c;return}if(s=s.sibling,s!==null){pt=s;return}pt=s=r}while(s!==null);mn===0&&(mn=5)}function S1(r,s){do{var c=JD(r.alternate,r);if(c!==null){c.flags&=32767,pt=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(r=r.sibling,r!==null)){pt=r;return}pt=r=c}while(r!==null);mn=6,pt=null}function C1(r,s,c,h,b,_,O,V,te){r.cancelPendingCommit=null;do td();while(On!==0);if((jt&6)!==0)throw Error(o(327));if(s!==null){if(s===r.current)throw Error(o(177));if(_=s.lanes|s.childLanes,_|=zh,Rn(r,c,_,O,V,te),r===Zt&&(pt=Zt=null,xt=0),mi=s,Na=r,Wr=c,Vm=_,Um=b,f1=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,d3(jn,function(){return R1(),null})):(r.callbackNode=null,r.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=A.T,A.T=null,b=B.p,B.p=2,O=jt,jt|=4;try{e3(r,s,c)}finally{jt=O,B.p=b,A.T=h}}On=1,E1(),_1(),M1()}}function E1(){if(On===1){On=0;var r=Na,s=mi,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=A.T,A.T=null;var h=B.p;B.p=2;var b=jt;jt|=4;try{r1(s,r);var _=ag,O=uv(r.containerInfo),V=_.focusedElem,te=_.selectionRange;if(O!==V&&V&&V.ownerDocument&&cv(V.ownerDocument.documentElement,V)){if(te!==null&&Th(V)){var fe=te.start,pe=te.end;if(pe===void 0&&(pe=fe),"selectionStart"in V)V.selectionStart=fe,V.selectionEnd=Math.min(pe,V.value.length);else{var Se=V.ownerDocument||document,he=Se&&Se.defaultView||window;if(he.getSelection){var me=he.getSelection(),Le=V.textContent.length,Ke=Math.min(te.start,Le),Yt=te.end===void 0?Ke:Math.min(te.end,Le);!me.extend&&Ke>Yt&&(O=Yt,Yt=Ke,Ke=O);var ie=lv(V,Ke),se=lv(V,Yt);if(ie&&se&&(me.rangeCount!==1||me.anchorNode!==ie.node||me.anchorOffset!==ie.offset||me.focusNode!==se.node||me.focusOffset!==se.offset)){var ce=Se.createRange();ce.setStart(ie.node,ie.offset),me.removeAllRanges(),Ke>Yt?(me.addRange(ce),me.extend(se.node,se.offset)):(ce.setEnd(se.node,se.offset),me.addRange(ce))}}}}for(Se=[],me=V;me=me.parentNode;)me.nodeType===1&&Se.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;V<Se.length;V++){var we=Se[V];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}hd=!!rg,ag=rg=null}finally{jt=b,B.p=h,A.T=c}}r.current=s,On=2}}function _1(){if(On===2){On=0;var r=Na,s=mi,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=A.T,A.T=null;var h=B.p;B.p=2;var b=jt;jt|=4;try{Jx(r,s.alternate,s)}finally{jt=b,B.p=h,A.T=c}}On=3}}function M1(){if(On===4||On===3){On=0,fn();var r=Na,s=mi,c=Wr,h=f1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?On=5:(On=0,mi=Na=null,N1(r,r.pendingLanes));var b=r.pendingLanes;if(b===0&&(Ma=null),Un(c),s=s.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(at,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=A.T,b=B.p,B.p=2,A.T=null;try{for(var _=r.onRecoverableError,O=0;O<h.length;O++){var V=h[O];_(V.value,{componentStack:V.stack})}}finally{A.T=s,B.p=b}}(Wr&3)!==0&&td(),fr(r),b=r.pendingLanes,(c&261930)!==0&&(b&42)!==0?r===Ym?Vl++:(Vl=0,Ym=r):Vl=0,Ul(0)}}function N1(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,El(s)))}function td(){return E1(),_1(),M1(),R1()}function R1(){if(On!==5)return!1;var r=Na,s=Vm;Vm=0;var c=Un(Wr),h=A.T,b=B.p;try{B.p=32>c?32:c,A.T=null,c=Um,Um=null;var _=Na,O=Wr;if(On=0,mi=Na=null,Wr=0,(jt&6)!==0)throw Error(o(331));var V=jt;if(jt|=4,c1(_.current),s1(_,_.current,O,c),jt=V,Ul(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(at,_)}catch{}return!0}finally{B.p=b,A.T=h,N1(r,s)}}function D1(r,s,c){s=Ao(c,s),s=Cm(r.stateNode,s,2),r=ba(r,s,2),r!==null&&(Dt(r,2),fr(r))}function Ht(r,s,c){if(r.tag===3)D1(r,r,c);else for(;s!==null;){if(s.tag===3){D1(s,r,c);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ma===null||!Ma.has(h))){r=Ao(c,r),c=Tx(2),h=ba(s,c,2),h!==null&&(kx(c,h,s,r),Dt(h,2),fr(h));break}}s=s.return}}function Wm(r,s,c){var h=r.pingCache;if(h===null){h=r.pingCache=new o3;var b=new Set;h.set(s,b)}else b=h.get(s),b===void 0&&(b=new Set,h.set(s,b));b.has(c)||(Hm=!0,b.add(c),r=l3.bind(null,r,s,c),s.then(r,r))}function l3(r,s,c){var h=r.pingCache;h!==null&&h.delete(s),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Zt===r&&(xt&c)===c&&(mn===4||mn===3&&(xt&62914560)===xt&&300>zt()-Ku?(jt&2)===0&&gi(r,0):Bm|=c,hi===xt&&(hi=0)),fr(r)}function T1(r,s){s===0&&(s=cn()),r=ls(r,s),r!==null&&(Dt(r,s),fr(r))}function c3(r){var s=r.memoizedState,c=0;s!==null&&(c=s.retryLane),T1(r,c)}function u3(r,s){var c=0;switch(r.tag){case 31:case 13:var h=r.stateNode,b=r.memoizedState;b!==null&&(c=b.retryLane);break;case 19:h=r.stateNode;break;case 22:h=r.stateNode._retryCache;break;default:throw Error(o(314))}h!==null&&h.delete(s),T1(r,c)}function d3(r,s){return xn(r,s)}var nd=null,yi=null,Km=!1,od=!1,Xm=!1,Da=0;function fr(r){r!==yi&&r.next===null&&(yi===null?nd=yi=r:yi=yi.next=r),od=!0,Km||(Km=!0,h3())}function Ul(r,s){if(!Xm&&od){Xm=!0;do for(var c=!1,h=nd;h!==null;){if(r!==0){var b=h.pendingLanes;if(b===0)var _=0;else{var O=h.suspendedLanes,V=h.pingedLanes;_=(1<<31-Wt(42|r)+1)-1,_&=b&~(O&~V),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(c=!0,j1(h,_))}else _=xt,_=Te(h,h===Zt?_:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(_&3)===0||Ot(h,_)||(c=!0,j1(h,_));h=h.next}while(c);Xm=!1}}function f3(){k1()}function k1(){od=Km=!1;var r=0;Da!==0&&C3()&&(r=Da);for(var s=zt(),c=null,h=nd;h!==null;){var b=h.next,_=O1(h,s);_===0?(h.next=null,c===null?nd=b:c.next=b,b===null&&(yi=c)):(c=h,(r!==0||(_&3)!==0)&&(od=!0)),h=b}On!==0&&On!==5||Ul(r),Da!==0&&(Da=0)}function O1(r,s){for(var c=r.suspendedLanes,h=r.pingedLanes,b=r.expirationTimes,_=r.pendingLanes&-62914561;0<_;){var O=31-Wt(_),V=1<<O,te=b[O];te===-1?((V&c)===0||(V&h)!==0)&&(b[O]=Kt(V,s)):te<=s&&(r.expiredLanes|=V),_&=~V}if(s=Zt,c=xt,c=Te(r,r===s?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h=r.callbackNode,c===0||r===s&&($t===2||$t===9)||r.cancelPendingCommit!==null)return h!==null&&h!==null&&ln(h),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||Ot(r,c)){if(s=c&-c,s===r.callbackPriority)return s;switch(h!==null&&ln(h),Un(c)){case 2:case 8:c=In;break;case 32:c=jn;break;case 268435456:c=Ve;break;default:c=jn}return h=A1.bind(null,r),c=xn(c,h),r.callbackPriority=s,r.callbackNode=c,s}return h!==null&&h!==null&&ln(h),r.callbackPriority=2,r.callbackNode=null,2}function A1(r,s){if(On!==0&&On!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(td()&&r.callbackNode!==c)return null;var h=xt;return h=Te(r,r===Zt?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h===0?null:(m1(r,h,s),O1(r,zt()),r.callbackNode!=null&&r.callbackNode===c?A1.bind(null,r):null)}function j1(r,s){if(td())return null;m1(r,s,!0)}function h3(){_3(function(){(jt&6)!==0?xn(gn,f3):k1()})}function Zm(){if(Da===0){var r=ni;r===0&&(r=nt,nt<<=1,(nt&261888)===0&&(nt=256)),Da=r}return Da}function z1(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:du(""+r)}function I1(r,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,r.id&&c.setAttribute("form",r.id),s.parentNode.insertBefore(c,s),r=new FormData(r),c.parentNode.removeChild(c),r}function m3(r,s,c,h,b){if(s==="submit"&&c&&c.stateNode===b){var _=z1((b[Tn]||null).action),O=h.submitter;O&&(s=(s=O[Tn]||null)?z1(s.formAction):O.getAttribute("formAction"),s!==null&&(_=s,O=null));var V=new gu("action","action",null,h,b);r.push({event:V,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Da!==0){var te=O?I1(b,O):new FormData(b);ym(c,{pending:!0,data:te,method:b.method,action:_},null,te)}}else typeof _=="function"&&(V.preventDefault(),te=O?I1(b,O):new FormData(b),ym(c,{pending:!0,data:te,method:b.method,action:_},_,te))},currentTarget:b}]})}}for(var Qm=0;Qm<jh.length;Qm++){var Jm=jh[Qm],g3=Jm.toLowerCase(),p3=Jm[0].toUpperCase()+Jm.slice(1);Go(g3,"on"+p3)}Go(hv,"onAnimationEnd"),Go(mv,"onAnimationIteration"),Go(gv,"onAnimationStart"),Go("dblclick","onDoubleClick"),Go("focusin","onFocus"),Go("focusout","onBlur"),Go(OD,"onTransitionRun"),Go(AD,"onTransitionStart"),Go(jD,"onTransitionCancel"),Go(pv,"onTransitionEnd"),ve("onMouseEnter",["mouseout","mouseover"]),ve("onMouseLeave",["mouseout","mouseover"]),ve("onPointerEnter",["pointerout","pointerover"]),ve("onPointerLeave",["pointerout","pointerover"]),Ae("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ae("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ae("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ae("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ae("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ae("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yl="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(" "),y3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yl));function P1(r,s){s=(s&4)!==0;for(var c=0;c<r.length;c++){var h=r[c],b=h.event;h=h.listeners;e:{var _=void 0;if(s)for(var O=h.length-1;0<=O;O--){var V=h[O],te=V.instance,fe=V.currentTarget;if(V=V.listener,te!==_&&b.isPropagationStopped())break e;_=V,b.currentTarget=fe;try{_(b)}catch(pe){vu(pe)}b.currentTarget=null,_=te}else for(O=0;O<h.length;O++){if(V=h[O],te=V.instance,fe=V.currentTarget,V=V.listener,te!==_&&b.isPropagationStopped())break e;_=V,b.currentTarget=fe;try{_(b)}catch(pe){vu(pe)}b.currentTarget=null,_=te}}}}function yt(r,s){var c=s[Tr];c===void 0&&(c=s[Tr]=new Set);var h=r+"__bubble";c.has(h)||(L1(s,r,2,!1),c.add(h))}function eg(r,s,c){var h=0;s&&(h|=4),L1(c,r,h,s)}var rd="_reactListening"+Math.random().toString(36).slice(2);function tg(r){if(!r[rd]){r[rd]=!0,Re.forEach(function(c){c!=="selectionchange"&&(y3.has(c)||eg(c,!1,r),eg(c,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[rd]||(s[rd]=!0,eg("selectionchange",!1,s))}}function L1(r,s,c,h){switch(hb(s)){case 2:var b=Y3;break;case 8:b=G3;break;default:b=pg}c=b.bind(null,s,c,r),b=void 0,!wh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),h?b!==void 0?r.addEventListener(s,c,{capture:!0,passive:b}):r.addEventListener(s,c,!0):b!==void 0?r.addEventListener(s,c,{passive:b}):r.addEventListener(s,c,!1)}function ng(r,s,c,h,b){var _=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var O=h.tag;if(O===3||O===4){var V=h.stateNode.containerInfo;if(V===b)break;if(O===4)for(O=h.return;O!==null;){var te=O.tag;if((te===3||te===4)&&O.stateNode.containerInfo===b)return;O=O.return}for(;V!==null;){if(O=xe(V),O===null)return;if(te=O.tag,te===5||te===6||te===26||te===27){h=_=O;continue e}V=V.parentNode}}h=h.return}Vy(function(){var fe=_,pe=xh(c),Se=[];e:{var he=yv.get(r);if(he!==void 0){var me=gu,Le=r;switch(r){case"keypress":if(hu(c)===0)break e;case"keydown":case"keyup":me=uD;break;case"focusin":Le="focus",me=_h;break;case"focusout":Le="blur",me=_h;break;case"beforeblur":case"afterblur":me=_h;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Gy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=QR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=hD;break;case hv:case mv:case gv:me=tD;break;case pv:me=gD;break;case"scroll":case"scrollend":me=XR;break;case"wheel":me=yD;break;case"copy":case"cut":case"paste":me=oD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Wy;break;case"toggle":case"beforetoggle":me=xD}var Ke=(s&4)!==0,Yt=!Ke&&(r==="scroll"||r==="scrollend"),ie=Ke?he!==null?he+"Capture":null:he;Ke=[];for(var se=fe,ce;se!==null;){var we=se;if(ce=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||ce===null||ie===null||(we=hl(se,ie),we!=null&&Ke.push(Gl(se,we,ce))),Yt)break;se=se.return}0<Ke.length&&(he=new me(he,Le,null,c,pe),Se.push({event:he,listeners:Ke}))}}if((s&7)===0){e:{if(he=r==="mouseover"||r==="pointerover",me=r==="mouseout"||r==="pointerout",he&&c!==vh&&(Le=c.relatedTarget||c.fromElement)&&(xe(Le)||Le[ko]))break e;if((me||he)&&(he=pe.window===pe?pe:(he=pe.ownerDocument)?he.defaultView||he.parentWindow:window,me?(Le=c.relatedTarget||c.toElement,me=fe,Le=Le?xe(Le):null,Le!==null&&(Yt=i(Le),Ke=Le.tag,Le!==Yt||Ke!==5&&Ke!==27&&Ke!==6)&&(Le=null)):(me=null,Le=fe),me!==Le)){if(Ke=Gy,we="onMouseLeave",ie="onMouseEnter",se="mouse",(r==="pointerout"||r==="pointerover")&&(Ke=Wy,we="onPointerLeave",ie="onPointerEnter",se="pointer"),Yt=me==null?he:Ie(me),ce=Le==null?he:Ie(Le),he=new Ke(we,se+"leave",me,c,pe),he.target=Yt,he.relatedTarget=ce,we=null,xe(pe)===fe&&(Ke=new Ke(ie,se+"enter",Le,c,pe),Ke.target=ce,Ke.relatedTarget=Yt,we=Ke),Yt=we,me&&Le)t:{for(Ke=v3,ie=me,se=Le,ce=0,we=ie;we;we=Ke(we))ce++;we=0;for(var We=se;We;We=Ke(We))we++;for(;0<ce-we;)ie=Ke(ie),ce--;for(;0<we-ce;)se=Ke(se),we--;for(;ce--;){if(ie===se||se!==null&&ie===se.alternate){Ke=ie;break t}ie=Ke(ie),se=Ke(se)}Ke=null}else Ke=null;me!==null&&$1(Se,he,me,Ke,!1),Le!==null&&Yt!==null&&$1(Se,Yt,Le,Ke,!0)}}e:{if(he=fe?Ie(fe):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var Tt=nv;else if(ev(he))if(ov)Tt=DD;else{Tt=ND;var Fe=MD}else me=he.nodeName,!me||me.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?fe&&yh(fe.elementType)&&(Tt=nv):Tt=RD;if(Tt&&(Tt=Tt(r,fe))){tv(Se,Tt,c,pe);break e}Fe&&Fe(r,he,fe),r==="focusout"&&fe&&he.type==="number"&&fe.memoizedProps.value!=null&&rs(he,"number",he.value)}switch(Fe=fe?Ie(fe):window,r){case"focusin":(ev(Fe)||Fe.contentEditable==="true")&&(Ws=Fe,kh=fe,wl=null);break;case"focusout":wl=kh=Ws=null;break;case"mousedown":Oh=!0;break;case"contextmenu":case"mouseup":case"dragend":Oh=!1,dv(Se,c,pe);break;case"selectionchange":if(kD)break;case"keydown":case"keyup":dv(Se,c,pe)}var ut;if(Nh)e:{switch(r){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else qs?Qy(r,c)&&(bt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(bt="onCompositionStart");bt&&(Ky&&c.locale!=="ko"&&(qs||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&qs&&(ut=Uy()):(ha=pe,Sh="value"in ha?ha.value:ha.textContent,qs=!0)),Fe=ad(fe,bt),0<Fe.length&&(bt=new qy(bt,r,null,c,pe),Se.push({event:bt,listeners:Fe}),ut?bt.data=ut:(ut=Jy(c),ut!==null&&(bt.data=ut)))),(ut=wD?SD(r,c):CD(r,c))&&(bt=ad(fe,"onBeforeInput"),0<bt.length&&(Fe=new qy("onBeforeInput","beforeinput",null,c,pe),Se.push({event:Fe,listeners:bt}),Fe.data=ut)),m3(Se,r,fe,c,pe)}P1(Se,s)})}function Gl(r,s,c){return{instance:r,listener:s,currentTarget:c}}function ad(r,s){for(var c=s+"Capture",h=[];r!==null;){var b=r,_=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||_===null||(b=hl(r,c),b!=null&&h.unshift(Gl(r,b,_)),b=hl(r,s),b!=null&&h.push(Gl(r,b,_))),r.tag===3)return h;r=r.return}return[]}function v3(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function $1(r,s,c,h,b){for(var _=s._reactName,O=[];c!==null&&c!==h;){var V=c,te=V.alternate,fe=V.stateNode;if(V=V.tag,te!==null&&te===h)break;V!==5&&V!==26&&V!==27||fe===null||(te=fe,b?(fe=hl(c,_),fe!=null&&O.unshift(Gl(c,fe,te))):b||(fe=hl(c,_),fe!=null&&O.push(Gl(c,fe,te)))),c=c.return}O.length!==0&&r.push({event:s,listeners:O})}var x3=/\r\n?/g,b3=/\u0000|\uFFFD/g;function H1(r){return(typeof r=="string"?r:""+r).replace(x3,`
|
|
9
|
+
`).replace(b3,"")}function B1(r,s){return s=H1(s),H1(r)===s}function Ut(r,s,c,h,b,_){switch(c){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||Nt(r,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&Nt(r,""+h);break;case"className":It(r,"class",h);break;case"tabIndex":It(r,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":It(r,c,h);break;case"style":uu(r,h,_);break;case"data":if(s!=="object"){It(r,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||c!=="href")){r.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(c);break}h=du(""+h),r.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){r.setAttribute(c,"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 _=="function"&&(c==="formAction"?(s!=="input"&&Ut(r,s,"name",b.name,b,null),Ut(r,s,"formEncType",b.formEncType,b,null),Ut(r,s,"formMethod",b.formMethod,b,null),Ut(r,s,"formTarget",b.formTarget,b,null)):(Ut(r,s,"encType",b.encType,b,null),Ut(r,s,"method",b.method,b,null),Ut(r,s,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(c);break}h=du(""+h),r.setAttribute(c,h);break;case"onClick":h!=null&&(r.onclick=Ar);break;case"onScroll":h!=null&&yt("scroll",r);break;case"onScrollEnd":h!=null&&yt("scrollend",r);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(o(60));r.innerHTML=c}}break;case"multiple":r.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":r.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){r.removeAttribute("xlink:href");break}c=du(""+h),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,""+h):r.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":h===!0?r.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,h):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?r.setAttribute(c,h):r.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?r.removeAttribute(c):r.setAttribute(c,h);break;case"popover":yt("beforetoggle",r),yt("toggle",r),lt(r,"popover",h);break;case"xlinkActuate":rt(r,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":rt(r,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":rt(r,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":rt(r,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":rt(r,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":rt(r,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":rt(r,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":rt(r,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":rt(r,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":lt(r,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=WR.get(c)||c,lt(r,c,h))}}function og(r,s,c,h,b,_){switch(c){case"style":uu(r,h,_);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(o(60));r.innerHTML=c}}break;case"children":typeof h=="string"?Nt(r,h):(typeof h=="number"||typeof h=="bigint")&&Nt(r,""+h);break;case"onScroll":h!=null&&yt("scroll",r);break;case"onScrollEnd":h!=null&&yt("scrollend",r);break;case"onClick":h!=null&&(r.onclick=Ar);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ke.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(b=c.endsWith("Capture"),s=c.slice(2,b?c.length-7:void 0),_=r[Tn]||null,_=_!=null?_[c]:null,typeof _=="function"&&r.removeEventListener(s,_,b),typeof h=="function")){typeof _!="function"&&_!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(s,h,b);break e}c in r?r[c]=h:h===!0?r.setAttribute(c,""):lt(r,c,h)}}}function Fn(r,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",r),yt("load",r);var h=!1,b=!1,_;for(_ in c)if(c.hasOwnProperty(_)){var O=c[_];if(O!=null)switch(_){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:Ut(r,s,_,O,c,null)}}b&&Ut(r,s,"srcSet",c.srcSet,c,null),h&&Ut(r,s,"src",c.src,c,null);return;case"input":yt("invalid",r);var V=_=O=b=null,te=null,fe=null;for(h in c)if(c.hasOwnProperty(h)){var pe=c[h];if(pe!=null)switch(h){case"name":b=pe;break;case"type":O=pe;break;case"checked":te=pe;break;case"defaultChecked":fe=pe;break;case"value":_=pe;break;case"defaultValue":V=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(o(137,s));break;default:Ut(r,s,h,pe,c,null)}}lr(r,_,V,te,fe,O,b,!1);return;case"select":yt("invalid",r),h=O=_=null;for(b in c)if(c.hasOwnProperty(b)&&(V=c[b],V!=null))switch(b){case"value":_=V;break;case"defaultValue":O=V;break;case"multiple":h=V;default:Ut(r,s,b,V,c,null)}s=_,c=O,r.multiple=!!h,s!=null?At(r,!!h,s,!1):c!=null&&At(r,!!h,c,!0);return;case"textarea":yt("invalid",r),_=b=h=null;for(O in c)if(c.hasOwnProperty(O)&&(V=c[O],V!=null))switch(O){case"value":h=V;break;case"defaultValue":b=V;break;case"children":_=V;break;case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(91));break;default:Ut(r,s,O,V,c,null)}Xt(r,h,b,_);return;case"option":for(te in c)c.hasOwnProperty(te)&&(h=c[te],h!=null)&&(te==="selected"?r.selected=h&&typeof h!="function"&&typeof h!="symbol":Ut(r,s,te,h,c,null));return;case"dialog":yt("beforetoggle",r),yt("toggle",r),yt("cancel",r),yt("close",r);break;case"iframe":case"object":yt("load",r);break;case"video":case"audio":for(h=0;h<Yl.length;h++)yt(Yl[h],r);break;case"image":yt("error",r),yt("load",r);break;case"details":yt("toggle",r);break;case"embed":case"source":case"link":yt("error",r),yt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in c)if(c.hasOwnProperty(fe)&&(h=c[fe],h!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:Ut(r,s,fe,h,c,null)}return;default:if(yh(s)){for(pe in c)c.hasOwnProperty(pe)&&(h=c[pe],h!==void 0&&og(r,s,pe,h,c,void 0));return}}for(V in c)c.hasOwnProperty(V)&&(h=c[V],h!=null&&Ut(r,s,V,h,c,null))}function w3(r,s,c,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,_=null,O=null,V=null,te=null,fe=null,pe=null;for(me in c){var Se=c[me];if(c.hasOwnProperty(me)&&Se!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":te=Se;default:h.hasOwnProperty(me)||Ut(r,s,me,null,h,Se)}}for(var he in h){var me=h[he];if(Se=c[he],h.hasOwnProperty(he)&&(me!=null||Se!=null))switch(he){case"type":_=me;break;case"name":b=me;break;case"checked":fe=me;break;case"defaultChecked":pe=me;break;case"value":O=me;break;case"defaultValue":V=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(o(137,s));break;default:me!==Se&&Ut(r,s,he,me,h,Se)}}fo(r,O,V,te,fe,pe,_,b);return;case"select":me=O=V=he=null;for(_ in c)if(te=c[_],c.hasOwnProperty(_)&&te!=null)switch(_){case"value":break;case"multiple":me=te;default:h.hasOwnProperty(_)||Ut(r,s,_,null,h,te)}for(b in h)if(_=h[b],te=c[b],h.hasOwnProperty(b)&&(_!=null||te!=null))switch(b){case"value":he=_;break;case"defaultValue":V=_;break;case"multiple":O=_;default:_!==te&&Ut(r,s,b,_,h,te)}s=V,c=O,h=me,he!=null?At(r,!!c,he,!1):!!h!=!!c&&(s!=null?At(r,!!c,s,!0):At(r,!!c,c?[]:"",!1));return;case"textarea":me=he=null;for(V in c)if(b=c[V],c.hasOwnProperty(V)&&b!=null&&!h.hasOwnProperty(V))switch(V){case"value":break;case"children":break;default:Ut(r,s,V,null,h,b)}for(O in h)if(b=h[O],_=c[O],h.hasOwnProperty(O)&&(b!=null||_!=null))switch(O){case"value":he=b;break;case"defaultValue":me=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(o(91));break;default:b!==_&&Ut(r,s,O,b,h,_)}Jn(r,he,me);return;case"option":for(var Le in c)he=c[Le],c.hasOwnProperty(Le)&&he!=null&&!h.hasOwnProperty(Le)&&(Le==="selected"?r.selected=!1:Ut(r,s,Le,null,h,he));for(te in h)he=h[te],me=c[te],h.hasOwnProperty(te)&&he!==me&&(he!=null||me!=null)&&(te==="selected"?r.selected=he&&typeof he!="function"&&typeof he!="symbol":Ut(r,s,te,he,h,me));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 Ke in c)he=c[Ke],c.hasOwnProperty(Ke)&&he!=null&&!h.hasOwnProperty(Ke)&&Ut(r,s,Ke,null,h,he);for(fe in h)if(he=h[fe],me=c[fe],h.hasOwnProperty(fe)&&he!==me&&(he!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,s));break;default:Ut(r,s,fe,he,h,me)}return;default:if(yh(s)){for(var Yt in c)he=c[Yt],c.hasOwnProperty(Yt)&&he!==void 0&&!h.hasOwnProperty(Yt)&&og(r,s,Yt,void 0,h,he);for(pe in h)he=h[pe],me=c[pe],!h.hasOwnProperty(pe)||he===me||he===void 0&&me===void 0||og(r,s,pe,he,h,me);return}}for(var ie in c)he=c[ie],c.hasOwnProperty(ie)&&he!=null&&!h.hasOwnProperty(ie)&&Ut(r,s,ie,null,h,he);for(Se in h)he=h[Se],me=c[Se],!h.hasOwnProperty(Se)||he===me||he==null&&me==null||Ut(r,s,Se,he,h,me)}function F1(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function S3(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var b=c[h],_=b.transferSize,O=b.initiatorType,V=b.duration;if(_&&V&&F1(O)){for(O=0,V=b.responseEnd,h+=1;h<c.length;h++){var te=c[h],fe=te.startTime;if(fe>V)break;var pe=te.transferSize,Se=te.initiatorType;pe&&F1(Se)&&(te=te.responseEnd,O+=pe*(te<V?1:(V-fe)/(te-fe)))}if(--h,s+=8*(_+O)/(b.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var rg=null,ag=null;function sd(r){return r.nodeType===9?r:r.ownerDocument}function V1(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function U1(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function sg(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var ig=null;function C3(){var r=window.event;return r&&r.type==="popstate"?r===ig?!1:(ig=r,!0):(ig=null,!1)}var Y1=typeof setTimeout=="function"?setTimeout:void 0,E3=typeof clearTimeout=="function"?clearTimeout:void 0,G1=typeof Promise=="function"?Promise:void 0,_3=typeof queueMicrotask=="function"?queueMicrotask:typeof G1<"u"?function(r){return G1.resolve(null).then(r).catch(M3)}:Y1;function M3(r){setTimeout(function(){throw r})}function Ta(r){return r==="head"}function q1(r,s){var c=s,h=0;do{var b=c.nextSibling;if(r.removeChild(c),b&&b.nodeType===8)if(c=b.data,c==="/$"||c==="/&"){if(h===0){r.removeChild(b),wi(s);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")ql(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,ql(c);for(var _=c.firstChild;_;){var O=_.nextSibling,V=_.nodeName;_[le]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&_.rel.toLowerCase()==="stylesheet"||c.removeChild(_),_=O}}else c==="body"&&ql(r.ownerDocument.body);c=b}while(c);wi(s)}function W1(r,s){var c=r;r=0;do{var h=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=h}while(c)}function lg(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":lg(c),ye(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function N3(r,s,c,h){for(;r.nodeType===1;){var b=c;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(h){if(!r[le])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(_=r.getAttribute("rel"),_==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(_!==b.rel||r.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||r.getAttribute("title")!==(b.title==null?null:b.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(_=r.getAttribute("src"),(_!==(b.src==null?null:b.src)||r.getAttribute("type")!==(b.type==null?null:b.type)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&_&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var _=b.name==null?null:""+b.name;if(b.type==="hidden"&&r.getAttribute("name")===_)return r}else return r;if(r=Lo(r.nextSibling),r===null)break}return null}function R3(r,s,c){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Lo(r.nextSibling),r===null))return null;return r}function K1(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Lo(r.nextSibling),r===null))return null;return r}function cg(r){return r.data==="$?"||r.data==="$~"}function ug(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function D3(r,s){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||c.readyState!=="loading")s();else{var h=function(){s(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),r._reactRetry=h}}function Lo(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var dg=null;function X1(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(s===0)return Lo(r.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}r=r.nextSibling}return null}function Z1(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return r;s--}else c!=="/$"&&c!=="/&"||s++}r=r.previousSibling}return null}function Q1(r,s,c){switch(s=sd(c),r){case"html":if(r=s.documentElement,!r)throw Error(o(452));return r;case"head":if(r=s.head,!r)throw Error(o(453));return r;case"body":if(r=s.body,!r)throw Error(o(454));return r;default:throw Error(o(451))}}function ql(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);ye(r)}var $o=new Map,J1=new Set;function id(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Kr=B.d;B.d={f:T3,r:k3,D:O3,C:A3,L:j3,m:z3,X:P3,S:I3,M:L3};function T3(){var r=Kr.f(),s=Qu();return r||s}function k3(r){var s=Me(r);s!==null&&s.tag===5&&s.type==="form"?px(s):Kr.r(r)}var vi=typeof document>"u"?null:document;function eb(r,s,c){var h=vi;if(h&&typeof s=="string"&&s){var b=Ze(s);b='link[rel="'+r+'"][href="'+b+'"]',typeof c=="string"&&(b+='[crossorigin="'+c+'"]'),J1.has(b)||(J1.add(b),r={rel:r,crossOrigin:c,href:s},h.querySelector(b)===null&&(s=h.createElement("link"),Fn(s,"link",r),be(s),h.head.appendChild(s)))}}function O3(r){Kr.D(r),eb("dns-prefetch",r,null)}function A3(r,s){Kr.C(r,s),eb("preconnect",r,s)}function j3(r,s,c){Kr.L(r,s,c);var h=vi;if(h&&r&&s){var b='link[rel="preload"][as="'+Ze(s)+'"]';s==="image"&&c&&c.imageSrcSet?(b+='[imagesrcset="'+Ze(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(b+='[imagesizes="'+Ze(c.imageSizes)+'"]')):b+='[href="'+Ze(r)+'"]';var _=b;switch(s){case"style":_=xi(r);break;case"script":_=bi(r)}$o.has(_)||(r=m({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:r,as:s},c),$o.set(_,r),h.querySelector(b)!==null||s==="style"&&h.querySelector(Wl(_))||s==="script"&&h.querySelector(Kl(_))||(s=h.createElement("link"),Fn(s,"link",r),be(s),h.head.appendChild(s)))}}function z3(r,s){Kr.m(r,s);var c=vi;if(c&&r){var h=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+Ze(h)+'"][href="'+Ze(r)+'"]',_=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=bi(r)}if(!$o.has(_)&&(r=m({rel:"modulepreload",href:r},s),$o.set(_,r),c.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Kl(_)))return}h=c.createElement("link"),Fn(h,"link",r),be(h),c.head.appendChild(h)}}}function I3(r,s,c){Kr.S(r,s,c);var h=vi;if(h&&r){var b=je(h).hoistableStyles,_=xi(r);s=s||"default";var O=b.get(_);if(!O){var V={loading:0,preload:null};if(O=h.querySelector(Wl(_)))V.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":s},c),(c=$o.get(_))&&fg(r,c);var te=O=h.createElement("link");be(te),Fn(te,"link",r),te._p=new Promise(function(fe,pe){te.onload=fe,te.onerror=pe}),te.addEventListener("load",function(){V.loading|=1}),te.addEventListener("error",function(){V.loading|=2}),V.loading|=4,ld(O,s,h)}O={type:"stylesheet",instance:O,count:1,state:V},b.set(_,O)}}}function P3(r,s){Kr.X(r,s);var c=vi;if(c&&r){var h=je(c).hoistableScripts,b=bi(r),_=h.get(b);_||(_=c.querySelector(Kl(b)),_||(r=m({src:r,async:!0},s),(s=$o.get(b))&&hg(r,s),_=c.createElement("script"),be(_),Fn(_,"link",r),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(b,_))}}function L3(r,s){Kr.M(r,s);var c=vi;if(c&&r){var h=je(c).hoistableScripts,b=bi(r),_=h.get(b);_||(_=c.querySelector(Kl(b)),_||(r=m({src:r,async:!0,type:"module"},s),(s=$o.get(b))&&hg(r,s),_=c.createElement("script"),be(_),Fn(_,"link",r),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(b,_))}}function tb(r,s,c,h){var b=(b=ae.current)?id(b):null;if(!b)throw Error(o(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=xi(c.href),c=je(b).hoistableStyles,h=c.get(s),h||(h={type:"style",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=xi(c.href);var _=je(b).hoistableStyles,O=_.get(r);if(O||(b=b.ownerDocument||b,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(r,O),(_=b.querySelector(Wl(r)))&&!_._p&&(O.instance=_,O.state.loading=5),$o.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},$o.set(r,c),_||$3(b,r,c,O.state))),s&&h===null)throw Error(o(528,""));return O}if(s&&h!==null)throw Error(o(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=bi(c),c=je(b).hoistableScripts,h=c.get(s),h||(h={type:"script",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,r))}}function xi(r){return'href="'+Ze(r)+'"'}function Wl(r){return'link[rel="stylesheet"]['+r+"]"}function nb(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function $3(r,s,c,h){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=r.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),Fn(s,"link",c),be(s),r.head.appendChild(s))}function bi(r){return'[src="'+Ze(r)+'"]'}function Kl(r){return"script[async]"+r}function ob(r,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var h=r.querySelector('style[data-href~="'+Ze(c.href)+'"]');if(h)return s.instance=h,be(h),h;var b=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(r.ownerDocument||r).createElement("style"),be(h),Fn(h,"style",b),ld(h,c.precedence,r),s.instance=h;case"stylesheet":b=xi(c.href);var _=r.querySelector(Wl(b));if(_)return s.state.loading|=4,s.instance=_,be(_),_;h=nb(c),(b=$o.get(b))&&fg(h,b),_=(r.ownerDocument||r).createElement("link"),be(_);var O=_;return O._p=new Promise(function(V,te){O.onload=V,O.onerror=te}),Fn(_,"link",h),s.state.loading|=4,ld(_,c.precedence,r),s.instance=_;case"script":return _=bi(c.src),(b=r.querySelector(Kl(_)))?(s.instance=b,be(b),b):(h=c,(b=$o.get(_))&&(h=m({},c),hg(h,b)),r=r.ownerDocument||r,b=r.createElement("script"),be(b),Fn(b,"link",h),r.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(o(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,ld(h,c.precedence,r));return s.instance}function ld(r,s,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,_=b,O=0;O<h.length;O++){var V=h[O];if(V.dataset.precedence===s)_=V;else if(_!==b)break}_?_.parentNode.insertBefore(r,_.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(r,s.firstChild))}function fg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function hg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var cd=null;function rb(r,s,c){if(cd===null){var h=new Map,b=cd=new Map;b.set(c,h)}else b=cd,h=b.get(c),h||(h=new Map,b.set(c,h));if(h.has(r))return h;for(h.set(r,null),c=c.getElementsByTagName(r),b=0;b<c.length;b++){var _=c[b];if(!(_[le]||_[un]||r==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var O=_.getAttribute(s)||"";O=r+O;var V=h.get(O);V?V.push(_):h.set(O,[_])}}return h}function ab(r,s,c){r=r.ownerDocument||r,r.head.insertBefore(c,s==="title"?r.querySelector("head > title"):null)}function H3(r,s,c){if(c===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function sb(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function B3(r,s,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var b=xi(h.href),_=s.querySelector(Wl(b));if(_){s=_._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=ud.bind(r),s.then(r,r)),c.state.loading|=4,c.instance=_,be(_);return}_=s.ownerDocument||s,h=nb(h),(b=$o.get(b))&&fg(h,b),_=_.createElement("link"),be(_);var O=_;O._p=new Promise(function(V,te){O.onload=V,O.onerror=te}),Fn(_,"link",h),c.instance=_}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=ud.bind(r),s.addEventListener("load",c),s.addEventListener("error",c))}}var mg=0;function F3(r,s){return r.stylesheets&&r.count===0&&fd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var h=setTimeout(function(){if(r.stylesheets&&fd(r,r.stylesheets),r.unsuspend){var _=r.unsuspend;r.unsuspend=null,_()}},6e4+s);0<r.imgBytes&&mg===0&&(mg=62500*S3());var b=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&fd(r,r.stylesheets),r.unsuspend)){var _=r.unsuspend;r.unsuspend=null,_()}},(r.imgBytes>mg?50:800)+s);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function ud(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var dd=null;function fd(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,dd=new Map,s.forEach(V3,r),dd=null,ud.call(r))}function V3(r,s){if(!(s.state.loading&4)){var c=dd.get(r);if(c)var h=c.get(null);else{c=new Map,dd.set(r,c);for(var b=r.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<b.length;_++){var O=b[_];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(c.set(O.dataset.precedence,O),h=O)}h&&c.set(null,h)}b=s.instance,O=b.getAttribute("data-precedence"),_=c.get(O)||h,_===h&&c.set(null,b),c.set(O,b),this.count++,h=ud.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),_?_.parentNode.insertBefore(b,_.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(b,r.firstChild)),s.state.loading|=4}}var Xl={$$typeof:C,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function U3(r,s,c,h,b,_,O,V,te){this.tag=1,this.containerInfo=r,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=Pn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pn(0),this.hiddenUpdates=Pn(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=_,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function ib(r,s,c,h,b,_,O,V,te,fe,pe,Se){return r=new U3(r,s,c,O,te,fe,pe,Se,V),s=1,_===!0&&(s|=24),_=mo(3,null,null,s),r.current=_,_.stateNode=r,s=qh(),s.refCount++,r.pooledCache=s,s.refCount++,_.memoizedState={element:h,isDehydrated:c,cache:s},Zh(_),r}function lb(r){return r?(r=Zs,r):Zs}function cb(r,s,c,h,b,_){b=lb(b),h.context===null?h.context=b:h.pendingContext=b,h=xa(s),h.payload={element:c},_=_===void 0?null:_,_!==null&&(h.callback=_),c=ba(r,h,s),c!==null&&(ao(c,r,s),Rl(c,r,s))}function ub(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<s?c:s}}function gg(r,s){ub(r,s),(r=r.alternate)&&ub(r,s)}function db(r){if(r.tag===13||r.tag===31){var s=ls(r,67108864);s!==null&&ao(s,r,67108864),gg(r,67108864)}}function fb(r){if(r.tag===13||r.tag===31){var s=xo();s=To(s);var c=ls(r,s);c!==null&&ao(c,r,s),gg(r,s)}}var hd=!0;function Y3(r,s,c,h){var b=A.T;A.T=null;var _=B.p;try{B.p=2,pg(r,s,c,h)}finally{B.p=_,A.T=b}}function G3(r,s,c,h){var b=A.T;A.T=null;var _=B.p;try{B.p=8,pg(r,s,c,h)}finally{B.p=_,A.T=b}}function pg(r,s,c,h){if(hd){var b=yg(h);if(b===null)ng(r,s,h,md,c),mb(r,h);else if(W3(b,r,s,c,h))h.stopPropagation();else if(mb(r,h),s&4&&-1<q3.indexOf(r)){for(;b!==null;){var _=Me(b);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var O=Lt(_.pendingLanes);if(O!==0){var V=_;for(V.pendingLanes|=2,V.entangledLanes|=2;O;){var te=1<<31-Wt(O);V.entanglements[1]|=te,O&=~te}fr(_),(jt&6)===0&&(Xu=zt()+500,Ul(0))}}break;case 31:case 13:V=ls(_,2),V!==null&&ao(V,_,2),Qu(),gg(_,2)}if(_=yg(h),_===null&&ng(r,s,h,md,c),_===b)break;b=_}b!==null&&h.stopPropagation()}else ng(r,s,h,null,c)}}function yg(r){return r=xh(r),vg(r)}var md=null;function vg(r){if(md=null,r=xe(r),r!==null){var s=i(r);if(s===null)r=null;else{var c=s.tag;if(c===13){if(r=l(s),r!==null)return r;r=null}else if(c===31){if(r=u(s),r!==null)return r;r=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return md=r,null}function hb(r){switch(r){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(Nn()){case gn:return 2;case In:return 8;case jn:case Ce:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var xg=!1,ka=null,Oa=null,Aa=null,Zl=new Map,Ql=new Map,ja=[],q3="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 mb(r,s){switch(r){case"focusin":case"focusout":ka=null;break;case"dragenter":case"dragleave":Oa=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":Zl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ql.delete(s.pointerId)}}function Jl(r,s,c,h,b,_){return r===null||r.nativeEvent!==_?(r={blockedOn:s,domEventName:c,eventSystemFlags:h,nativeEvent:_,targetContainers:[b]},s!==null&&(s=Me(s),s!==null&&db(s)),r):(r.eventSystemFlags|=h,s=r.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),r)}function W3(r,s,c,h,b){switch(s){case"focusin":return ka=Jl(ka,r,s,c,h,b),!0;case"dragenter":return Oa=Jl(Oa,r,s,c,h,b),!0;case"mouseover":return Aa=Jl(Aa,r,s,c,h,b),!0;case"pointerover":var _=b.pointerId;return Zl.set(_,Jl(Zl.get(_)||null,r,s,c,h,b)),!0;case"gotpointercapture":return _=b.pointerId,Ql.set(_,Jl(Ql.get(_)||null,r,s,c,h,b)),!0}return!1}function gb(r){var s=xe(r.target);if(s!==null){var c=i(s);if(c!==null){if(s=c.tag,s===13){if(s=l(c),s!==null){r.blockedOn=s,Dr(r.priority,function(){fb(c)});return}}else if(s===31){if(s=u(c),s!==null){r.blockedOn=s,Dr(r.priority,function(){fb(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function gd(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var c=yg(r.nativeEvent);if(c===null){c=r.nativeEvent;var h=new c.constructor(c.type,c);vh=h,c.target.dispatchEvent(h),vh=null}else return s=Me(c),s!==null&&db(s),r.blockedOn=c,!1;s.shift()}return!0}function pb(r,s,c){gd(r)&&c.delete(s)}function K3(){xg=!1,ka!==null&&gd(ka)&&(ka=null),Oa!==null&&gd(Oa)&&(Oa=null),Aa!==null&&gd(Aa)&&(Aa=null),Zl.forEach(pb),Ql.forEach(pb)}function pd(r,s){r.blockedOn===s&&(r.blockedOn=null,xg||(xg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,K3)))}var yd=null;function yb(r){yd!==r&&(yd=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){yd===r&&(yd=null);for(var s=0;s<r.length;s+=3){var c=r[s],h=r[s+1],b=r[s+2];if(typeof h!="function"){if(vg(h||c)===null)continue;break}var _=Me(c);_!==null&&(r.splice(s,3),s-=3,ym(_,{pending:!0,data:b,method:c.method,action:h},h,b))}}))}function wi(r){function s(te){return pd(te,r)}ka!==null&&pd(ka,r),Oa!==null&&pd(Oa,r),Aa!==null&&pd(Aa,r),Zl.forEach(s),Ql.forEach(s);for(var c=0;c<ja.length;c++){var h=ja[c];h.blockedOn===r&&(h.blockedOn=null)}for(;0<ja.length&&(c=ja[0],c.blockedOn===null);)gb(c),c.blockedOn===null&&ja.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var b=c[h],_=c[h+1],O=b[Tn]||null;if(typeof _=="function")O||yb(c);else if(O){var V=null;if(_&&_.hasAttribute("formAction")){if(b=_,O=_[Tn]||null)V=O.formAction;else if(vg(b)!==null)continue}else V=O.action;typeof V=="function"?c[h+1]=V:(c.splice(h,3),h-=3),yb(c)}}}function vb(){function r(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(O){return b=O})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,b=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function bg(r){this._internalRoot=r}vd.prototype.render=bg.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(o(409));var c=s.current,h=xo();cb(c,h,r,s,null,null)},vd.prototype.unmount=bg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;cb(r.current,2,null,r,null,null),Qu(),s[ko]=null}};function vd(r){this._internalRoot=r}vd.prototype.unstable_scheduleHydration=function(r){if(r){var s=co();r={blockedOn:null,target:r,priority:s};for(var c=0;c<ja.length&&s!==0&&s<ja[c].priority;c++);ja.splice(c,0,r),c===0&&gb(r)}};var xb=e.version;if(xb!=="19.2.4")throw Error(o(527,xb,"19.2.4"));B.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(o(188)):(r=Object.keys(r).join(","),Error(o(268,r)));return r=f(s),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var X3={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xd.isDisabled&&xd.supportsFiber)try{at=xd.inject(X3),gt=xd}catch{}}return tc.createRoot=function(r,s){if(!a(r))throw Error(o(299));var c=!1,h="",b=Mx,_=Nx,O=Rx;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(O=s.onRecoverableError)),s=ib(r,1,!1,null,null,c,h,null,b,_,O,vb),r[ko]=s.current,tg(r),new bg(s)},tc.hydrateRoot=function(r,s,c){if(!a(r))throw Error(o(299));var h=!1,b="",_=Mx,O=Nx,V=Rx,te=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(O=c.onCaughtError),c.onRecoverableError!==void 0&&(V=c.onRecoverableError),c.formState!==void 0&&(te=c.formState)),s=ib(r,1,!0,s,c??null,h,b,te,_,O,V,vb),s.context=lb(null),c=s.current,h=xo(),h=To(h),b=xa(h),b.callback=null,ba(c,b,h),c=h,s.current.lanes=c,Dt(s,c),fr(s),r[ko]=s.current,tg(r),new vd(s)},tc.version="19.2.4",tc}var Db;function sT(){if(Db)return Cg.exports;Db=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Cg.exports=aT(),Cg.exports}var iT=sT();var Tb="popstate";function lT(t={}){function e(o,a){let{pathname:i,search:l,hash:u}=o.location;return wp("",{pathname:i,search:l,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(o,a){return typeof a=="string"?a:Cc(a)}return uT(e,n,null,t)}function on(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function or(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function cT(){return Math.random().toString(36).substring(2,10)}function kb(t,e){return{usr:t.state,key:t.key,idx:e}}function wp(t,e,n=null,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?tl(e):e,state:n,key:e&&e.key||o||cT()}}function Cc({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function tl(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let o=t.indexOf("?");o>=0&&(e.search=t.substring(o),t=t.substring(0,o)),t&&(e.pathname=t)}return e}function uT(t,e,n,o={}){let{window:a=document.defaultView,v5Compat:i=!1}=o,l=a.history,u="POP",d=null,f=g();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function g(){return(l.state||{idx:null}).idx}function m(){u="POP";let S=g(),M=S==null?null:S-f;f=S,d&&d({action:u,location:E.location,delta:M})}function p(S,M){u="PUSH";let N=wp(E.location,S,M);f=g()+1;let C=kb(N,f),R=E.createHref(N);try{l.pushState(C,"",R)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(R)}i&&d&&d({action:u,location:E.location,delta:1})}function x(S,M){u="REPLACE";let N=wp(E.location,S,M);f=g();let C=kb(N,f),R=E.createHref(N);l.replaceState(C,"",R),i&&d&&d({action:u,location:E.location,delta:0})}function w(S){return dT(S)}let E={get action(){return u},get location(){return t(a,l)},listen(S){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(Tb,m),d=S,()=>{a.removeEventListener(Tb,m),d=null}},createHref(S){return e(a,S)},createURL:w,encodeLocation(S){let M=w(S);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:p,replace:x,go(S){return l.go(S)}};return E}function dT(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),on(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Cc(t);return o=o.replace(/ $/,"%20"),!e&&o.startsWith("//")&&(o=n+o),new URL(o,n)}function xC(t,e,n="/"){return fT(t,e,n,!1)}function fT(t,e,n,o){let a=typeof e=="string"?tl(e):e,i=ra(a.pathname||"/",n);if(i==null)return null;let l=bC(t);hT(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=ET(i);u=ST(l[d],f,o)}return u}function bC(t,e=[],n=[],o="",a=!1){let i=(l,u,d=a,f)=>{let g={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&d)return;on(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let m=na([o,g.relativePath]),p=n.concat(g);l.children&&l.children.length>0&&(on(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),bC(l.children,e,p,m,d)),!(l.path==null&&!l.index)&&e.push({path:m,score:bT(m,l.index),routesMeta:p})};return t.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))i(l,u);else for(let d of wC(l.path))i(l,u,!0,d)}),e}function wC(t){let e=t.split("/");if(e.length===0)return[];let[n,...o]=e,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(o.length===0)return a?[i,""]:[i];let l=wC(o.join("/")),u=[];return u.push(...l.map(d=>d===""?i:[i,d].join("/"))),a&&u.push(...l),u.map(d=>t.startsWith("/")&&d===""?"/":d)}function hT(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:wT(e.routesMeta.map(o=>o.childrenIndex),n.routesMeta.map(o=>o.childrenIndex)))}var mT=/^:[\w-]+$/,gT=3,pT=2,yT=1,vT=10,xT=-2,Ob=t=>t==="*";function bT(t,e){let n=t.split("/"),o=n.length;return n.some(Ob)&&(o+=xT),e&&(o+=pT),n.filter(a=>!Ob(a)).reduce((a,i)=>a+(mT.test(i)?gT:i===""?yT:vT),o)}function wT(t,e){return t.length===e.length&&t.slice(0,-1).every((o,a)=>o===e[a])?t[t.length-1]-e[e.length-1]:0}function ST(t,e,n=!1){let{routesMeta:o}=t,a={},i="/",l=[];for(let u=0;u<o.length;++u){let d=o[u],f=u===o.length-1,g=i==="/"?e:e.slice(i.length)||"/",m=Qd({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},g),p=d.route;if(!m&&f&&n&&!o[o.length-1].route.index&&(m=Qd({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},g)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:na([i,m.pathname]),pathnameBase:RT(na([i,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(i=na([i,m.pathnameBase]))}return l}function Qd(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,o]=CT(t.path,t.caseSensitive,t.end),a=e.match(n);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:o.reduce((f,{paramName:g,isOptional:m},p)=>{if(g==="*"){let w=u[p]||"";l=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const x=u[p];return m&&!x?f[g]=void 0:f[g]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:l,pattern:t}}function CT(t,e=!1,n=!0){or(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(o.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),o]}function ET(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return or(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ra(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,o=t.charAt(n);return o&&o!=="/"?null:t.slice(n)||"/"}var _T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function MT(t,e="/"){let{pathname:n,search:o="",hash:a=""}=typeof t=="string"?tl(t):t,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=Ab(n.substring(1),"/"):i=Ab(n,e)):i=e,{pathname:i,search:DT(o),hash:TT(a)}}function Ab(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ng(t,e,n,o){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(o)}]. 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 NT(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function d0(t){let e=NT(t);return e.map((n,o)=>o===e.length-1?n.pathname:n.pathnameBase)}function f0(t,e,n,o=!1){let a;typeof t=="string"?a=tl(t):(a={...t},on(!a.pathname||!a.pathname.includes("?"),Ng("?","pathname","search",a)),on(!a.pathname||!a.pathname.includes("#"),Ng("#","pathname","hash",a)),on(!a.search||!a.search.includes("#"),Ng("#","search","hash",a)));let i=t===""||a.pathname==="",l=i?"/":a.pathname,u;if(l==null)u=n;else{let m=e.length-1;if(!o&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),m-=1;a.pathname=p.join("/")}u=m>=0?e[m]:"/"}let d=MT(a,u),f=l&&l!=="/"&&l.endsWith("/"),g=(i||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||g)&&(d.pathname+="/"),d}var na=t=>t.join("/").replace(/\/\/+/g,"/"),RT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),DT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,TT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,kT=class{constructor(t,e,n,o=!1){this.status=t,this.statusText=e||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function OT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function AT(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var SC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function CC(t,e){let n=t;if(typeof n!="string"||!_T.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,a=!1;if(SC)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),u=ra(l.pathname,e);l.origin===i.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{or(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var EC=["POST","PUT","PATCH","DELETE"];new Set(EC);var jT=["GET",...EC];new Set(jT);var nl=v.createContext(null);nl.displayName="DataRouter";var wf=v.createContext(null);wf.displayName="DataRouterState";var zT=v.createContext(!1),_C=v.createContext({isTransitioning:!1});_C.displayName="ViewTransition";var IT=v.createContext(new Map);IT.displayName="Fetchers";var PT=v.createContext(null);PT.displayName="Await";var Ro=v.createContext(null);Ro.displayName="Navigation";var Bc=v.createContext(null);Bc.displayName="Location";var Er=v.createContext({outlet:null,matches:[],isDataRoute:!1});Er.displayName="Route";var h0=v.createContext(null);h0.displayName="RouteError";var MC="REACT_ROUTER_ERROR",LT="REDIRECT",$T="ROUTE_ERROR_RESPONSE";function HT(t){if(t.startsWith(`${MC}:${LT}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function BT(t){if(t.startsWith(`${MC}:${$T}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new kT(e.status,e.statusText,e.data)}catch{}}function FT(t,{relative:e}={}){on(ol(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:o}=v.useContext(Ro),{hash:a,pathname:i,search:l}=Fc(t,{relative:e}),u=i;return n!=="/"&&(u=i==="/"?n:na([n,i])),o.createHref({pathname:u,search:l,hash:a})}function ol(){return v.useContext(Bc)!=null}function ca(){return on(ol(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Bc).location}var NC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function RC(t){v.useContext(Ro).static||v.useLayoutEffect(t)}function DC(){let{isDataRoute:t}=v.useContext(Er);return t?tk():VT()}function VT(){on(ol(),"useNavigate() may be used only in the context of a <Router> component.");let t=v.useContext(nl),{basename:e,navigator:n}=v.useContext(Ro),{matches:o}=v.useContext(Er),{pathname:a}=ca(),i=JSON.stringify(d0(o)),l=v.useRef(!1);return RC(()=>{l.current=!0}),v.useCallback((d,f={})=>{if(or(l.current,NC),!l.current)return;if(typeof d=="number"){n.go(d);return}let g=f0(d,JSON.parse(i),a,f.relative==="path");t==null&&e!=="/"&&(g.pathname=g.pathname==="/"?e:na([e,g.pathname])),(f.replace?n.replace:n.push)(g,f.state,f)},[e,n,i,a,t])}v.createContext(null);function Fc(t,{relative:e}={}){let{matches:n}=v.useContext(Er),{pathname:o}=ca(),a=JSON.stringify(d0(n));return v.useMemo(()=>f0(t,JSON.parse(a),o,e==="path"),[t,a,o,e])}function UT(t,e){return TC(t,e)}function TC(t,e,n,o,a){on(ol(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(Ro),{matches:l}=v.useContext(Er),u=l[l.length-1],d=u?u.params:{},f=u?u.pathname:"/",g=u?u.pathnameBase:"/",m=u&&u.route;{let N=m&&m.path||"";OC(f,!m||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${N}">) 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.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let p=ca(),x;if(e){let N=typeof e=="string"?tl(e):e;on(g==="/"||N.pathname?.startsWith(g),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${N.pathname}" was given in the \`location\` prop.`),x=N}else x=p;let w=x.pathname||"/",E=w;if(g!=="/"){let N=g.replace(/^\//,"").split("/");E="/"+w.replace(/^\//,"").split("/").slice(N.length).join("/")}let S=xC(t,{pathname:E});or(m||S!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),or(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 "${x.pathname}${x.search}${x.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.`);let M=KT(S&&S.map(N=>Object.assign({},N,{params:Object.assign({},d,N.params),pathname:na([g,i.encodeLocation?i.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?g:na([g,i.encodeLocation?i.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),l,n,o,a);return e&&M?v.createElement(Bc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},M):M}function YT(){let t=ek(),e=OT(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:o},i={padding:"2px 4px",backgroundColor:o},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:i},"ErrorBoundary")," or"," ",v.createElement("code",{style:i},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},e),n?v.createElement("pre",{style:a},n):null,l)}var GT=v.createElement(YT,null),kC=class extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=BT(t.digest);n&&(t=n)}let e=t!==void 0?v.createElement(Er.Provider,{value:this.props.routeContext},v.createElement(h0.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?v.createElement(qT,{error:t},e):e}};kC.contextType=zT;var Rg=new WeakMap;function qT({children:t,error:e}){let{basename:n}=v.useContext(Ro);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let o=HT(e.digest);if(o){let a=Rg.get(e);if(a)throw a;let i=CC(o.location,n);if(SC&&!Rg.get(e))if(i.isExternal||o.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw Rg.set(e,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function WT({routeContext:t,match:e,children:n}){let o=v.useContext(nl);return o&&o.static&&o.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=e.route.id),v.createElement(Er.Provider,{value:t},n)}function KT(t,e=[],n=null,o=null,a=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,l=n?.errors;if(l!=null){let g=i.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);on(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let u=!1,d=-1;if(n)for(let g=0;g<i.length;g++){let m=i[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:p,errors:x}=n,w=m.route.loader&&!p.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||w){u=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}let f=n&&o?(g,m)=>{o(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:AT(n.matches),errorInfo:m})}:void 0;return i.reduceRight((g,m,p)=>{let x,w=!1,E=null,S=null;n&&(x=l&&m.route.id?l[m.route.id]:void 0,E=m.route.errorElement||GT,u&&(d<0&&p===0?(OC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,S=null):d===p&&(w=!0,S=m.route.hydrateFallbackElement||null)));let M=e.concat(i.slice(0,p+1)),N=()=>{let C;return x?C=E:w?C=S:m.route.Component?C=v.createElement(m.route.Component,null):m.route.element?C=m.route.element:C=g,v.createElement(WT,{match:m,routeContext:{outlet:g,matches:M,isDataRoute:n!=null},children:C})};return n&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?v.createElement(kC,{location:n.location,revalidation:n.revalidation,component:E,error:x,children:N(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:f}):N()},null)}function m0(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XT(t){let e=v.useContext(nl);return on(e,m0(t)),e}function ZT(t){let e=v.useContext(wf);return on(e,m0(t)),e}function QT(t){let e=v.useContext(Er);return on(e,m0(t)),e}function g0(t){let e=QT(t),n=e.matches[e.matches.length-1];return on(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function JT(){return g0("useRouteId")}function ek(){let t=v.useContext(h0),e=ZT("useRouteError"),n=g0("useRouteError");return t!==void 0?t:e.errors?.[n]}function tk(){let{router:t}=XT("useNavigate"),e=g0("useNavigate"),n=v.useRef(!1);return RC(()=>{n.current=!0}),v.useCallback(async(a,i={})=>{or(n.current,NC),n.current&&(typeof a=="number"?await t.navigate(a):await t.navigate(a,{fromRouteId:e,...i}))},[t,e])}var jb={};function OC(t,e,n){!e&&!jb[t]&&(jb[t]=!0,or(!1,n))}v.memo(nk);function nk({routes:t,future:e,state:n,onError:o}){return TC(t,void 0,n,o,e)}function ok({to:t,replace:e,state:n,relative:o}){on(ol(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=v.useContext(Ro);or(!a,"<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}=v.useContext(Er),{pathname:l}=ca(),u=DC(),d=f0(t,d0(i),l,o==="path"),f=JSON.stringify(d);return v.useEffect(()=>{u(JSON.parse(f),{replace:e,state:n,relative:o})},[u,f,o,e,n]),null}function fc(t){on(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function rk({basename:t="/",children:e=null,location:n,navigationType:o="POP",navigator:a,static:i=!1,unstable_useTransitions:l}){on(!ol(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:u,navigator:a,static:i,unstable_useTransitions:l,future:{}}),[u,a,i,l]);typeof n=="string"&&(n=tl(n));let{pathname:f="/",search:g="",hash:m="",state:p=null,key:x="default"}=n,w=v.useMemo(()=>{let E=ra(f,u);return E==null?null:{location:{pathname:E,search:g,hash:m,state:p,key:x},navigationType:o}},[u,f,g,m,p,x,o]);return or(w!=null,`<Router basename="${u}"> is not able to match the URL "${f}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:v.createElement(Ro.Provider,{value:d},v.createElement(Bc.Provider,{children:e,value:w}))}function ak({children:t,location:e}){return UT(Sp(t),e)}function Sp(t,e=[]){let n=[];return v.Children.forEach(t,(o,a)=>{if(!v.isValidElement(o))return;let i=[...e,a];if(o.type===v.Fragment){n.push.apply(n,Sp(o.props.children,i));return}on(o.type===fc,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),on(!o.props.index||!o.props.children,"An index route cannot have child routes.");let l={id:o.props.id||i.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(l.children=Sp(o.props.children,i)),n.push(l)}),n}var Fd="get",Vd="application/x-www-form-urlencoded";function Sf(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function sk(t){return Sf(t)&&t.tagName.toLowerCase()==="button"}function ik(t){return Sf(t)&&t.tagName.toLowerCase()==="form"}function lk(t){return Sf(t)&&t.tagName.toLowerCase()==="input"}function ck(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function uk(t,e){return t.button===0&&(!e||e==="_self")&&!ck(t)}var bd=null;function dk(){if(bd===null)try{new FormData(document.createElement("form"),0),bd=!1}catch{bd=!0}return bd}var fk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Dg(t){return t!=null&&!fk.has(t)?(or(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vd}"`),null):t}function hk(t,e){let n,o,a,i,l;if(ik(t)){let u=t.getAttribute("action");o=u?ra(u,e):null,n=t.getAttribute("method")||Fd,a=Dg(t.getAttribute("enctype"))||Vd,i=new FormData(t)}else if(sk(t)||lk(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||u.getAttribute("action");if(o=d?ra(d,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||Fd,a=Dg(t.getAttribute("formenctype"))||Dg(u.getAttribute("enctype"))||Vd,i=new FormData(u,t),!dk()){let{name:f,type:g,value:m}=t;if(g==="image"){let p=f?`${f}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else f&&i.append(f,m)}}else{if(Sf(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Fd,o=null,a=Vd,l=t}return i&&a==="text/plain"&&(l=i,i=void 0),{action:o,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function p0(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function mk(t,e,n,o){let a=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${o}`:a.pathname=`${a.pathname}.${o}`:a.pathname==="/"?a.pathname=`_root.${o}`:e&&ra(a.pathname,e)==="/"?a.pathname=`${e.replace(/\/$/,"")}/_root.${o}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${o}`,a}async function gk(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function pk(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function yk(t,e,n){let o=await Promise.all(t.map(async a=>{let i=e.routes[a.route.id];if(i){let l=await gk(i,n);return l.links?l.links():[]}return[]}));return wk(o.flat(1).filter(pk).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function zb(t,e,n,o,a,i){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,u=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return i==="assets"?e.filter((d,f)=>l(d,f)||u(d,f)):i==="data"?e.filter((d,f)=>{let g=o.routes[d.route.id];if(!g||!g.hasLoader)return!1;if(l(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function vk(t,e,{includeHydrateFallback:n}={}){return xk(t.map(o=>{let a=e.routes[o.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function xk(t){return[...new Set(t)]}function bk(t){let e={},n=Object.keys(t).sort();for(let o of n)e[o]=t[o];return e}function wk(t,e){let n=new Set;return new Set(e),t.reduce((o,a)=>{let i=JSON.stringify(bk(a));return n.has(i)||(n.add(i),o.push({key:i,link:a})),o},[])}function AC(){let t=v.useContext(nl);return p0(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function Sk(){let t=v.useContext(wf);return p0(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var y0=v.createContext(void 0);y0.displayName="FrameworkContext";function jC(){let t=v.useContext(y0);return p0(t,"You must render this element inside a <HydratedRouter> element"),t}function Ck(t,e){let n=v.useContext(y0),[o,a]=v.useState(!1),[i,l]=v.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:g,onTouchStart:m}=e,p=v.useRef(null);v.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let E=M=>{M.forEach(N=>{l(N.isIntersecting)})},S=new IntersectionObserver(E,{threshold:.5});return p.current&&S.observe(p.current),()=>{S.disconnect()}}},[t]),v.useEffect(()=>{if(o){let E=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(E)}}},[o]);let x=()=>{a(!0)},w=()=>{a(!1),l(!1)};return n?t!=="intent"?[i,p,{}]:[i,p,{onFocus:nc(u,x),onBlur:nc(d,w),onMouseEnter:nc(f,x),onMouseLeave:nc(g,w),onTouchStart:nc(m,x)}]:[!1,p,{}]}function nc(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function Ek({page:t,...e}){let{router:n}=AC(),o=v.useMemo(()=>xC(n.routes,t,n.basename),[n.routes,t,n.basename]);return o?v.createElement(Mk,{page:t,matches:o,...e}):null}function _k(t){let{manifest:e,routeModules:n}=jC(),[o,a]=v.useState([]);return v.useEffect(()=>{let i=!1;return yk(t,e,n).then(l=>{i||a(l)}),()=>{i=!0}},[t,e,n]),o}function Mk({page:t,matches:e,...n}){let o=ca(),{future:a,manifest:i,routeModules:l}=jC(),{basename:u}=AC(),{loaderData:d,matches:f}=Sk(),g=v.useMemo(()=>zb(t,e,f,i,o,"data"),[t,e,f,i,o]),m=v.useMemo(()=>zb(t,e,f,i,o,"assets"),[t,e,f,i,o]),p=v.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let E=new Set,S=!1;if(e.forEach(N=>{let C=i.routes[N.route.id];!C||!C.hasLoader||(!g.some(R=>R.route.id===N.route.id)&&N.route.id in d&&l[N.route.id]?.shouldRevalidate||C.hasClientLoader?S=!0:E.add(N.route.id))}),E.size===0)return[];let M=mk(t,u,a.unstable_trailingSlashAwareDataRequests,"data");return S&&E.size>0&&M.searchParams.set("_routes",e.filter(N=>E.has(N.route.id)).map(N=>N.route.id).join(",")),[M.pathname+M.search]},[u,a.unstable_trailingSlashAwareDataRequests,d,o,i,g,e,t,l]),x=v.useMemo(()=>vk(m,i),[m,i]),w=_k(m);return v.createElement(v.Fragment,null,p.map(E=>v.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...n})),x.map(E=>v.createElement("link",{key:E,rel:"modulepreload",href:E,...n})),w.map(({key:E,link:S})=>v.createElement("link",{key:E,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function Nk(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var Rk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Rk&&(window.__reactRouterVersion="7.13.0")}catch{}function Dk({basename:t,children:e,unstable_useTransitions:n,window:o}){let a=v.useRef();a.current==null&&(a.current=lT({window:o,v5Compat:!0}));let i=a.current,[l,u]=v.useState({action:i.action,location:i.location}),d=v.useCallback(f=>{n===!1?u(f):v.startTransition(()=>u(f))},[n]);return v.useLayoutEffect(()=>i.listen(d),[i,d]),v.createElement(rk,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var zC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,v0=v.forwardRef(function({onClick:e,discover:n="render",prefetch:o="none",relative:a,reloadDocument:i,replace:l,state:u,target:d,to:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:p,...x},w){let{basename:E,unstable_useTransitions:S}=v.useContext(Ro),M=typeof f=="string"&&zC.test(f),N=CC(f,E);f=N.to;let C=FT(f,{relative:a}),[R,D,T]=Ck(o,x),k=Ak(f,{replace:l,state:u,target:d,preventScrollReset:g,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:S});function j(K){e&&e(K),K.defaultPrevented||k(K)}let $=v.createElement("a",{...x,...T,href:N.absoluteURL||C,onClick:N.isExternal||i?e:j,ref:Nk(w,D),target:d,"data-discover":!M&&n==="render"?"true":void 0});return R&&!M?v.createElement(v.Fragment,null,$,v.createElement(Ek,{page:C})):$});v0.displayName="Link";var Tk=v.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:o="",end:a=!1,style:i,to:l,viewTransition:u,children:d,...f},g){let m=Fc(l,{relative:f.relative}),p=ca(),x=v.useContext(wf),{navigator:w,basename:E}=v.useContext(Ro),S=x!=null&&Lk(m)&&u===!0,M=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,N=p.pathname,C=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(N=N.toLowerCase(),C=C?C.toLowerCase():null,M=M.toLowerCase()),C&&E&&(C=ra(C,E)||C);const R=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let D=N===M||!a&&N.startsWith(M)&&N.charAt(R)==="/",T=C!=null&&(C===M||!a&&C.startsWith(M)&&C.charAt(M.length)==="/"),k={isActive:D,isPending:T,isTransitioning:S},j=D?e:void 0,$;typeof o=="function"?$=o(k):$=[o,D?"active":null,T?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let K=typeof i=="function"?i(k):i;return v.createElement(v0,{...f,"aria-current":j,className:$,ref:g,style:K,to:l,viewTransition:u},typeof d=="function"?d(k):d)});Tk.displayName="NavLink";var kk=v.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:o,replace:a,state:i,method:l=Fd,action:u,onSubmit:d,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:p,...x},w)=>{let{unstable_useTransitions:E}=v.useContext(Ro),S=Ik(),M=Pk(u,{relative:f}),N=l.toLowerCase()==="get"?"get":"post",C=typeof u=="string"&&zC.test(u),R=D=>{if(d&&d(D),D.defaultPrevented)return;D.preventDefault();let T=D.nativeEvent.submitter,k=T?.getAttribute("formmethod")||l,j=()=>S(T||D.currentTarget,{fetcherKey:e,method:k,navigate:n,replace:a,state:i,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:p});E&&n!==!1?v.startTransition(()=>j()):j()};return v.createElement("form",{ref:w,method:N,action:M,onSubmit:o?d:R,...x,"data-discover":!C&&t==="render"?"true":void 0})});kk.displayName="Form";function Ok(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function IC(t){let e=v.useContext(nl);return on(e,Ok(t)),e}function Ak(t,{target:e,replace:n,state:o,preventScrollReset:a,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let f=DC(),g=ca(),m=Fc(t,{relative:i});return v.useCallback(p=>{if(uk(p,e)){p.preventDefault();let x=n!==void 0?n:Cc(g)===Cc(m),w=()=>f(t,{replace:x,state:o,preventScrollReset:a,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:u});d?v.startTransition(()=>w()):w()}},[g,f,m,n,o,e,t,a,i,l,u,d])}var jk=0,zk=()=>`__${String(++jk)}__`;function Ik(){let{router:t}=IC("useSubmit"),{basename:e}=v.useContext(Ro),n=JT(),o=t.fetch,a=t.navigate;return v.useCallback(async(i,l={})=>{let{action:u,method:d,encType:f,formData:g,body:m}=hk(i,e);if(l.navigate===!1){let p=l.fetcherKey||zk();await o(p,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||d,formEncType:l.encType||f,flushSync:l.flushSync})}else await a(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||d,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[o,a,e,n])}function Pk(t,{relative:e}={}){let{basename:n}=v.useContext(Ro),o=v.useContext(Er);on(o,"useFormAction must be used inside a RouteContext");let[a]=o.matches.slice(-1),i={...Fc(t||".",{relative:e})},l=ca();if(t==null){i.search=l.search;let u=new URLSearchParams(i.search),d=u.getAll("index");if(d.some(g=>g==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let g=u.toString();i.search=g?`?${g}`:""}}return(!t||t===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:na([n,i.pathname])),Cc(i)}function Lk(t,{relative:e}={}){let n=v.useContext(_C);on(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=IC("useViewTransitionState"),a=Fc(t,{relative:e});if(!n.isTransitioning)return!1;let i=ra(n.currentLocation.pathname,o)||n.currentLocation.pathname,l=ra(n.nextLocation.pathname,o)||n.nextLocation.pathname;return Qd(a.pathname,l)!=null||Qd(a.pathname,i)!=null}var rl=vC();const PC=u0(rl);var Tg={exports:{}},kg={};var Ib;function $k(){if(Ib)return kg;Ib=1;var t=el().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return kg.c=function(e){return t.H.useMemoCache(e)},kg}var Pb;function Hk(){return Pb||(Pb=1,Tg.exports=$k()),Tg.exports}var Ee=Hk();function Bk(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const Fk=t=>{switch(t){case"success":return Yk;case"info":return qk;case"warning":return Gk;case"error":return Wk;default:return null}},Vk=Array(12).fill(0),Uk=({visible:t,className:e})=>ue.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},ue.createElement("div",{className:"sonner-spinner"},Vk.map((n,o)=>ue.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Yk=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),Gk=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ue.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"})),qk=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),Wk=ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ue.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"})),Kk=ue.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"},ue.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ue.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Xk=()=>{const[t,e]=ue.useState(document.hidden);return ue.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let Cp=1;class Zk{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:o,...a}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Cp++,l=this.toasts.find(d=>d.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...e,id:i,title:o}),{...d,...e,id:i,dismissible:u,title:o}):d):this.addToast({title:o,...a,dismissible:u,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(e instanceof Function?e():e);let i=o!==void 0,l;const u=a.then(async f=>{if(l=["resolve",f],ue.isValidElement(f))i=!1,this.create({id:o,type:"default",message:f});else if(Jk(f)&&!f.ok){i=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,w=typeof m=="object"&&!ue.isValidElement(m)?m:{message:m};this.create({id:o,type:"error",description:p,...w})}else if(f instanceof Error){i=!1;const m=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!ue.isValidElement(m)?m:{message:m};this.create({id:o,type:"error",description:p,...w})}else if(n.success!==void 0){i=!1;const m=typeof n.success=="function"?await n.success(f):n.success,p=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!ue.isValidElement(m)?m:{message:m};this.create({id:o,type:"success",description:p,...w})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){i=!1;const g=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof g=="object"&&!ue.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:m,...x})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,g)=>u.then(()=>l[0]==="reject"?g(l[1]):f(l[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:d}:Object.assign(o,{unwrap:d})},this.custom=(e,n)=>{const o=n?.id||Cp++;return this.create({jsx:e(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const so=new Zk,Qk=(t,e)=>{const n=e?.id||Cp++;return so.addToast({title:t,...e,id:n}),n},Jk=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",e4=Qk,t4=()=>so.toasts,n4=()=>so.getActiveToasts(),En=Object.assign(e4,{success:so.success,info:so.info,warning:so.warning,error:so.error,custom:so.custom,message:so.message,promise:so.promise,dismiss:so.dismiss,loading:so.loading},{getHistory:t4,getToasts:n4});Bk("[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 wd(t){return t.label!==void 0}const o4=3,r4="24px",a4="16px",Lb=4e3,s4=356,i4=14,l4=45,c4=200;function hr(...t){return t.filter(Boolean).join(" ")}function u4(t){const[e,n]=t.split("-"),o=[];return e&&o.push(e),n&&o.push(n),o}const d4=t=>{var e,n,o,a,i,l,u,d,f;const{invert:g,toast:m,unstyled:p,interacting:x,setHeights:w,visibleToasts:E,heights:S,index:M,toasts:N,expanded:C,removeToast:R,defaultRichColors:D,closeButton:T,style:k,cancelButtonStyle:j,actionButtonStyle:$,className:K="",descriptionClassName:U="",duration:Y,position:Z,gap:P,expandByDefault:q,classNames:A,icons:B,closeButtonAriaLabel:L="Close toast"}=t,[F,X]=ue.useState(null),[I,z]=ue.useState(null),[H,G]=ue.useState(!1),[J,ae]=ue.useState(!1),[W,ee]=ue.useState(!1),[oe,de]=ue.useState(!1),[ge,ne]=ue.useState(!1),[_e,De]=ue.useState(0),[Ye,Pe]=ue.useState(0),mt=ue.useRef(m.duration||Y||Lb),sn=ue.useRef(null),ft=ue.useRef(null),xn=M===0,ln=M+1<=E,Ft=m.type,fn=m.dismissible!==!1,zt=m.className||"",Nn=m.descriptionClassName||"",gn=ue.useMemo(()=>S.findIndex(Te=>Te.toastId===m.id)||0,[S,m.id]),In=ue.useMemo(()=>{var Te;return(Te=m.closeButton)!=null?Te:T},[m.closeButton,T]),jn=ue.useMemo(()=>m.duration||Y||Lb,[m.duration,Y]),Ce=ue.useRef(0),Ve=ue.useRef(0),Et=ue.useRef(0),Xe=ue.useRef(null),[at,gt]=Z.split("-"),qt=ue.useMemo(()=>S.reduce((Te,Ot,Kt)=>Kt>=gn?Te:Te+Ot.height,0),[S,gn]),Wt=Xk(),Qn=m.invert||g,_t=Ft==="loading";Ve.current=ue.useMemo(()=>gn*P+qt,[gn,qt]),ue.useEffect(()=>{mt.current=jn},[jn]),ue.useEffect(()=>{G(!0)},[]),ue.useEffect(()=>{const Te=ft.current;if(Te){const Ot=Te.getBoundingClientRect().height;return Pe(Ot),w(Kt=>[{toastId:m.id,height:Ot,position:m.position},...Kt]),()=>w(Kt=>Kt.filter(cn=>cn.toastId!==m.id))}},[w,m.id]),ue.useLayoutEffect(()=>{if(!H)return;const Te=ft.current,Ot=Te.style.height;Te.style.height="auto";const Kt=Te.getBoundingClientRect().height;Te.style.height=Ot,Pe(Kt),w(cn=>cn.find(Dt=>Dt.toastId===m.id)?cn.map(Dt=>Dt.toastId===m.id?{...Dt,height:Kt}:Dt):[{toastId:m.id,height:Kt,position:m.position},...cn])},[H,m.title,m.description,w,m.id,m.jsx,m.action,m.cancel]);const Be=ue.useCallback(()=>{ae(!0),De(Ve.current),w(Te=>Te.filter(Ot=>Ot.toastId!==m.id)),setTimeout(()=>{R(m)},c4)},[m,R,w,Ve]);ue.useEffect(()=>{if(m.promise&&Ft==="loading"||m.duration===1/0||m.type==="loading")return;let Te;return C||x||Wt?(()=>{if(Et.current<Ce.current){const cn=new Date().getTime()-Ce.current;mt.current=mt.current-cn}Et.current=new Date().getTime()})():mt.current!==1/0&&(Ce.current=new Date().getTime(),Te=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Be()},mt.current)),()=>clearTimeout(Te)},[C,x,m,Ft,Wt,Be]),ue.useEffect(()=>{m.delete&&(Be(),m.onDismiss==null||m.onDismiss.call(m,m))},[Be,m.delete]);function nt(){var Te;if(B?.loading){var Ot;return ue.createElement("div",{className:hr(A?.loader,m==null||(Ot=m.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Ft==="loading"},B.loading)}return ue.createElement(Uk,{className:hr(A?.loader,m==null||(Te=m.classNames)==null?void 0:Te.loader),visible:Ft==="loading"})}const Ue=m.icon||B?.[Ft]||Fk(Ft);var st,Lt;return ue.createElement("li",{tabIndex:0,ref:ft,className:hr(K,zt,A?.toast,m==null||(e=m.classNames)==null?void 0:e.toast,A?.default,A?.[Ft],m==null||(n=m.classNames)==null?void 0:n[Ft]),"data-sonner-toast":"","data-rich-colors":(st=m.richColors)!=null?st:D,"data-styled":!(m.jsx||m.unstyled||p),"data-mounted":H,"data-promise":!!m.promise,"data-swiped":ge,"data-removed":J,"data-visible":ln,"data-y-position":at,"data-x-position":gt,"data-index":M,"data-front":xn,"data-swiping":W,"data-dismissible":fn,"data-type":Ft,"data-invert":Qn,"data-swipe-out":oe,"data-swipe-direction":I,"data-expanded":!!(C||q&&H),"data-testid":m.testId,style:{"--index":M,"--toasts-before":M,"--z-index":N.length-M,"--offset":`${J?_e:Ve.current}px`,"--initial-height":q?"auto":`${Ye}px`,...k,...m.style},onDragEnd:()=>{ee(!1),X(null),Xe.current=null},onPointerDown:Te=>{Te.button!==2&&(_t||!fn||(sn.current=new Date,De(Ve.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(ee(!0),Xe.current={x:Te.clientX,y:Te.clientY})))},onPointerUp:()=>{var Te,Ot,Kt;if(oe||!fn)return;Xe.current=null;const cn=Number(((Te=ft.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pn=Number(((Ot=ft.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((Kt=sn.current)==null?void 0:Kt.getTime()),Rn=F==="x"?cn:Pn,Yo=Math.abs(Rn)/Dt;if(Math.abs(Rn)>=l4||Yo>.11){De(Ve.current),m.onDismiss==null||m.onDismiss.call(m,m),z(F==="x"?cn>0?"right":"left":Pn>0?"down":"up"),Be(),de(!0);return}else{var vt,Dn;(vt=ft.current)==null||vt.style.setProperty("--swipe-amount-x","0px"),(Dn=ft.current)==null||Dn.style.setProperty("--swipe-amount-y","0px")}ne(!1),ee(!1),X(null)},onPointerMove:Te=>{var Ot,Kt,cn;if(!Xe.current||!fn||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const Dt=Te.clientY-Xe.current.y,Rn=Te.clientX-Xe.current.x;var Yo;const vt=(Yo=t.swipeDirections)!=null?Yo:u4(Z);!F&&(Math.abs(Rn)>1||Math.abs(Dt)>1)&&X(Math.abs(Rn)>Math.abs(Dt)?"x":"y");let Dn={x:0,y:0};const To=Un=>1/(1.5+Math.abs(Un)/20);if(F==="y"){if(vt.includes("top")||vt.includes("bottom"))if(vt.includes("top")&&Dt<0||vt.includes("bottom")&&Dt>0)Dn.y=Dt;else{const Un=Dt*To(Dt);Dn.y=Math.abs(Un)<Math.abs(Dt)?Un:Dt}}else if(F==="x"&&(vt.includes("left")||vt.includes("right")))if(vt.includes("left")&&Rn<0||vt.includes("right")&&Rn>0)Dn.x=Rn;else{const Un=Rn*To(Rn);Dn.x=Math.abs(Un)<Math.abs(Rn)?Un:Rn}(Math.abs(Dn.x)>0||Math.abs(Dn.y)>0)&&ne(!0),(Kt=ft.current)==null||Kt.style.setProperty("--swipe-amount-x",`${Dn.x}px`),(cn=ft.current)==null||cn.style.setProperty("--swipe-amount-y",`${Dn.y}px`)}},In&&!m.jsx&&Ft!=="loading"?ue.createElement("button",{"aria-label":L,"data-disabled":_t,"data-close-button":!0,onClick:_t||!fn?()=>{}:()=>{Be(),m.onDismiss==null||m.onDismiss.call(m,m)},className:hr(A?.closeButton,m==null||(o=m.classNames)==null?void 0:o.closeButton)},(Lt=B?.close)!=null?Lt:Kk):null,(Ft||m.icon||m.promise)&&m.icon!==null&&(B?.[Ft]!==null||m.icon)?ue.createElement("div",{"data-icon":"",className:hr(A?.icon,m==null||(a=m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||nt():null,m.type!=="loading"?Ue:null):null,ue.createElement("div",{"data-content":"",className:hr(A?.content,m==null||(i=m.classNames)==null?void 0:i.content)},ue.createElement("div",{"data-title":"",className:hr(A?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?ue.createElement("div",{"data-description":"",className:hr(U,Nn,A?.description,m==null||(u=m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),ue.isValidElement(m.cancel)?m.cancel:m.cancel&&wd(m.cancel)?ue.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||j,onClick:Te=>{wd(m.cancel)&&fn&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Te),Be())},className:hr(A?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,ue.isValidElement(m.action)?m.action:m.action&&wd(m.action)?ue.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||$,onClick:Te=>{wd(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Te),!Te.defaultPrevented&&Be())},className:hr(A?.actionButton,m==null||(f=m.classNames)==null?void 0:f.actionButton)},m.action.label):null)};function $b(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function f4(t,e){const n={};return[t,e].forEach((o,a)=>{const i=a===1,l=i?"--mobile-offset":"--offset",u=i?a4:r4;function d(f){["top","right","bottom","left"].forEach(g=>{n[`${l}-${g}`]=typeof f=="number"?`${f}px`:f})}typeof o=="number"||typeof o=="string"?d(o):typeof o=="object"?["top","right","bottom","left"].forEach(f=>{o[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof o[f]=="number"?`${o[f]}px`:o[f]}):d(u)}),n}const h4=ue.forwardRef(function(e,n){const{id:o,invert:a,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:f,offset:g,mobileOffset:m,theme:p="light",richColors:x,duration:w,style:E,visibleToasts:S=o4,toastOptions:M,dir:N=$b(),gap:C=i4,icons:R,containerAriaLabel:D="Notifications"}=e,[T,k]=ue.useState([]),j=ue.useMemo(()=>o?T.filter(H=>H.toasterId===o):T.filter(H=>!H.toasterId),[T,o]),$=ue.useMemo(()=>Array.from(new Set([i].concat(j.filter(H=>H.position).map(H=>H.position)))),[j,i]),[K,U]=ue.useState([]),[Y,Z]=ue.useState(!1),[P,q]=ue.useState(!1),[A,B]=ue.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=ue.useRef(null),F=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=ue.useRef(null),I=ue.useRef(!1),z=ue.useCallback(H=>{k(G=>{var J;return(J=G.find(ae=>ae.id===H.id))!=null&&J.delete||so.dismiss(H.id),G.filter(({id:ae})=>ae!==H.id)})},[]);return ue.useEffect(()=>so.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{k(G=>G.map(J=>J.id===H.id?{...J,delete:!0}:J))});return}setTimeout(()=>{PC.flushSync(()=>{k(G=>{const J=G.findIndex(ae=>ae.id===H.id);return J!==-1?[...G.slice(0,J),{...G[J],...H},...G.slice(J+1)]:[H,...G]})})})}),[T]),ue.useEffect(()=>{if(p!=="system"){B(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:G})=>{B(G?"dark":"light")})}catch{H.addListener(({matches:J})=>{try{B(J?"dark":"light")}catch(ae){console.error(ae)}})}},[p]),ue.useEffect(()=>{T.length<=1&&Z(!1)},[T]),ue.useEffect(()=>{const H=G=>{var J;if(l.every(ee=>G[ee]||G.code===ee)){var W;Z(!0),(W=L.current)==null||W.focus()}G.code==="Escape"&&(document.activeElement===L.current||(J=L.current)!=null&&J.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[l]),ue.useEffect(()=>{if(L.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,I.current=!1)}},[L.current]),ue.createElement("section",{ref:n,"aria-label":`${D} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},$.map((H,G)=>{var J;const[ae,W]=H.split("-");return j.length?ue.createElement("ol",{key:H,dir:N==="auto"?$b():N,tabIndex:-1,ref:L,className:f,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":ae,"data-x-position":W,style:{"--front-toast-height":`${((J=K[0])==null?void 0:J.height)||0}px`,"--width":`${s4}px`,"--gap":`${C}px`,...E,...f4(g,m)},onBlur:ee=>{I.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(I.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||I.current||(I.current=!0,X.current=ee.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{P||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},j.filter(ee=>!ee.position&&G===0||ee.position===H).map((ee,oe)=>{var de,ge;return ue.createElement(d4,{key:ee.id,icons:R,index:oe,toast:ee,defaultRichColors:x,duration:(de=M?.duration)!=null?de:w,className:M?.className,descriptionClassName:M?.descriptionClassName,invert:a,visibleToasts:S,closeButton:(ge=M?.closeButton)!=null?ge:d,interacting:P,position:H,style:M?.style,unstyled:M?.unstyled,classNames:M?.classNames,cancelButtonStyle:M?.cancelButtonStyle,actionButtonStyle:M?.actionButtonStyle,closeButtonAriaLabel:M?.closeButtonAriaLabel,removeToast:z,toasts:j.filter(ne=>ne.position==ee.position),heights:K.filter(ne=>ne.position==ee.position),setHeights:U,expandByDefault:u,gap:C,expanded:Y,swipeDirections:e.swipeDirections})})):null}))});function LC(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=LC(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function $C(){for(var t,e,n=0,o="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=LC(t))&&(o&&(o+=" "),o+=e);return o}const Hb=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Bb=$C,Cf=(t,e)=>n=>{var o;if(e?.variants==null)return Bb(t,n?.class,n?.className);const{variants:a,defaultVariants:i}=e,l=Object.keys(a).map(f=>{const g=n?.[f],m=i?.[f];if(g===null)return null;const p=Hb(g)||Hb(m);return a[f][p]}),u=n&&Object.entries(n).reduce((f,g)=>{let[m,p]=g;return p===void 0||(f[m]=p),f},{}),d=e==null||(o=e.compoundVariants)===null||o===void 0?void 0:o.reduce((f,g)=>{let{class:m,className:p,...x}=g;return Object.entries(x).every(w=>{let[E,S]=w;return Array.isArray(S)?S.includes({...i,...u}[E]):{...i,...u}[E]===S})?[...f,m,p]:f},[]);return Bb(t,l,d,n?.class,n?.className)};function Fb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function aa(...t){return e=>{let n=!1;const o=t.map(a=>{const i=Fb(a,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<o.length;a++){const i=o[a];typeof i=="function"?i():Fb(t[a],null)}}}}function Rt(...t){return v.useCallback(aa(...t),t)}function Ya(t){const e=m4(t),n=v.forwardRef((o,a)=>{const{children:i,...l}=o,u=v.Children.toArray(i),d=u.find(p4);if(d){const f=d.props.children,g=u.map(m=>m===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:m);return y.jsx(e,{...l,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,g):null})}return y.jsx(e,{...l,ref:a,children:i})});return n.displayName=`${t}.Slot`,n}var Ef=Ya("Slot");function m4(t){const e=v.forwardRef((n,o)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const l=v4(a),u=y4(i,a.props);return a.type!==v.Fragment&&(u.ref=o?aa(o,l):l),v.cloneElement(a,u)}return v.Children.count(a)>1?v.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var HC=Symbol("radix.slottable");function g4(t){const e=({children:n})=>y.jsx(y.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=HC,e}function p4(t){return v.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===HC}function y4(t,e){const n={...e};for(const o in e){const a=t[o],i=e[o];/^on[A-Z]/.test(o)?a&&i?n[o]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[o]=a):o==="style"?n[o]={...a,...i}:o==="className"&&(n[o]=[a,i].filter(Boolean).join(" "))}return{...t,...n}}function v4(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var x4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=x4.reduce((t,e)=>{const n=Ya(`Primitive.${e}`),o=v.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(d,{...u,ref:i})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function BC(t,e){t&&rl.flushSync(()=>t.dispatchEvent(e))}var FC=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"}),b4="VisuallyHidden",VC=v.forwardRef((t,e)=>y.jsx(et.span,{...t,ref:e,style:{...FC,...t.style}}));VC.displayName=b4;var w4=VC;function S4(t,e){const n=v.createContext(e),o=i=>{const{children:l,...u}=i,d=v.useMemo(()=>u,Object.values(u));return y.jsx(n.Provider,{value:d,children:l})};o.displayName=t+"Provider";function a(i){const l=v.useContext(n);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[o,a]}function _r(t,e=[]){let n=[];function o(i,l){const u=v.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:p,children:x,...w}=m,E=p?.[t]?.[d]||u,S=v.useMemo(()=>w,Object.values(w));return y.jsx(E.Provider,{value:S,children:x})};f.displayName=i+"Provider";function g(m,p){const x=p?.[t]?.[d]||u,w=v.useContext(x);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[f,g]}const a=()=>{const i=n.map(l=>v.createContext(l));return function(u){const d=u?.[t]||i;return v.useMemo(()=>({[`__scope${t}`]:{...u,[t]:d}}),[u,d])}};return a.scopeName=t,[o,C4(a,...e)]}function C4(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const o=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=o.reduce((u,{useScope:d,scopeName:f})=>{const m=d(i)[`__scope${f}`];return{...u,...m}},{});return v.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}function x0(t){const e=t+"CollectionProvider",[n,o]=_r(e),[a,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),l=E=>{const{scope:S,children:M}=E,N=ue.useRef(null),C=ue.useRef(new Map).current;return y.jsx(a,{scope:S,itemMap:C,collectionRef:N,children:M})};l.displayName=e;const u=t+"CollectionSlot",d=Ya(u),f=ue.forwardRef((E,S)=>{const{scope:M,children:N}=E,C=i(u,M),R=Rt(S,C.collectionRef);return y.jsx(d,{ref:R,children:N})});f.displayName=u;const g=t+"CollectionItemSlot",m="data-radix-collection-item",p=Ya(g),x=ue.forwardRef((E,S)=>{const{scope:M,children:N,...C}=E,R=ue.useRef(null),D=Rt(S,R),T=i(g,M);return ue.useEffect(()=>(T.itemMap.set(R,{ref:R,...C}),()=>{T.itemMap.delete(R)})),y.jsx(p,{[m]:"",ref:D,children:N})});x.displayName=g;function w(E){const S=i(t+"CollectionConsumer",E);return ue.useCallback(()=>{const N=S.collectionRef.current;if(!N)return[];const C=Array.from(N.querySelectorAll(`[${m}]`));return Array.from(S.itemMap.values()).sort((T,k)=>C.indexOf(T.ref.current)-C.indexOf(k.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:l,Slot:f,ItemSlot:x},w,o]}function ze(t,e,{checkForDefaultPrevented:n=!0}={}){return function(a){if(t?.(a),n===!1||!a.defaultPrevented)return e?.(a)}}var Kn=globalThis?.document?v.useLayoutEffect:()=>{},E4=yC[" useInsertionEffect ".trim().toString()]||Kn;function Ga({prop:t,defaultProp:e,onChange:n=()=>{},caller:o}){const[a,i,l]=_4({defaultProp:e,onChange:n}),u=t!==void 0,d=u?t:a;{const g=v.useRef(t!==void 0);v.useEffect(()=>{const m=g.current;m!==u&&console.warn(`${o} is changing from ${m?"controlled":"uncontrolled"} to ${u?"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.`),g.current=u},[u,o])}const f=v.useCallback(g=>{if(u){const m=M4(g)?g(t):g;m!==t&&l.current?.(m)}else i(g)},[u,t,i,l]);return[d,f]}function _4({defaultProp:t,onChange:e}){const[n,o]=v.useState(t),a=v.useRef(n),i=v.useRef(e);return E4(()=>{i.current=e},[e]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}function M4(t){return typeof t=="function"}function N4(t,e){return v.useReducer((n,o)=>e[n][o]??n,t)}var Do=t=>{const{present:e,children:n}=t,o=R4(e),a=typeof n=="function"?n({present:o.isPresent}):v.Children.only(n),i=Rt(o.ref,D4(a));return typeof n=="function"||o.isPresent?v.cloneElement(a,{ref:i}):null};Do.displayName="Presence";function R4(t){const[e,n]=v.useState(),o=v.useRef(null),a=v.useRef(t),i=v.useRef("none"),l=t?"mounted":"unmounted",[u,d]=N4(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Sd(o.current);i.current=u==="mounted"?f:"none"},[u]),Kn(()=>{const f=o.current,g=a.current;if(g!==t){const p=i.current,x=Sd(f);t?d("MOUNT"):x==="none"||f?.display==="none"?d("UNMOUNT"):d(g&&p!==x?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,d]),Kn(()=>{if(e){let f;const g=e.ownerDocument.defaultView??window,m=x=>{const E=Sd(o.current).includes(CSS.escape(x.animationName));if(x.target===e&&E&&(d("ANIMATION_END"),!a.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",f=g.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},p=x=>{x.target===e&&(i.current=Sd(o.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{g.clearTimeout(f),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(f=>{o.current=f?getComputedStyle(f):null,n(f)},[])}}function Sd(t){return t?.animationName||"none"}function D4(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var T4=yC[" useId ".trim().toString()]||(()=>{}),k4=0;function Vn(t){const[e,n]=v.useState(T4());return Kn(()=>{n(o=>o??String(k4++))},[t]),t||(e?`radix-${e}`:"")}var O4=v.createContext(void 0);function _f(t){const e=v.useContext(O4);return t||e||"ltr"}function wr(t){const e=v.useRef(t);return v.useEffect(()=>{e.current=t}),v.useMemo(()=>(...n)=>e.current?.(...n),[])}function A4(t,e=globalThis?.document){const n=wr(t);v.useEffect(()=>{const o=a=>{a.key==="Escape"&&n(a)};return e.addEventListener("keydown",o,{capture:!0}),()=>e.removeEventListener("keydown",o,{capture:!0})},[n,e])}var j4="DismissableLayer",Ep="dismissableLayer.update",z4="dismissableLayer.pointerDownOutside",I4="dismissableLayer.focusOutside",Vb,UC=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),al=v.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...d}=t,f=v.useContext(UC),[g,m]=v.useState(null),p=g?.ownerDocument??globalThis?.document,[,x]=v.useState({}),w=Rt(e,k=>m(k)),E=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),M=E.indexOf(S),N=g?E.indexOf(g):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,R=N>=M,D=$4(k=>{const j=k.target,$=[...f.branches].some(K=>K.contains(j));!R||$||(a?.(k),l?.(k),k.defaultPrevented||u?.())},p),T=H4(k=>{const j=k.target;[...f.branches].some(K=>K.contains(j))||(i?.(k),l?.(k),k.defaultPrevented||u?.())},p);return A4(k=>{N===f.layers.size-1&&(o?.(k),!k.defaultPrevented&&u&&(k.preventDefault(),u()))},p),v.useEffect(()=>{if(g)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Vb=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(g)),f.layers.add(g),Ub(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Vb)}},[g,p,n,f]),v.useEffect(()=>()=>{g&&(f.layers.delete(g),f.layersWithOutsidePointerEventsDisabled.delete(g),Ub())},[g,f]),v.useEffect(()=>{const k=()=>x({});return document.addEventListener(Ep,k),()=>document.removeEventListener(Ep,k)},[]),y.jsx(et.div,{...d,ref:w,style:{pointerEvents:C?R?"auto":"none":void 0,...t.style},onFocusCapture:ze(t.onFocusCapture,T.onFocusCapture),onBlurCapture:ze(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ze(t.onPointerDownCapture,D.onPointerDownCapture)})});al.displayName=j4;var P4="DismissableLayerBranch",L4=v.forwardRef((t,e)=>{const n=v.useContext(UC),o=v.useRef(null),a=Rt(e,o);return v.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),y.jsx(et.div,{...t,ref:a})});L4.displayName=P4;function $4(t,e=globalThis?.document){const n=wr(t),o=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let d=function(){YC(z4,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=d,e.addEventListener("click",a.current,{once:!0})):d()}else e.removeEventListener("click",a.current);o.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",i),e.removeEventListener("click",a.current)}},[e,n]),{onPointerDownCapture:()=>o.current=!0}}function H4(t,e=globalThis?.document){const n=wr(t),o=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!o.current&&YC(I4,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ub(){const t=new CustomEvent(Ep);document.dispatchEvent(t)}function YC(t,e,n,{discrete:o}){const a=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&a.addEventListener(t,e,{once:!0}),o?BC(a,i):a.dispatchEvent(i)}var Og="focusScope.autoFocusOnMount",Ag="focusScope.autoFocusOnUnmount",Yb={bubbles:!1,cancelable:!0},B4="FocusScope",Vc=v.forwardRef((t,e)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[u,d]=v.useState(null),f=wr(a),g=wr(i),m=v.useRef(null),p=Rt(e,E=>d(E)),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(o){let E=function(C){if(x.paused||!u)return;const R=C.target;u.contains(R)?m.current=R:Ha(m.current,{select:!0})},S=function(C){if(x.paused||!u)return;const R=C.relatedTarget;R!==null&&(u.contains(R)||Ha(m.current,{select:!0}))},M=function(C){if(document.activeElement===document.body)for(const D of C)D.removedNodes.length>0&&Ha(u)};document.addEventListener("focusin",E),document.addEventListener("focusout",S);const N=new MutationObserver(M);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",S),N.disconnect()}}},[o,u,x.paused]),v.useEffect(()=>{if(u){qb.add(x);const E=document.activeElement;if(!u.contains(E)){const M=new CustomEvent(Og,Yb);u.addEventListener(Og,f),u.dispatchEvent(M),M.defaultPrevented||(F4(q4(GC(u)),{select:!0}),document.activeElement===E&&Ha(u))}return()=>{u.removeEventListener(Og,f),setTimeout(()=>{const M=new CustomEvent(Ag,Yb);u.addEventListener(Ag,g),u.dispatchEvent(M),M.defaultPrevented||Ha(E??document.body,{select:!0}),u.removeEventListener(Ag,g),qb.remove(x)},0)}}},[u,f,g,x]);const w=v.useCallback(E=>{if(!n&&!o||x.paused)return;const S=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,M=document.activeElement;if(S&&M){const N=E.currentTarget,[C,R]=V4(N);C&&R?!E.shiftKey&&M===R?(E.preventDefault(),n&&Ha(C,{select:!0})):E.shiftKey&&M===C&&(E.preventDefault(),n&&Ha(R,{select:!0})):M===N&&E.preventDefault()}},[n,o,x.paused]);return y.jsx(et.div,{tabIndex:-1,...l,ref:p,onKeyDown:w})});Vc.displayName=B4;function F4(t,{select:e=!1}={}){const n=document.activeElement;for(const o of t)if(Ha(o,{select:e}),document.activeElement!==n)return}function V4(t){const e=GC(t),n=Gb(e,t),o=Gb(e.reverse(),t);return[n,o]}function GC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Gb(t,e){for(const n of t)if(!U4(n,{upTo:e}))return n}function U4(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Y4(t){return t instanceof HTMLInputElement&&"select"in t}function Ha(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Y4(t)&&e&&t.select()}}var qb=G4();function G4(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=Wb(t,e),t.unshift(e)},remove(e){t=Wb(t,e),t[0]?.resume()}}}function Wb(t,e){const n=[...t],o=n.indexOf(e);return o!==-1&&n.splice(o,1),n}function q4(t){return t.filter(e=>e.tagName!=="A")}var W4="Portal",sl=v.forwardRef((t,e)=>{const{container:n,...o}=t,[a,i]=v.useState(!1);Kn(()=>i(!0),[]);const l=n||a&&globalThis?.document?.body;return l?PC.createPortal(y.jsx(et.div,{...o,ref:e}),l):null});sl.displayName=W4;var jg=0;function Mf(){v.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Kb()),document.body.insertAdjacentElement("beforeend",t[1]??Kb()),jg++,()=>{jg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),jg--}},[])}function Kb(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var pr=function(){return pr=Object.assign||function(e){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},pr.apply(this,arguments)};function qC(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function K4(t,e,n){if(n||arguments.length===2)for(var o=0,a=e.length,i;o<a;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}var Ud="right-scroll-bar-position",Yd="width-before-scroll-bar",X4="with-scroll-bars-hidden",Z4="--removed-body-scroll-bar-size";function zg(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Q4(t,e){var n=v.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(o){var a=n.value;a!==o&&(n.value=o,n.callback(o,a))}}}})[0];return n.callback=e,n.facade}var J4=typeof window<"u"?v.useLayoutEffect:v.useEffect,Xb=new WeakMap;function e5(t,e){var n=Q4(null,function(o){return t.forEach(function(a){return zg(a,o)})});return J4(function(){var o=Xb.get(n);if(o){var a=new Set(o),i=new Set(t),l=n.current;a.forEach(function(u){i.has(u)||zg(u,null)}),i.forEach(function(u){a.has(u)||zg(u,l)})}Xb.set(n,t)},[t]),n}function t5(t){return t}function n5(t,e){e===void 0&&(e=t5);var n=[],o=!1,a={read:function(){if(o)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]:t},useMedium:function(i){var l=e(i,o);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(o=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){o=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var d=function(){var g=l;l=[],g.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(g){l.push(g),f()},filter:function(g){return l=l.filter(g),n}}}};return a}function o5(t){t===void 0&&(t={});var e=n5(null);return e.options=pr({async:!0,ssr:!1},t),e}var WC=function(t){var e=t.sideCar,n=qC(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=e.read();if(!o)throw new Error("Sidecar medium not found");return v.createElement(o,pr({},n))};WC.isSideCarExport=!0;function r5(t,e){return t.useMedium(e),WC}var KC=o5(),Ig=function(){},Nf=v.forwardRef(function(t,e){var n=v.useRef(null),o=v.useState({onScrollCapture:Ig,onWheelCapture:Ig,onTouchMoveCapture:Ig}),a=o[0],i=o[1],l=t.forwardProps,u=t.children,d=t.className,f=t.removeScrollBar,g=t.enabled,m=t.shards,p=t.sideCar,x=t.noRelative,w=t.noIsolation,E=t.inert,S=t.allowPinchZoom,M=t.as,N=M===void 0?"div":M,C=t.gapMode,R=qC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=p,T=e5([n,e]),k=pr(pr({},R),a);return v.createElement(v.Fragment,null,g&&v.createElement(D,{sideCar:KC,removeScrollBar:f,shards:m,noRelative:x,noIsolation:w,inert:E,setCallbacks:i,allowPinchZoom:!!S,lockRef:n,gapMode:C}),l?v.cloneElement(v.Children.only(u),pr(pr({},k),{ref:T})):v.createElement(N,pr({},k,{className:d,ref:T}),u))});Nf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nf.classNames={fullWidth:Yd,zeroRight:Ud};var a5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function s5(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=a5();return e&&t.setAttribute("nonce",e),t}function i5(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function l5(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var c5=function(){var t=0,e=null;return{add:function(n){t==0&&(e=s5())&&(i5(e,n),l5(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},u5=function(){var t=c5();return function(e,n){v.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},XC=function(){var t=u5(),e=function(n){var o=n.styles,a=n.dynamic;return t(o,a),null};return e},d5={left:0,top:0,right:0,gap:0},Pg=function(t){return parseInt(t||"",10)||0},f5=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],o=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[Pg(n),Pg(o),Pg(a)]},h5=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return d5;var e=f5(t),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,o-n+e[2]-e[0])}},m5=XC(),Pi="data-scroll-locked",g5=function(t,e,n,o){var a=t.left,i=t.top,l=t.right,u=t.gap;return n===void 0&&(n="margin"),`
|
|
12
|
+
.`.concat(X4,` {
|
|
13
|
+
overflow: hidden `).concat(o,`;
|
|
14
|
+
padding-right: `).concat(u,"px ").concat(o,`;
|
|
15
|
+
}
|
|
16
|
+
body[`).concat(Pi,`] {
|
|
17
|
+
overflow: hidden `).concat(o,`;
|
|
18
|
+
overscroll-behavior: contain;
|
|
19
|
+
`).concat([e&&"position: relative ".concat(o,";"),n==="margin"&&`
|
|
20
|
+
padding-left: `.concat(a,`px;
|
|
21
|
+
padding-top: `).concat(i,`px;
|
|
22
|
+
padding-right: `).concat(l,`px;
|
|
23
|
+
margin-left:0;
|
|
24
|
+
margin-top:0;
|
|
25
|
+
margin-right: `).concat(u,"px ").concat(o,`;
|
|
26
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.`).concat(Ud,` {
|
|
30
|
+
right: `).concat(u,"px ").concat(o,`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.`).concat(Yd,` {
|
|
34
|
+
margin-right: `).concat(u,"px ").concat(o,`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.`).concat(Ud," .").concat(Ud,` {
|
|
38
|
+
right: 0 `).concat(o,`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.`).concat(Yd," .").concat(Yd,` {
|
|
42
|
+
margin-right: 0 `).concat(o,`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
body[`).concat(Pi,`] {
|
|
46
|
+
`).concat(Z4,": ").concat(u,`px;
|
|
47
|
+
}
|
|
48
|
+
`)},Zb=function(){var t=parseInt(document.body.getAttribute(Pi)||"0",10);return isFinite(t)?t:0},p5=function(){v.useEffect(function(){return document.body.setAttribute(Pi,(Zb()+1).toString()),function(){var t=Zb()-1;t<=0?document.body.removeAttribute(Pi):document.body.setAttribute(Pi,t.toString())}},[])},y5=function(t){var e=t.noRelative,n=t.noImportant,o=t.gapMode,a=o===void 0?"margin":o;p5();var i=v.useMemo(function(){return h5(a)},[a]);return v.createElement(m5,{styles:g5(i,!e,a,n?"":"!important")})},_p=!1;if(typeof window<"u")try{var Cd=Object.defineProperty({},"passive",{get:function(){return _p=!0,!0}});window.addEventListener("test",Cd,Cd),window.removeEventListener("test",Cd,Cd)}catch{_p=!1}var Si=_p?{passive:!1}:!1,v5=function(t){return t.tagName==="TEXTAREA"},ZC=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!v5(t)&&n[e]==="visible")},x5=function(t){return ZC(t,"overflowY")},b5=function(t){return ZC(t,"overflowX")},Qb=function(t,e){var n=e.ownerDocument,o=e;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=QC(t,o);if(a){var i=JC(t,o),l=i[1],u=i[2];if(l>u)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},w5=function(t){var e=t.scrollTop,n=t.scrollHeight,o=t.clientHeight;return[e,n,o]},S5=function(t){var e=t.scrollLeft,n=t.scrollWidth,o=t.clientWidth;return[e,n,o]},QC=function(t,e){return t==="v"?x5(e):b5(e)},JC=function(t,e){return t==="v"?w5(e):S5(e)},C5=function(t,e){return t==="h"&&e==="rtl"?-1:1},E5=function(t,e,n,o,a){var i=C5(t,window.getComputedStyle(e).direction),l=i*o,u=n.target,d=e.contains(u),f=!1,g=l>0,m=0,p=0;do{if(!u)break;var x=JC(t,u),w=x[0],E=x[1],S=x[2],M=E-S-i*w;(w||M)&&QC(t,u)&&(m+=M,p+=w);var N=u.parentNode;u=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&u!==document.body||d&&(e.contains(u)||e===u));return(g&&Math.abs(m)<1||!g&&Math.abs(p)<1)&&(f=!0),f},Ed=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Jb=function(t){return[t.deltaX,t.deltaY]},ew=function(t){return t&&"current"in t?t.current:t},_5=function(t,e){return t[0]===e[0]&&t[1]===e[1]},M5=function(t){return`
|
|
49
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
50
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
51
|
+
`)},N5=0,Ci=[];function R5(t){var e=v.useRef([]),n=v.useRef([0,0]),o=v.useRef(),a=v.useState(N5++)[0],i=v.useState(XC)[0],l=v.useRef(t);v.useEffect(function(){l.current=t},[t]),v.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var E=K4([t.lockRef.current],(t.shards||[]).map(ew),!0).filter(Boolean);return E.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),E.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var u=v.useCallback(function(E,S){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!l.current.allowPinchZoom;var M=Ed(E),N=n.current,C="deltaX"in E?E.deltaX:N[0]-M[0],R="deltaY"in E?E.deltaY:N[1]-M[1],D,T=E.target,k=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in E&&k==="h"&&T.type==="range")return!1;var j=window.getSelection(),$=j&&j.anchorNode,K=$?$===T||$.contains(T):!1;if(K)return!1;var U=Qb(k,T);if(!U)return!0;if(U?D=k:(D=k==="v"?"h":"v",U=Qb(k,T)),!U)return!1;if(!o.current&&"changedTouches"in E&&(C||R)&&(o.current=D),!D)return!0;var Y=o.current||D;return E5(Y,S,E,Y==="h"?C:R)},[]),d=v.useCallback(function(E){var S=E;if(!(!Ci.length||Ci[Ci.length-1]!==i)){var M="deltaY"in S?Jb(S):Ed(S),N=e.current.filter(function(D){return D.name===S.type&&(D.target===S.target||S.target===D.shadowParent)&&_5(D.delta,M)})[0];if(N&&N.should){S.cancelable&&S.preventDefault();return}if(!N){var C=(l.current.shards||[]).map(ew).filter(Boolean).filter(function(D){return D.contains(S.target)}),R=C.length>0?u(S,C[0]):!l.current.noIsolation;R&&S.cancelable&&S.preventDefault()}}},[]),f=v.useCallback(function(E,S,M,N){var C={name:E,delta:S,target:M,should:N,shadowParent:D5(M)};e.current.push(C),setTimeout(function(){e.current=e.current.filter(function(R){return R!==C})},1)},[]),g=v.useCallback(function(E){n.current=Ed(E),o.current=void 0},[]),m=v.useCallback(function(E){f(E.type,Jb(E),E.target,u(E,t.lockRef.current))},[]),p=v.useCallback(function(E){f(E.type,Ed(E),E.target,u(E,t.lockRef.current))},[]);v.useEffect(function(){return Ci.push(i),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",d,Si),document.addEventListener("touchmove",d,Si),document.addEventListener("touchstart",g,Si),function(){Ci=Ci.filter(function(E){return E!==i}),document.removeEventListener("wheel",d,Si),document.removeEventListener("touchmove",d,Si),document.removeEventListener("touchstart",g,Si)}},[]);var x=t.removeScrollBar,w=t.inert;return v.createElement(v.Fragment,null,w?v.createElement(i,{styles:M5(a)}):null,x?v.createElement(y5,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function D5(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const T5=r5(KC,R5);var Uc=v.forwardRef(function(t,e){return v.createElement(Nf,pr({},t,{ref:e,sideCar:T5}))});Uc.classNames=Nf.classNames;var k5=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ei=new WeakMap,_d=new WeakMap,Md={},Lg=0,e2=function(t){return t&&(t.host||e2(t.parentNode))},O5=function(t,e){return e.map(function(n){if(t.contains(n))return n;var o=e2(n);return o&&t.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},A5=function(t,e,n,o){var a=O5(e,Array.isArray(t)?t:[t]);Md[n]||(Md[n]=new WeakMap);var i=Md[n],l=[],u=new Set,d=new Set(a),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};a.forEach(f);var g=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(p){if(u.has(p))g(p);else try{var x=p.getAttribute(o),w=x!==null&&x!=="false",E=(Ei.get(p)||0)+1,S=(i.get(p)||0)+1;Ei.set(p,E),i.set(p,S),l.push(p),E===1&&w&&_d.set(p,!0),S===1&&p.setAttribute(n,"true"),w||p.setAttribute(o,"true")}catch(M){console.error("aria-hidden: cannot operate on ",p,M)}})};return g(e),u.clear(),Lg++,function(){l.forEach(function(m){var p=Ei.get(m)-1,x=i.get(m)-1;Ei.set(m,p),i.set(m,x),p||(_d.has(m)||m.removeAttribute(o),_d.delete(m)),x||m.removeAttribute(n)}),Lg--,Lg||(Ei=new WeakMap,Ei=new WeakMap,_d=new WeakMap,Md={})}},Rf=function(t,e,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(t)?t:[t]),a=k5(t);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),A5(o,a,n,"aria-hidden")):function(){return null}},Df="Dialog",[t2]=_r(Df),[j5,sr]=t2(Df),n2=t=>{const{__scopeDialog:e,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=t,u=v.useRef(null),d=v.useRef(null),[f,g]=Ga({prop:o,defaultProp:a??!1,onChange:i,caller:Df});return y.jsx(j5,{scope:e,triggerRef:u,contentRef:d,contentId:Vn(),titleId:Vn(),descriptionId:Vn(),open:f,onOpenChange:g,onOpenToggle:v.useCallback(()=>g(m=>!m),[g]),modal:l,children:n})};n2.displayName=Df;var o2="DialogTrigger",r2=v.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=sr(o2,n),i=Rt(e,a.triggerRef);return y.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":S0(a.open),...o,ref:i,onClick:ze(t.onClick,a.onOpenToggle)})});r2.displayName=o2;var b0="DialogPortal",[z5,a2]=t2(b0,{forceMount:void 0}),s2=t=>{const{__scopeDialog:e,forceMount:n,children:o,container:a}=t,i=sr(b0,e);return y.jsx(z5,{scope:e,forceMount:n,children:v.Children.map(o,l=>y.jsx(Do,{present:n||i.open,children:y.jsx(sl,{asChild:!0,container:a,children:l})}))})};s2.displayName=b0;var Jd="DialogOverlay",i2=v.forwardRef((t,e)=>{const n=a2(Jd,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=sr(Jd,t.__scopeDialog);return i.modal?y.jsx(Do,{present:o||i.open,children:y.jsx(P5,{...a,ref:e})}):null});i2.displayName=Jd;var I5=Ya("DialogOverlay.RemoveScroll"),P5=v.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=sr(Jd,n);return y.jsx(Uc,{as:I5,allowPinchZoom:!0,shards:[a.contentRef],children:y.jsx(et.div,{"data-state":S0(a.open),...o,ref:e,style:{pointerEvents:"auto",...o.style}})})}),Rs="DialogContent",l2=v.forwardRef((t,e)=>{const n=a2(Rs,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=sr(Rs,t.__scopeDialog);return y.jsx(Do,{present:o||i.open,children:i.modal?y.jsx(L5,{...a,ref:e}):y.jsx($5,{...a,ref:e})})});l2.displayName=Rs;var L5=v.forwardRef((t,e)=>{const n=sr(Rs,t.__scopeDialog),o=v.useRef(null),a=Rt(e,n.contentRef,o);return v.useEffect(()=>{const i=o.current;if(i)return Rf(i)},[]),y.jsx(c2,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ze(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ze(t.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:ze(t.onFocusOutside,i=>i.preventDefault())})}),$5=v.forwardRef((t,e)=>{const n=sr(Rs,t.__scopeDialog),o=v.useRef(!1),a=v.useRef(!1);return y.jsx(c2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),c2=v.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=t,u=sr(Rs,n),d=v.useRef(null),f=Rt(e,d);return Mf(),y.jsxs(y.Fragment,{children:[y.jsx(Vc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:y.jsx(al,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":S0(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(H5,{titleId:u.titleId}),y.jsx(F5,{contentRef:d,descriptionId:u.descriptionId})]})]})}),w0="DialogTitle",u2=v.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=sr(w0,n);return y.jsx(et.h2,{id:a.titleId,...o,ref:e})});u2.displayName=w0;var d2="DialogDescription",f2=v.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=sr(d2,n);return y.jsx(et.p,{id:a.descriptionId,...o,ref:e})});f2.displayName=d2;var h2="DialogClose",m2=v.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=sr(h2,n);return y.jsx(et.button,{type:"button",...o,ref:e,onClick:ze(t.onClick,()=>a.onOpenChange(!1))})});m2.displayName=h2;function S0(t){return t?"open":"closed"}var g2="DialogTitleWarning",[GW,p2]=S4(g2,{contentName:Rs,titleName:w0,docsSlug:"dialog"}),H5=({titleId:t})=>{const e=p2(g2),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
52
|
+
|
|
53
|
+
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
54
|
+
|
|
55
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return v.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},B5="DialogDescriptionWarning",F5=({contentRef:t,descriptionId:e})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${p2(B5).contentName}}.`;return v.useEffect(()=>{const a=t.current?.getAttribute("aria-describedby");e&&a&&(document.getElementById(e)||console.warn(o))},[o,t,e]),null},C0=n2,V5=r2,E0=s2,_0=i2,M0=l2,y2=u2,v2=f2,N0=m2,$g={exports:{}},Hg={};var tw;function U5(){if(tw)return Hg;tw=1;var t=el();function e(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var n=typeof Object.is=="function"?Object.is:e,o=t.useState,a=t.useEffect,i=t.useLayoutEffect,l=t.useDebugValue;function u(m,p){var x=p(),w=o({inst:{value:x,getSnapshot:p}}),E=w[0].inst,S=w[1];return i(function(){E.value=x,E.getSnapshot=p,d(E)&&S({inst:E})},[m,x,p]),a(function(){return d(E)&&S({inst:E}),m(function(){d(E)&&S({inst:E})})},[m]),l(x),x}function d(m){var p=m.getSnapshot;m=m.value;try{var x=p();return!n(m,x)}catch{return!0}}function f(m,p){return p()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Hg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,Hg}var nw;function Y5(){return nw||(nw=1,$g.exports=U5()),$g.exports}function x2(t){const e=v.useRef({value:t,previous:t});return v.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function b2(t){const[e,n]=v.useState(void 0);return Kn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=t.offsetWidth,u=t.offsetHeight;n({width:l,height:u})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}var Tf="Checkbox",[G5]=_r(Tf),[q5,R0]=G5(Tf);function W5(t){const{__scopeCheckbox:e,checked:n,children:o,defaultChecked:a,disabled:i,form:l,name:u,onCheckedChange:d,required:f,value:g="on",internal_do_not_use_render:m}=t,[p,x]=Ga({prop:n,defaultProp:a??!1,onChange:d,caller:Tf}),[w,E]=v.useState(null),[S,M]=v.useState(null),N=v.useRef(!1),C=w?!!l||!!w.closest("form"):!0,R={checked:p,disabled:i,setChecked:x,control:w,setControl:E,name:u,form:l,value:g,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:Va(a)?!1:a,isFormControl:C,bubbleInput:S,setBubbleInput:M};return y.jsx(q5,{scope:e,...R,children:K5(m)?m(R):o})}var w2="CheckboxTrigger",S2=v.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...o},a)=>{const{control:i,value:l,disabled:u,checked:d,required:f,setControl:g,setChecked:m,hasConsumerStoppedPropagationRef:p,isFormControl:x,bubbleInput:w}=R0(w2,t),E=Rt(a,g),S=v.useRef(d);return v.useEffect(()=>{const M=i?.form;if(M){const N=()=>m(S.current);return M.addEventListener("reset",N),()=>M.removeEventListener("reset",N)}},[i,m]),y.jsx(et.button,{type:"button",role:"checkbox","aria-checked":Va(d)?"mixed":d,"aria-required":f,"data-state":R2(d),"data-disabled":u?"":void 0,disabled:u,value:l,...o,ref:E,onKeyDown:ze(e,M=>{M.key==="Enter"&&M.preventDefault()}),onClick:ze(n,M=>{m(N=>Va(N)?!0:!N),w&&x&&(p.current=M.isPropagationStopped(),p.current||M.stopPropagation())})})});S2.displayName=w2;var C2=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:o,checked:a,defaultChecked:i,required:l,disabled:u,value:d,onCheckedChange:f,form:g,...m}=t;return y.jsx(W5,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:u,required:l,onCheckedChange:f,name:o,form:g,value:d,internal_do_not_use_render:({isFormControl:p})=>y.jsxs(y.Fragment,{children:[y.jsx(S2,{...m,ref:e,__scopeCheckbox:n}),p&&y.jsx(N2,{__scopeCheckbox:n})]})})});C2.displayName=Tf;var E2="CheckboxIndicator",_2=v.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:o,...a}=t,i=R0(E2,n);return y.jsx(Do,{present:o||Va(i.checked)||i.checked===!0,children:y.jsx(et.span,{"data-state":R2(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:e,style:{pointerEvents:"none",...t.style}})})});_2.displayName=E2;var M2="CheckboxBubbleInput",N2=v.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:o,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:l,required:u,disabled:d,name:f,value:g,form:m,bubbleInput:p,setBubbleInput:x}=R0(M2,t),w=Rt(n,x),E=x2(i),S=b2(o);v.useEffect(()=>{const N=p;if(!N)return;const C=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(C,"checked").set,T=!a.current;if(E!==i&&D){const k=new Event("click",{bubbles:T});N.indeterminate=Va(i),D.call(N,Va(i)?!1:i),N.dispatchEvent(k)}},[p,E,i,a]);const M=v.useRef(Va(i)?!1:i);return y.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??M.current,required:u,disabled:d,name:f,value:g,form:m,...e,tabIndex:-1,ref:w,style:{...e.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});N2.displayName=M2;function K5(t){return typeof t=="function"}function Va(t){return t==="indeterminate"}function R2(t){return Va(t)?"indeterminate":t?"checked":"unchecked"}const X5=["top","right","bottom","left"],qa=Math.min,So=Math.max,ef=Math.round,Nd=Math.floor,xr=t=>({x:t,y:t}),Z5={left:"right",right:"left",bottom:"top",top:"bottom"},Q5={start:"end",end:"start"};function Mp(t,e,n){return So(t,qa(e,n))}function sa(t,e){return typeof t=="function"?t(e):t}function ia(t){return t.split("-")[0]}function il(t){return t.split("-")[1]}function D0(t){return t==="x"?"y":"x"}function T0(t){return t==="y"?"height":"width"}const J5=new Set(["top","bottom"]);function yr(t){return J5.has(ia(t))?"y":"x"}function k0(t){return D0(yr(t))}function eO(t,e,n){n===void 0&&(n=!1);const o=il(t),a=k0(t),i=T0(a);let l=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=tf(l)),[l,tf(l)]}function tO(t){const e=tf(t);return[Np(t),e,Np(e)]}function Np(t){return t.replace(/start|end/g,e=>Q5[e])}const ow=["left","right"],rw=["right","left"],nO=["top","bottom"],oO=["bottom","top"];function rO(t,e,n){switch(t){case"top":case"bottom":return n?e?rw:ow:e?ow:rw;case"left":case"right":return e?nO:oO;default:return[]}}function aO(t,e,n,o){const a=il(t);let i=rO(ia(t),n==="start",o);return a&&(i=i.map(l=>l+"-"+a),e&&(i=i.concat(i.map(Np)))),i}function tf(t){return t.replace(/left|right|bottom|top/g,e=>Z5[e])}function sO(t){return{top:0,right:0,bottom:0,left:0,...t}}function D2(t){return typeof t!="number"?sO(t):{top:t,right:t,bottom:t,left:t}}function nf(t){const{x:e,y:n,width:o,height:a}=t;return{width:o,height:a,top:n,left:e,right:e+o,bottom:n+a,x:e,y:n}}function aw(t,e,n){let{reference:o,floating:a}=t;const i=yr(e),l=k0(e),u=T0(l),d=ia(e),f=i==="y",g=o.x+o.width/2-a.width/2,m=o.y+o.height/2-a.height/2,p=o[u]/2-a[u]/2;let x;switch(d){case"top":x={x:g,y:o.y-a.height};break;case"bottom":x={x:g,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:m};break;case"left":x={x:o.x-a.width,y:m};break;default:x={x:o.x,y:o.y}}switch(il(e)){case"start":x[l]-=p*(n&&f?-1:1);break;case"end":x[l]+=p*(n&&f?-1:1);break}return x}const iO=async(t,e,n)=>{const{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:a}),{x:g,y:m}=aw(f,o,d),p=o,x={},w=0;for(let E=0;E<u.length;E++){const{name:S,fn:M}=u[E],{x:N,y:C,data:R,reset:D}=await M({x:g,y:m,initialPlacement:o,placement:p,strategy:a,middlewareData:x,rects:f,platform:l,elements:{reference:t,floating:e}});g=N??g,m=C??m,x={...x,[S]:{...x[S],...R}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(f=D.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:a}):D.rects),{x:g,y:m}=aw(f,p,d)),E=-1)}return{x:g,y:m,placement:p,strategy:a,middlewareData:x}};async function Ec(t,e){var n;e===void 0&&(e={});const{x:o,y:a,platform:i,rects:l,elements:u,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:p=!1,padding:x=0}=sa(e,t),w=D2(x),S=u[p?m==="floating"?"reference":"floating":m],M=nf(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(u.floating)),boundary:f,rootBoundary:g,strategy:d})),N=m==="floating"?{x:o,y:a,width:l.floating.width,height:l.floating.height}:l.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),R=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},D=nf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:N,offsetParent:C,strategy:d}):N);return{top:(M.top-D.top+w.top)/R.y,bottom:(D.bottom-M.bottom+w.bottom)/R.y,left:(M.left-D.left+w.left)/R.x,right:(D.right-M.right+w.right)/R.x}}const lO=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:a,rects:i,platform:l,elements:u,middlewareData:d}=e,{element:f,padding:g=0}=sa(t,e)||{};if(f==null)return{};const m=D2(g),p={x:n,y:o},x=k0(a),w=T0(x),E=await l.getDimensions(f),S=x==="y",M=S?"top":"left",N=S?"bottom":"right",C=S?"clientHeight":"clientWidth",R=i.reference[w]+i.reference[x]-p[x]-i.floating[w],D=p[x]-i.reference[x],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let k=T?T[C]:0;(!k||!await(l.isElement==null?void 0:l.isElement(T)))&&(k=u.floating[C]||i.floating[w]);const j=R/2-D/2,$=k/2-E[w]/2-1,K=qa(m[M],$),U=qa(m[N],$),Y=K,Z=k-E[w]-U,P=k/2-E[w]/2+j,q=Mp(Y,P,Z),A=!d.arrow&&il(a)!=null&&P!==q&&i.reference[w]/2-(P<Y?K:U)-E[w]/2<0,B=A?P<Y?P-Y:P-Z:0;return{[x]:p[x]+B,data:{[x]:q,centerOffset:P-q-B,...A&&{alignmentOffset:B}},reset:A}}}),cO=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:a,middlewareData:i,rects:l,initialPlacement:u,platform:d,elements:f}=e,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:E=!0,...S}=sa(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const M=ia(a),N=yr(u),C=ia(u)===u,R=await(d.isRTL==null?void 0:d.isRTL(f.floating)),D=p||(C||!E?[tf(u)]:tO(u)),T=w!=="none";!p&&T&&D.push(...aO(u,E,w,R));const k=[u,...D],j=await Ec(e,S),$=[];let K=((o=i.flip)==null?void 0:o.overflows)||[];if(g&&$.push(j[M]),m){const P=eO(a,l,R);$.push(j[P[0]],j[P[1]])}if(K=[...K,{placement:a,overflows:$}],!$.every(P=>P<=0)){var U,Y;const P=(((U=i.flip)==null?void 0:U.index)||0)+1,q=k[P];if(q&&(!(m==="alignment"?N!==yr(q):!1)||K.every(L=>yr(L.placement)===N?L.overflows[0]>0:!0)))return{data:{index:P,overflows:K},reset:{placement:q}};let A=(Y=K.filter(B=>B.overflows[0]<=0).sort((B,L)=>B.overflows[1]-L.overflows[1])[0])==null?void 0:Y.placement;if(!A)switch(x){case"bestFit":{var Z;const B=(Z=K.filter(L=>{if(T){const F=yr(L.placement);return F===N||F==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(F=>F>0).reduce((F,X)=>F+X,0)]).sort((L,F)=>L[1]-F[1])[0])==null?void 0:Z[0];B&&(A=B);break}case"initialPlacement":A=u;break}if(a!==A)return{reset:{placement:A}}}return{}}}};function sw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function iw(t){return X5.some(e=>t[e]>=0)}const uO=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...a}=sa(t,e);switch(o){case"referenceHidden":{const i=await Ec(e,{...a,elementContext:"reference"}),l=sw(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:iw(l)}}}case"escaped":{const i=await Ec(e,{...a,altBoundary:!0}),l=sw(i,n.floating);return{data:{escapedOffsets:l,escaped:iw(l)}}}default:return{}}}}},T2=new Set(["left","top"]);async function dO(t,e){const{placement:n,platform:o,elements:a}=t,i=await(o.isRTL==null?void 0:o.isRTL(a.floating)),l=ia(n),u=il(n),d=yr(n)==="y",f=T2.has(l)?-1:1,g=i&&d?-1:1,m=sa(e,t);let{mainAxis:p,crossAxis:x,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof w=="number"&&(x=u==="end"?w*-1:w),d?{x:x*g,y:p*f}:{x:p*f,y:x*g}}const fO=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:a,y:i,placement:l,middlewareData:u}=e,d=await dO(e,t);return l===((n=u.offset)==null?void 0:n.placement)&&(o=u.arrow)!=null&&o.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:l}}}}},hO=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:a}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:M,y:N}=S;return{x:M,y:N}}},...d}=sa(t,e),f={x:n,y:o},g=await Ec(e,d),m=yr(ia(a)),p=D0(m);let x=f[p],w=f[m];if(i){const S=p==="y"?"top":"left",M=p==="y"?"bottom":"right",N=x+g[S],C=x-g[M];x=Mp(N,x,C)}if(l){const S=m==="y"?"top":"left",M=m==="y"?"bottom":"right",N=w+g[S],C=w-g[M];w=Mp(N,w,C)}const E=u.fn({...e,[p]:x,[m]:w});return{...E,data:{x:E.x-n,y:E.y-o,enabled:{[p]:i,[m]:l}}}}}},mO=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:a,rects:i,middlewareData:l}=e,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=sa(t,e),g={x:n,y:o},m=yr(a),p=D0(m);let x=g[p],w=g[m];const E=sa(u,e),S=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(d){const C=p==="y"?"height":"width",R=i.reference[p]-i.floating[C]+S.mainAxis,D=i.reference[p]+i.reference[C]-S.mainAxis;x<R?x=R:x>D&&(x=D)}if(f){var M,N;const C=p==="y"?"width":"height",R=T2.has(ia(a)),D=i.reference[m]-i.floating[C]+(R&&((M=l.offset)==null?void 0:M[m])||0)+(R?0:S.crossAxis),T=i.reference[m]+i.reference[C]+(R?0:((N=l.offset)==null?void 0:N[m])||0)-(R?S.crossAxis:0);w<D?w=D:w>T&&(w=T)}return{[p]:x,[m]:w}}}},gO=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:a,rects:i,platform:l,elements:u}=e,{apply:d=()=>{},...f}=sa(t,e),g=await Ec(e,f),m=ia(a),p=il(a),x=yr(a)==="y",{width:w,height:E}=i.floating;let S,M;m==="top"||m==="bottom"?(S=m,M=p===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(M=m,S=p==="end"?"top":"bottom");const N=E-g.top-g.bottom,C=w-g.left-g.right,R=qa(E-g[S],N),D=qa(w-g[M],C),T=!e.middlewareData.shift;let k=R,j=D;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(j=C),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(k=N),T&&!p){const K=So(g.left,0),U=So(g.right,0),Y=So(g.top,0),Z=So(g.bottom,0);x?j=w-2*(K!==0||U!==0?K+U:So(g.left,g.right)):k=E-2*(Y!==0||Z!==0?Y+Z:So(g.top,g.bottom))}await d({...e,availableWidth:j,availableHeight:k});const $=await l.getDimensions(u.floating);return w!==$.width||E!==$.height?{reset:{rects:!0}}:{}}}};function kf(){return typeof window<"u"}function ll(t){return k2(t)?(t.nodeName||"").toLowerCase():"#document"}function Eo(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Mr(t){var e;return(e=(k2(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function k2(t){return kf()?t instanceof Node||t instanceof Eo(t).Node:!1}function rr(t){return kf()?t instanceof Element||t instanceof Eo(t).Element:!1}function Sr(t){return kf()?t instanceof HTMLElement||t instanceof Eo(t).HTMLElement:!1}function lw(t){return!kf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Eo(t).ShadowRoot}const pO=new Set(["inline","contents"]);function Yc(t){const{overflow:e,overflowX:n,overflowY:o,display:a}=ar(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!pO.has(a)}const yO=new Set(["table","td","th"]);function vO(t){return yO.has(ll(t))}const xO=[":popover-open",":modal"];function Of(t){return xO.some(e=>{try{return t.matches(e)}catch{return!1}})}const bO=["transform","translate","scale","rotate","perspective"],wO=["transform","translate","scale","rotate","perspective","filter"],SO=["paint","layout","strict","content"];function O0(t){const e=A0(),n=rr(t)?ar(t):t;return bO.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||wO.some(o=>(n.willChange||"").includes(o))||SO.some(o=>(n.contain||"").includes(o))}function CO(t){let e=Wa(t);for(;Sr(e)&&!Bi(e);){if(O0(e))return e;if(Of(e))return null;e=Wa(e)}return null}function A0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const EO=new Set(["html","body","#document"]);function Bi(t){return EO.has(ll(t))}function ar(t){return Eo(t).getComputedStyle(t)}function Af(t){return rr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Wa(t){if(ll(t)==="html")return t;const e=t.assignedSlot||t.parentNode||lw(t)&&t.host||Mr(t);return lw(e)?e.host:e}function O2(t){const e=Wa(t);return Bi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Sr(e)&&Yc(e)?e:O2(e)}function _c(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=O2(t),i=a===((o=t.ownerDocument)==null?void 0:o.body),l=Eo(a);if(i){const u=Rp(l);return e.concat(l,l.visualViewport||[],Yc(a)?a:[],u&&n?_c(u):[])}return e.concat(a,_c(a,[],n))}function Rp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function A2(t){const e=ar(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const a=Sr(t),i=a?t.offsetWidth:n,l=a?t.offsetHeight:o,u=ef(n)!==i||ef(o)!==l;return u&&(n=i,o=l),{width:n,height:o,$:u}}function j0(t){return rr(t)?t:t.contextElement}function Li(t){const e=j0(t);if(!Sr(e))return xr(1);const n=e.getBoundingClientRect(),{width:o,height:a,$:i}=A2(e);let l=(i?ef(n.width):n.width)/o,u=(i?ef(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const _O=xr(0);function j2(t){const e=Eo(t);return!A0()||!e.visualViewport?_O:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function MO(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Eo(t)?!1:e}function Ds(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect(),i=j0(t);let l=xr(1);e&&(o?rr(o)&&(l=Li(o)):l=Li(t));const u=MO(i,n,o)?j2(i):xr(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,g=a.width/l.x,m=a.height/l.y;if(i){const p=Eo(i),x=o&&rr(o)?Eo(o):o;let w=p,E=Rp(w);for(;E&&o&&x!==w;){const S=Li(E),M=E.getBoundingClientRect(),N=ar(E),C=M.left+(E.clientLeft+parseFloat(N.paddingLeft))*S.x,R=M.top+(E.clientTop+parseFloat(N.paddingTop))*S.y;d*=S.x,f*=S.y,g*=S.x,m*=S.y,d+=C,f+=R,w=Eo(E),E=Rp(w)}}return nf({width:g,height:m,x:d,y:f})}function jf(t,e){const n=Af(t).scrollLeft;return e?e.left+n:Ds(Mr(t)).left+n}function z2(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-jf(t,n),a=n.top+e.scrollTop;return{x:o,y:a}}function NO(t){let{elements:e,rect:n,offsetParent:o,strategy:a}=t;const i=a==="fixed",l=Mr(o),u=e?Of(e.floating):!1;if(o===l||u&&i)return n;let d={scrollLeft:0,scrollTop:0},f=xr(1);const g=xr(0),m=Sr(o);if((m||!m&&!i)&&((ll(o)!=="body"||Yc(l))&&(d=Af(o)),Sr(o))){const x=Ds(o);f=Li(o),g.x=x.x+o.clientLeft,g.y=x.y+o.clientTop}const p=l&&!m&&!i?z2(l,d):xr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+g.x+p.x,y:n.y*f.y-d.scrollTop*f.y+g.y+p.y}}function RO(t){return Array.from(t.getClientRects())}function DO(t){const e=Mr(t),n=Af(t),o=t.ownerDocument.body,a=So(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=So(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+jf(t);const u=-n.scrollTop;return ar(o).direction==="rtl"&&(l+=So(e.clientWidth,o.clientWidth)-a),{width:a,height:i,x:l,y:u}}const cw=25;function TO(t,e){const n=Eo(t),o=Mr(t),a=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,u=0,d=0;if(a){i=a.width,l=a.height;const g=A0();(!g||g&&e==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const f=jf(o);if(f<=0){const g=o.ownerDocument,m=g.body,p=getComputedStyle(m),x=g.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(o.clientWidth-m.clientWidth-x);w<=cw&&(i-=w)}else f<=cw&&(i+=f);return{width:i,height:l,x:u,y:d}}const kO=new Set(["absolute","fixed"]);function OO(t,e){const n=Ds(t,!0,e==="fixed"),o=n.top+t.clientTop,a=n.left+t.clientLeft,i=Sr(t)?Li(t):xr(1),l=t.clientWidth*i.x,u=t.clientHeight*i.y,d=a*i.x,f=o*i.y;return{width:l,height:u,x:d,y:f}}function uw(t,e,n){let o;if(e==="viewport")o=TO(t,n);else if(e==="document")o=DO(Mr(t));else if(rr(e))o=OO(e,n);else{const a=j2(t);o={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return nf(o)}function I2(t,e){const n=Wa(t);return n===e||!rr(n)||Bi(n)?!1:ar(n).position==="fixed"||I2(n,e)}function AO(t,e){const n=e.get(t);if(n)return n;let o=_c(t,[],!1).filter(u=>rr(u)&&ll(u)!=="body"),a=null;const i=ar(t).position==="fixed";let l=i?Wa(t):t;for(;rr(l)&&!Bi(l);){const u=ar(l),d=O0(l);!d&&u.position==="fixed"&&(a=null),(i?!d&&!a:!d&&u.position==="static"&&!!a&&kO.has(a.position)||Yc(l)&&!d&&I2(t,l))?o=o.filter(g=>g!==l):a=u,l=Wa(l)}return e.set(t,o),o}function jO(t){let{element:e,boundary:n,rootBoundary:o,strategy:a}=t;const l=[...n==="clippingAncestors"?Of(e)?[]:AO(e,this._c):[].concat(n),o],u=l[0],d=l.reduce((f,g)=>{const m=uw(e,g,a);return f.top=So(m.top,f.top),f.right=qa(m.right,f.right),f.bottom=qa(m.bottom,f.bottom),f.left=So(m.left,f.left),f},uw(e,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function zO(t){const{width:e,height:n}=A2(t);return{width:e,height:n}}function IO(t,e,n){const o=Sr(e),a=Mr(e),i=n==="fixed",l=Ds(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const d=xr(0);function f(){d.x=jf(a)}if(o||!o&&!i)if((ll(e)!=="body"||Yc(a))&&(u=Af(e)),o){const x=Ds(e,!0,i,e);d.x=x.x+e.clientLeft,d.y=x.y+e.clientTop}else a&&f();i&&!o&&a&&f();const g=a&&!o&&!i?z2(a,u):xr(0),m=l.left+u.scrollLeft-d.x-g.x,p=l.top+u.scrollTop-d.y-g.y;return{x:m,y:p,width:l.width,height:l.height}}function Bg(t){return ar(t).position==="static"}function dw(t,e){if(!Sr(t)||ar(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Mr(t)===n&&(n=n.ownerDocument.body),n}function P2(t,e){const n=Eo(t);if(Of(t))return n;if(!Sr(t)){let a=Wa(t);for(;a&&!Bi(a);){if(rr(a)&&!Bg(a))return a;a=Wa(a)}return n}let o=dw(t,e);for(;o&&vO(o)&&Bg(o);)o=dw(o,e);return o&&Bi(o)&&Bg(o)&&!O0(o)?n:o||CO(t)||n}const PO=async function(t){const e=this.getOffsetParent||P2,n=this.getDimensions,o=await n(t.floating);return{reference:IO(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function LO(t){return ar(t).direction==="rtl"}const $O={convertOffsetParentRelativeRectToViewportRelativeRect:NO,getDocumentElement:Mr,getClippingRect:jO,getOffsetParent:P2,getElementRects:PO,getClientRects:RO,getDimensions:zO,getScale:Li,isElement:rr,isRTL:LO};function L2(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function HO(t,e){let n=null,o;const a=Mr(t);function i(){var u;clearTimeout(o),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=t.getBoundingClientRect(),{left:g,top:m,width:p,height:x}=f;if(u||e(),!p||!x)return;const w=Nd(m),E=Nd(a.clientWidth-(g+p)),S=Nd(a.clientHeight-(m+x)),M=Nd(g),C={rootMargin:-w+"px "+-E+"px "+-S+"px "+-M+"px",threshold:So(0,qa(1,d))||1};let R=!0;function D(T){const k=T[0].intersectionRatio;if(k!==d){if(!R)return l();k?l(!1,k):o=setTimeout(()=>{l(!1,1e-7)},1e3)}k===1&&!L2(f,t.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(D,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,C)}n.observe(t)}return l(!0),i}function BO(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,f=j0(t),g=a||i?[...f?_c(f):[],..._c(e)]:[];g.forEach(M=>{a&&M.addEventListener("scroll",n,{passive:!0}),i&&M.addEventListener("resize",n)});const m=f&&u?HO(f,n):null;let p=-1,x=null;l&&(x=new ResizeObserver(M=>{let[N]=M;N&&N.target===f&&x&&(x.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(e)})),n()}),f&&!d&&x.observe(f),x.observe(e));let w,E=d?Ds(t):null;d&&S();function S(){const M=Ds(t);E&&!L2(E,M)&&n(),E=M,w=requestAnimationFrame(S)}return n(),()=>{var M;g.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),m?.(),(M=x)==null||M.disconnect(),x=null,d&&cancelAnimationFrame(w)}}const FO=fO,VO=hO,UO=cO,YO=gO,GO=uO,fw=lO,qO=mO,WO=(t,e,n)=>{const o=new Map,a={platform:$O,...n},i={...a.platform,_c:o};return iO(t,e,{...a,platform:i})};var KO=typeof document<"u",XO=function(){},Gd=KO?v.useLayoutEffect:XO;function of(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!of(t[o],e[o]))return!1;return!0}if(a=Object.keys(t),n=a.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,a[o]))return!1;for(o=n;o--!==0;){const i=a[o];if(!(i==="_owner"&&t.$$typeof)&&!of(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function $2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function hw(t,e){const n=$2(t);return Math.round(e*n)/n}function Fg(t){const e=v.useRef(t);return Gd(()=>{e.current=t}),e}function ZO(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=t,[g,m]=v.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,x]=v.useState(o);of(p,o)||x(o);const[w,E]=v.useState(null),[S,M]=v.useState(null),N=v.useCallback(L=>{L!==T.current&&(T.current=L,E(L))},[]),C=v.useCallback(L=>{L!==k.current&&(k.current=L,M(L))},[]),R=i||w,D=l||S,T=v.useRef(null),k=v.useRef(null),j=v.useRef(g),$=d!=null,K=Fg(d),U=Fg(a),Y=Fg(f),Z=v.useCallback(()=>{if(!T.current||!k.current)return;const L={placement:e,strategy:n,middleware:p};U.current&&(L.platform=U.current),WO(T.current,k.current,L).then(F=>{const X={...F,isPositioned:Y.current!==!1};P.current&&!of(j.current,X)&&(j.current=X,rl.flushSync(()=>{m(X)}))})},[p,e,n,U,Y]);Gd(()=>{f===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[f]);const P=v.useRef(!1);Gd(()=>(P.current=!0,()=>{P.current=!1}),[]),Gd(()=>{if(R&&(T.current=R),D&&(k.current=D),R&&D){if(K.current)return K.current(R,D,Z);Z()}},[R,D,Z,K,$]);const q=v.useMemo(()=>({reference:T,floating:k,setReference:N,setFloating:C}),[N,C]),A=v.useMemo(()=>({reference:R,floating:D}),[R,D]),B=v.useMemo(()=>{const L={position:n,left:0,top:0};if(!A.floating)return L;const F=hw(A.floating,g.x),X=hw(A.floating,g.y);return u?{...L,transform:"translate("+F+"px, "+X+"px)",...$2(A.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:X}},[n,u,A.floating,g.x,g.y]);return v.useMemo(()=>({...g,update:Z,refs:q,elements:A,floatingStyles:B}),[g,Z,q,A,B])}const QO=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:a}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?fw({element:o.current,padding:a}).fn(n):{}:o?fw({element:o,padding:a}).fn(n):{}}}},JO=(t,e)=>({...FO(t),options:[t,e]}),eA=(t,e)=>({...VO(t),options:[t,e]}),tA=(t,e)=>({...qO(t),options:[t,e]}),nA=(t,e)=>({...UO(t),options:[t,e]}),oA=(t,e)=>({...YO(t),options:[t,e]}),rA=(t,e)=>({...GO(t),options:[t,e]}),aA=(t,e)=>({...QO(t),options:[t,e]});var sA="Arrow",H2=v.forwardRef((t,e)=>{const{children:n,width:o=10,height:a=5,...i}=t;return y.jsx(et.svg,{...i,ref:e,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});H2.displayName=sA;var iA=H2,z0="Popper",[B2,Qa]=_r(z0),[lA,F2]=B2(z0),V2=t=>{const{__scopePopper:e,children:n}=t,[o,a]=v.useState(null);return y.jsx(lA,{scope:e,anchor:o,onAnchorChange:a,children:n})};V2.displayName=z0;var U2="PopperAnchor",Y2=v.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...a}=t,i=F2(U2,n),l=v.useRef(null),u=Rt(e,l),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=o?.current||l.current,f!==d.current&&i.onAnchorChange(d.current)}),o?null:y.jsx(et.div,{...a,ref:u})});Y2.displayName=U2;var I0="PopperContent",[cA,uA]=B2(I0),G2=v.forwardRef((t,e)=>{const{__scopePopper:n,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:g=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:x="optimized",onPlaced:w,...E}=t,S=F2(I0,n),[M,N]=v.useState(null),C=Rt(e,W=>N(W)),[R,D]=v.useState(null),T=b2(R),k=T?.width??0,j=T?.height??0,$=o+(i!=="center"?"-"+i:""),K=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(f)?f:[f],Y=U.length>0,Z={padding:K,boundary:U.filter(fA),altBoundary:Y},{refs:P,floatingStyles:q,placement:A,isPositioned:B,middlewareData:L}=ZO({strategy:"fixed",placement:$,whileElementsMounted:(...W)=>BO(...W,{animationFrame:x==="always"}),elements:{reference:S.anchor},middleware:[JO({mainAxis:a+j,alignmentAxis:l}),d&&eA({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?tA():void 0,...Z}),d&&nA({...Z}),oA({...Z,apply:({elements:W,rects:ee,availableWidth:oe,availableHeight:de})=>{const{width:ge,height:ne}=ee.reference,_e=W.floating.style;_e.setProperty("--radix-popper-available-width",`${oe}px`),_e.setProperty("--radix-popper-available-height",`${de}px`),_e.setProperty("--radix-popper-anchor-width",`${ge}px`),_e.setProperty("--radix-popper-anchor-height",`${ne}px`)}}),R&&aA({element:R,padding:u}),hA({arrowWidth:k,arrowHeight:j}),p&&rA({strategy:"referenceHidden",...Z})]}),[F,X]=K2(A),I=wr(w);Kn(()=>{B&&I?.()},[B,I]);const z=L.arrow?.x,H=L.arrow?.y,G=L.arrow?.centerOffset!==0,[J,ae]=v.useState();return Kn(()=>{M&&ae(window.getComputedStyle(M).zIndex)},[M]),y.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:B?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y.jsx(cA,{scope:n,placedSide:F,onArrowChange:D,arrowX:z,arrowY:H,shouldHideArrow:G,children:y.jsx(et.div,{"data-side":F,"data-align":X,...E,ref:C,style:{...E.style,animation:B?void 0:"none"}})})})});G2.displayName=I0;var q2="PopperArrow",dA={top:"bottom",right:"left",bottom:"top",left:"right"},W2=v.forwardRef(function(e,n){const{__scopePopper:o,...a}=e,i=uA(q2,o),l=dA[i.placedSide];return y.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]: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:y.jsx(iA,{...a,ref:n,style:{...a.style,display:"block"}})})});W2.displayName=q2;function fA(t){return t!==null}var hA=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:o,middlewareData:a}=e,l=a.arrow?.centerOffset!==0,u=l?0:t.arrowWidth,d=l?0:t.arrowHeight,[f,g]=K2(n),m={start:"0%",center:"50%",end:"100%"}[g],p=(a.arrow?.x??0)+u/2,x=(a.arrow?.y??0)+d/2;let w="",E="";return f==="bottom"?(w=l?m:`${p}px`,E=`${-d}px`):f==="top"?(w=l?m:`${p}px`,E=`${o.floating.height+d}px`):f==="right"?(w=`${-d}px`,E=l?m:`${x}px`):f==="left"&&(w=`${o.floating.width+d}px`,E=l?m:`${x}px`),{data:{x:w,y:E}}}});function K2(t){const[e,n="center"]=t.split("-");return[e,n]}var zf=V2,Gc=Y2,If=G2,Pf=W2,Vg="rovingFocusGroup.onEntryFocus",mA={bubbles:!1,cancelable:!0},qc="RovingFocusGroup",[Dp,X2,gA]=x0(qc),[pA,Z2]=_r(qc,[gA]),[yA,vA]=pA(qc),Q2=v.forwardRef((t,e)=>y.jsx(Dp.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(Dp.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(xA,{...t,ref:e})})}));Q2.displayName=qc;var xA=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:g=!1,...m}=t,p=v.useRef(null),x=Rt(e,p),w=_f(i),[E,S]=Ga({prop:l,defaultProp:u??null,onChange:d,caller:qc}),[M,N]=v.useState(!1),C=wr(f),R=X2(n),D=v.useRef(!1),[T,k]=v.useState(0);return v.useEffect(()=>{const j=p.current;if(j)return j.addEventListener(Vg,C),()=>j.removeEventListener(Vg,C)},[C]),y.jsx(yA,{scope:n,orientation:o,dir:w,loop:a,currentTabStopId:E,onItemFocus:v.useCallback(j=>S(j),[S]),onItemShiftTab:v.useCallback(()=>N(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(j=>j+1),[]),onFocusableItemRemove:v.useCallback(()=>k(j=>j-1),[]),children:y.jsx(et.div,{tabIndex:M||T===0?-1:0,"data-orientation":o,...m,ref:x,style:{outline:"none",...t.style},onMouseDown:ze(t.onMouseDown,()=>{D.current=!0}),onFocus:ze(t.onFocus,j=>{const $=!D.current;if(j.target===j.currentTarget&&$&&!M){const K=new CustomEvent(Vg,mA);if(j.currentTarget.dispatchEvent(K),!K.defaultPrevented){const U=R().filter(A=>A.focusable),Y=U.find(A=>A.active),Z=U.find(A=>A.id===E),q=[Y,Z,...U].filter(Boolean).map(A=>A.ref.current);tE(q,g)}}D.current=!1}),onBlur:ze(t.onBlur,()=>N(!1))})})}),J2="RovingFocusGroupItem",eE=v.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:i,children:l,...u}=t,d=Vn(),f=i||d,g=vA(J2,n),m=g.currentTabStopId===f,p=X2(n),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:E}=g;return v.useEffect(()=>{if(o)return x(),()=>w()},[o,x,w]),y.jsx(Dp.ItemSlot,{scope:n,id:f,focusable:o,active:a,children:y.jsx(et.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...u,ref:e,onMouseDown:ze(t.onMouseDown,S=>{o?g.onItemFocus(f):S.preventDefault()}),onFocus:ze(t.onFocus,()=>g.onItemFocus(f)),onKeyDown:ze(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){g.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const M=SA(S,g.orientation,g.dir);if(M!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let C=p().filter(R=>R.focusable).map(R=>R.ref.current);if(M==="last")C.reverse();else if(M==="prev"||M==="next"){M==="prev"&&C.reverse();const R=C.indexOf(S.currentTarget);C=g.loop?CA(C,R+1):C.slice(R+1)}setTimeout(()=>tE(C))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:E!=null}):l})})});eE.displayName=J2;var bA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function wA(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function SA(t,e,n){const o=wA(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return bA[o]}function tE(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}function CA(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var EA=Q2,_A=eE,Tp=["Enter"," "],MA=["ArrowDown","PageUp","Home"],nE=["ArrowUp","PageDown","End"],NA=[...MA,...nE],RA={ltr:[...Tp,"ArrowRight"],rtl:[...Tp,"ArrowLeft"]},DA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Wc="Menu",[Mc,TA,kA]=x0(Wc),[Bs,oE]=_r(Wc,[kA,Qa,Z2]),Lf=Qa(),rE=Z2(),[OA,Fs]=Bs(Wc),[AA,Kc]=Bs(Wc),aE=t=>{const{__scopeMenu:e,open:n=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=t,u=Lf(e),[d,f]=v.useState(null),g=v.useRef(!1),m=wr(i),p=_f(a);return v.useEffect(()=>{const x=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),y.jsx(zf,{...u,children:y.jsx(OA,{scope:e,open:n,onOpenChange:m,content:d,onContentChange:f,children:y.jsx(AA,{scope:e,onClose:v.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:g,dir:p,modal:l,children:o})})})};aE.displayName=Wc;var jA="MenuAnchor",P0=v.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t,a=Lf(n);return y.jsx(Gc,{...a,...o,ref:e})});P0.displayName=jA;var L0="MenuPortal",[zA,sE]=Bs(L0,{forceMount:void 0}),iE=t=>{const{__scopeMenu:e,forceMount:n,children:o,container:a}=t,i=Fs(L0,e);return y.jsx(zA,{scope:e,forceMount:n,children:y.jsx(Do,{present:n||i.open,children:y.jsx(sl,{asChild:!0,container:a,children:o})})})};iE.displayName=L0;var Uo="MenuContent",[IA,$0]=Bs(Uo),lE=v.forwardRef((t,e)=>{const n=sE(Uo,t.__scopeMenu),{forceMount:o=n.forceMount,...a}=t,i=Fs(Uo,t.__scopeMenu),l=Kc(Uo,t.__scopeMenu);return y.jsx(Mc.Provider,{scope:t.__scopeMenu,children:y.jsx(Do,{present:o||i.open,children:y.jsx(Mc.Slot,{scope:t.__scopeMenu,children:l.modal?y.jsx(PA,{...a,ref:e}):y.jsx(LA,{...a,ref:e})})})})}),PA=v.forwardRef((t,e)=>{const n=Fs(Uo,t.__scopeMenu),o=v.useRef(null),a=Rt(e,o);return v.useEffect(()=>{const i=o.current;if(i)return Rf(i)},[]),y.jsx(H0,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ze(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),LA=v.forwardRef((t,e)=>{const n=Fs(Uo,t.__scopeMenu);return y.jsx(H0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$A=Ya("MenuContent.ScrollLock"),H0=v.forwardRef((t,e)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:p,onDismiss:x,disableOutsideScroll:w,...E}=t,S=Fs(Uo,n),M=Kc(Uo,n),N=Lf(n),C=rE(n),R=TA(n),[D,T]=v.useState(null),k=v.useRef(null),j=Rt(e,k,S.onContentChange),$=v.useRef(0),K=v.useRef(""),U=v.useRef(0),Y=v.useRef(null),Z=v.useRef("right"),P=v.useRef(0),q=w?Uc:v.Fragment,A=w?{as:$A,allowPinchZoom:!0}:void 0,B=F=>{const X=K.current+F,I=R().filter(W=>!W.disabled),z=document.activeElement,H=I.find(W=>W.ref.current===z)?.textValue,G=I.map(W=>W.textValue),J=ZA(G,X,H),ae=I.find(W=>W.textValue===J)?.ref.current;(function W(ee){K.current=ee,window.clearTimeout($.current),ee!==""&&($.current=window.setTimeout(()=>W(""),1e3))})(X),ae&&setTimeout(()=>ae.focus())};v.useEffect(()=>()=>window.clearTimeout($.current),[]),Mf();const L=v.useCallback(F=>Z.current===Y.current?.side&&JA(F,Y.current?.area),[]);return y.jsx(IA,{scope:n,searchRef:K,onItemEnter:v.useCallback(F=>{L(F)&&F.preventDefault()},[L]),onItemLeave:v.useCallback(F=>{L(F)||(k.current?.focus(),T(null))},[L]),onTriggerLeave:v.useCallback(F=>{L(F)&&F.preventDefault()},[L]),pointerGraceTimerRef:U,onPointerGraceIntentChange:v.useCallback(F=>{Y.current=F},[]),children:y.jsx(q,{...A,children:y.jsx(Vc,{asChild:!0,trapped:a,onMountAutoFocus:ze(i,F=>{F.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:y.jsx(al,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:p,onDismiss:x,children:y.jsx(EA,{asChild:!0,...C,dir:M.dir,orientation:"vertical",loop:o,currentTabStopId:D,onCurrentTabStopIdChange:T,onEntryFocus:ze(d,F=>{M.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(If,{role:"menu","aria-orientation":"vertical","data-state":EE(S.open),"data-radix-menu-content":"",dir:M.dir,...N,...E,ref:j,style:{outline:"none",...E.style},onKeyDown:ze(E.onKeyDown,F=>{const I=F.target.closest("[data-radix-menu-content]")===F.currentTarget,z=F.ctrlKey||F.altKey||F.metaKey,H=F.key.length===1;I&&(F.key==="Tab"&&F.preventDefault(),!z&&H&&B(F.key));const G=k.current;if(F.target!==G||!NA.includes(F.key))return;F.preventDefault();const ae=R().filter(W=>!W.disabled).map(W=>W.ref.current);nE.includes(F.key)&&ae.reverse(),KA(ae)}),onBlur:ze(t.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout($.current),K.current="")}),onPointerMove:ze(t.onPointerMove,Nc(F=>{const X=F.target,I=P.current!==F.clientX;if(F.currentTarget.contains(X)&&I){const z=F.clientX>P.current?"right":"left";Z.current=z,P.current=F.clientX}}))})})})})})})});lE.displayName=Uo;var HA="MenuGroup",B0=v.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return y.jsx(et.div,{role:"group",...o,ref:e})});B0.displayName=HA;var BA="MenuLabel",cE=v.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return y.jsx(et.div,{...o,ref:e})});cE.displayName=BA;var rf="MenuItem",mw="menu.itemSelect",$f=v.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:o,...a}=t,i=v.useRef(null),l=Kc(rf,t.__scopeMenu),u=$0(rf,t.__scopeMenu),d=Rt(e,i),f=v.useRef(!1),g=()=>{const m=i.current;if(!n&&m){const p=new CustomEvent(mw,{bubbles:!0,cancelable:!0});m.addEventListener(mw,x=>o?.(x),{once:!0}),BC(m,p),p.defaultPrevented?f.current=!1:l.onClose()}};return y.jsx(uE,{...a,ref:d,disabled:n,onClick:ze(t.onClick,g),onPointerDown:m=>{t.onPointerDown?.(m),f.current=!0},onPointerUp:ze(t.onPointerUp,m=>{f.current||m.currentTarget?.click()}),onKeyDown:ze(t.onKeyDown,m=>{const p=u.searchRef.current!=="";n||p&&m.key===" "||Tp.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});$f.displayName=rf;var uE=v.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:o=!1,textValue:a,...i}=t,l=$0(rf,n),u=rE(n),d=v.useRef(null),f=Rt(e,d),[g,m]=v.useState(!1),[p,x]=v.useState("");return v.useEffect(()=>{const w=d.current;w&&x((w.textContent??"").trim())},[i.children]),y.jsx(Mc.ItemSlot,{scope:n,disabled:o,textValue:a??p,children:y.jsx(_A,{asChild:!0,...u,focusable:!o,children:y.jsx(et.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:f,onPointerMove:ze(t.onPointerMove,Nc(w=>{o?l.onItemLeave(w):(l.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ze(t.onPointerLeave,Nc(w=>l.onItemLeave(w))),onFocus:ze(t.onFocus,()=>m(!0)),onBlur:ze(t.onBlur,()=>m(!1))})})})}),FA="MenuCheckboxItem",dE=v.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:o,...a}=t;return y.jsx(pE,{scope:t.__scopeMenu,checked:n,children:y.jsx($f,{role:"menuitemcheckbox","aria-checked":af(n)?"mixed":n,...a,ref:e,"data-state":V0(n),onSelect:ze(a.onSelect,()=>o?.(af(n)?!0:!n),{checkForDefaultPrevented:!1})})})});dE.displayName=FA;var fE="MenuRadioGroup",[VA,UA]=Bs(fE,{value:void 0,onValueChange:()=>{}}),hE=v.forwardRef((t,e)=>{const{value:n,onValueChange:o,...a}=t,i=wr(o);return y.jsx(VA,{scope:t.__scopeMenu,value:n,onValueChange:i,children:y.jsx(B0,{...a,ref:e})})});hE.displayName=fE;var mE="MenuRadioItem",gE=v.forwardRef((t,e)=>{const{value:n,...o}=t,a=UA(mE,t.__scopeMenu),i=n===a.value;return y.jsx(pE,{scope:t.__scopeMenu,checked:i,children:y.jsx($f,{role:"menuitemradio","aria-checked":i,...o,ref:e,"data-state":V0(i),onSelect:ze(o.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});gE.displayName=mE;var F0="MenuItemIndicator",[pE,YA]=Bs(F0,{checked:!1}),yE=v.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:o,...a}=t,i=YA(F0,n);return y.jsx(Do,{present:o||af(i.checked)||i.checked===!0,children:y.jsx(et.span,{...a,ref:e,"data-state":V0(i.checked)})})});yE.displayName=F0;var GA="MenuSeparator",vE=v.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return y.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...o,ref:e})});vE.displayName=GA;var qA="MenuArrow",xE=v.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t,a=Lf(n);return y.jsx(Pf,{...a,...o,ref:e})});xE.displayName=qA;var WA="MenuSub",[qW,bE]=Bs(WA),hc="MenuSubTrigger",wE=v.forwardRef((t,e)=>{const n=Fs(hc,t.__scopeMenu),o=Kc(hc,t.__scopeMenu),a=bE(hc,t.__scopeMenu),i=$0(hc,t.__scopeMenu),l=v.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=i,f={__scopeMenu:t.__scopeMenu},g=v.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return v.useEffect(()=>g,[g]),v.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),y.jsx(P0,{asChild:!0,...f,children:y.jsx(uE,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":EE(n.open),...t,ref:aa(e,a.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ze(t.onPointerMove,Nc(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:ze(t.onPointerLeave,Nc(m=>{g();const p=n.content?.getBoundingClientRect();if(p){const x=n.content?.dataset.side,w=x==="right",E=w?-5:5,S=p[w?"left":"right"],M=p[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+E,y:m.clientY},{x:S,y:p.top},{x:M,y:p.top},{x:M,y:p.bottom},{x:S,y:p.bottom}],side:x}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ze(t.onKeyDown,m=>{const p=i.searchRef.current!=="";t.disabled||p&&m.key===" "||RA[o.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});wE.displayName=hc;var SE="MenuSubContent",CE=v.forwardRef((t,e)=>{const n=sE(Uo,t.__scopeMenu),{forceMount:o=n.forceMount,...a}=t,i=Fs(Uo,t.__scopeMenu),l=Kc(Uo,t.__scopeMenu),u=bE(SE,t.__scopeMenu),d=v.useRef(null),f=Rt(e,d);return y.jsx(Mc.Provider,{scope:t.__scopeMenu,children:y.jsx(Do,{present:o||i.open,children:y.jsx(Mc.Slot,{scope:t.__scopeMenu,children:y.jsx(H0,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{l.isUsingKeyboardRef.current&&d.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ze(t.onFocusOutside,g=>{g.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ze(t.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:ze(t.onKeyDown,g=>{const m=g.currentTarget.contains(g.target),p=DA[l.dir].includes(g.key);m&&p&&(i.onOpenChange(!1),u.trigger?.focus(),g.preventDefault())})})})})})});CE.displayName=SE;function EE(t){return t?"open":"closed"}function af(t){return t==="indeterminate"}function V0(t){return af(t)?"indeterminate":t?"checked":"unchecked"}function KA(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function XA(t,e){return t.map((n,o)=>t[(e+o)%t.length])}function ZA(t,e,n){const a=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let l=XA(t,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function QA(t,e){const{x:n,y:o}=t;let a=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const u=e[i],d=e[l],f=u.x,g=u.y,m=d.x,p=d.y;g>o!=p>o&&n<(m-f)*(o-g)/(p-g)+f&&(a=!a)}return a}function JA(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return QA(n,e)}function Nc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ej=aE,tj=P0,nj=iE,oj=lE,rj=B0,aj=cE,sj=$f,ij=dE,lj=hE,cj=gE,uj=yE,dj=vE,fj=xE,hj=wE,mj=CE,Hf="DropdownMenu",[gj]=_r(Hf,[oE]),Zn=oE(),[pj,_E]=gj(Hf),ME=t=>{const{__scopeDropdownMenu:e,children:n,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:u=!0}=t,d=Zn(e),f=v.useRef(null),[g,m]=Ga({prop:a,defaultProp:i??!1,onChange:l,caller:Hf});return y.jsx(pj,{scope:e,triggerId:Vn(),triggerRef:f,contentId:Vn(),open:g,onOpenChange:m,onOpenToggle:v.useCallback(()=>m(p=>!p),[m]),modal:u,children:y.jsx(ej,{...d,open:g,onOpenChange:m,dir:o,modal:u,children:n})})};ME.displayName=Hf;var NE="DropdownMenuTrigger",RE=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=t,i=_E(NE,n),l=Zn(n);return y.jsx(tj,{asChild:!0,...l,children:y.jsx(et.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":o?"":void 0,disabled:o,...a,ref:aa(e,i.triggerRef),onPointerDown:ze(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:ze(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});RE.displayName=NE;var yj="DropdownMenuPortal",DE=t=>{const{__scopeDropdownMenu:e,...n}=t,o=Zn(e);return y.jsx(nj,{...o,...n})};DE.displayName=yj;var TE="DropdownMenuContent",kE=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=_E(TE,n),i=Zn(n),l=v.useRef(!1);return y.jsx(oj,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:e,onCloseAutoFocus:ze(t.onCloseAutoFocus,u=>{l.current||a.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:ze(t.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,g=d.button===2||f;(!a.modal||g)&&(l.current=!0)}),style:{...t.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)"}})});kE.displayName=TE;var vj="DropdownMenuGroup",xj=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(rj,{...a,...o,ref:e})});xj.displayName=vj;var bj="DropdownMenuLabel",wj=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(aj,{...a,...o,ref:e})});wj.displayName=bj;var Sj="DropdownMenuItem",OE=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(sj,{...a,...o,ref:e})});OE.displayName=Sj;var Cj="DropdownMenuCheckboxItem",AE=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(ij,{...a,...o,ref:e})});AE.displayName=Cj;var Ej="DropdownMenuRadioGroup",_j=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(lj,{...a,...o,ref:e})});_j.displayName=Ej;var Mj="DropdownMenuRadioItem",Nj=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(cj,{...a,...o,ref:e})});Nj.displayName=Mj;var Rj="DropdownMenuItemIndicator",jE=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(uj,{...a,...o,ref:e})});jE.displayName=Rj;var Dj="DropdownMenuSeparator",zE=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(dj,{...a,...o,ref:e})});zE.displayName=Dj;var Tj="DropdownMenuArrow",kj=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(fj,{...a,...o,ref:e})});kj.displayName=Tj;var Oj="DropdownMenuSubTrigger",Aj=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(hj,{...a,...o,ref:e})});Aj.displayName=Oj;var jj="DropdownMenuSubContent",zj=v.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(mj,{...a,...o,ref:e,style:{...t.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)"}})});zj.displayName=jj;var Ij=ME,Pj=RE,Lj=DE,$j=kE,Hj=OE,Bj=AE,Fj=jE,Vj=zE,Uj="Label",IE=v.forwardRef((t,e)=>y.jsx(et.label,{...t,ref:e,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));IE.displayName=Uj;var Yj=IE;function gw(t,[e,n]){return Math.min(n,Math.max(e,t))}var Bf="Popover",[PE]=_r(Bf,[Qa]),Xc=Qa(),[Gj,Ja]=PE(Bf),LE=t=>{const{__scopePopover:e,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=t,u=Xc(e),d=v.useRef(null),[f,g]=v.useState(!1),[m,p]=Ga({prop:o,defaultProp:a??!1,onChange:i,caller:Bf});return y.jsx(zf,{...u,children:y.jsx(Gj,{scope:e,contentId:Vn(),triggerRef:d,open:m,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(x=>!x),[p]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>g(!0),[]),onCustomAnchorRemove:v.useCallback(()=>g(!1),[]),modal:l,children:n})})};LE.displayName=Bf;var $E="PopoverAnchor",HE=v.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Ja($E,n),i=Xc(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return v.useEffect(()=>(l(),()=>u()),[l,u]),y.jsx(Gc,{...i,...o,ref:e})});HE.displayName=$E;var BE="PopoverTrigger",qj=v.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Ja(BE,n),i=Xc(n),l=Rt(e,a.triggerRef),u=y.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":GE(a.open),...o,ref:l,onClick:ze(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:y.jsx(Gc,{asChild:!0,...i,children:u})});qj.displayName=BE;var U0="PopoverPortal",[Wj,Kj]=PE(U0,{forceMount:void 0}),FE=t=>{const{__scopePopover:e,forceMount:n,children:o,container:a}=t,i=Ja(U0,e);return y.jsx(Wj,{scope:e,forceMount:n,children:y.jsx(Do,{present:n||i.open,children:y.jsx(sl,{asChild:!0,container:a,children:o})})})};FE.displayName=U0;var Fi="PopoverContent",VE=v.forwardRef((t,e)=>{const n=Kj(Fi,t.__scopePopover),{forceMount:o=n.forceMount,...a}=t,i=Ja(Fi,t.__scopePopover);return y.jsx(Do,{present:o||i.open,children:i.modal?y.jsx(Zj,{...a,ref:e}):y.jsx(Qj,{...a,ref:e})})});VE.displayName=Fi;var Xj=Ya("PopoverContent.RemoveScroll"),Zj=v.forwardRef((t,e)=>{const n=Ja(Fi,t.__scopePopover),o=v.useRef(null),a=Rt(e,o),i=v.useRef(!1);return v.useEffect(()=>{const l=o.current;if(l)return Rf(l)},[]),y.jsx(Uc,{as:Xj,allowPinchZoom:!0,children:y.jsx(UE,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ze(t.onCloseAutoFocus,l=>{l.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ze(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:ze(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qj=v.forwardRef((t,e)=>{const n=Ja(Fi,t.__scopePopover),o=v.useRef(!1),a=v.useRef(!1);return y.jsx(UE,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),UE=v.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,...m}=t,p=Ja(Fi,n),x=Xc(n);return Mf(),y.jsx(Vc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:y.jsx(al,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>p.onOpenChange(!1),children:y.jsx(If,{"data-state":GE(p.open),role:"dialog",id:p.contentId,...x,...m,ref:e,style:{...m.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)"}})})})}),YE="PopoverClose",Jj=v.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Ja(YE,n);return y.jsx(et.button,{type:"button",...o,ref:e,onClick:ze(t.onClick,()=>a.onOpenChange(!1))})});Jj.displayName=YE;var ez="PopoverArrow",tz=v.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Xc(n);return y.jsx(Pf,{...a,...o,ref:e})});tz.displayName=ez;function GE(t){return t?"open":"closed"}var nz=LE,oz=HE,rz=FE,az=VE,sz=[" ","Enter","ArrowUp","ArrowDown"],iz=[" ","Enter"],Ts="Select",[Ff,Vf,lz]=x0(Ts),[cl]=_r(Ts,[lz,Qa]),Uf=Qa(),[cz,es]=cl(Ts),[uz,dz]=cl(Ts),qE=t=>{const{__scopeSelect:e,children:n,open:o,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:d,dir:f,name:g,autoComplete:m,disabled:p,required:x,form:w}=t,E=Uf(e),[S,M]=v.useState(null),[N,C]=v.useState(null),[R,D]=v.useState(!1),T=_f(f),[k,j]=Ga({prop:o,defaultProp:a??!1,onChange:i,caller:Ts}),[$,K]=Ga({prop:l,defaultProp:u,onChange:d,caller:Ts}),U=v.useRef(null),Y=S?w||!!S.closest("form"):!0,[Z,P]=v.useState(new Set),q=Array.from(Z).map(A=>A.props.value).join(";");return y.jsx(zf,{...E,children:y.jsxs(cz,{required:x,scope:e,trigger:S,onTriggerChange:M,valueNode:N,onValueNodeChange:C,valueNodeHasChildren:R,onValueNodeHasChildrenChange:D,contentId:Vn(),value:$,onValueChange:K,open:k,onOpenChange:j,dir:T,triggerPointerDownPosRef:U,disabled:p,children:[y.jsx(Ff.Provider,{scope:e,children:y.jsx(uz,{scope:t.__scopeSelect,onNativeOptionAdd:v.useCallback(A=>{P(B=>new Set(B).add(A))},[]),onNativeOptionRemove:v.useCallback(A=>{P(B=>{const L=new Set(B);return L.delete(A),L})},[]),children:n})}),Y?y.jsxs(g_,{"aria-hidden":!0,required:x,tabIndex:-1,name:g,autoComplete:m,value:$,onChange:A=>K(A.target.value),disabled:p,form:w,children:[$===void 0?y.jsx("option",{value:""}):null,Array.from(Z)]},q):null]})})};qE.displayName=Ts;var WE="SelectTrigger",KE=v.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:o=!1,...a}=t,i=Uf(n),l=es(WE,n),u=l.disabled||o,d=Rt(e,l.onTriggerChange),f=Vf(n),g=v.useRef("touch"),[m,p,x]=y_(E=>{const S=f().filter(C=>!C.disabled),M=S.find(C=>C.value===l.value),N=v_(S,E,M);N!==void 0&&l.onValueChange(N.value)}),w=E=>{u||(l.onOpenChange(!0),x()),E&&(l.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return y.jsx(Gc,{asChild:!0,...i,children:y.jsx(et.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":p_(l.value)?"":void 0,...a,ref:d,onClick:ze(a.onClick,E=>{E.currentTarget.focus(),g.current!=="mouse"&&w(E)}),onPointerDown:ze(a.onPointerDown,E=>{g.current=E.pointerType;const S=E.target;S.hasPointerCapture(E.pointerId)&&S.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(w(E),E.preventDefault())}),onKeyDown:ze(a.onKeyDown,E=>{const S=m.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&p(E.key),!(S&&E.key===" ")&&sz.includes(E.key)&&(w(),E.preventDefault())})})})});KE.displayName=WE;var XE="SelectValue",ZE=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:l="",...u}=t,d=es(XE,n),{onValueNodeHasChildrenChange:f}=d,g=i!==void 0,m=Rt(e,d.onValueNodeChange);return Kn(()=>{f(g)},[f,g]),y.jsx(et.span,{...u,ref:m,style:{pointerEvents:"none"},children:p_(d.value)?y.jsx(y.Fragment,{children:l}):i})});ZE.displayName=XE;var fz="SelectIcon",QE=v.forwardRef((t,e)=>{const{__scopeSelect:n,children:o,...a}=t;return y.jsx(et.span,{"aria-hidden":!0,...a,ref:e,children:o||"▼"})});QE.displayName=fz;var hz="SelectPortal",JE=t=>y.jsx(sl,{asChild:!0,...t});JE.displayName=hz;var ks="SelectContent",e_=v.forwardRef((t,e)=>{const n=es(ks,t.__scopeSelect),[o,a]=v.useState();if(Kn(()=>{a(new DocumentFragment)},[]),!n.open){const i=o;return i?rl.createPortal(y.jsx(t_,{scope:t.__scopeSelect,children:y.jsx(Ff.Slot,{scope:t.__scopeSelect,children:y.jsx("div",{children:t.children})})}),i):null}return y.jsx(n_,{...t,ref:e})});e_.displayName=ks;var Xo=10,[t_,ts]=cl(ks),mz="SelectContentImpl",gz=Ya("SelectContent.RemoveScroll"),n_=v.forwardRef((t,e)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:m,collisionBoundary:p,collisionPadding:x,sticky:w,hideWhenDetached:E,avoidCollisions:S,...M}=t,N=es(ks,n),[C,R]=v.useState(null),[D,T]=v.useState(null),k=Rt(e,W=>R(W)),[j,$]=v.useState(null),[K,U]=v.useState(null),Y=Vf(n),[Z,P]=v.useState(!1),q=v.useRef(!1);v.useEffect(()=>{if(C)return Rf(C)},[C]),Mf();const A=v.useCallback(W=>{const[ee,...oe]=Y().map(ne=>ne.ref.current),[de]=oe.slice(-1),ge=document.activeElement;for(const ne of W)if(ne===ge||(ne?.scrollIntoView({block:"nearest"}),ne===ee&&D&&(D.scrollTop=0),ne===de&&D&&(D.scrollTop=D.scrollHeight),ne?.focus(),document.activeElement!==ge))return},[Y,D]),B=v.useCallback(()=>A([j,C]),[A,j,C]);v.useEffect(()=>{Z&&B()},[Z,B]);const{onOpenChange:L,triggerPointerDownPosRef:F}=N;v.useEffect(()=>{if(C){let W={x:0,y:0};const ee=de=>{W={x:Math.abs(Math.round(de.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(F.current?.y??0))}},oe=de=>{W.x<=10&&W.y<=10?de.preventDefault():C.contains(de.target)||L(!1),document.removeEventListener("pointermove",ee),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",oe,{capture:!0})}}},[C,L,F]),v.useEffect(()=>{const W=()=>L(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[L]);const[X,I]=y_(W=>{const ee=Y().filter(ge=>!ge.disabled),oe=ee.find(ge=>ge.ref.current===document.activeElement),de=v_(ee,W,oe);de&&setTimeout(()=>de.ref.current.focus())}),z=v.useCallback((W,ee,oe)=>{const de=!q.current&&!oe;(N.value!==void 0&&N.value===ee||de)&&($(W),de&&(q.current=!0))},[N.value]),H=v.useCallback(()=>C?.focus(),[C]),G=v.useCallback((W,ee,oe)=>{const de=!q.current&&!oe;(N.value!==void 0&&N.value===ee||de)&&U(W)},[N.value]),J=o==="popper"?kp:o_,ae=J===kp?{side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:m,collisionBoundary:p,collisionPadding:x,sticky:w,hideWhenDetached:E,avoidCollisions:S}:{};return y.jsx(t_,{scope:n,content:C,viewport:D,onViewportChange:T,itemRefCallback:z,selectedItem:j,onItemLeave:H,itemTextRefCallback:G,focusSelectedItem:B,selectedItemText:K,position:o,isPositioned:Z,searchRef:X,children:y.jsx(Uc,{as:gz,allowPinchZoom:!0,children:y.jsx(Vc,{asChild:!0,trapped:N.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:ze(a,W=>{N.trigger?.focus({preventScroll:!0}),W.preventDefault()}),children:y.jsx(al,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:y.jsx(J,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:W=>W.preventDefault(),...M,...ae,onPlaced:()=>P(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:ze(M.onKeyDown,W=>{const ee=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ee&&W.key.length===1&&I(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let de=Y().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(W.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const ge=W.target,ne=de.indexOf(ge);de=de.slice(ne+1)}setTimeout(()=>A(de)),W.preventDefault()}})})})})})})});n_.displayName=mz;var pz="SelectItemAlignedPosition",o_=v.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:o,...a}=t,i=es(ks,n),l=ts(ks,n),[u,d]=v.useState(null),[f,g]=v.useState(null),m=Rt(e,k=>g(k)),p=Vf(n),x=v.useRef(!1),w=v.useRef(!0),{viewport:E,selectedItem:S,selectedItemText:M,focusSelectedItem:N}=l,C=v.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&f&&E&&S&&M){const k=i.trigger.getBoundingClientRect(),j=f.getBoundingClientRect(),$=i.valueNode.getBoundingClientRect(),K=M.getBoundingClientRect();if(i.dir!=="rtl"){const ge=K.left-j.left,ne=$.left-ge,_e=k.left-ne,De=k.width+_e,Ye=Math.max(De,j.width),Pe=window.innerWidth-Xo,mt=gw(ne,[Xo,Math.max(Xo,Pe-Ye)]);u.style.minWidth=De+"px",u.style.left=mt+"px"}else{const ge=j.right-K.right,ne=window.innerWidth-$.right-ge,_e=window.innerWidth-k.right-ne,De=k.width+_e,Ye=Math.max(De,j.width),Pe=window.innerWidth-Xo,mt=gw(ne,[Xo,Math.max(Xo,Pe-Ye)]);u.style.minWidth=De+"px",u.style.right=mt+"px"}const U=p(),Y=window.innerHeight-Xo*2,Z=E.scrollHeight,P=window.getComputedStyle(f),q=parseInt(P.borderTopWidth,10),A=parseInt(P.paddingTop,10),B=parseInt(P.borderBottomWidth,10),L=parseInt(P.paddingBottom,10),F=q+A+Z+L+B,X=Math.min(S.offsetHeight*5,F),I=window.getComputedStyle(E),z=parseInt(I.paddingTop,10),H=parseInt(I.paddingBottom,10),G=k.top+k.height/2-Xo,J=Y-G,ae=S.offsetHeight/2,W=S.offsetTop+ae,ee=q+A+W,oe=F-ee;if(ee<=G){const ge=U.length>0&&S===U[U.length-1].ref.current;u.style.bottom="0px";const ne=f.clientHeight-E.offsetTop-E.offsetHeight,_e=Math.max(J,ae+(ge?H:0)+ne+B),De=ee+_e;u.style.height=De+"px"}else{const ge=U.length>0&&S===U[0].ref.current;u.style.top="0px";const _e=Math.max(G,q+E.offsetTop+(ge?z:0)+ae)+oe;u.style.height=_e+"px",E.scrollTop=ee-G+E.offsetTop}u.style.margin=`${Xo}px 0`,u.style.minHeight=X+"px",u.style.maxHeight=Y+"px",o?.(),requestAnimationFrame(()=>x.current=!0)}},[p,i.trigger,i.valueNode,u,f,E,S,M,i.dir,o]);Kn(()=>C(),[C]);const[R,D]=v.useState();Kn(()=>{f&&D(window.getComputedStyle(f).zIndex)},[f]);const T=v.useCallback(k=>{k&&w.current===!0&&(C(),N?.(),w.current=!1)},[C,N]);return y.jsx(vz,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:T,children:y.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:y.jsx(et.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});o_.displayName=pz;var yz="SelectPopperPosition",kp=v.forwardRef((t,e)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=Xo,...i}=t,l=Uf(n);return y.jsx(If,{...l,...i,ref:e,align:o,collisionPadding:a,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)"}})});kp.displayName=yz;var[vz,Y0]=cl(ks,{}),Op="SelectViewport",r_=v.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:o,...a}=t,i=ts(Op,n),l=Y0(Op,n),u=Rt(e,i.onViewportChange),d=v.useRef(0);return y.jsxs(y.Fragment,{children:[y.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:o}),y.jsx(Ff.Slot,{scope:n,children:y.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ze(a.onScroll,f=>{const g=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:p}=l;if(p?.current&&m){const x=Math.abs(d.current-g.scrollTop);if(x>0){const w=window.innerHeight-Xo*2,E=parseFloat(m.style.minHeight),S=parseFloat(m.style.height),M=Math.max(E,S);if(M<w){const N=M+x,C=Math.min(w,N),R=N-C;m.style.height=C+"px",m.style.bottom==="0px"&&(g.scrollTop=R>0?R:0,m.style.justifyContent="flex-end")}}}d.current=g.scrollTop})})})]})});r_.displayName=Op;var a_="SelectGroup",[xz,bz]=cl(a_),wz=v.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,a=Vn();return y.jsx(xz,{scope:n,id:a,children:y.jsx(et.div,{role:"group","aria-labelledby":a,...o,ref:e})})});wz.displayName=a_;var s_="SelectLabel",Sz=v.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,a=bz(s_,n);return y.jsx(et.div,{id:a.id,...o,ref:e})});Sz.displayName=s_;var sf="SelectItem",[Cz,i_]=cl(sf),l_=v.forwardRef((t,e)=>{const{__scopeSelect:n,value:o,disabled:a=!1,textValue:i,...l}=t,u=es(sf,n),d=ts(sf,n),f=u.value===o,[g,m]=v.useState(i??""),[p,x]=v.useState(!1),w=Rt(e,N=>d.itemRefCallback?.(N,o,a)),E=Vn(),S=v.useRef("touch"),M=()=>{a||(u.onValueChange(o),u.onOpenChange(!1))};if(o==="")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 y.jsx(Cz,{scope:n,value:o,disabled:a,textId:E,isSelected:f,onItemTextChange:v.useCallback(N=>{m(C=>C||(N?.textContent??"").trim())},[]),children:y.jsx(Ff.ItemSlot,{scope:n,value:o,disabled:a,textValue:g,children:y.jsx(et.div,{role:"option","aria-labelledby":E,"data-highlighted":p?"":void 0,"aria-selected":f&&p,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:w,onFocus:ze(l.onFocus,()=>x(!0)),onBlur:ze(l.onBlur,()=>x(!1)),onClick:ze(l.onClick,()=>{S.current!=="mouse"&&M()}),onPointerUp:ze(l.onPointerUp,()=>{S.current==="mouse"&&M()}),onPointerDown:ze(l.onPointerDown,N=>{S.current=N.pointerType}),onPointerMove:ze(l.onPointerMove,N=>{S.current=N.pointerType,a?d.onItemLeave?.():S.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ze(l.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:ze(l.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(iz.includes(N.key)&&M(),N.key===" "&&N.preventDefault())})})})})});l_.displayName=sf;var mc="SelectItemText",c_=v.forwardRef((t,e)=>{const{__scopeSelect:n,className:o,style:a,...i}=t,l=es(mc,n),u=ts(mc,n),d=i_(mc,n),f=dz(mc,n),[g,m]=v.useState(null),p=Rt(e,M=>m(M),d.onItemTextChange,M=>u.itemTextRefCallback?.(M,d.value,d.disabled)),x=g?.textContent,w=v.useMemo(()=>y.jsx("option",{value:d.value,disabled:d.disabled,children:x},d.value),[d.disabled,d.value,x]),{onNativeOptionAdd:E,onNativeOptionRemove:S}=f;return Kn(()=>(E(w),()=>S(w)),[E,S,w]),y.jsxs(y.Fragment,{children:[y.jsx(et.span,{id:d.textId,...i,ref:p}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?rl.createPortal(i.children,l.valueNode):null]})});c_.displayName=mc;var u_="SelectItemIndicator",d_=v.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t;return i_(u_,n).isSelected?y.jsx(et.span,{"aria-hidden":!0,...o,ref:e}):null});d_.displayName=u_;var Ap="SelectScrollUpButton",f_=v.forwardRef((t,e)=>{const n=ts(Ap,t.__scopeSelect),o=Y0(Ap,t.__scopeSelect),[a,i]=v.useState(!1),l=Rt(e,o.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?y.jsx(m_,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});f_.displayName=Ap;var jp="SelectScrollDownButton",h_=v.forwardRef((t,e)=>{const n=ts(jp,t.__scopeSelect),o=Y0(jp,t.__scopeSelect),[a,i]=v.useState(!1),l=Rt(e,o.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,g=Math.ceil(d.scrollTop)<f;i(g)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?y.jsx(m_,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});h_.displayName=jp;var m_=v.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:o,...a}=t,i=ts("SelectScrollButton",n),l=v.useRef(null),u=Vf(n),d=v.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),Kn(()=>{u().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),y.jsx(et.div,{"aria-hidden":!0,...a,ref:e,style:{flexShrink:0,...a.style},onPointerDown:ze(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:ze(a.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:ze(a.onPointerLeave,()=>{d()})})}),Ez="SelectSeparator",_z=v.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t;return y.jsx(et.div,{"aria-hidden":!0,...o,ref:e})});_z.displayName=Ez;var zp="SelectArrow",Mz=v.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,a=Uf(n),i=es(zp,n),l=ts(zp,n);return i.open&&l.position==="popper"?y.jsx(Pf,{...a,...o,ref:e}):null});Mz.displayName=zp;var Nz="SelectBubbleInput",g_=v.forwardRef(({__scopeSelect:t,value:e,...n},o)=>{const a=v.useRef(null),i=Rt(o,a),l=x2(e);return v.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==e&&g){const m=new Event("change",{bubbles:!0});g.call(u,e),u.dispatchEvent(m)}},[l,e]),y.jsx(et.select,{...n,style:{...FC,...n.style},ref:i,defaultValue:e})});g_.displayName=Nz;function p_(t){return t===""||t===void 0}function y_(t){const e=wr(t),n=v.useRef(""),o=v.useRef(0),a=v.useCallback(l=>{const u=n.current+l;e(u),(function d(f){n.current=f,window.clearTimeout(o.current),f!==""&&(o.current=window.setTimeout(()=>d(""),1e3))})(u)},[e]),i=v.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function v_(t,e,n){const a=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let l=Rz(t,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Rz(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var Dz=qE,Tz=KE,kz=ZE,Oz=QE,Az=JE,jz=e_,zz=r_,Iz=l_,Pz=c_,Lz=d_,$z=f_,Hz=h_,[Yf]=_r("Tooltip",[Qa]),Gf=Qa(),x_="TooltipProvider",Bz=700,Ip="tooltip.open",[Fz,G0]=Yf(x_),b_=t=>{const{__scopeTooltip:e,delayDuration:n=Bz,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=t,l=v.useRef(!0),u=v.useRef(!1),d=v.useRef(0);return v.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),y.jsx(Fz,{scope:e,isOpenDelayedRef:l,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:u,onPointerInTransitChange:v.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:i})};b_.displayName=x_;var Rc="Tooltip",[Vz,Zc]=Yf(Rc),w_=t=>{const{__scopeTooltip:e,children:n,open:o,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=t,d=G0(Rc,t.__scopeTooltip),f=Gf(e),[g,m]=v.useState(null),p=Vn(),x=v.useRef(0),w=l??d.disableHoverableContent,E=u??d.delayDuration,S=v.useRef(!1),[M,N]=Ga({prop:o,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(Ip))):d.onClose(),i?.(k)},caller:Rc}),C=v.useMemo(()=>M?S.current?"delayed-open":"instant-open":"closed",[M]),R=v.useCallback(()=>{window.clearTimeout(x.current),x.current=0,S.current=!1,N(!0)},[N]),D=v.useCallback(()=>{window.clearTimeout(x.current),x.current=0,N(!1)},[N]),T=v.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{S.current=!0,N(!0),x.current=0},E)},[E,N]);return v.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),y.jsx(zf,{...f,children:y.jsx(Vz,{scope:e,contentId:p,open:M,stateAttribute:C,trigger:g,onTriggerChange:m,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?T():R()},[d.isOpenDelayedRef,T,R]),onTriggerLeave:v.useCallback(()=>{w?D():(window.clearTimeout(x.current),x.current=0)},[D,w]),onOpen:R,onClose:D,disableHoverableContent:w,children:n})})};w_.displayName=Rc;var Pp="TooltipTrigger",S_=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...o}=t,a=Zc(Pp,n),i=G0(Pp,n),l=Gf(n),u=v.useRef(null),d=Rt(e,u,a.onTriggerChange),f=v.useRef(!1),g=v.useRef(!1),m=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),y.jsx(Gc,{asChild:!0,...l,children:y.jsx(et.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:d,onPointerMove:ze(t.onPointerMove,p=>{p.pointerType!=="touch"&&!g.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),g.current=!0)}),onPointerLeave:ze(t.onPointerLeave,()=>{a.onTriggerLeave(),g.current=!1}),onPointerDown:ze(t.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ze(t.onFocus,()=>{f.current||a.onOpen()}),onBlur:ze(t.onBlur,a.onClose),onClick:ze(t.onClick,a.onClose)})})});S_.displayName=Pp;var q0="TooltipPortal",[Uz,Yz]=Yf(q0,{forceMount:void 0}),C_=t=>{const{__scopeTooltip:e,forceMount:n,children:o,container:a}=t,i=Zc(q0,e);return y.jsx(Uz,{scope:e,forceMount:n,children:y.jsx(Do,{present:n||i.open,children:y.jsx(sl,{asChild:!0,container:a,children:o})})})};C_.displayName=q0;var Vi="TooltipContent",E_=v.forwardRef((t,e)=>{const n=Yz(Vi,t.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=t,l=Zc(Vi,t.__scopeTooltip);return y.jsx(Do,{present:o||l.open,children:l.disableHoverableContent?y.jsx(__,{side:a,...i,ref:e}):y.jsx(Gz,{side:a,...i,ref:e})})}),Gz=v.forwardRef((t,e)=>{const n=Zc(Vi,t.__scopeTooltip),o=G0(Vi,t.__scopeTooltip),a=v.useRef(null),i=Rt(e,a),[l,u]=v.useState(null),{trigger:d,onClose:f}=n,g=a.current,{onPointerInTransitChange:m}=o,p=v.useCallback(()=>{u(null),m(!1)},[m]),x=v.useCallback((w,E)=>{const S=w.currentTarget,M={x:w.clientX,y:w.clientY},N=Xz(M,S.getBoundingClientRect()),C=Zz(M,N),R=Qz(E.getBoundingClientRect()),D=e6([...C,...R]);u(D),m(!0)},[m]);return v.useEffect(()=>()=>p(),[p]),v.useEffect(()=>{if(d&&g){const w=S=>x(S,g),E=S=>x(S,d);return d.addEventListener("pointerleave",w),g.addEventListener("pointerleave",E),()=>{d.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",E)}}},[d,g,x,p]),v.useEffect(()=>{if(l){const w=E=>{const S=E.target,M={x:E.clientX,y:E.clientY},N=d?.contains(S)||g?.contains(S),C=!Jz(M,l);N?p():C&&(p(),f())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,g,l,f,p]),y.jsx(__,{...t,ref:i})}),[qz,Wz]=Yf(Rc,{isInside:!1}),Kz=g4("TooltipContent"),__=v.forwardRef((t,e)=>{const{__scopeTooltip:n,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=t,d=Zc(Vi,n),f=Gf(n),{onClose:g}=d;return v.useEffect(()=>(document.addEventListener(Ip,g),()=>document.removeEventListener(Ip,g)),[g]),v.useEffect(()=>{if(d.trigger){const m=p=>{p.target?.contains(d.trigger)&&g()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,g]),y.jsx(al,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:g,children:y.jsxs(If,{"data-state":d.stateAttribute,...f,...u,ref:e,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(Kz,{children:o}),y.jsx(qz,{scope:n,isInside:!0,children:y.jsx(w4,{id:d.contentId,role:"tooltip",children:a||o})})]})})});E_.displayName=Vi;var M_="TooltipArrow",N_=v.forwardRef((t,e)=>{const{__scopeTooltip:n,...o}=t,a=Gf(n);return Wz(M_,n).isInside?null:y.jsx(Pf,{...a,...o,ref:e})});N_.displayName=M_;function Xz(t,e){const n=Math.abs(e.top-t.y),o=Math.abs(e.bottom-t.y),a=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,o,a,i)){case i:return"left";case a:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Zz(t,e,n=5){const o=[];switch(e){case"top":o.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":o.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":o.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":o.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return o}function Qz(t){const{top:e,right:n,bottom:o,left:a}=t;return[{x:a,y:e},{x:n,y:e},{x:n,y:o},{x:a,y:o}]}function Jz(t,e){const{x:n,y:o}=t;let a=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const u=e[i],d=e[l],f=u.x,g=u.y,m=d.x,p=d.y;g>o!=p>o&&n<(m-f)*(o-g)/(p-g)+f&&(a=!a)}return a}function e6(t){const e=t.slice();return e.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),t6(e)}function t6(t){if(t.length<=1)return t.slice();const e=[];for(let o=0;o<t.length;o++){const a=t[o];for(;e.length>=2;){const i=e[e.length-1],l=e[e.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))e.pop();else break}e.push(a)}e.pop();const n=[];for(let o=t.length-1;o>=0;o--){const a=t[o];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var n6=b_,o6=w_,r6=S_,a6=C_,s6=E_,i6=N_;const l6=(t,e)=>{const n=new Array(t.length+e.length);for(let o=0;o<t.length;o++)n[o]=t[o];for(let o=0;o<e.length;o++)n[t.length+o]=e[o];return n},c6=(t,e)=>({classGroupId:t,validator:e}),R_=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),lf="-",pw=[],u6="arbitrary..",d6=t=>{const e=h6(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return f6(l);const u=l.split(lf),d=u[0]===""&&u.length>1?1:0;return D_(u,d,e)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=o[l],f=n[l];return d?f?l6(f,d):d:f||pw}return n[l]||pw}}},D_=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const a=t[e],i=n.nextPart.get(a);if(i){const f=D_(t,e+1,i);if(f)return f}const l=n.validators;if(l===null)return;const u=e===0?t.join(lf):t.slice(e).join(lf),d=l.length;for(let f=0;f<d;f++){const g=l[f];if(g.validator(u))return g.classGroupId}},f6=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),o=e.slice(0,n);return o?u6+o:void 0})(),h6=t=>{const{theme:e,classGroups:n}=t;return m6(n,e)},m6=(t,e)=>{const n=R_();for(const o in t){const a=t[o];W0(a,n,o,e)}return n},W0=(t,e,n,o)=>{const a=t.length;for(let i=0;i<a;i++){const l=t[i];g6(l,e,n,o)}},g6=(t,e,n,o)=>{if(typeof t=="string"){p6(t,e,n);return}if(typeof t=="function"){y6(t,e,n,o);return}v6(t,e,n,o)},p6=(t,e,n)=>{const o=t===""?e:T_(e,t);o.classGroupId=n},y6=(t,e,n,o)=>{if(x6(t)){W0(t(o),e,n,o);return}e.validators===null&&(e.validators=[]),e.validators.push(c6(n,t))},v6=(t,e,n,o)=>{const a=Object.entries(t),i=a.length;for(let l=0;l<i;l++){const[u,d]=a[l];W0(d,T_(e,u),n,o)}},T_=(t,e)=>{let n=t;const o=e.split(lf),a=o.length;for(let i=0;i<a;i++){const l=o[i];let u=n.nextPart.get(l);u||(u=R_(),n.nextPart.set(l,u)),n=u}return n},x6=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,b6=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),o=Object.create(null);const a=(i,l)=>{n[i]=l,e++,e>t&&(e=0,o=n,n=Object.create(null))};return{get(i){let l=n[i];if(l!==void 0)return l;if((l=o[i])!==void 0)return a(i,l),l},set(i,l){i in n?n[i]=l:a(i,l)}}},Lp="!",yw=":",w6=[],vw=(t,e,n,o,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:o,isExternal:a}),S6=t=>{const{prefix:e,experimentalParseClassName:n}=t;let o=a=>{const i=[];let l=0,u=0,d=0,f;const g=a.length;for(let E=0;E<g;E++){const S=a[E];if(l===0&&u===0){if(S===yw){i.push(a.slice(d,E)),d=E+1;continue}if(S==="/"){f=E;continue}}S==="["?l++:S==="]"?l--:S==="("?u++:S===")"&&u--}const m=i.length===0?a:a.slice(d);let p=m,x=!1;m.endsWith(Lp)?(p=m.slice(0,-1),x=!0):m.startsWith(Lp)&&(p=m.slice(1),x=!0);const w=f&&f>d?f-d:void 0;return vw(i,x,p,w)};if(e){const a=e+yw,i=o;o=l=>l.startsWith(a)?i(l.slice(a.length)):vw(w6,!1,l,void 0,!0)}if(n){const a=o;o=i=>n({className:i,parseClassName:a})}return o},C6=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,o)=>{e.set(n,1e6+o)}),n=>{const o=[];let a=[];for(let i=0;i<n.length;i++){const l=n[i],u=l[0]==="[",d=e.has(l);u||d?(a.length>0&&(a.sort(),o.push(...a),a=[]),o.push(l)):a.push(l)}return a.length>0&&(a.sort(),o.push(...a)),o}},E6=t=>({cache:b6(t.cacheSize),parseClassName:S6(t),sortModifiers:C6(t),...d6(t)}),_6=/\s+/,M6=(t,e)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:i}=e,l=[],u=t.trim().split(_6);let d="";for(let f=u.length-1;f>=0;f-=1){const g=u[f],{isExternal:m,modifiers:p,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:E}=n(g);if(m){d=g+(d.length>0?" "+d:d);continue}let S=!!E,M=o(S?w.substring(0,E):w);if(!M){if(!S){d=g+(d.length>0?" "+d:d);continue}if(M=o(w),!M){d=g+(d.length>0?" "+d:d);continue}S=!1}const N=p.length===0?"":p.length===1?p[0]:i(p).join(":"),C=x?N+Lp:N,R=C+M;if(l.indexOf(R)>-1)continue;l.push(R);const D=a(M,S);for(let T=0;T<D.length;++T){const k=D[T];l.push(C+k)}d=g+(d.length>0?" "+d:d)}return d},N6=(...t)=>{let e=0,n,o,a="";for(;e<t.length;)(n=t[e++])&&(o=k_(n))&&(a&&(a+=" "),a+=o);return a},k_=t=>{if(typeof t=="string")return t;let e,n="";for(let o=0;o<t.length;o++)t[o]&&(e=k_(t[o]))&&(n&&(n+=" "),n+=e);return n},R6=(t,...e)=>{let n,o,a,i;const l=d=>{const f=e.reduce((g,m)=>m(g),t());return n=E6(f),o=n.cache.get,a=n.cache.set,i=u,u(d)},u=d=>{const f=o(d);if(f)return f;const g=M6(d,n);return a(d,g),g};return i=l,(...d)=>i(N6(...d))},D6=[],An=t=>{const e=n=>n[t]||D6;return e.isThemeGetter=!0,e},O_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,T6=/^\d+\/\d+$/,k6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,O6=/\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$/,A6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,j6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_i=t=>T6.test(t),dt=t=>!!t&&!Number.isNaN(Number(t)),Ia=t=>!!t&&Number.isInteger(Number(t)),Ug=t=>t.endsWith("%")&&dt(t.slice(0,-1)),Xr=t=>k6.test(t),I6=()=>!0,P6=t=>O6.test(t)&&!A6.test(t),j_=()=>!1,L6=t=>j6.test(t),$6=t=>z6.test(t),H6=t=>!$e(t)&&!He(t),B6=t=>ul(t,P_,j_),$e=t=>O_.test(t),ws=t=>ul(t,L_,P6),Yg=t=>ul(t,G6,dt),xw=t=>ul(t,z_,j_),F6=t=>ul(t,I_,$6),Rd=t=>ul(t,$_,L6),He=t=>A_.test(t),oc=t=>dl(t,L_),V6=t=>dl(t,q6),bw=t=>dl(t,z_),U6=t=>dl(t,P_),Y6=t=>dl(t,I_),Dd=t=>dl(t,$_,!0),ul=(t,e,n)=>{const o=O_.exec(t);return o?o[1]?e(o[1]):n(o[2]):!1},dl=(t,e,n=!1)=>{const o=A_.exec(t);return o?o[1]?e(o[1]):n:!1},z_=t=>t==="position"||t==="percentage",I_=t=>t==="image"||t==="url",P_=t=>t==="length"||t==="size"||t==="bg-size",L_=t=>t==="length",G6=t=>t==="number",q6=t=>t==="family-name",$_=t=>t==="shadow",W6=()=>{const t=An("color"),e=An("font"),n=An("text"),o=An("font-weight"),a=An("tracking"),i=An("leading"),l=An("breakpoint"),u=An("container"),d=An("spacing"),f=An("radius"),g=An("shadow"),m=An("inset-shadow"),p=An("text-shadow"),x=An("drop-shadow"),w=An("blur"),E=An("perspective"),S=An("aspect"),M=An("ease"),N=An("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...R(),He,$e],T=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],j=()=>[He,$e,d],$=()=>[_i,"full","auto",...j()],K=()=>[Ia,"none","subgrid",He,$e],U=()=>["auto",{span:["full",Ia,He,$e]},Ia,He,$e],Y=()=>[Ia,"auto",He,$e],Z=()=>["auto","min","max","fr",He,$e],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...j()],B=()=>[_i,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],L=()=>[t,He,$e],F=()=>[...R(),bw,xw,{position:[He,$e]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",U6,B6,{size:[He,$e]}],z=()=>[Ug,oc,ws],H=()=>["","none","full",f,He,$e],G=()=>["",dt,oc,ws],J=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[dt,Ug,bw,xw],ee=()=>["","none",w,He,$e],oe=()=>["none",dt,He,$e],de=()=>["none",dt,He,$e],ge=()=>[dt,He,$e],ne=()=>[_i,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xr],breakpoint:[Xr],color:[I6],container:[Xr],"drop-shadow":[Xr],ease:["in","out","in-out"],font:[H6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xr],shadow:[Xr],spacing:["px",dt],text:[Xr],"text-shadow":[Xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_i,$e,He,S]}],container:["container"],columns:[{columns:[dt,$e,He,u]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],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:D()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[Ia,"auto",He,$e]}],basis:[{basis:[_i,"full","auto",u,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,_i,"auto","initial","none",$e]}],grow:[{grow:["",dt,He,$e]}],shrink:[{shrink:["",dt,He,$e]}],order:[{order:[Ia,"first","last","none",He,$e]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[u,"screen",...B()]}],"min-w":[{"min-w":[u,"screen","none",...B()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,oc,ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,He,Yg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ug,$e]}],"font-family":[{font:[V6,$e,e]}],"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:[a,He,$e]}],"line-clamp":[{"line-clamp":[dt,"none",He,Yg]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",He,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",He,ws]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[dt,"auto",He,$e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,$e]}],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",He,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ia,He,$e],radial:["",He,$e],conic:[Ia,He,$e]},Y6,F6]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,He,$e]}],"outline-w":[{outline:["",dt,oc,ws]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",g,Dd,Rd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",m,Dd,Rd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[dt,ws]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",p,Dd,Rd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[dt,He,$e]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"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":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[He,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,$e]}],filter:[{filter:["","none",He,$e]}],blur:[{blur:ee()}],brightness:[{brightness:[dt,He,$e]}],contrast:[{contrast:[dt,He,$e]}],"drop-shadow":[{"drop-shadow":["","none",x,Dd,Rd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",dt,He,$e]}],"hue-rotate":[{"hue-rotate":[dt,He,$e]}],invert:[{invert:["",dt,He,$e]}],saturate:[{saturate:[dt,He,$e]}],sepia:[{sepia:["",dt,He,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",He,$e]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[dt,He,$e]}],"backdrop-contrast":[{"backdrop-contrast":[dt,He,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,He,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,He,$e]}],"backdrop-invert":[{"backdrop-invert":["",dt,He,$e]}],"backdrop-opacity":[{"backdrop-opacity":[dt,He,$e]}],"backdrop-saturate":[{"backdrop-saturate":[dt,He,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,He,$e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",He,$e]}],ease:[{ease:["linear","initial",M,He,$e]}],delay:[{delay:[dt,He,$e]}],animate:[{animate:["none",N,He,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,He,$e]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[He,$e,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ne()}],"translate-x":[{"translate-x":ne()}],"translate-y":[{"translate-y":ne()}],"translate-z":[{"translate-z":ne()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",He,$e]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",He,$e]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[dt,oc,ws,Yg]}],stroke:[{stroke:["none",...L()]}],"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"]}},K6=R6(W6);function Ne(...t){return K6($C(t))}const $p=Cf("focus-visible:border-ring cursor-pointer focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function vn(t){const e=Ee.c(16);let n,o,a,i,l;e[0]!==t?({className:n,variant:a,size:i,asChild:l,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=a===void 0?"default":a,d=i===void 0?"default":i,g=(l===void 0?!1:l)?Ef:"button";let m;e[6]!==n||e[7]!==d||e[8]!==u?(m=Ne($p({variant:u,size:d,className:n})),e[6]=n,e[7]=d,e[8]=u,e[9]=m):m=e[9];let p;return e[10]!==g||e[11]!==o||e[12]!==d||e[13]!==m||e[14]!==u?(p=y.jsx(g,{"data-slot":"button","data-variant":u,"data-size":d,className:m,...o}),e[10]=g,e[11]=o,e[12]=d,e[13]=m,e[14]=u,e[15]=p):p=e[15],p}function Ui(t){const e=Ee.c(10);let n,o,a;e[0]!==t?({className:n,type:a,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);let i;e[4]!==n?(i=Ne("dark:bg-input/30 border-input 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:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",n),e[4]=n,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i||e[8]!==a?(l=y.jsx("input",{type:a,"data-slot":"input",className:i,...o}),e[6]=o,e[7]=i,e[8]=a,e[9]=l):l=e[9],l}const H_=(...t)=>t.filter((e,n,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===n).join(" ").trim();const X6=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Z6=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,o)=>o?o.toUpperCase():n.toLowerCase());const ww=t=>{const e=Z6(t);return e.charAt(0).toUpperCase()+e.slice(1)};var Q6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const J6=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const e8=v.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:l,...u},d)=>v.createElement("svg",{ref:d,...Q6,width:e,height:e,stroke:t,strokeWidth:o?Number(n)*24/Number(e):n,className:H_("lucide",a),...!i&&!J6(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,g])=>v.createElement(f,g)),...Array.isArray(i)?i:[i]]));const tt=(t,e)=>{const n=v.forwardRef(({className:o,...a},i)=>v.createElement(e8,{ref:i,iconNode:e,className:H_(`lucide-${X6(ww(t))}`,`lucide-${t}`,o),...a}));return n.displayName=ww(t),n};const t8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],n8=tt("arrow-right",t8);const o8=[["path",{d:"M4 20h16",key:"14thso"}],["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}]],r8=tt("baseline",o8);const a8=[["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"}]],s8=tt("calendar",a8);const i8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Vs=tt("check",i8);const l8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Os=tt("chevron-down",l8);const c8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],B_=tt("chevron-left",c8);const u8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],F_=tt("chevron-right",u8);const d8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],qf=tt("chevron-up",d8);const f8=[["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"}]],V_=tt("copy",f8);const h8=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],K0=tt("database",h8);const m8=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],g8=tt("eraser",m8);const p8=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],y8=tt("eye-off",p8);const v8=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],x8=tt("file-archive",v8);const b8=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],w8=tt("file-headphone",b8);const S8=[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],C8=tt("file-image",S8);const E8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],_8=tt("file-play",E8);const M8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],N8=tt("file-spreadsheet",M8);const R8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Sw=tt("file-text",R8);const D8=[["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"}]],U_=tt("file",D8);const T8=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],k8=tt("git-branch",T8);const O8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],A8=tt("grid-3x3",O8);const j8=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],z8=tt("hash",j8);const I8=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Y_=tt("key",I8);const P8=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],L8=tt("link",P8);const $8=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],H8=tt("list-checks",$8);const B8=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],F8=tt("list",B8);const V8=[["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"}]],U8=tt("loader",V8);const Y8=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],G8=tt("lock-open",Y8);const q8=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],W8=tt("lock",q8);const K8=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],Cw=tt("pin-off",K8);const X8=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],Ew=tt("pin",X8);const Z8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],X0=tt("plus",Z8);const Q8=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],J8=tt("presentation",Q8);const eI=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],tI=tt("scissors",eI);const nI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wf=tt("search",nI);const oI=[["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"}]],rI=tt("shield-check",oI);const aI=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],sI=tt("shield-off",aI);const iI=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],lI=tt("square-check-big",iI);const cI=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],Kf=tt("table-2",cI);const uI=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],dI=tt("table",uI);const fI=[["path",{d:"M15 5h6",key:"1pr8yx"}],["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M3 19h18",key:"awlh7x"}],["path",{d:"m3 12 3.553-7.724a.5.5 0 0 1 .894 0L11 12",key:"6lvno8"}],["path",{d:"M3.92 10h6.16",key:"1tl8ex"}]],hI=tt("text-initial",fI);const mI=[["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"}]],G_=tt("trash-2",mI);const gI=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],pI=tt("trending-up",gI);const yI=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],_w=tt("upload",yI);const vI=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],xI=tt("waves",vI);const bI=[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]],wI=tt("waypoints",bI);const SI=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],CI=tt("workflow",SI);const EI=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ns=tt("x",EI);function q_(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(C0,{"data-slot":"sheet",...n}),e[2]=n,e[3]=o):o=e[3],o}function _I(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(E0,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=o):o=e[3],o}function MI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-[100]",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(_0,{"data-slot":"sheet-overlay",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function W_(t){const e=Ee.c(17);let n,o,a,i,l;e[0]!==t?({className:o,children:n,side:i,showCloseButton:l,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=i===void 0?"right":i,d=l===void 0?!0:l;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx(MI,{}),e[6]=f):f=e[6];let g;e[7]!==o?(g=Ne("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-[100] flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",o),e[7]=o,e[8]=g):g=e[8];let m;e[9]!==d?(m=d&&y.jsx(N0,{"data-slot":"sheet-close",asChild:!0,children:y.jsxs(vn,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[y.jsx(ns,{}),y.jsx("span",{className:"sr-only",children:"Close"})]})}),e[9]=d,e[10]=m):m=e[10];let p;return e[11]!==n||e[12]!==a||e[13]!==u||e[14]!==g||e[15]!==m?(p=y.jsxs(_I,{children:[f,y.jsxs(M0,{"data-slot":"sheet-content","data-side":u,className:g,...a,children:[n,m]})]}),e[11]=n,e[12]=a,e[13]=u,e[14]=g,e[15]=m,e[16]=p):p=e[16],p}function K_(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("gap-1.5 p-4 flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sheet-header",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function NI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("gap-2 p-4 mt-auto flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sheet-footer",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function X_(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("text-foreground font-medium",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(y2,{"data-slot":"sheet-title",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function RI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("text-muted-foreground text-sm",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(v2,{"data-slot":"sheet-description",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function DI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("bg-muted rounded-md animate-pulse",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"skeleton",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function TI(t){const e=Ee.c(6);let n,o;e[0]!==t?({delayDuration:o,...n}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);const a=o===void 0?0:o;let i;return e[3]!==a||e[4]!==n?(i=y.jsx(n6,{"data-slot":"tooltip-provider",delayDuration:a,...n}),e[3]=a,e[4]=n,e[5]=i):i=e[5],i}function Z0(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(TI,{children:y.jsx(o6,{"data-slot":"tooltip",...n})}),e[2]=n,e[3]=o):o=e[3],o}function Q0(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(r6,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function J0(t){const e=Ee.c(13);let n,o,a,i;e[0]!==t?({className:o,sideOffset:i,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?0:i;let u;e[5]!==o?(u=Ne("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-popover text-popover-foreground border border-border ring-1 ring-foreground/10 z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(i6,{className:"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover border-border z-50 translate-y-[calc(-50%_-_2px)]"}),e[7]=d):d=e[7];let f;return e[8]!==n||e[9]!==a||e[10]!==l||e[11]!==u?(f=y.jsx(a6,{children:y.jsxs(s6,{"data-slot":"tooltip-content",sideOffset:l,className:u,...a,children:[n,d]})}),e[8]=n,e[9]=a,e[10]=l,e[11]=u,e[12]=f):f=e[12],f}const Gg=768;function kI(){const t=Ee.c(2),[e,n]=v.useState(void 0);let o,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{const i=window.matchMedia(`(max-width: ${Gg-1}px)`),l=()=>{n(window.innerWidth<Gg)};return i.addEventListener("change",l),n(window.innerWidth<Gg),()=>i.removeEventListener("change",l)},a=[],t[0]=o,t[1]=a):(o=t[0],a=t[1]),v.useEffect(o,a),!!e}const OI="sidebar_state",AI=3600*24*7,jI="16rem",zI="18rem",II="3rem",PI="b",Z_=v.createContext(null);function Q_(){const t=v.useContext(Z_);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function LI(t){const e=Ee.c(36);let n,o,a,i,l,u,d;e[0]!==t?({defaultOpen:d,open:a,onOpenChange:l,className:o,style:u,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=d===void 0?!0:d,g=kI(),[m,p]=v.useState(!1),[x,w]=v.useState(f),E=a??x;let S;e[8]!==E||e[9]!==l?(S=P=>{const q=typeof P=="function"?P(E):P;l?l(q):w(q),document.cookie=`${OI}=${q}; path=/; max-age=${AI}`},e[8]=E,e[9]=l,e[10]=S):S=e[10];const M=S;let N;e[11]!==g||e[12]!==M?(N=()=>g?p(HI):M($I),e[11]=g,e[12]=M,e[13]=N):N=e[13];const C=N;let R,D;e[14]!==C?(R=()=>{const P=q=>{q.key===PI&&(q.metaKey||q.ctrlKey)&&(q.preventDefault(),C())};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},D=[C],e[14]=C,e[15]=R,e[16]=D):(R=e[15],D=e[16]),v.useEffect(R,D);const T=E?"expanded":"collapsed";let k;e[17]!==g||e[18]!==E||e[19]!==m||e[20]!==M||e[21]!==T||e[22]!==C?(k={state:T,open:E,setOpen:M,isMobile:g,openMobile:m,setOpenMobile:p,toggleSidebar:C},e[17]=g,e[18]=E,e[19]=m,e[20]=M,e[21]=T,e[22]=C,e[23]=k):k=e[23];const j=k;let $;e[24]!==u?($={"--sidebar-width":jI,"--sidebar-width-icon":II,...u},e[24]=u,e[25]=$):$=e[25];const K=$;let U;e[26]!==o?(U=Ne("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),e[26]=o,e[27]=U):U=e[27];let Y;e[28]!==n||e[29]!==i||e[30]!==K||e[31]!==U?(Y=y.jsx("div",{"data-slot":"sidebar-wrapper",style:K,className:U,...i,children:n}),e[28]=n,e[29]=i,e[30]=K,e[31]=U,e[32]=Y):Y=e[32];let Z;return e[33]!==j||e[34]!==Y?(Z=y.jsx(Z_.Provider,{value:j,children:Y}),e[33]=j,e[34]=Y,e[35]=Z):Z=e[35],Z}function $I(t){return!t}function HI(t){return!t}function BI(t){const e=Ee.c(54);let n,o,a,i,l,u;e[0]!==t?({side:i,variant:l,collapsible:u,className:o,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6]);const d=i===void 0?"left":i,f=l===void 0?"sidebar":l,g=u===void 0?"offcanvas":u,{isMobile:m,state:p,setOpen:x,openMobile:w,setOpenMobile:E}=Q_(),S=v.useRef(!1);let M;e[7]!==g||e[8]!==x||e[9]!==p?(M=()=>{g==="icon"&&p==="collapsed"&&(S.current=!0,x(!0))},e[7]=g,e[8]=x,e[9]=p,e[10]=M):M=e[10];const N=M;let C;e[11]!==x?(C=()=>{S.current&&(S.current=!1,x(!1))},e[11]=x,e[12]=C):C=e[12];const R=C;if(g==="none"){let B;e[13]!==o?(B=Ne("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),e[13]=o,e[14]=B):B=e[14];let L;return e[15]!==n||e[16]!==a||e[17]!==B?(L=y.jsx("div",{"data-slot":"sidebar",className:B,...a,children:n}),e[15]=n,e[16]=a,e[17]=B,e[18]=L):L=e[18],L}if(m){let B;e[19]===Symbol.for("react.memo_cache_sentinel")?(B={"--sidebar-width":zI},e[19]=B):B=e[19];let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=y.jsxs(K_,{className:"sr-only",children:[y.jsx(X_,{children:"Sidebar"}),y.jsx(RI,{children:"Displays the mobile sidebar."})]}),e[20]=L):L=e[20];let F;e[21]!==n?(F=y.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[21]=n,e[22]=F):F=e[22];let X;e[23]!==d||e[24]!==F?(X=y.jsxs(W_,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:B,side:d,children:[L,F]}),e[23]=d,e[24]=F,e[25]=X):X=e[25];let I;return e[26]!==w||e[27]!==a||e[28]!==E||e[29]!==X?(I=y.jsx(q_,{open:w,onOpenChange:E,...a,children:X}),e[26]=w,e[27]=a,e[28]=E,e[29]=X,e[30]=I):I=e[30],I}const D=p==="collapsed"?g:"",T=f==="floating"||f==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let k;e[31]!==T?(k=Ne("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",T),e[31]=T,e[32]=k):k=e[32];let j;e[33]!==k?(j=y.jsx("div",{"data-slot":"sidebar-gap",className:k}),e[33]=k,e[34]=j):j=e[34];const $=d==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",K=f==="floating"||f==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let U;e[35]!==o||e[36]!==$||e[37]!==K?(U=Ne("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",$,K,o),e[35]=o,e[36]=$,e[37]=K,e[38]=U):U=e[38];const Y=g==="icon"?N:void 0,Z=g==="icon"?R:void 0;let P;e[39]!==n?(P=y.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",children:n}),e[39]=n,e[40]=P):P=e[40];let q;e[41]!==a||e[42]!==U||e[43]!==Y||e[44]!==Z||e[45]!==P?(q=y.jsx("div",{"data-slot":"sidebar-container",className:U,onMouseEnter:Y,onMouseLeave:Z,...a,children:P}),e[41]=a,e[42]=U,e[43]=Y,e[44]=Z,e[45]=P,e[46]=q):q=e[46];let A;return e[47]!==d||e[48]!==p||e[49]!==q||e[50]!==D||e[51]!==j||e[52]!==f?(A=y.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":D,"data-variant":f,"data-side":d,"data-slot":"sidebar",children:[j,q]}),e[47]=d,e[48]=p,e[49]=q,e[50]=D,e[51]=j,e[52]=f,e[53]=A):A=e[53],A}function FI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("gap-2 p-2 flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function VI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("no-scrollbar gap-2 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function UI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("p-2 relative flex w-full min-w-0 flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function YI(t){const e=Ee.c(10);let n,o,a;e[0]!==t?({className:n,asChild:a,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);const l=(a===void 0?!1:a)?Ef:"div";let u;e[4]!==n?(u=Ne("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",n),e[4]=n,e[5]=u):u=e[5];let d;return e[6]!==l||e[7]!==o||e[8]!==u?(d=y.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:u,...o}),e[6]=l,e[7]=o,e[8]=u,e[9]=d):d=e[9],d}function GI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("text-sm w-full",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function qI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("gap-1 flex w-full min-w-0 flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function WI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("group/menu-item relative",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const KI=Cf("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function XI(t){const e=Ee.c(28);let n,o,a,i,l,u,d;e[0]!==t?({asChild:a,isActive:i,variant:l,size:u,tooltip:d,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=a===void 0?!1:a,g=i===void 0?!1:i,m=l===void 0?"default":l,p=u===void 0?"default":u,x=f?Ef:"button",{isMobile:w,state:E}=Q_();let S;e[8]!==n||e[9]!==p||e[10]!==m?(S=Ne(KI({variant:m,size:p}),n),e[8]=n,e[9]=p,e[10]=m,e[11]=S):S=e[11];let M;e[12]!==x||e[13]!==g||e[14]!==o||e[15]!==p||e[16]!==S?(M=y.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":p,"data-active":g,className:S,...o}),e[12]=x,e[13]=g,e[14]=o,e[15]=p,e[16]=S,e[17]=M):M=e[17];const N=M;if(!d)return N;if(typeof d=="string"){let k;e[18]!==d?(k={children:d},e[18]=d,e[19]=k):k=e[19],d=k}let C;e[20]!==N?(C=y.jsx(Q0,{asChild:!0,children:N}),e[20]=N,e[21]=C):C=e[21];const R=E!=="collapsed"||w;let D;e[22]!==R||e[23]!==d?(D=y.jsx(J0,{side:"right",align:"center",hidden:R,...d}),e[22]=R,e[23]=d,e[24]=D):D=e[24];let T;return e[25]!==C||e[26]!==D?(T=y.jsxs(Z0,{children:[C,D]}),e[25]=C,e[26]=D,e[27]=T):T=e[27],T}function ey(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(C0,{"data-slot":"dialog",...n}),e[2]=n,e[3]=o):o=e[3],o}function ZI(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(V5,{"data-slot":"dialog-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function QI(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(E0,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=o):o=e[3],o}function JI(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(_0,{"data-slot":"dialog-overlay",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ty(t){const e=Ee.c(15);let n,o,a,i;e[0]!==t?({className:o,children:n,showCloseButton:i,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?!0:i;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(JI,{}),e[5]=u):u=e[5];let d;e[6]!==o?(d=Ne("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",o),e[6]=o,e[7]=d):d=e[7];let f;e[8]!==l?(f=l&&y.jsx(N0,{"data-slot":"dialog-close",asChild:!0,children:y.jsxs(vn,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[y.jsx(ns,{}),y.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=l,e[9]=f):f=e[9];let g;return e[10]!==n||e[11]!==a||e[12]!==d||e[13]!==f?(g=y.jsxs(QI,{children:[u,y.jsxs(M0,{"data-slot":"dialog-content",className:d,...a,children:[n,f]})]}),e[10]=n,e[11]=a,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function ny(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("gap-2 flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"dialog-header",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function J_(t){const e=Ee.c(14);let n,o,a,i;e[0]!==t?({className:o,showCloseButton:i,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?!1:i;let u;e[5]!==o?(u=Ne("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]!==l?(d=l&&y.jsx(N0,{asChild:!0,children:y.jsx(vn,{variant:"outline",children:"Close"})}),e[7]=l,e[8]=d):d=e[8];let f;return e[9]!==n||e[10]!==a||e[11]!==u||e[12]!==d?(f=y.jsxs("div",{"data-slot":"dialog-footer",className:u,...a,children:[n,d]}),e[9]=n,e[10]=a,e[11]=u,e[12]=d,e[13]=f):f=e[13],f}function oy(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("leading-none font-medium",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(y2,{"data-slot":"dialog-title",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ry(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(v2,{"data-slot":"dialog-description",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const e7=Cf("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>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 overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function oa(t){const e=Ee.c(13);let n,o,a,i;e[0]!==t?({className:n,variant:a,asChild:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"default":a,d=(i===void 0?!1:i)?Ef:"span";let f;e[5]!==n||e[6]!==l?(f=Ne(e7({variant:l}),n),e[5]=n,e[6]=l,e[7]=f):f=e[7];let g;return e[8]!==d||e[9]!==o||e[10]!==f||e[11]!==l?(g=y.jsx(d,{"data-slot":"badge","data-variant":l,className:f,...o}),e[8]=d,e[9]=o,e[10]=f,e[11]=l,e[12]=g):g=e[12],g}const ay="";let Dc=null,rc=null;async function t7(){try{const e=await(await fetch(`${ay}/api/connections`)).json();return e.success?(Dc=e.data,e.data):(console.error("Failed to fetch connections:",e.error),[])}catch(t){return console.error("Failed to fetch connections:",t),[]}}async function sy(){if(Dc!==null)return Dc;if(rc)return rc;rc=t7();const t=await rc;return rc=null,t}async function gc(t,e=!1,n,o){try{const i=await(await fetch(`${ay}/api/connections`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,success:e,databaseName:n,name:o})})).json();i.success?Dc=null:console.error("Failed to save connection:",i.error)}catch(a){console.error("Failed to save connection:",a)}}async function n7(t){const e=await fetch(`${ay}/api/connections/${encodeURIComponent(t)}`,{method:"DELETE"});let n={};try{n=await e.json()}catch{}if(e.ok&&n.success)Dc=null;else throw new Error(n.error||"Failed to remove connection")}function o7(t){const e=Ee.c(19),{open:n,onOpenChange:o,trigger:a}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[l,u]=v.useState(i),[d,f]=v.useState(null),g=r7;let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=async()=>{const T=await sy();u(T)},e[1]=m):m=e[1];const p=m;let x;e[2]===Symbol.for("react.memo_cache_sentinel")?(x=async T=>{try{await n7(T),f(null),await p(),En.success("Connection removed")}catch(k){const j=k;En.error(j instanceof Error?j.message:"Failed to remove connection")}},e[2]=x):x=e[2];const w=x;let E,S;e[3]!==n?(E=()=>{n?p():f(null)},S=[n,p],e[3]=n,e[4]=E,e[5]=S):(E=e[4],S=e[5]),v.useEffect(E,S);let M;e[6]!==a?(M=y.jsx(ZI,{asChild:!0,children:a}),e[6]=a,e[7]=M):M=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsxs(ny,{children:[y.jsx(oy,{children:"Saved Database Connections"}),y.jsx(ry,{children:"View and manage your saved database connections."})]}),e[8]=N):N=e[8];let C;e[9]!==d||e[10]!==l?(C=l.length===0?y.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No saved connections yet"}):l.map(T=>y.jsxs("div",{className:"p-4 rounded-md border text-card-foreground cursor-pointer",children:[y.jsxs("div",{className:"flex items-center justify-between gap-4 mb-2",children:[y.jsx("div",{className:"text-base font-medium text-foreground",children:T.name||"Unnamed"}),d===T.id?y.jsx(vn,{variant:"destructive",size:"sm",onClick:()=>w(T.id),children:"Confirm removal"}):y.jsx(vn,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive","aria-label":"Delete connection",onClick:()=>f(T.id),children:y.jsx(G_,{className:"size-4"})})]}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"mb-2",children:T.success?y.jsx(oa,{variant:"secondary",className:"bg-primary/10 text-primary",children:"Success"}):y.jsx(oa,{variant:"secondary",className:"bg-destructive/10 text-destructive",children:"Failed"})}),y.jsxs(Z0,{children:[y.jsx(Q0,{asChild:!0,children:y.jsx("button",{type:"button",onClick:()=>g(T.connectionString),className:"text-sm font-mono text-muted-foreground hover:text-foreground truncate text-left w-full transition-colors cursor-pointer",children:T.connectionString})}),y.jsx(J0,{children:"Copy"})]}),T.databaseName&&y.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:["Database: ",T.databaseName]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Last used:"," ",new Date(T.lastUsed||T.timestamp).toLocaleString()]})]})]},T.id)),e[9]=d,e[10]=l,e[11]=C):C=e[11];let R;e[12]!==C?(R=y.jsxs(ty,{className:"w-[calc(100%-2rem)] sm:max-w-2xl ",children:[N,y.jsx("div",{className:"space-y-2 max-h-[60vh] overflow-y-auto",children:C})]}),e[12]=C,e[13]=R):R=e[13];let D;return e[14]!==o||e[15]!==n||e[16]!==M||e[17]!==R?(D=y.jsxs(ey,{open:n,onOpenChange:o,children:[M,R]}),e[14]=o,e[15]=n,e[16]=M,e[17]=R,e[18]=D):D=e[18],D}function r7(t){navigator.clipboard.writeText(t),En.success("URL Copied")}const a7=[{title:"Schema",icon:K0,url:"/schema"},{title:"Tables",icon:dI,url:"/tables"},{title:"Indexes",icon:Y_,url:"/indexes"}];function s7(){const t=Ee.c(11),e=ca(),[n,o]=v.useState(!1);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(YI,{children:"Database"}),t[0]=a):a=t[0];let i;t[1]!==e?(i=a7.map(g=>y.jsx(WI,{children:y.jsx(XI,{asChild:!0,isActive:e.pathname===g.url,children:y.jsxs(v0,{to:g.url,children:[y.jsx(g.icon,{}),y.jsx("span",{children:g.title})]})})},g.title)),t[1]=e,t[2]=i):i=t[2];let l;t[3]!==i?(l=y.jsx(VI,{children:y.jsxs(UI,{children:[a,y.jsx(GI,{children:y.jsx(qI,{children:i})})]})}),t[3]=i,t[4]=l):l=t[4];let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsxs(vn,{variant:"ghost",className:"w-full justify-start group-data-[collapsible=icon]:w-8 group-data-[collapsible=icon]:p-2 group-data-[collapsible=icon]:[&>span]:hidden",children:[y.jsx(K0,{}),y.jsx("span",{children:"My Connections"})]}),t[5]=u):u=t[5];let d;t[6]!==n?(d=y.jsx(FI,{children:y.jsx(o7,{open:n,onOpenChange:o,trigger:u})}),t[6]=n,t[7]=d):d=t[7];let f;return t[8]!==l||t[9]!==d?(f=y.jsxs(BI,{collapsible:"icon",className:"!top-14 !h-[calc(100vh-3.5rem)]",children:[l,d]}),t[8]=l,t[9]=d,t[10]=f):f=t[10],f}function iy(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(Ij,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=o):o=e[3],o}function ly(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(Pj,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function cy(t){const e=Ee.c(12);let n,o,a,i;e[0]!==t?({className:n,align:a,sideOffset:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"start":a,u=i===void 0?4:i;let d;e[5]!==n?(d=Ne("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden",n),e[5]=n,e[6]=d):d=e[6];let f;return e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==d?(f=y.jsx(Lj,{children:y.jsx($j,{"data-slot":"dropdown-menu-content",sideOffset:u,align:l,className:d,...o})}),e[7]=l,e[8]=o,e[9]=u,e[10]=d,e[11]=f):f=e[11],f}function Vo(t){const e=Ee.c(12);let n,o,a,i;e[0]!==t?({className:n,inset:o,variant:i,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?"default":i;let u;e[5]!==n?(u=Ne("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==o||e[8]!==a||e[9]!==u||e[10]!==l?(d=y.jsx(Hj,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":l,className:u,...a}),e[7]=o,e[8]=a,e[9]=u,e[10]=l,e[11]=d):d=e[11],d}function Mw(t){const e=Ee.c(13);let n,o,a,i;e[0]!==t?({className:a,children:o,checked:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);let l;e[5]!==a?(l=Ne("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",a),e[5]=a,e[6]=l):l=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-checkbox-item-indicator",children:y.jsx(Fj,{children:y.jsx(Vs,{})})}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==o||e[10]!==i||e[11]!==l?(d=y.jsxs(Bj,{"data-slot":"dropdown-menu-checkbox-item",className:l,checked:n,...i,children:[u,o]}),e[8]=n,e[9]=o,e[10]=i,e[11]=l,e[12]=d):d=e[12],d}function cf(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Vj,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Nw(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Yj,{"data-slot":"label",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function i7({open:t,onOpenChange:e,onSuccess:n,onConnectionSaved:o}){const[a,i]=v.useState(""),[l,u]=v.useState(""),[d,f]=v.useState(null),[g,m]=v.useState(!1),[p,x]=v.useState(!1),w=t!==void 0?t:p,E=e||x,S=async M=>{M.preventDefault(),f(null),m(!0),await gc(a,!1,void 0,l||void 0),o?.();try{const N=await fetch("/api/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:a})});let C;try{C=await N.json()}catch{throw new Error(`Server error: ${N.status} ${N.statusText}`)}C.success?(f(null),await gc(a,!0,C.databaseName,l||void 0),o?.(),E(!1),u(""),i(""),n?.(C.databaseName)):(f(C.error||"Failed to connect to database"),await gc(a,!1,void 0,l||void 0),o?.())}catch(N){const C=N instanceof Error?N.message:"Failed to connect to database";f(C),await gc(a,!1,void 0,l||void 0),o?.()}finally{m(!1)}};return y.jsx(ey,{open:w,onOpenChange:E,children:y.jsxs(ty,{children:[y.jsxs(ny,{children:[y.jsx(oy,{children:"Connect to Database"}),y.jsx(ry,{children:"Enter your PostgreSQL connection string to connect to your database."})]}),y.jsxs("form",{onSubmit:S,children:[y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx(Nw,{htmlFor:"connection-name",children:"Connection Name (Optional)"}),y.jsx(Ui,{id:"connection-name",type:"text",value:l,onChange:M=>u(M.target.value),placeholder:"My Database Connection",disabled:g})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx(Nw,{htmlFor:"connection-string",children:"Connection String"}),y.jsx(Ui,{id:"connection-string",type:"text",value:a,onChange:M=>i(M.target.value),placeholder:"postgresql://user:password@host:5432/database",required:!0,disabled:g})]}),d&&y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md text-sm",children:d})]}),y.jsxs(J_,{className:"mt-6",children:[y.jsx(vn,{type:"button",variant:"outline",onClick:()=>E(!1),disabled:g,children:"Cancel"}),y.jsx(vn,{type:"submit",disabled:g,children:g?"Connecting...":"Connect"})]})]})]})})}function l7(t){const e=Ee.c(47),{selectedConnection:n,onConnectionSelect:o}=t,[a,i]=v.useState(!1),[l,u]=v.useState("");let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[0]=d):d=e[0];const[f,g]=v.useState(d),[m,p]=v.useState(!1);let x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=async()=>{const G=await sy();g(G)},e[1]=x):x=e[1];const w=x;let E;e[2]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{w()},e[2]=E):E=e[2];let S;e[3]!==m||e[4]!==a?(S=[w,a,m],e[3]=m,e[4]=a,e[5]=S):S=e[5],v.useEffect(E,S);let M;e:{if(!l){M=f;break e}let G;if(e[6]!==f||e[7]!==l){const J=l.toLowerCase();G=f.filter(ae=>ae.name?.toLowerCase().includes(J)||ae.connectionString.toLowerCase().includes(J)||ae.databaseName?.toLowerCase().includes(J)),e[6]=f,e[7]=l,e[8]=G}else G=e[8];M=G}const N=M;let C;e[9]!==o?(C=async G=>{await gc(G.connectionString,G.success||!1,G.databaseName,G.name),o?.(G),i(!1),u(""),await w()},e[9]=o,e[10]=C):C=e[10];const R=C,D=n?.name||n?.databaseName||"No connection";let T;e[11]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx("span",{className:"text-muted-foreground",children:"/"}),e[11]=T):T=e[11];let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx(K0,{className:"h-4 w-4"}),e[12]=k):k=e[12];let j;e[13]!==D?(j=y.jsx("span",{children:D}),e[13]=D,e[14]=j):j=e[14];let $;e[15]!==a?($=a?y.jsx(qf,{className:"h-4 w-4"}):y.jsx(Os,{className:"h-4 w-4"}),e[15]=a,e[16]=$):$=e[16];let K;e[17]!==$||e[18]!==j?(K=y.jsx(ly,{asChild:!0,children:y.jsxs(vn,{variant:"ghost",className:"h-auto px-2 py-1 text-sm font-normal hover:bg-accent flex items-center gap-1.5",children:[k,j,$]})}),e[17]=$,e[18]=j,e[19]=K):K=e[19];let U;e[20]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(Wf,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e[20]=U):U=e[20];let Y;e[21]===Symbol.for("react.memo_cache_sentinel")?(Y=G=>u(G.target.value),e[21]=Y):Y=e[21];let Z;e[22]!==l?(Z=y.jsx("div",{className:"p-2 border-b",children:y.jsxs("div",{className:"relative",children:[U,y.jsx(Ui,{placeholder:"Find connection...",value:l,onChange:Y,className:"pl-8 h-8",autoFocus:!0})]})}),e[22]=l,e[23]=Z):Z=e[23];let P;e[24]!==N||e[25]!==R||e[26]!==l||e[27]!==n?.connectionString?(P=N.length===0?y.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:l?"No connections found":"No saved connections"}):N.map((G,J)=>y.jsxs(Vo,{onClick:()=>R(G),className:"flex items-center justify-between cursor-pointer",children:[y.jsxs("div",{className:"flex-1 min-w-0",children:[G.name&&y.jsx("div",{className:"font-medium truncate",children:G.name}),y.jsx("div",{className:"text-xs text-muted-foreground truncate",children:G.databaseName||G.connectionString})]}),n?.connectionString===G.connectionString&&y.jsx(Vs,{className:"h-4 w-4 ml-2 shrink-0"})]},J)),e[24]=N,e[25]=R,e[26]=l,e[27]=n?.connectionString,e[28]=P):P=e[28];let q;e[29]!==P?(q=y.jsx("div",{className:"max-h-64 overflow-y-auto",children:P}),e[29]=P,e[30]=q):q=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=y.jsx(cf,{}),e[31]=A):A=e[31];let B;e[32]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{i(!1),p(!0)},e[32]=B):B=e[32];let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=y.jsxs(Vo,{onClick:B,className:"cursor-pointer",children:[y.jsx(X0,{className:"h-4 w-4 mr-2"}),y.jsx("span",{children:"New connection"})]}),e[33]=L):L=e[33];let F;e[34]!==Z||e[35]!==q?(F=y.jsxs(cy,{align:"start",className:"w-80 p-0 z-[70]",onCloseAutoFocus:c7,children:[Z,q,A,L]}),e[34]=Z,e[35]=q,e[36]=F):F=e[36];let X;e[37]!==a||e[38]!==K||e[39]!==F?(X=y.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[T,y.jsxs(iy,{open:a,onOpenChange:i,children:[K,F]})]}),e[37]=a,e[38]=K,e[39]=F,e[40]=X):X=e[40];let I;e[41]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{w()},e[41]=I):I=e[41];let z;e[42]!==m?(z=y.jsx(i7,{open:m,onOpenChange:p,onConnectionSaved:I}),e[42]=m,e[43]=z):z=e[43];let H;return e[44]!==X||e[45]!==z?(H=y.jsxs(y.Fragment,{children:[X,z]}),e[44]=X,e[45]=z,e[46]=H):H=e[46],H}function c7(t){return t.preventDefault()}const eM=v.createContext(void 0);function u7({children:t}){const[e,n]=v.useState(null),[o,a]=v.useState(!0);return v.useEffect(()=>{async function i(){console.log("ConnectionProvider: Loading connections..."),a(!0);try{const l=await sy();if(console.log("ConnectionProvider: Found connections:",l.length),l.length>0){const d=l.find(f=>f.success)||l[0];console.log("ConnectionProvider: Setting selected connection:",d.name||d.databaseName||"unnamed"),n(d)}else console.log("ConnectionProvider: No connections found")}catch(l){console.error("ConnectionProvider: Failed to load connections:",l)}finally{a(!1)}}i()},[]),y.jsx(eM.Provider,{value:{selectedConnection:e,setSelectedConnection:n,isLoadingConnections:o},children:t})}function Xf(){const t=v.useContext(eM);if(t===void 0)throw new Error("useConnection must be used within a ConnectionProvider");return t}function d7(){const t=Ee.c(4),{selectedConnection:e,setSelectedConnection:n}=Xf();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx("div",{className:"flex items-center gap-2",children:y.jsx("h1",{className:"text-sm font-semibold",children:"Fakebase Studio"})}),t[0]=o):o=t[0];let a;return t[1]!==e||t[2]!==n?(a=y.jsx("header",{className:"fixed top-0 left-0 right-0 z-[60] w-full border-b bg-background",children:y.jsxs("div",{className:"flex h-14 items-center px-4 gap-4",children:[o,y.jsx(l7,{selectedConnection:e,onConnectionSelect:n})]})}),t[1]=e,t[2]=n,t[3]=a):a=t[3],a}function f7(t){const e=Ee.c(5),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx(h4,{}),e[0]=o):o=e[0];let a,i;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(d7,{}),i=y.jsx(s7,{}),e[1]=a,e[2]=i):(a=e[1],i=e[2]);let l;return e[3]!==n?(l=y.jsxs(u7,{children:[o,y.jsxs(LI,{defaultOpen:!1,children:[a,i,y.jsx("div",{className:"flex pt-14 min-h-screen w-full overflow-hidden",children:y.jsx("div",{className:"w-full h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden",children:n})})]})]}),e[3]=n,e[4]=l):l=e[4],l}function Mn(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,o;n<t.length;n++)(o=Mn(t[n]))!==""&&(e+=(e&&" ")+o);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var h7={value:()=>{}};function Zf(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new qd(n)}function qd(t){this._=t}function m7(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",a=n.indexOf(".");if(a>=0&&(o=n.slice(a+1),n=n.slice(0,a)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}qd.prototype=Zf.prototype={constructor:qd,on:function(t,e){var n=this._,o=m7(t+"",n),a,i=-1,l=o.length;if(arguments.length<2){for(;++i<l;)if((a=(t=o[i]).type)&&(a=g7(n[a],t.name)))return a;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<l;)if(a=(t=o[i]).type)n[a]=Rw(n[a],t.name,e);else if(e==null)for(a in n)n[a]=Rw(n[a],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new qd(t)},call:function(t,e){if((a=arguments.length-2)>0)for(var n=new Array(a),o=0,a,i;o<a;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],o=0,a=i.length;o<a;++o)i[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],a=0,i=o.length;a<i;++a)o[a].value.apply(e,n)}};function g7(t,e){for(var n=0,o=t.length,a;n<o;++n)if((a=t[n]).name===e)return a.value}function Rw(t,e,n){for(var o=0,a=t.length;o<a;++o)if(t[o].name===e){t[o]=h7,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var Hp="http://www.w3.org/1999/xhtml";const Dw={svg:"http://www.w3.org/2000/svg",xhtml:Hp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Qf(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Dw.hasOwnProperty(e)?{space:Dw[e],local:t}:t}function p7(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Hp&&e.documentElement.namespaceURI===Hp?e.createElement(t):e.createElementNS(n,t)}}function y7(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function tM(t){var e=Qf(t);return(e.local?y7:p7)(e)}function v7(){}function uy(t){return t==null?v7:function(){return this.querySelector(t)}}function x7(t){typeof t!="function"&&(t=uy(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var i=e[a],l=i.length,u=o[a]=new Array(l),d,f,g=0;g<l;++g)(d=i[g])&&(f=t.call(d,d.__data__,g,i))&&("__data__"in d&&(f.__data__=d.__data__),u[g]=f);return new _o(o,this._parents)}function b7(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function w7(){return[]}function nM(t){return t==null?w7:function(){return this.querySelectorAll(t)}}function S7(t){return function(){return b7(t.apply(this,arguments))}}function C7(t){typeof t=="function"?t=S7(t):t=nM(t);for(var e=this._groups,n=e.length,o=[],a=[],i=0;i<n;++i)for(var l=e[i],u=l.length,d,f=0;f<u;++f)(d=l[f])&&(o.push(t.call(d,d.__data__,f,l)),a.push(d));return new _o(o,a)}function oM(t){return function(){return this.matches(t)}}function rM(t){return function(e){return e.matches(t)}}var E7=Array.prototype.find;function _7(t){return function(){return E7.call(this.children,t)}}function M7(){return this.firstElementChild}function N7(t){return this.select(t==null?M7:_7(typeof t=="function"?t:rM(t)))}var R7=Array.prototype.filter;function D7(){return Array.from(this.children)}function T7(t){return function(){return R7.call(this.children,t)}}function k7(t){return this.selectAll(t==null?D7:T7(typeof t=="function"?t:rM(t)))}function O7(t){typeof t!="function"&&(t=oM(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var i=e[a],l=i.length,u=o[a]=[],d,f=0;f<l;++f)(d=i[f])&&t.call(d,d.__data__,f,i)&&u.push(d);return new _o(o,this._parents)}function aM(t){return new Array(t.length)}function A7(){return new _o(this._enter||this._groups.map(aM),this._parents)}function uf(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}uf.prototype={constructor:uf,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function j7(t){return function(){return t}}function z7(t,e,n,o,a,i){for(var l=0,u,d=e.length,f=i.length;l<f;++l)(u=e[l])?(u.__data__=i[l],o[l]=u):n[l]=new uf(t,i[l]);for(;l<d;++l)(u=e[l])&&(a[l]=u)}function I7(t,e,n,o,a,i,l){var u,d,f=new Map,g=e.length,m=i.length,p=new Array(g),x;for(u=0;u<g;++u)(d=e[u])&&(p[u]=x=l.call(d,d.__data__,u,e)+"",f.has(x)?a[u]=d:f.set(x,d));for(u=0;u<m;++u)x=l.call(t,i[u],u,i)+"",(d=f.get(x))?(o[u]=d,d.__data__=i[u],f.delete(x)):n[u]=new uf(t,i[u]);for(u=0;u<g;++u)(d=e[u])&&f.get(p[u])===d&&(a[u]=d)}function P7(t){return t.__data__}function L7(t,e){if(!arguments.length)return Array.from(this,P7);var n=e?I7:z7,o=this._parents,a=this._groups;typeof t!="function"&&(t=j7(t));for(var i=a.length,l=new Array(i),u=new Array(i),d=new Array(i),f=0;f<i;++f){var g=o[f],m=a[f],p=m.length,x=$7(t.call(g,g&&g.__data__,f,o)),w=x.length,E=u[f]=new Array(w),S=l[f]=new Array(w),M=d[f]=new Array(p);n(g,m,E,S,M,x,e);for(var N=0,C=0,R,D;N<w;++N)if(R=E[N]){for(N>=C&&(C=N+1);!(D=S[C])&&++C<w;);R._next=D||null}}return l=new _o(l,o),l._enter=u,l._exit=d,l}function $7(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function H7(){return new _o(this._exit||this._groups.map(aM),this._parents)}function B7(t,e,n){var o=this.enter(),a=this,i=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(a=e(a),a&&(a=a.selection())),n==null?i.remove():n(i),o&&a?o.merge(a).order():a}function F7(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,a=n.length,i=o.length,l=Math.min(a,i),u=new Array(a),d=0;d<l;++d)for(var f=n[d],g=o[d],m=f.length,p=u[d]=new Array(m),x,w=0;w<m;++w)(x=f[w]||g[w])&&(p[w]=x);for(;d<a;++d)u[d]=n[d];return new _o(u,this._parents)}function V7(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],a=o.length-1,i=o[a],l;--a>=0;)(l=o[a])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function U7(t){t||(t=Y7);function e(m,p){return m&&p?t(m.__data__,p.__data__):!m-!p}for(var n=this._groups,o=n.length,a=new Array(o),i=0;i<o;++i){for(var l=n[i],u=l.length,d=a[i]=new Array(u),f,g=0;g<u;++g)(f=l[g])&&(d[g]=f);d.sort(e)}return new _o(a,this._parents).order()}function Y7(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function G7(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function q7(){return Array.from(this)}function W7(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],a=0,i=o.length;a<i;++a){var l=o[a];if(l)return l}return null}function K7(){let t=0;for(const e of this)++t;return t}function X7(){return!this.node()}function Z7(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var a=e[n],i=0,l=a.length,u;i<l;++i)(u=a[i])&&t.call(u,u.__data__,i,a);return this}function Q7(t){return function(){this.removeAttribute(t)}}function J7(t){return function(){this.removeAttributeNS(t.space,t.local)}}function eP(t,e){return function(){this.setAttribute(t,e)}}function tP(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function nP(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function oP(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function rP(t,e){var n=Qf(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?J7:Q7:typeof e=="function"?n.local?oP:nP:n.local?tP:eP)(n,e))}function sM(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function aP(t){return function(){this.style.removeProperty(t)}}function sP(t,e,n){return function(){this.style.setProperty(t,e,n)}}function iP(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function lP(t,e,n){return arguments.length>1?this.each((e==null?aP:typeof e=="function"?iP:sP)(t,e,n??"")):Yi(this.node(),t)}function Yi(t,e){return t.style.getPropertyValue(e)||sM(t).getComputedStyle(t,null).getPropertyValue(e)}function cP(t){return function(){delete this[t]}}function uP(t,e){return function(){this[t]=e}}function dP(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function fP(t,e){return arguments.length>1?this.each((e==null?cP:typeof e=="function"?dP:uP)(t,e)):this.node()[t]}function iM(t){return t.trim().split(/^|\s+/)}function dy(t){return t.classList||new lM(t)}function lM(t){this._node=t,this._names=iM(t.getAttribute("class")||"")}lM.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function cM(t,e){for(var n=dy(t),o=-1,a=e.length;++o<a;)n.add(e[o])}function uM(t,e){for(var n=dy(t),o=-1,a=e.length;++o<a;)n.remove(e[o])}function hP(t){return function(){cM(this,t)}}function mP(t){return function(){uM(this,t)}}function gP(t,e){return function(){(e.apply(this,arguments)?cM:uM)(this,t)}}function pP(t,e){var n=iM(t+"");if(arguments.length<2){for(var o=dy(this.node()),a=-1,i=n.length;++a<i;)if(!o.contains(n[a]))return!1;return!0}return this.each((typeof e=="function"?gP:e?hP:mP)(n,e))}function yP(){this.textContent=""}function vP(t){return function(){this.textContent=t}}function xP(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function bP(t){return arguments.length?this.each(t==null?yP:(typeof t=="function"?xP:vP)(t)):this.node().textContent}function wP(){this.innerHTML=""}function SP(t){return function(){this.innerHTML=t}}function CP(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function EP(t){return arguments.length?this.each(t==null?wP:(typeof t=="function"?CP:SP)(t)):this.node().innerHTML}function _P(){this.nextSibling&&this.parentNode.appendChild(this)}function MP(){return this.each(_P)}function NP(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function RP(){return this.each(NP)}function DP(t){var e=typeof t=="function"?t:tM(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function TP(){return null}function kP(t,e){var n=typeof t=="function"?t:tM(t),o=e==null?TP:typeof e=="function"?e:uy(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function OP(){var t=this.parentNode;t&&t.removeChild(this)}function AP(){return this.each(OP)}function jP(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function zP(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function IP(t){return this.select(t?zP:jP)}function PP(t){return arguments.length?this.property("__data__",t):this.node().__data__}function LP(t){return function(e){t.call(this,e,this.__data__)}}function $P(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function HP(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,a=e.length,i;n<a;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++o]=i;++o?e.length=o:delete this.__on}}}function BP(t,e,n){return function(){var o=this.__on,a,i=LP(e);if(o){for(var l=0,u=o.length;l<u;++l)if((a=o[l]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=e;return}}this.addEventListener(t.type,i,n),a={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(a):this.__on=[a]}}function FP(t,e,n){var o=$P(t+""),a,i=o.length,l;if(arguments.length<2){var u=this.node().__on;if(u){for(var d=0,f=u.length,g;d<f;++d)for(a=0,g=u[d];a<i;++a)if((l=o[a]).type===g.type&&l.name===g.name)return g.value}return}for(u=e?BP:HP,a=0;a<i;++a)this.each(u(o[a],e,n));return this}function dM(t,e,n){var o=sM(t),a=o.CustomEvent;typeof a=="function"?a=new a(e,n):(a=o.document.createEvent("Event"),n?(a.initEvent(e,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(e,!1,!1)),t.dispatchEvent(a)}function VP(t,e){return function(){return dM(this,t,e)}}function UP(t,e){return function(){return dM(this,t,e.apply(this,arguments))}}function YP(t,e){return this.each((typeof e=="function"?UP:VP)(t,e))}function*GP(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],a=0,i=o.length,l;a<i;++a)(l=o[a])&&(yield l)}var fM=[null];function _o(t,e){this._groups=t,this._parents=e}function Qc(){return new _o([[document.documentElement]],fM)}function qP(){return this}_o.prototype=Qc.prototype={constructor:_o,select:x7,selectAll:C7,selectChild:N7,selectChildren:k7,filter:O7,data:L7,enter:A7,exit:H7,join:B7,merge:F7,selection:qP,order:V7,sort:U7,call:G7,nodes:q7,node:W7,size:K7,empty:X7,each:Z7,attr:rP,style:lP,property:fP,classed:pP,text:bP,html:EP,raise:MP,lower:RP,append:DP,insert:kP,remove:AP,clone:IP,datum:PP,on:FP,dispatch:YP,[Symbol.iterator]:GP};function Co(t){return typeof t=="string"?new _o([[document.querySelector(t)]],[document.documentElement]):new _o([[t]],fM)}function WP(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Zo(t,e){if(t=WP(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var a=e.getBoundingClientRect();return[t.clientX-a.left-e.clientLeft,t.clientY-a.top-e.clientTop]}}return[t.pageX,t.pageY]}const KP={passive:!1},Tc={capture:!0,passive:!1};function qg(t){t.stopImmediatePropagation()}function $i(t){t.preventDefault(),t.stopImmediatePropagation()}function hM(t){var e=t.document.documentElement,n=Co(t).on("dragstart.drag",$i,Tc);"onselectstart"in e?n.on("selectstart.drag",$i,Tc):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function mM(t,e){var n=t.document.documentElement,o=Co(t).on("dragstart.drag",null);e&&(o.on("click.drag",$i,Tc),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Td=t=>()=>t;function Bp(t,{sourceEvent:e,subject:n,target:o,identifier:a,active:i,x:l,y:u,dx:d,dy:f,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:g}})}Bp.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function XP(t){return!t.ctrlKey&&!t.button}function ZP(){return this.parentNode}function QP(t,e){return e??{x:t.x,y:t.y}}function JP(){return navigator.maxTouchPoints||"ontouchstart"in this}function gM(){var t=XP,e=ZP,n=QP,o=JP,a={},i=Zf("start","drag","end"),l=0,u,d,f,g,m=0;function p(R){R.on("mousedown.drag",x).filter(o).on("touchstart.drag",S).on("touchmove.drag",M,KP).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(R,D){if(!(g||!t.call(this,R,D))){var T=C(this,e.call(this,R,D),R,D,"mouse");T&&(Co(R.view).on("mousemove.drag",w,Tc).on("mouseup.drag",E,Tc),hM(R.view),qg(R),f=!1,u=R.clientX,d=R.clientY,T("start",R))}}function w(R){if($i(R),!f){var D=R.clientX-u,T=R.clientY-d;f=D*D+T*T>m}a.mouse("drag",R)}function E(R){Co(R.view).on("mousemove.drag mouseup.drag",null),mM(R.view,f),$i(R),a.mouse("end",R)}function S(R,D){if(t.call(this,R,D)){var T=R.changedTouches,k=e.call(this,R,D),j=T.length,$,K;for($=0;$<j;++$)(K=C(this,k,R,D,T[$].identifier,T[$]))&&(qg(R),K("start",R,T[$]))}}function M(R){var D=R.changedTouches,T=D.length,k,j;for(k=0;k<T;++k)(j=a[D[k].identifier])&&($i(R),j("drag",R,D[k]))}function N(R){var D=R.changedTouches,T=D.length,k,j;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),k=0;k<T;++k)(j=a[D[k].identifier])&&(qg(R),j("end",R,D[k]))}function C(R,D,T,k,j,$){var K=i.copy(),U=Zo($||T,D),Y,Z,P;if((P=n.call(R,new Bp("beforestart",{sourceEvent:T,target:p,identifier:j,active:l,x:U[0],y:U[1],dx:0,dy:0,dispatch:K}),k))!=null)return Y=P.x-U[0]||0,Z=P.y-U[1]||0,function q(A,B,L){var F=U,X;switch(A){case"start":a[j]=q,X=l++;break;case"end":delete a[j],--l;case"drag":U=Zo(L||B,D),X=l;break}K.call(A,R,new Bp(A,{sourceEvent:B,subject:P,target:p,identifier:j,active:X,x:U[0]+Y,y:U[1]+Z,dx:U[0]-F[0],dy:U[1]-F[1],dispatch:K}),k)}}return p.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Td(!!R),p):t},p.container=function(R){return arguments.length?(e=typeof R=="function"?R:Td(R),p):e},p.subject=function(R){return arguments.length?(n=typeof R=="function"?R:Td(R),p):n},p.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Td(!!R),p):o},p.on=function(){var R=i.on.apply(i,arguments);return R===i?p:R},p.clickDistance=function(R){return arguments.length?(m=(R=+R)*R,p):Math.sqrt(m)},p}function fy(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pM(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function Jc(){}var kc=.7,df=1/kc,Hi="\\s*([+-]?\\d+)\\s*",Oc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eL=/^#([0-9a-f]{3,8})$/,tL=new RegExp(`^rgb\\(${Hi},${Hi},${Hi}\\)$`),nL=new RegExp(`^rgb\\(${br},${br},${br}\\)$`),oL=new RegExp(`^rgba\\(${Hi},${Hi},${Hi},${Oc}\\)$`),rL=new RegExp(`^rgba\\(${br},${br},${br},${Oc}\\)$`),aL=new RegExp(`^hsl\\(${Oc},${br},${br}\\)$`),sL=new RegExp(`^hsla\\(${Oc},${br},${br},${Oc}\\)$`),Tw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};fy(Jc,As,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:kw,formatHex:kw,formatHex8:iL,formatHsl:lL,formatRgb:Ow,toString:Ow});function kw(){return this.rgb().formatHex()}function iL(){return this.rgb().formatHex8()}function lL(){return yM(this).formatHsl()}function Ow(){return this.rgb().formatRgb()}function As(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=eL.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Aw(e):n===3?new lo(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?kd(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?kd(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=tL.exec(t))?new lo(e[1],e[2],e[3],1):(e=nL.exec(t))?new lo(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=oL.exec(t))?kd(e[1],e[2],e[3],e[4]):(e=rL.exec(t))?kd(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=aL.exec(t))?Iw(e[1],e[2]/100,e[3]/100,1):(e=sL.exec(t))?Iw(e[1],e[2]/100,e[3]/100,e[4]):Tw.hasOwnProperty(t)?Aw(Tw[t]):t==="transparent"?new lo(NaN,NaN,NaN,0):null}function Aw(t){return new lo(t>>16&255,t>>8&255,t&255,1)}function kd(t,e,n,o){return o<=0&&(t=e=n=NaN),new lo(t,e,n,o)}function cL(t){return t instanceof Jc||(t=As(t)),t?(t=t.rgb(),new lo(t.r,t.g,t.b,t.opacity)):new lo}function Fp(t,e,n,o){return arguments.length===1?cL(t):new lo(t,e,n,o??1)}function lo(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}fy(lo,Fp,pM(Jc,{brighter(t){return t=t==null?df:Math.pow(df,t),new lo(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?kc:Math.pow(kc,t),new lo(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new lo(Ms(this.r),Ms(this.g),Ms(this.b),ff(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:jw,formatHex:jw,formatHex8:uL,formatRgb:zw,toString:zw}));function jw(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}`}function uL(){return`#${Es(this.r)}${Es(this.g)}${Es(this.b)}${Es((isNaN(this.opacity)?1:this.opacity)*255)}`}function zw(){const t=ff(this.opacity);return`${t===1?"rgb(":"rgba("}${Ms(this.r)}, ${Ms(this.g)}, ${Ms(this.b)}${t===1?")":`, ${t})`}`}function ff(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ms(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Es(t){return t=Ms(t),(t<16?"0":"")+t.toString(16)}function Iw(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Qo(t,e,n,o)}function yM(t){if(t instanceof Qo)return new Qo(t.h,t.s,t.l,t.opacity);if(t instanceof Jc||(t=As(t)),!t)return new Qo;if(t instanceof Qo)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,a=Math.min(e,n,o),i=Math.max(e,n,o),l=NaN,u=i-a,d=(i+a)/2;return u?(e===i?l=(n-o)/u+(n<o)*6:n===i?l=(o-e)/u+2:l=(e-n)/u+4,u/=d<.5?i+a:2-i-a,l*=60):u=d>0&&d<1?0:l,new Qo(l,u,d,t.opacity)}function dL(t,e,n,o){return arguments.length===1?yM(t):new Qo(t,e,n,o??1)}function Qo(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}fy(Qo,dL,pM(Jc,{brighter(t){return t=t==null?df:Math.pow(df,t),new Qo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?kc:Math.pow(kc,t),new Qo(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,a=2*n-o;return new lo(Wg(t>=240?t-240:t+120,a,o),Wg(t,a,o),Wg(t<120?t+240:t-120,a,o),this.opacity)},clamp(){return new Qo(Pw(this.h),Od(this.s),Od(this.l),ff(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ff(this.opacity);return`${t===1?"hsl(":"hsla("}${Pw(this.h)}, ${Od(this.s)*100}%, ${Od(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Pw(t){return t=(t||0)%360,t<0?t+360:t}function Od(t){return Math.max(0,Math.min(1,t||0))}function Wg(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const hy=t=>()=>t;function fL(t,e){return function(n){return t+n*e}}function hL(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function mL(t){return(t=+t)==1?vM:function(e,n){return n-e?hL(e,n,t):hy(isNaN(e)?n:e)}}function vM(t,e){var n=e-t;return n?fL(t,n):hy(isNaN(t)?e:t)}const hf=(function t(e){var n=mL(e);function o(a,i){var l=n((a=Fp(a)).r,(i=Fp(i)).r),u=n(a.g,i.g),d=n(a.b,i.b),f=vM(a.opacity,i.opacity);return function(g){return a.r=l(g),a.g=u(g),a.b=d(g),a.opacity=f(g),a+""}}return o.gamma=t,o})(1);function gL(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),a;return function(i){for(a=0;a<n;++a)o[a]=t[a]*(1-i)+e[a]*i;return o}}function pL(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function yL(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,a=new Array(o),i=new Array(n),l;for(l=0;l<o;++l)a[l]=bc(t[l],e[l]);for(;l<n;++l)i[l]=e[l];return function(u){for(l=0;l<o;++l)i[l]=a[l](u);return i}}function vL(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function gr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function xL(t,e){var n={},o={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?n[a]=bc(t[a],e[a]):o[a]=e[a];return function(i){for(a in n)o[a]=n[a](i);return o}}var Vp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kg=new RegExp(Vp.source,"g");function bL(t){return function(){return t}}function wL(t){return function(e){return t(e)+""}}function xM(t,e){var n=Vp.lastIndex=Kg.lastIndex=0,o,a,i,l=-1,u=[],d=[];for(t=t+"",e=e+"";(o=Vp.exec(t))&&(a=Kg.exec(e));)(i=a.index)>n&&(i=e.slice(n,i),u[l]?u[l]+=i:u[++l]=i),(o=o[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,d.push({i:l,x:gr(o,a)})),n=Kg.lastIndex;return n<e.length&&(i=e.slice(n),u[l]?u[l]+=i:u[++l]=i),u.length<2?d[0]?wL(d[0].x):bL(e):(e=d.length,function(f){for(var g=0,m;g<e;++g)u[(m=d[g]).i]=m.x(f);return u.join("")})}function bc(t,e){var n=typeof e,o;return e==null||n==="boolean"?hy(e):(n==="number"?gr:n==="string"?(o=As(e))?(e=o,hf):xM:e instanceof As?hf:e instanceof Date?vL:pL(e)?gL:Array.isArray(e)?yL:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?xL:gr)(t,e)}var Lw=180/Math.PI,Up={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bM(t,e,n,o,a,i){var l,u,d;return(l=Math.sqrt(t*t+e*e))&&(t/=l,e/=l),(d=t*n+e*o)&&(n-=t*d,o-=e*d),(u=Math.sqrt(n*n+o*o))&&(n/=u,o/=u,d/=u),t*o<e*n&&(t=-t,e=-e,d=-d,l=-l),{translateX:a,translateY:i,rotate:Math.atan2(e,t)*Lw,skewX:Math.atan(d)*Lw,scaleX:l,scaleY:u}}var Ad;function SL(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Up:bM(e.a,e.b,e.c,e.d,e.e,e.f)}function CL(t){return t==null||(Ad||(Ad=document.createElementNS("http://www.w3.org/2000/svg","g")),Ad.setAttribute("transform",t),!(t=Ad.transform.baseVal.consolidate()))?Up:(t=t.matrix,bM(t.a,t.b,t.c,t.d,t.e,t.f))}function wM(t,e,n,o){function a(f){return f.length?f.pop()+" ":""}function i(f,g,m,p,x,w){if(f!==m||g!==p){var E=x.push("translate(",null,e,null,n);w.push({i:E-4,x:gr(f,m)},{i:E-2,x:gr(g,p)})}else(m||p)&&x.push("translate("+m+e+p+n)}function l(f,g,m,p){f!==g?(f-g>180?g+=360:g-f>180&&(f+=360),p.push({i:m.push(a(m)+"rotate(",null,o)-2,x:gr(f,g)})):g&&m.push(a(m)+"rotate("+g+o)}function u(f,g,m,p){f!==g?p.push({i:m.push(a(m)+"skewX(",null,o)-2,x:gr(f,g)}):g&&m.push(a(m)+"skewX("+g+o)}function d(f,g,m,p,x,w){if(f!==m||g!==p){var E=x.push(a(x)+"scale(",null,",",null,")");w.push({i:E-4,x:gr(f,m)},{i:E-2,x:gr(g,p)})}else(m!==1||p!==1)&&x.push(a(x)+"scale("+m+","+p+")")}return function(f,g){var m=[],p=[];return f=t(f),g=t(g),i(f.translateX,f.translateY,g.translateX,g.translateY,m,p),l(f.rotate,g.rotate,m,p),u(f.skewX,g.skewX,m,p),d(f.scaleX,f.scaleY,g.scaleX,g.scaleY,m,p),f=g=null,function(x){for(var w=-1,E=p.length,S;++w<E;)m[(S=p[w]).i]=S.x(x);return m.join("")}}}var EL=wM(SL,"px, ","px)","deg)"),_L=wM(CL,", ",")",")"),ML=1e-12;function $w(t){return((t=Math.exp(t))+1/t)/2}function NL(t){return((t=Math.exp(t))-1/t)/2}function RL(t){return((t=Math.exp(2*t))-1)/(t+1)}const Wd=(function t(e,n,o){function a(i,l){var u=i[0],d=i[1],f=i[2],g=l[0],m=l[1],p=l[2],x=g-u,w=m-d,E=x*x+w*w,S,M;if(E<ML)M=Math.log(p/f)/e,S=function(k){return[u+k*x,d+k*w,f*Math.exp(e*k*M)]};else{var N=Math.sqrt(E),C=(p*p-f*f+o*E)/(2*f*n*N),R=(p*p-f*f-o*E)/(2*p*n*N),D=Math.log(Math.sqrt(C*C+1)-C),T=Math.log(Math.sqrt(R*R+1)-R);M=(T-D)/e,S=function(k){var j=k*M,$=$w(D),K=f/(n*N)*($*RL(e*j+D)-NL(D));return[u+K*x,d+K*w,f*$/$w(e*j+D)]}}return S.duration=M*1e3*e/Math.SQRT2,S}return a.rho=function(i){var l=Math.max(.001,+i),u=l*l,d=u*u;return t(l,u,d)},a})(Math.SQRT2,2,4);var Gi=0,pc=0,ac=0,SM=1e3,mf,yc,gf=0,js=0,Jf=0,Ac=typeof performance=="object"&&performance.now?performance:Date,CM=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function my(){return js||(CM(DL),js=Ac.now()+Jf)}function DL(){js=0}function pf(){this._call=this._time=this._next=null}pf.prototype=EM.prototype={constructor:pf,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?my():+n)+(e==null?0:+e),!this._next&&yc!==this&&(yc?yc._next=this:mf=this,yc=this),this._call=t,this._time=n,Yp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yp())}};function EM(t,e,n){var o=new pf;return o.restart(t,e,n),o}function TL(){my(),++Gi;for(var t=mf,e;t;)(e=js-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Gi}function Hw(){js=(gf=Ac.now())+Jf,Gi=pc=0;try{TL()}finally{Gi=0,OL(),js=0}}function kL(){var t=Ac.now(),e=t-gf;e>SM&&(Jf-=e,gf=t)}function OL(){for(var t,e=mf,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:mf=n);yc=t,Yp(o)}function Yp(t){if(!Gi){pc&&(pc=clearTimeout(pc));var e=t-js;e>24?(t<1/0&&(pc=setTimeout(Hw,t-Ac.now()-Jf)),ac&&(ac=clearInterval(ac))):(ac||(gf=Ac.now(),ac=setInterval(kL,SM)),Gi=1,CM(Hw))}}function Bw(t,e,n){var o=new pf;return e=e==null?0:+e,o.restart(a=>{o.stop(),t(a+e)},e,n),o}var AL=Zf("start","end","cancel","interrupt"),jL=[],_M=0,Fw=1,Gp=2,Kd=3,Vw=4,qp=5,Xd=6;function eh(t,e,n,o,a,i){var l=t.__transition;if(!l)t.__transition={};else if(n in l)return;zL(t,n,{name:e,index:o,group:a,on:AL,tween:jL,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:_M})}function gy(t,e){var n=ir(t,e);if(n.state>_M)throw new Error("too late; already scheduled");return n}function Nr(t,e){var n=ir(t,e);if(n.state>Kd)throw new Error("too late; already running");return n}function ir(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function zL(t,e,n){var o=t.__transition,a;o[e]=n,n.timer=EM(i,0,n.time);function i(f){n.state=Fw,n.timer.restart(l,n.delay,n.time),n.delay<=f&&l(f-n.delay)}function l(f){var g,m,p,x;if(n.state!==Fw)return d();for(g in o)if(x=o[g],x.name===n.name){if(x.state===Kd)return Bw(l);x.state===Vw?(x.state=Xd,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete o[g]):+g<e&&(x.state=Xd,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete o[g])}if(Bw(function(){n.state===Kd&&(n.state=Vw,n.timer.restart(u,n.delay,n.time),u(f))}),n.state=Gp,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Gp){for(n.state=Kd,a=new Array(p=n.tween.length),g=0,m=-1;g<p;++g)(x=n.tween[g].value.call(t,t.__data__,n.index,n.group))&&(a[++m]=x);a.length=m+1}}function u(f){for(var g=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(d),n.state=qp,1),m=-1,p=a.length;++m<p;)a[m].call(t,g);n.state===qp&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=Xd,n.timer.stop(),delete o[e];for(var f in o)return;delete t.__transition}}function Zd(t,e){var n=t.__transition,o,a,i=!0,l;if(n){e=e==null?null:e+"";for(l in n){if((o=n[l]).name!==e){i=!1;continue}a=o.state>Gp&&o.state<qp,o.state=Xd,o.timer.stop(),o.on.call(a?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[l]}i&&delete t.__transition}}function IL(t){return this.each(function(){Zd(this,t)})}function PL(t,e){var n,o;return function(){var a=Nr(this,t),i=a.tween;if(i!==n){o=n=i;for(var l=0,u=o.length;l<u;++l)if(o[l].name===e){o=o.slice(),o.splice(l,1);break}}a.tween=o}}function LL(t,e,n){var o,a;if(typeof n!="function")throw new Error;return function(){var i=Nr(this,t),l=i.tween;if(l!==o){a=(o=l).slice();for(var u={name:e,value:n},d=0,f=a.length;d<f;++d)if(a[d].name===e){a[d]=u;break}d===f&&a.push(u)}i.tween=a}}function $L(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=ir(this.node(),n).tween,a=0,i=o.length,l;a<i;++a)if((l=o[a]).name===t)return l.value;return null}return this.each((e==null?PL:LL)(n,t,e))}function py(t,e,n){var o=t._id;return t.each(function(){var a=Nr(this,o);(a.value||(a.value={}))[e]=n.apply(this,arguments)}),function(a){return ir(a,o).value[e]}}function MM(t,e){var n;return(typeof e=="number"?gr:e instanceof As?hf:(n=As(e))?(e=n,hf):xM)(t,e)}function HL(t){return function(){this.removeAttribute(t)}}function BL(t){return function(){this.removeAttributeNS(t.space,t.local)}}function FL(t,e,n){var o,a=n+"",i;return function(){var l=this.getAttribute(t);return l===a?null:l===o?i:i=e(o=l,n)}}function VL(t,e,n){var o,a=n+"",i;return function(){var l=this.getAttributeNS(t.space,t.local);return l===a?null:l===o?i:i=e(o=l,n)}}function UL(t,e,n){var o,a,i;return function(){var l,u=n(this),d;return u==null?void this.removeAttribute(t):(l=this.getAttribute(t),d=u+"",l===d?null:l===o&&d===a?i:(a=d,i=e(o=l,u)))}}function YL(t,e,n){var o,a,i;return function(){var l,u=n(this),d;return u==null?void this.removeAttributeNS(t.space,t.local):(l=this.getAttributeNS(t.space,t.local),d=u+"",l===d?null:l===o&&d===a?i:(a=d,i=e(o=l,u)))}}function GL(t,e){var n=Qf(t),o=n==="transform"?_L:MM;return this.attrTween(t,typeof e=="function"?(n.local?YL:UL)(n,o,py(this,"attr."+t,e)):e==null?(n.local?BL:HL)(n):(n.local?VL:FL)(n,o,e))}function qL(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function WL(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function KL(t,e){var n,o;function a(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&WL(t,i)),n}return a._value=e,a}function XL(t,e){var n,o;function a(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&qL(t,i)),n}return a._value=e,a}function ZL(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=Qf(t);return this.tween(n,(o.local?KL:XL)(o,e))}function QL(t,e){return function(){gy(this,t).delay=+e.apply(this,arguments)}}function JL(t,e){return e=+e,function(){gy(this,t).delay=e}}function e$(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?QL:JL)(e,t)):ir(this.node(),e).delay}function t$(t,e){return function(){Nr(this,t).duration=+e.apply(this,arguments)}}function n$(t,e){return e=+e,function(){Nr(this,t).duration=e}}function o$(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?t$:n$)(e,t)):ir(this.node(),e).duration}function r$(t,e){if(typeof e!="function")throw new Error;return function(){Nr(this,t).ease=e}}function a$(t){var e=this._id;return arguments.length?this.each(r$(e,t)):ir(this.node(),e).ease}function s$(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Nr(this,t).ease=n}}function i$(t){if(typeof t!="function")throw new Error;return this.each(s$(this._id,t))}function l$(t){typeof t!="function"&&(t=oM(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var i=e[a],l=i.length,u=o[a]=[],d,f=0;f<l;++f)(d=i[f])&&t.call(d,d.__data__,f,i)&&u.push(d);return new la(o,this._parents,this._name,this._id)}function c$(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,a=n.length,i=Math.min(o,a),l=new Array(o),u=0;u<i;++u)for(var d=e[u],f=n[u],g=d.length,m=l[u]=new Array(g),p,x=0;x<g;++x)(p=d[x]||f[x])&&(m[x]=p);for(;u<o;++u)l[u]=e[u];return new la(l,this._parents,this._name,this._id)}function u$(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function d$(t,e,n){var o,a,i=u$(e)?gy:Nr;return function(){var l=i(this,t),u=l.on;u!==o&&(a=(o=u).copy()).on(e,n),l.on=a}}function f$(t,e){var n=this._id;return arguments.length<2?ir(this.node(),n).on.on(t):this.each(d$(n,t,e))}function h$(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function m$(){return this.on("end.remove",h$(this._id))}function g$(t){var e=this._name,n=this._id;typeof t!="function"&&(t=uy(t));for(var o=this._groups,a=o.length,i=new Array(a),l=0;l<a;++l)for(var u=o[l],d=u.length,f=i[l]=new Array(d),g,m,p=0;p<d;++p)(g=u[p])&&(m=t.call(g,g.__data__,p,u))&&("__data__"in g&&(m.__data__=g.__data__),f[p]=m,eh(f[p],e,n,p,f,ir(g,n)));return new la(i,this._parents,e,n)}function p$(t){var e=this._name,n=this._id;typeof t!="function"&&(t=nM(t));for(var o=this._groups,a=o.length,i=[],l=[],u=0;u<a;++u)for(var d=o[u],f=d.length,g,m=0;m<f;++m)if(g=d[m]){for(var p=t.call(g,g.__data__,m,d),x,w=ir(g,n),E=0,S=p.length;E<S;++E)(x=p[E])&&eh(x,e,n,E,p,w);i.push(p),l.push(g)}return new la(i,l,e,n)}var y$=Qc.prototype.constructor;function v$(){return new y$(this._groups,this._parents)}function x$(t,e){var n,o,a;return function(){var i=Yi(this,t),l=(this.style.removeProperty(t),Yi(this,t));return i===l?null:i===n&&l===o?a:a=e(n=i,o=l)}}function NM(t){return function(){this.style.removeProperty(t)}}function b$(t,e,n){var o,a=n+"",i;return function(){var l=Yi(this,t);return l===a?null:l===o?i:i=e(o=l,n)}}function w$(t,e,n){var o,a,i;return function(){var l=Yi(this,t),u=n(this),d=u+"";return u==null&&(d=u=(this.style.removeProperty(t),Yi(this,t))),l===d?null:l===o&&d===a?i:(a=d,i=e(o=l,u))}}function S$(t,e){var n,o,a,i="style."+e,l="end."+i,u;return function(){var d=Nr(this,t),f=d.on,g=d.value[i]==null?u||(u=NM(e)):void 0;(f!==n||a!==g)&&(o=(n=f).copy()).on(l,a=g),d.on=o}}function C$(t,e,n){var o=(t+="")=="transform"?EL:MM;return e==null?this.styleTween(t,x$(t,o)).on("end.style."+t,NM(t)):typeof e=="function"?this.styleTween(t,w$(t,o,py(this,"style."+t,e))).each(S$(this._id,t)):this.styleTween(t,b$(t,o,e),n).on("end.style."+t,null)}function E$(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function _$(t,e,n){var o,a;function i(){var l=e.apply(this,arguments);return l!==a&&(o=(a=l)&&E$(t,l,n)),o}return i._value=e,i}function M$(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,_$(t,e,n??""))}function N$(t){return function(){this.textContent=t}}function R$(t){return function(){var e=t(this);this.textContent=e??""}}function D$(t){return this.tween("text",typeof t=="function"?R$(py(this,"text",t)):N$(t==null?"":t+""))}function T$(t){return function(e){this.textContent=t.call(this,e)}}function k$(t){var e,n;function o(){var a=t.apply(this,arguments);return a!==n&&(e=(n=a)&&T$(a)),e}return o._value=t,o}function O$(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,k$(t))}function A$(){for(var t=this._name,e=this._id,n=RM(),o=this._groups,a=o.length,i=0;i<a;++i)for(var l=o[i],u=l.length,d,f=0;f<u;++f)if(d=l[f]){var g=ir(d,e);eh(d,t,n,f,l,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new la(o,this._parents,t,n)}function j$(){var t,e,n=this,o=n._id,a=n.size();return new Promise(function(i,l){var u={value:l},d={value:function(){--a===0&&i()}};n.each(function(){var f=Nr(this,o),g=f.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(d)),f.on=e}),a===0&&i()})}var z$=0;function la(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function RM(){return++z$}var Zr=Qc.prototype;la.prototype={constructor:la,select:g$,selectAll:p$,selectChild:Zr.selectChild,selectChildren:Zr.selectChildren,filter:l$,merge:c$,selection:v$,transition:A$,call:Zr.call,nodes:Zr.nodes,node:Zr.node,size:Zr.size,empty:Zr.empty,each:Zr.each,on:f$,attr:GL,attrTween:ZL,style:C$,styleTween:M$,text:D$,textTween:O$,remove:m$,tween:$L,delay:e$,duration:o$,ease:a$,easeVarying:i$,end:j$,[Symbol.iterator]:Zr[Symbol.iterator]};function I$(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var P$={time:null,delay:0,duration:250,ease:I$};function L$(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function $$(t){var e,n;t instanceof la?(e=t._id,t=t._name):(e=RM(),(n=P$).time=my(),t=t==null?null:t+"");for(var o=this._groups,a=o.length,i=0;i<a;++i)for(var l=o[i],u=l.length,d,f=0;f<u;++f)(d=l[f])&&eh(d,t,e,f,l,n||L$(d,e));return new la(o,this._parents,t,e)}Qc.prototype.interrupt=IL;Qc.prototype.transition=$$;const jd=t=>()=>t;function H$(t,{sourceEvent:e,target:n,transform:o,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function Jr(t,e,n){this.k=t,this.x=e,this.y=n}Jr.prototype={constructor:Jr,scale:function(t){return t===1?this:new Jr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Jr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var th=new Jr(1,0,0);DM.prototype=Jr.prototype;function DM(t){for(;!t.__zoom;)if(!(t=t.parentNode))return th;return t.__zoom}function Xg(t){t.stopImmediatePropagation()}function sc(t){t.preventDefault(),t.stopImmediatePropagation()}function B$(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function F$(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Uw(){return this.__zoom||th}function V$(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function U$(){return navigator.maxTouchPoints||"ontouchstart"in this}function Y$(t,e,n){var o=t.invertX(e[0][0])-n[0][0],a=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],l=t.invertY(e[1][1])-n[1][1];return t.translate(a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function TM(){var t=B$,e=F$,n=Y$,o=V$,a=U$,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,d=Wd,f=Zf("start","zoom","end"),g,m,p,x=500,w=150,E=0,S=10;function M(P){P.property("__zoom",Uw).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",K).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}M.transform=function(P,q,A,B){var L=P.selection?P.selection():P;L.property("__zoom",Uw),P!==L?D(P,q,A,B):L.interrupt().each(function(){T(this,arguments).event(B).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},M.scaleBy=function(P,q,A,B){M.scaleTo(P,function(){var L=this.__zoom.k,F=typeof q=="function"?q.apply(this,arguments):q;return L*F},A,B)},M.scaleTo=function(P,q,A,B){M.transform(P,function(){var L=e.apply(this,arguments),F=this.__zoom,X=A==null?R(L):typeof A=="function"?A.apply(this,arguments):A,I=F.invert(X),z=typeof q=="function"?q.apply(this,arguments):q;return n(C(N(F,z),X,I),L,l)},A,B)},M.translateBy=function(P,q,A,B){M.transform(P,function(){return n(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof A=="function"?A.apply(this,arguments):A),e.apply(this,arguments),l)},null,B)},M.translateTo=function(P,q,A,B,L){M.transform(P,function(){var F=e.apply(this,arguments),X=this.__zoom,I=B==null?R(F):typeof B=="function"?B.apply(this,arguments):B;return n(th.translate(I[0],I[1]).scale(X.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof A=="function"?-A.apply(this,arguments):-A),F,l)},B,L)};function N(P,q){return q=Math.max(i[0],Math.min(i[1],q)),q===P.k?P:new Jr(q,P.x,P.y)}function C(P,q,A){var B=q[0]-A[0]*P.k,L=q[1]-A[1]*P.k;return B===P.x&&L===P.y?P:new Jr(P.k,B,L)}function R(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function D(P,q,A,B){P.on("start.zoom",function(){T(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(B).end()}).tween("zoom",function(){var L=this,F=arguments,X=T(L,F).event(B),I=e.apply(L,F),z=A==null?R(I):typeof A=="function"?A.apply(L,F):A,H=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),G=L.__zoom,J=typeof q=="function"?q.apply(L,F):q,ae=d(G.invert(z).concat(H/G.k),J.invert(z).concat(H/J.k));return function(W){if(W===1)W=J;else{var ee=ae(W),oe=H/ee[2];W=new Jr(oe,z[0]-ee[0]*oe,z[1]-ee[1]*oe)}X.zoom(null,W)}})}function T(P,q,A){return!A&&P.__zooming||new k(P,q)}function k(P,q){this.that=P,this.args=q,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,q),this.taps=0}k.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,q){return this.mouse&&P!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var q=Co(this.that).datum();f.call(P,this.that,new H$(P,{sourceEvent:this.sourceEvent,target:M,transform:this.that.__zoom,dispatch:f}),q)}};function j(P,...q){if(!t.apply(this,arguments))return;var A=T(this,q).event(P),B=this.__zoom,L=Math.max(i[0],Math.min(i[1],B.k*Math.pow(2,o.apply(this,arguments)))),F=Zo(P);if(A.wheel)(A.mouse[0][0]!==F[0]||A.mouse[0][1]!==F[1])&&(A.mouse[1]=B.invert(A.mouse[0]=F)),clearTimeout(A.wheel);else{if(B.k===L)return;A.mouse=[F,B.invert(F)],Zd(this),A.start()}sc(P),A.wheel=setTimeout(X,w),A.zoom("mouse",n(C(N(B,L),A.mouse[0],A.mouse[1]),A.extent,l));function X(){A.wheel=null,A.end()}}function $(P,...q){if(p||!t.apply(this,arguments))return;var A=P.currentTarget,B=T(this,q,!0).event(P),L=Co(P.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",H,!0),F=Zo(P,A),X=P.clientX,I=P.clientY;hM(P.view),Xg(P),B.mouse=[F,this.__zoom.invert(F)],Zd(this),B.start();function z(G){if(sc(G),!B.moved){var J=G.clientX-X,ae=G.clientY-I;B.moved=J*J+ae*ae>E}B.event(G).zoom("mouse",n(C(B.that.__zoom,B.mouse[0]=Zo(G,A),B.mouse[1]),B.extent,l))}function H(G){L.on("mousemove.zoom mouseup.zoom",null),mM(G.view,B.moved),sc(G),B.event(G).end()}}function K(P,...q){if(t.apply(this,arguments)){var A=this.__zoom,B=Zo(P.changedTouches?P.changedTouches[0]:P,this),L=A.invert(B),F=A.k*(P.shiftKey?.5:2),X=n(C(N(A,F),B,L),e.apply(this,q),l);sc(P),u>0?Co(this).transition().duration(u).call(D,X,B,P):Co(this).call(M.transform,X,B,P)}}function U(P,...q){if(t.apply(this,arguments)){var A=P.touches,B=A.length,L=T(this,q,P.changedTouches.length===B).event(P),F,X,I,z;for(Xg(P),X=0;X<B;++X)I=A[X],z=Zo(I,this),z=[z,this.__zoom.invert(z),I.identifier],L.touch0?!L.touch1&&L.touch0[2]!==z[2]&&(L.touch1=z,L.taps=0):(L.touch0=z,F=!0,L.taps=1+!!g);g&&(g=clearTimeout(g)),F&&(L.taps<2&&(m=z[0],g=setTimeout(function(){g=null},x)),Zd(this),L.start())}}function Y(P,...q){if(this.__zooming){var A=T(this,q).event(P),B=P.changedTouches,L=B.length,F,X,I,z;for(sc(P),F=0;F<L;++F)X=B[F],I=Zo(X,this),A.touch0&&A.touch0[2]===X.identifier?A.touch0[0]=I:A.touch1&&A.touch1[2]===X.identifier&&(A.touch1[0]=I);if(X=A.that.__zoom,A.touch1){var H=A.touch0[0],G=A.touch0[1],J=A.touch1[0],ae=A.touch1[1],W=(W=J[0]-H[0])*W+(W=J[1]-H[1])*W,ee=(ee=ae[0]-G[0])*ee+(ee=ae[1]-G[1])*ee;X=N(X,Math.sqrt(W/ee)),I=[(H[0]+J[0])/2,(H[1]+J[1])/2],z=[(G[0]+ae[0])/2,(G[1]+ae[1])/2]}else if(A.touch0)I=A.touch0[0],z=A.touch0[1];else return;A.zoom("touch",n(C(X,I,z),A.extent,l))}}function Z(P,...q){if(this.__zooming){var A=T(this,q).event(P),B=P.changedTouches,L=B.length,F,X;for(Xg(P),p&&clearTimeout(p),p=setTimeout(function(){p=null},x),F=0;F<L;++F)X=B[F],A.touch0&&A.touch0[2]===X.identifier?delete A.touch0:A.touch1&&A.touch1[2]===X.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(X=Zo(X,this),Math.hypot(m[0]-X[0],m[1]-X[1])<S)){var I=Co(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return M.wheelDelta=function(P){return arguments.length?(o=typeof P=="function"?P:jd(+P),M):o},M.filter=function(P){return arguments.length?(t=typeof P=="function"?P:jd(!!P),M):t},M.touchable=function(P){return arguments.length?(a=typeof P=="function"?P:jd(!!P),M):a},M.extent=function(P){return arguments.length?(e=typeof P=="function"?P:jd([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),M):e},M.scaleExtent=function(P){return arguments.length?(i[0]=+P[0],i[1]=+P[1],M):[i[0],i[1]]},M.translateExtent=function(P){return arguments.length?(l[0][0]=+P[0][0],l[1][0]=+P[1][0],l[0][1]=+P[0][1],l[1][1]=+P[1][1],M):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},M.constrain=function(P){return arguments.length?(n=P,M):n},M.duration=function(P){return arguments.length?(u=+P,M):u},M.interpolate=function(P){return arguments.length?(d=P,M):d},M.on=function(){var P=f.on.apply(f,arguments);return P===f?M:P},M.clickDistance=function(P){return arguments.length?(E=(P=+P)*P,M):Math.sqrt(E)},M.tapDistance=function(P){return arguments.length?(S=+P,M):S},M}const Cr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:o}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},jc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],kM=["Enter"," ","Escape"],OM={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var qi;(function(t){t.Strict="strict",t.Loose="loose"})(qi||(qi={}));var Ns;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ns||(Ns={}));var zc;(function(t){t.Partial="partial",t.Full="full"})(zc||(zc={}));const AM={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ba;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Ba||(Ba={}));var yf;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(yf||(yf={}));var qe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(qe||(qe={}));const Yw={[qe.Left]:qe.Right,[qe.Right]:qe.Left,[qe.Top]:qe.Bottom,[qe.Bottom]:qe.Top};function jM(t){return t===null?null:t?"valid":"invalid"}const zM=t=>"id"in t&&"source"in t&&"target"in t,G$=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),yy=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),eu=(t,e=[0,0])=>{const{width:n,height:o}=ua(t),a=t.origin??e,i=n*a[0],l=o*a[1];return{x:t.position.x-i,y:t.position.y-l}},q$=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,a)=>{const i=typeof a=="string";let l=!e.nodeLookup&&!i?a:void 0;e.nodeLookup&&(l=i?e.nodeLookup.get(a):yy(a)?a:e.nodeLookup.get(a.id));const u=l?vf(l,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return nh(o,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return oh(n)},tu=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(a=>{(e.filter===void 0||e.filter(a))&&(n=nh(n,vf(a)),o=!0)}),o?oh(n):{x:0,y:0,width:0,height:0}},vy=(t,e,[n,o,a]=[0,0,1],i=!1,l=!1)=>{const u={...ou(e,[n,o,a]),width:e.width/a,height:e.height/a},d=[];for(const f of t.values()){const{measured:g,selectable:m=!0,hidden:p=!1}=f;if(l&&!m||p)continue;const x=g.width??f.width??f.initialWidth??null,w=g.height??f.height??f.initialHeight??null,E=Ic(u,Ki(f)),S=(x??0)*(w??0),M=i&&E>0;(!f.internals.handleBounds||M||E>=S||f.dragging)&&d.push(f)}return d},W$=(t,e)=>{const n=new Set;return t.forEach(o=>{n.add(o.id)}),e.filter(o=>n.has(o.source)||n.has(o.target))};function K$(t,e){const n=new Map,o=e?.nodes?new Set(e.nodes.map(a=>a.id)):null;return t.forEach(a=>{a.measured.width&&a.measured.height&&(e?.includeHiddenNodes||!a.hidden)&&(!o||o.has(a.id))&&n.set(a.id,a)}),n}async function X$({nodes:t,width:e,height:n,panZoom:o,minZoom:a,maxZoom:i},l){if(t.size===0)return Promise.resolve(!0);const u=K$(t,l),d=tu(u),f=xy(d,e,n,l?.minZoom??a,l?.maxZoom??i,l?.padding??.1);return await o.setViewport(f,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function IM({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:a,onError:i}){const l=n.get(t),u=l.parentId?n.get(l.parentId):void 0,{x:d,y:f}=u?u.internals.positionAbsolute:{x:0,y:0},g=l.origin??o;let m=l.extent||a;if(l.extent==="parent"&&!l.expandParent)if(!u)i?.("005",Cr.error005());else{const x=u.measured.width,w=u.measured.height;x&&w&&(m=[[d,f],[d+x,f+w]])}else u&&Xi(l.extent)&&(m=[[l.extent[0][0]+d,l.extent[0][1]+f],[l.extent[1][0]+d,l.extent[1][1]+f]]);const p=Xi(m)?zs(e,m,l.measured):e;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Cr.error015()),{position:{x:p.x-d+(l.measured.width??0)*g[0],y:p.y-f+(l.measured.height??0)*g[1]},positionAbsolute:p}}async function Z$({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:a}){const i=new Set(t.map(p=>p.id)),l=[];for(const p of n){if(p.deletable===!1)continue;const x=i.has(p.id),w=!x&&p.parentId&&l.find(E=>E.id===p.parentId);(x||w)&&l.push(p)}const u=new Set(e.map(p=>p.id)),d=o.filter(p=>p.deletable!==!1),g=W$(l,d);for(const p of d)u.has(p.id)&&!g.find(w=>w.id===p.id)&&g.push(p);if(!a)return{edges:g,nodes:l};const m=await a({nodes:l,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:l}:{edges:[],nodes:[]}:m}const Wi=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),zs=(t={x:0,y:0},e,n)=>({x:Wi(t.x,e[0][0],e[1][0]-(n?.width??0)),y:Wi(t.y,e[0][1],e[1][1]-(n?.height??0))});function PM(t,e,n){const{width:o,height:a}=ua(n),{x:i,y:l}=n.internals.positionAbsolute;return zs(t,[[i,l],[i+o,l+a]],e)}const Gw=(t,e,n)=>t<e?Wi(Math.abs(t-e),1,e)/e:t>n?-Wi(Math.abs(t-n),1,e)/e:0,LM=(t,e,n=15,o=40)=>{const a=Gw(t.x,o,e.width-o)*n,i=Gw(t.y,o,e.height-o)*n;return[a,i]},nh=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),Wp=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),oh=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),Ki=(t,e=[0,0])=>{const{x:n,y:o}=yy(t)?t.internals.positionAbsolute:eu(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},vf=(t,e=[0,0])=>{const{x:n,y:o}=yy(t)?t.internals.positionAbsolute:eu(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},$M=(t,e)=>oh(nh(Wp(t),Wp(e))),Ic=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},qw=t=>Jo(t.width)&&Jo(t.height)&&Jo(t.x)&&Jo(t.y),Jo=t=>!isNaN(t)&&isFinite(t),Q$=(t,e)=>{},nu=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),ou=({x:t,y:e},[n,o,a],i=!1,l=[1,1])=>{const u={x:(t-n)/a,y:(e-o)/a};return i?nu(u,l):u},xf=({x:t,y:e},[n,o,a])=>({x:t*a+n,y:e*a+o});function Mi(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function J$(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=Mi(t,n),a=Mi(t,e);return{top:o,right:a,bottom:o,left:a,x:a*2,y:o*2}}if(typeof t=="object"){const o=Mi(t.top??t.y??0,n),a=Mi(t.bottom??t.y??0,n),i=Mi(t.left??t.x??0,e),l=Mi(t.right??t.x??0,e);return{top:o,right:l,bottom:a,left:i,x:i+l,y:o+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function e9(t,e,n,o,a,i){const{x:l,y:u}=xf(t,[e,n,o]),{x:d,y:f}=xf({x:t.x+t.width,y:t.y+t.height},[e,n,o]),g=a-d,m=i-f;return{left:Math.floor(l),top:Math.floor(u),right:Math.floor(g),bottom:Math.floor(m)}}const xy=(t,e,n,o,a,i)=>{const l=J$(i,e,n),u=(e-l.x)/t.width,d=(n-l.y)/t.height,f=Math.min(u,d),g=Wi(f,o,a),m=t.x+t.width/2,p=t.y+t.height/2,x=e/2-m*g,w=n/2-p*g,E=e9(t,x,w,g,e,n),S={left:Math.min(E.left-l.left,0),top:Math.min(E.top-l.top,0),right:Math.min(E.right-l.right,0),bottom:Math.min(E.bottom-l.bottom,0)};return{x:x-S.left+S.right,y:w-S.top+S.bottom,zoom:g}},Pc=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Xi(t){return t!=null&&t!=="parent"}function ua(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function HM(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function BM(t,e={width:0,height:0},n,o,a){const i={...t},l=o.get(n);if(l){const u=l.origin||a;i.x+=l.internals.positionAbsolute.x-(e.width??0)*u[0],i.y+=l.internals.positionAbsolute.y-(e.height??0)*u[1]}return i}function Ww(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function t9(){let t,e;return{promise:new Promise((o,a)=>{t=o,e=a}),resolve:t,reject:e}}function n9(t){return{...OM,...t||{}}}function wc(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:a}){const{x:i,y:l}=er(t),u=ou({x:i-(a?.left??0),y:l-(a?.top??0)},o),{x:d,y:f}=n?nu(u,e):u;return{xSnapped:d,ySnapped:f,...u}}const by=t=>({width:t.offsetWidth,height:t.offsetHeight}),FM=t=>t?.getRootNode?.()||window?.document,o9=["INPUT","SELECT","TEXTAREA"];function VM(t){const e=t.composedPath?.()?.[0]||t.target;return e?.nodeType!==1?!1:o9.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const UM=t=>"clientX"in t,er=(t,e)=>{const n=UM(t),o=n?t.clientX:t.touches?.[0].clientX,a=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:a-(e?.top??0)}},Kw=(t,e,n,o,a)=>{const i=e.querySelectorAll(`.${t}`);return!i||!i.length?null:Array.from(i).map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:t,nodeId:a,position:l.getAttribute("data-handlepos"),x:(u.left-n.left)/o,y:(u.top-n.top)/o,...by(l)}})};function YM({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:a,sourceControlY:i,targetControlX:l,targetControlY:u}){const d=t*.125+a*.375+l*.375+n*.125,f=e*.125+i*.375+u*.375+o*.125,g=Math.abs(d-t),m=Math.abs(f-e);return[d,f,g,m]}function zd(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function Xw({pos:t,x1:e,y1:n,x2:o,y2:a,c:i}){switch(t){case qe.Left:return[e-zd(e-o,i),n];case qe.Right:return[e+zd(o-e,i),n];case qe.Top:return[e,n-zd(n-a,i)];case qe.Bottom:return[e,n+zd(a-n,i)]}}function GM({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:a,targetPosition:i=qe.Top,curvature:l=.25}){const[u,d]=Xw({pos:n,x1:t,y1:e,x2:o,y2:a,c:l}),[f,g]=Xw({pos:i,x1:o,y1:a,x2:t,y2:e,c:l}),[m,p,x,w]=YM({sourceX:t,sourceY:e,targetX:o,targetY:a,sourceControlX:u,sourceControlY:d,targetControlX:f,targetControlY:g});return[`M${t},${e} C${u},${d} ${f},${g} ${o},${a}`,m,p,x,w]}function qM({sourceX:t,sourceY:e,targetX:n,targetY:o}){const a=Math.abs(n-t)/2,i=n<t?n+a:n-a,l=Math.abs(o-e)/2,u=o<e?o+l:o-l;return[i,u,a,l]}function r9({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:a=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const l=a&&n?o+1e3:o,u=Math.max(t.parentId||a&&t.selected?t.internals.z:0,e.parentId||a&&e.selected?e.internals.z:0);return l+u}function a9({sourceNode:t,targetNode:e,width:n,height:o,transform:a}){const i=nh(vf(t),vf(e));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:o/a[2]};return Ic(l,oh(i))>0}const s9=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,i9=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),l9=(t,e,n={})=>{if(!t.source||!t.target)return e;const o=n.getEdgeId||s9;let a;return zM(t)?a={...t}:a={...t,id:o(t)},i9(a,e)?e:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,e.concat(a))};function WM({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[a,i,l,u]=qM({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,a,i,l,u]}const Zw={[qe.Left]:{x:-1,y:0},[qe.Right]:{x:1,y:0},[qe.Top]:{x:0,y:-1},[qe.Bottom]:{x:0,y:1}},c9=({source:t,sourcePosition:e=qe.Bottom,target:n})=>e===qe.Left||e===qe.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},Qw=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function u9({source:t,sourcePosition:e=qe.Bottom,target:n,targetPosition:o=qe.Top,center:a,offset:i,stepPosition:l}){const u=Zw[e],d=Zw[o],f={x:t.x+u.x*i,y:t.y+u.y*i},g={x:n.x+d.x*i,y:n.y+d.y*i},m=c9({source:f,sourcePosition:e,target:g}),p=m.x!==0?"x":"y",x=m[p];let w=[],E,S;const M={x:0,y:0},N={x:0,y:0},[,,C,R]=qM({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(u[p]*d[p]===-1){p==="x"?(E=a.x??f.x+(g.x-f.x)*l,S=a.y??(f.y+g.y)/2):(E=a.x??(f.x+g.x)/2,S=a.y??f.y+(g.y-f.y)*l);const T=[{x:E,y:f.y},{x:E,y:g.y}],k=[{x:f.x,y:S},{x:g.x,y:S}];u[p]===x?w=p==="x"?T:k:w=p==="x"?k:T}else{const T=[{x:f.x,y:g.y}],k=[{x:g.x,y:f.y}];if(p==="x"?w=u.x===x?k:T:w=u.y===x?T:k,e===o){const Y=Math.abs(t[p]-n[p]);if(Y<=i){const Z=Math.min(i-1,i-Y);u[p]===x?M[p]=(f[p]>t[p]?-1:1)*Z:N[p]=(g[p]>n[p]?-1:1)*Z}}if(e!==o){const Y=p==="x"?"y":"x",Z=u[p]===d[Y],P=f[Y]>g[Y],q=f[Y]<g[Y];(u[p]===1&&(!Z&&P||Z&&q)||u[p]!==1&&(!Z&&q||Z&&P))&&(w=p==="x"?T:k)}const j={x:f.x+M.x,y:f.y+M.y},$={x:g.x+N.x,y:g.y+N.y},K=Math.max(Math.abs(j.x-w[0].x),Math.abs($.x-w[0].x)),U=Math.max(Math.abs(j.y-w[0].y),Math.abs($.y-w[0].y));K>=U?(E=(j.x+$.x)/2,S=w[0].y):(E=w[0].x,S=(j.y+$.y)/2)}return[[t,{x:f.x+M.x,y:f.y+M.y},...w,{x:g.x+N.x,y:g.y+N.y},n],E,S,C,R]}function d9(t,e,n,o){const a=Math.min(Qw(t,e)/2,Qw(e,n)/2,o),{x:i,y:l}=e;if(t.x===i&&i===n.x||t.y===l&&l===n.y)return`L${i} ${l}`;if(t.y===l){const f=t.x<n.x?-1:1,g=t.y<n.y?1:-1;return`L ${i+a*f},${l}Q ${i},${l} ${i},${l+a*g}`}const u=t.x<n.x?1:-1,d=t.y<n.y?-1:1;return`L ${i},${l+a*d}Q ${i},${l} ${i+a*u},${l}`}function Kp({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:a,targetPosition:i=qe.Top,borderRadius:l=5,centerX:u,centerY:d,offset:f=20,stepPosition:g=.5}){const[m,p,x,w,E]=u9({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:a},targetPosition:i,center:{x:u,y:d},offset:f,stepPosition:g});return[m.reduce((M,N,C)=>{let R="";return C>0&&C<m.length-1?R=d9(m[C-1],N,m[C+1],l):R=`${C===0?"M":"L"}${N.x} ${N.y}`,M+=R,M},""),p,x,w,E]}function Jw(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function f9(t){const{sourceNode:e,targetNode:n}=t;if(!Jw(e)||!Jw(n))return null;const o=e.internals.handleBounds||eS(e.handles),a=n.internals.handleBounds||eS(n.handles),i=tS(o?.source??[],t.sourceHandle),l=tS(t.connectionMode===qi.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),t.targetHandle);if(!i||!l)return t.onError?.("008",Cr.error008(i?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const u=i?.position||qe.Bottom,d=l?.position||qe.Top,f=Is(e,i,u),g=Is(n,l,d);return{sourceX:f.x,sourceY:f.y,targetX:g.x,targetY:g.y,sourcePosition:u,targetPosition:d}}function eS(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,o.type==="source"?e.push(o):o.type==="target"&&n.push(o);return{source:e,target:n}}function Is(t,e,n=qe.Left,o=!1){const a=(e?.x??0)+t.internals.positionAbsolute.x,i=(e?.y??0)+t.internals.positionAbsolute.y,{width:l,height:u}=e??ua(t);if(o)return{x:a+l/2,y:i+u/2};switch(e?.position??n){case qe.Top:return{x:a+l/2,y:i};case qe.Right:return{x:a+l,y:i+u/2};case qe.Bottom:return{x:a+l/2,y:i+u};case qe.Left:return{x:a,y:i+u/2}}}function tS(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function Xp(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function h9(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:a}){const i=new Set;return t.reduce((l,u)=>([u.markerStart||o,u.markerEnd||a].forEach(d=>{if(d&&typeof d=="object"){const f=Xp(d,e);i.has(f)||(l.push({id:f,color:d.color||n,...d}),i.add(f))}}),l),[]).sort((l,u)=>l.id.localeCompare(u.id))}const KM=1e3,m9=10,wy={nodeOrigin:[0,0],nodeExtent:jc,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},g9={...wy,checkEquality:!0};function Sy(t,e){const n={...t};for(const o in e)e[o]!==void 0&&(n[o]=e[o]);return n}function p9(t,e,n){const o=Sy(wy,n);for(const a of t.values())if(a.parentId)Ey(a,t,e,o);else{const i=eu(a,o.nodeOrigin),l=Xi(a.extent)?a.extent:o.nodeExtent,u=zs(i,l,ua(a));a.internals.positionAbsolute=u}}function y9(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;const n=[],o=[];for(const a of t.handles){const i={id:a.id,width:a.width??1,height:a.height??1,nodeId:t.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&o.push(i)}return{source:n,target:o}}function Cy(t){return t==="manual"}function Zp(t,e,n,o={}){const a=Sy(g9,o),i={i:0},l=new Map(e),u=a?.elevateNodesOnSelect&&!Cy(a.zIndexMode)?KM:0;let d=t.length>0;e.clear(),n.clear();for(const f of t){let g=l.get(f.id);if(a.checkEquality&&f===g?.internals.userNode)e.set(f.id,g);else{const m=eu(f,a.nodeOrigin),p=Xi(f.extent)?f.extent:a.nodeExtent,x=zs(m,p,ua(f));g={...a.defaults,...f,measured:{width:f.measured?.width,height:f.measured?.height},internals:{positionAbsolute:x,handleBounds:y9(f,g),z:XM(f,u,a.zIndexMode),userNode:f}},e.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(d=!1),f.parentId&&Ey(g,e,n,o,i)}return d}function v9(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Ey(t,e,n,o,a){const{elevateNodesOnSelect:i,nodeOrigin:l,nodeExtent:u,zIndexMode:d}=Sy(wy,o),f=t.parentId,g=e.get(f);if(!g){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}v9(t,n),a&&!g.parentId&&g.internals.rootParentIndex===void 0&&d==="auto"&&(g.internals.rootParentIndex=++a.i,g.internals.z=g.internals.z+a.i*m9),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=i&&!Cy(d)?KM:0,{x:p,y:x,z:w}=x9(t,g,l,u,m,d),{positionAbsolute:E}=t.internals,S=p!==E.x||x!==E.y;(S||w!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:S?{x:p,y:x}:E,z:w}})}function XM(t,e,n){const o=Jo(t.zIndex)?t.zIndex:0;return Cy(n)?o:o+(t.selected?e:0)}function x9(t,e,n,o,a,i){const{x:l,y:u}=e.internals.positionAbsolute,d=ua(t),f=eu(t,n),g=Xi(t.extent)?zs(f,t.extent,d):f;let m=zs({x:l+g.x,y:u+g.y},o,d);t.extent==="parent"&&(m=PM(m,d,e));const p=XM(t,a,i),x=e.internals.z??0;return{x:m.x,y:m.y,z:x>=p?x+1:p}}function _y(t,e,n,o=[0,0]){const a=[],i=new Map;for(const l of t){const u=e.get(l.parentId);if(!u)continue;const d=i.get(l.parentId)?.expandedRect??Ki(u),f=$M(d,l.rect);i.set(l.parentId,{expandedRect:f,parent:u})}return i.size>0&&i.forEach(({expandedRect:l,parent:u},d)=>{const f=u.internals.positionAbsolute,g=ua(u),m=u.origin??o,p=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,x=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,w=Math.max(g.width,Math.round(l.width)),E=Math.max(g.height,Math.round(l.height)),S=(w-g.width)*m[0],M=(E-g.height)*m[1];(p>0||x>0||S||M)&&(a.push({id:d,type:"position",position:{x:u.position.x-p+S,y:u.position.y-x+M}}),n.get(d)?.forEach(N=>{t.some(C=>C.id===N.id)||a.push({id:N.id,type:"position",position:{x:N.position.x+p,y:N.position.y+x}})})),(g.width<l.width||g.height<l.height||p||x)&&a.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:w+(p?m[0]*p-S:0),height:E+(x?m[1]*x-M:0)}})}),a}function b9(t,e,n,o,a,i,l){const u=o?.querySelector(".xyflow__viewport");let d=!1;if(!u)return{changes:[],updatedInternals:d};const f=[],g=window.getComputedStyle(u),{m22:m}=new window.DOMMatrixReadOnly(g.transform),p=[];for(const x of t.values()){const w=e.get(x.id);if(!w)continue;if(w.hidden){e.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),d=!0;continue}const E=by(x.nodeElement),S=w.measured.width!==E.width||w.measured.height!==E.height;if(!!(E.width&&E.height&&(S||!w.internals.handleBounds||x.force))){const N=x.nodeElement.getBoundingClientRect(),C=Xi(w.extent)?w.extent:i;let{positionAbsolute:R}=w.internals;w.parentId&&w.extent==="parent"?R=PM(R,E,e.get(w.parentId)):C&&(R=zs(R,C,E));const D={...w,measured:E,internals:{...w.internals,positionAbsolute:R,handleBounds:{source:Kw("source",x.nodeElement,N,m,w.id),target:Kw("target",x.nodeElement,N,m,w.id)}}};e.set(w.id,D),w.parentId&&Ey(D,e,n,{nodeOrigin:a,zIndexMode:l}),d=!0,S&&(f.push({id:w.id,type:"dimensions",dimensions:E}),w.expandParent&&w.parentId&&p.push({id:w.id,parentId:w.parentId,rect:Ki(D,a)}))}}if(p.length>0){const x=_y(p,e,n,a);f.push(...x)}return{changes:f,updatedInternals:d}}async function w9({delta:t,panZoom:e,transform:n,translateExtent:o,width:a,height:i}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const l=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[a,i]],o),u=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(u)}function nS(t,e,n,o,a,i){let l=a;const u=o.get(l)||new Map;o.set(l,u.set(n,e)),l=`${a}-${t}`;const d=o.get(l)||new Map;if(o.set(l,d.set(n,e)),i){l=`${a}-${t}-${i}`;const f=o.get(l)||new Map;o.set(l,f.set(n,e))}}function ZM(t,e,n){t.clear(),e.clear();for(const o of n){const{source:a,target:i,sourceHandle:l=null,targetHandle:u=null}=o,d={edgeId:o.id,source:a,target:i,sourceHandle:l,targetHandle:u},f=`${a}-${l}--${i}-${u}`,g=`${i}-${u}--${a}-${l}`;nS("source",d,g,t,a,l),nS("target",d,f,t,i,u),e.set(o.id,o)}}function QM(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:QM(n,e):!1}function oS(t,e,n){let o=t;do{if(o?.matches?.(e))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function S9(t,e,n,o){const a=new Map;for(const[i,l]of t)if((l.selected||l.id===o)&&(!l.parentId||!QM(l,t))&&(l.draggable||e&&typeof l.draggable>"u")){const u=t.get(i);u&&a.set(i,{id:i,position:u.position||{x:0,y:0},distance:{x:n.x-u.internals.positionAbsolute.x,y:n.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return a}function Zg({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){const a=[];for(const[l,u]of e){const d=n.get(l)?.internals.userNode;d&&a.push({...d,position:u.position,dragging:o})}if(!t)return[a[0],a];const i=n.get(t)?.internals.userNode;return[i?{...i,position:e.get(t)?.position||i.position,dragging:o}:a[0],a]}function C9({dragItems:t,snapGrid:e,x:n,y:o}){const a=t.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:o-a.distance.y},l=nu(i,e);return{x:l.x-i.x,y:l.y-i.y}}function E9({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:a}){let i={x:null,y:null},l=0,u=new Map,d=!1,f={x:0,y:0},g=null,m=!1,p=null,x=!1,w=!1,E=null;function S({noDragClassName:N,handleSelector:C,domNode:R,isSelectable:D,nodeId:T,nodeClickDistance:k=0}){p=Co(R);function j({x:Y,y:Z}){const{nodeLookup:P,nodeExtent:q,snapGrid:A,snapToGrid:B,nodeOrigin:L,onNodeDrag:F,onSelectionDrag:X,onError:I,updateNodePositions:z}=e();i={x:Y,y:Z};let H=!1;const G=u.size>1,J=G&&q?Wp(tu(u)):null,ae=G&&B?C9({dragItems:u,snapGrid:A,x:Y,y:Z}):null;for(const[W,ee]of u){if(!P.has(W))continue;let oe={x:Y-ee.distance.x,y:Z-ee.distance.y};B&&(oe=ae?{x:Math.round(oe.x+ae.x),y:Math.round(oe.y+ae.y)}:nu(oe,A));let de=null;if(G&&q&&!ee.extent&&J){const{positionAbsolute:_e}=ee.internals,De=_e.x-J.x+q[0][0],Ye=_e.x+ee.measured.width-J.x2+q[1][0],Pe=_e.y-J.y+q[0][1],mt=_e.y+ee.measured.height-J.y2+q[1][1];de=[[De,Pe],[Ye,mt]]}const{position:ge,positionAbsolute:ne}=IM({nodeId:W,nextPosition:oe,nodeLookup:P,nodeExtent:de||q,nodeOrigin:L,onError:I});H=H||ee.position.x!==ge.x||ee.position.y!==ge.y,ee.position=ge,ee.internals.positionAbsolute=ne}if(w=w||H,!!H&&(z(u,!0),E&&(o||F||!T&&X))){const[W,ee]=Zg({nodeId:T,dragItems:u,nodeLookup:P});o?.(E,u,W,ee),F?.(E,W,ee),T||X?.(E,ee)}}async function $(){if(!g)return;const{transform:Y,panBy:Z,autoPanSpeed:P,autoPanOnNodeDrag:q}=e();if(!q){d=!1,cancelAnimationFrame(l);return}const[A,B]=LM(f,g,P);(A!==0||B!==0)&&(i.x=(i.x??0)-A/Y[2],i.y=(i.y??0)-B/Y[2],await Z({x:A,y:B})&&j(i)),l=requestAnimationFrame($)}function K(Y){const{nodeLookup:Z,multiSelectionActive:P,nodesDraggable:q,transform:A,snapGrid:B,snapToGrid:L,selectNodesOnDrag:F,onNodeDragStart:X,onSelectionDragStart:I,unselectNodesAndEdges:z}=e();m=!0,(!F||!D)&&!P&&T&&(Z.get(T)?.selected||z()),D&&F&&T&&t?.(T);const H=wc(Y.sourceEvent,{transform:A,snapGrid:B,snapToGrid:L,containerBounds:g});if(i=H,u=S9(Z,q,H,T),u.size>0&&(n||X||!T&&I)){const[G,J]=Zg({nodeId:T,dragItems:u,nodeLookup:Z});n?.(Y.sourceEvent,u,G,J),X?.(Y.sourceEvent,G,J),T||I?.(Y.sourceEvent,J)}}const U=gM().clickDistance(k).on("start",Y=>{const{domNode:Z,nodeDragThreshold:P,transform:q,snapGrid:A,snapToGrid:B}=e();g=Z?.getBoundingClientRect()||null,x=!1,w=!1,E=Y.sourceEvent,P===0&&K(Y),i=wc(Y.sourceEvent,{transform:q,snapGrid:A,snapToGrid:B,containerBounds:g}),f=er(Y.sourceEvent,g)}).on("drag",Y=>{const{autoPanOnNodeDrag:Z,transform:P,snapGrid:q,snapToGrid:A,nodeDragThreshold:B,nodeLookup:L}=e(),F=wc(Y.sourceEvent,{transform:P,snapGrid:q,snapToGrid:A,containerBounds:g});if(E=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||T&&!L.has(T))&&(x=!0),!x){if(!d&&Z&&m&&(d=!0,$()),!m){const X=er(Y.sourceEvent,g),I=X.x-f.x,z=X.y-f.y;Math.sqrt(I*I+z*z)>B&&K(Y)}(i.x!==F.xSnapped||i.y!==F.ySnapped)&&u&&m&&(f=er(Y.sourceEvent,g),j(F))}}).on("end",Y=>{if(!(!m||x)&&(d=!1,m=!1,cancelAnimationFrame(l),u.size>0)){const{nodeLookup:Z,updateNodePositions:P,onNodeDragStop:q,onSelectionDragStop:A}=e();if(w&&(P(u,!1),w=!1),a||q||!T&&A){const[B,L]=Zg({nodeId:T,dragItems:u,nodeLookup:Z,dragging:!1});a?.(Y.sourceEvent,u,B,L),q?.(Y.sourceEvent,B,L),T||A?.(Y.sourceEvent,L)}}}).filter(Y=>{const Z=Y.target;return!Y.button&&(!N||!oS(Z,`.${N}`,R))&&(!C||oS(Z,C,R))});p.call(U)}function M(){p?.on(".drag",null)}return{update:S,destroy:M}}function _9(t,e,n){const o=[],a={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const i of e.values())Ic(a,Ki(i))>0&&o.push(i);return o}const M9=250;function N9(t,e,n,o){let a=[],i=1/0;const l=_9(t,n,e+M9);for(const u of l){const d=[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]];for(const f of d){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:g,y:m}=Is(u,f,f.position,!0),p=Math.sqrt(Math.pow(g-t.x,2)+Math.pow(m-t.y,2));p>e||(p<i?(a=[{...f,x:g,y:m}],i=p):p===i&&a.push({...f,x:g,y:m}))}}if(!a.length)return null;if(a.length>1){const u=o.type==="source"?"target":"source";return a.find(d=>d.type===u)??a[0]}return a[0]}function JM(t,e,n,o,a,i=!1){const l=o.get(t);if(!l)return null;const u=a==="strict"?l.internals.handleBounds?.[e]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],d=(n?u?.find(f=>f.id===n):u?.[0])??null;return d&&i?{...d,...Is(l,d,d.position,!0)}:d}function eN(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function R9(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const tN=()=>!0;function D9(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:a,edgeUpdaterType:i,isTarget:l,domNode:u,nodeLookup:d,lib:f,autoPanOnConnect:g,flowId:m,panBy:p,cancelConnection:x,onConnectStart:w,onConnect:E,onConnectEnd:S,isValidConnection:M=tN,onReconnectEnd:N,updateConnection:C,getTransform:R,getFromHandle:D,autoPanSpeed:T,dragThreshold:k=1,handleDomNode:j}){const $=FM(t.target);let K=0,U;const{x:Y,y:Z}=er(t),P=eN(i,j),q=u?.getBoundingClientRect();let A=!1;if(!q||!P)return;const B=JM(a,P,o,d,e);if(!B)return;let L=er(t,q),F=!1,X=null,I=!1,z=null;function H(){if(!g||!q)return;const[ge,ne]=LM(L,q,T);p({x:ge,y:ne}),K=requestAnimationFrame(H)}const G={...B,nodeId:a,type:P,position:B.position},J=d.get(a);let W={inProgress:!0,isValid:null,from:Is(J,G,qe.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:J,to:L,toHandle:null,toPosition:Yw[G.position],toNode:null,pointer:L};function ee(){A=!0,C(W),w?.(t,{nodeId:a,handleId:o,handleType:P})}k===0&&ee();function oe(ge){if(!A){const{x:mt,y:sn}=er(ge),ft=mt-Y,xn=sn-Z;if(!(ft*ft+xn*xn>k*k))return;ee()}if(!D()||!G){de(ge);return}const ne=R();L=er(ge,q),U=N9(ou(L,ne,!1,[1,1]),n,d,G),F||(H(),F=!0);const _e=nN(ge,{handle:U,connectionMode:e,fromNodeId:a,fromHandleId:o,fromType:l?"target":"source",isValidConnection:M,doc:$,lib:f,flowId:m,nodeLookup:d});z=_e.handleDomNode,X=_e.connection,I=R9(!!U,_e.isValid);const De=d.get(a),Ye=De?Is(De,G,qe.Left,!0):W.from,Pe={...W,from:Ye,isValid:I,to:_e.toHandle&&I?xf({x:_e.toHandle.x,y:_e.toHandle.y},ne):L,toHandle:_e.toHandle,toPosition:I&&_e.toHandle?_e.toHandle.position:Yw[G.position],toNode:_e.toHandle?d.get(_e.toHandle.nodeId):null,pointer:L};C(Pe),W=Pe}function de(ge){if(!("touches"in ge&&ge.touches.length>0)){if(A){(U||z)&&X&&I&&E?.(X);const{inProgress:ne,..._e}=W,De={..._e,toPosition:W.toHandle?W.toPosition:null};S?.(ge,De),i&&N?.(ge,De)}x(),cancelAnimationFrame(K),F=!1,I=!1,X=null,z=null,$.removeEventListener("mousemove",oe),$.removeEventListener("mouseup",de),$.removeEventListener("touchmove",oe),$.removeEventListener("touchend",de)}}$.addEventListener("mousemove",oe),$.addEventListener("mouseup",de),$.addEventListener("touchmove",oe),$.addEventListener("touchend",de)}function nN(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:i,doc:l,lib:u,flowId:d,isValidConnection:f=tN,nodeLookup:g}){const m=i==="target",p=e?l.querySelector(`.${u}-flow__handle[data-id="${d}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x,y:w}=er(t),E=l.elementFromPoint(x,w),S=E?.classList.contains(`${u}-flow__handle`)?E:p,M={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const N=eN(void 0,S),C=S.getAttribute("data-nodeid"),R=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),T=S.classList.contains("connectableend");if(!C||!N)return M;const k={source:m?C:o,sourceHandle:m?R:a,target:m?o:C,targetHandle:m?a:R};M.connection=k;const $=D&&T&&(n===qi.Strict?m&&N==="source"||!m&&N==="target":C!==o||R!==a);M.isValid=$&&f(k),M.toHandle=JM(C,N,R,g,n,!0)}return M}const Qp={onPointerDown:D9,isValid:nN};function T9({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const a=Co(t);function i({translateExtent:u,width:d,height:f,zoomStep:g=1,pannable:m=!0,zoomable:p=!0,inversePan:x=!1}){const w=C=>{if(C.sourceEvent.type!=="wheel"||!e)return;const R=n(),D=C.sourceEvent.ctrlKey&&Pc()?10:1,T=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*g,k=R[2]*Math.pow(2,T*D);e.scaleTo(k)};let E=[0,0];const S=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(E=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},M=C=>{const R=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!e)return;const D=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],T=[D[0]-E[0],D[1]-E[1]];E=D;const k=o()*Math.max(R[2],Math.log(R[2]))*(x?-1:1),j={x:R[0]-T[0]*k,y:R[1]-T[1]*k},$=[[0,0],[d,f]];e.setViewportConstrained({x:j.x,y:j.y,zoom:R[2]},$,u)},N=TM().on("start",S).on("zoom",m?M:null).on("zoom.wheel",p?w:null);a.call(N,{})}function l(){a.on("zoom",null)}return{update:i,destroy:l,pointer:Zo}}const rh=t=>({x:t.x,y:t.y,zoom:t.k}),Qg=({x:t,y:e,zoom:n})=>th.translate(t,e).scale(n),zi=(t,e)=>t.target.closest(`.${e}`),oN=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),k9=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Jg=(t,e=0,n=k9,o=()=>{})=>{const a=typeof e=="number"&&e>0;return a||o(),a?t.transition().duration(e).ease(n).on("end",o):t},rN=t=>{const e=t.ctrlKey&&Pc()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function O9({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:u,onPanZoom:d,onPanZoomEnd:f}){return g=>{if(zi(g,e))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&l){const S=Zo(g),M=rN(g),N=m*Math.pow(2,M);o.scaleTo(n,N,S,g);return}const p=g.deltaMode===1?20:1;let x=a===Ns.Vertical?0:g.deltaX*p,w=a===Ns.Horizontal?0:g.deltaY*p;!Pc()&&g.shiftKey&&a!==Ns.Vertical&&(x=g.deltaY*p,w=0),o.translateBy(n,-(x/m)*i,-(w/m)*i,{internal:!0});const E=rh(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(d?.(g,E),t.panScrollTimeout=setTimeout(()=>{f?.(g,E),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,u?.(g,E))}}function A9({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,a){const i=o.type==="wheel",l=!e&&i&&!o.ctrlKey,u=zi(o,t);if(o.ctrlKey&&i&&u&&o.preventDefault(),l||u)return null;o.preventDefault(),n.call(this,o,a)}}function j9({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const a=rh(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=a,o.sourceEvent?.type==="mousedown"&&e(!0),n&&n?.(o.sourceEvent,a)}}function z9({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:a}){return i=>{t.usedRightMouseButton=!!(n&&oN(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),a&&!i.sourceEvent?.internal&&a?.(i.sourceEvent,rh(i.transform))}}function I9({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:a,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,i&&oN(e,t.mouseButton??0)&&!t.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),t.usedRightMouseButton=!1,o(!1),a)){const u=rh(l.transform);t.prevViewport=u,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a?.(l.sourceEvent,u)},n?150:0)}}}function P9({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:u,noPanClassName:d,lib:f,connectionInProgress:g}){return m=>{const p=t||e,x=n&&m.ctrlKey,w=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(zi(m,`${f}-flow__node`)||zi(m,`${f}-flow__edge`)))return!0;if(!o&&!p&&!a&&!i&&!n||l||g&&!w||zi(m,u)&&w||zi(m,d)&&(!w||a&&w&&!t)||!n&&m.ctrlKey&&w)return!1;if(!n&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!p&&!a&&!x&&w||!o&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(o)&&!o.includes(m.button)&&m.type==="mousedown")return!1;const E=Array.isArray(o)&&o.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||w)&&E}}function L9({domNode:t,minZoom:e,maxZoom:n,translateExtent:o,viewport:a,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=t.getBoundingClientRect(),m=TM().scaleExtent([e,n]).translateExtent(o),p=Co(t).call(m);N({x:a.x,y:a.y,zoom:Wi(a.zoom,e,n)},[[0,0],[g.width,g.height]],o);const x=p.on("wheel.zoom"),w=p.on("dblclick.zoom");m.wheelDelta(rN);function E(U,Y){return p?new Promise(Z=>{m?.interpolate(Y?.interpolate==="linear"?bc:Wd).transform(Jg(p,Y?.duration,Y?.ease,()=>Z(!0)),U)}):Promise.resolve(!1)}function S({noWheelClassName:U,noPanClassName:Y,onPaneContextMenu:Z,userSelectionActive:P,panOnScroll:q,panOnDrag:A,panOnScrollMode:B,panOnScrollSpeed:L,preventScrolling:F,zoomOnPinch:X,zoomOnScroll:I,zoomOnDoubleClick:z,zoomActivationKeyPressed:H,lib:G,onTransformChange:J,connectionInProgress:ae,paneClickDistance:W,selectionOnDrag:ee}){P&&!f.isZoomingOrPanning&&M();const oe=q&&!H&&!P;m.clickDistance(ee?1/0:!Jo(W)||W<0?0:W);const de=oe?O9({zoomPanValues:f,noWheelClassName:U,d3Selection:p,d3Zoom:m,panOnScrollMode:B,panOnScrollSpeed:L,zoomOnPinch:X,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:u}):A9({noWheelClassName:U,preventScrolling:F,d3ZoomHandler:x});if(p.on("wheel.zoom",de,{passive:!1}),!P){const ne=j9({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:l});m.on("start",ne);const _e=z9({zoomPanValues:f,panOnDrag:A,onPaneContextMenu:!!Z,onPanZoom:i,onTransformChange:J});m.on("zoom",_e);const De=I9({zoomPanValues:f,panOnDrag:A,panOnScroll:q,onPaneContextMenu:Z,onPanZoomEnd:u,onDraggingChange:d});m.on("end",De)}const ge=P9({zoomActivationKeyPressed:H,panOnDrag:A,zoomOnScroll:I,panOnScroll:q,zoomOnDoubleClick:z,zoomOnPinch:X,userSelectionActive:P,noPanClassName:Y,noWheelClassName:U,lib:G,connectionInProgress:ae});m.filter(ge),z?p.on("dblclick.zoom",w):p.on("dblclick.zoom",null)}function M(){m.on("zoom",null)}async function N(U,Y,Z){const P=Qg(U),q=m?.constrain()(P,Y,Z);return q&&await E(q),new Promise(A=>A(q))}async function C(U,Y){const Z=Qg(U);return await E(Z,Y),new Promise(P=>P(Z))}function R(U){if(p){const Y=Qg(U),Z=p.property("__zoom");(Z.k!==U.zoom||Z.x!==U.x||Z.y!==U.y)&&m?.transform(p,Y,null,{sync:!0})}}function D(){const U=p?DM(p.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function T(U,Y){return p?new Promise(Z=>{m?.interpolate(Y?.interpolate==="linear"?bc:Wd).scaleTo(Jg(p,Y?.duration,Y?.ease,()=>Z(!0)),U)}):Promise.resolve(!1)}function k(U,Y){return p?new Promise(Z=>{m?.interpolate(Y?.interpolate==="linear"?bc:Wd).scaleBy(Jg(p,Y?.duration,Y?.ease,()=>Z(!0)),U)}):Promise.resolve(!1)}function j(U){m?.scaleExtent(U)}function $(U){m?.translateExtent(U)}function K(U){const Y=!Jo(U)||U<0?0:U;m?.clickDistance(Y)}return{update:S,destroy:M,setViewport:C,setViewportConstrained:N,getViewport:D,scaleTo:T,scaleBy:k,setScaleExtent:j,setTranslateExtent:$,syncViewport:R,setClickDistance:K}}var Zi;(function(t){t.Line="line",t.Handle="handle"})(Zi||(Zi={}));function $9({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:a,affectsY:i}){const l=t-e,u=n-o,d=[l>0?1:l<0?-1:0,u>0?1:u<0?-1:0];return l&&a&&(d[0]=d[0]*-1),u&&i&&(d[1]=d[1]*-1),d}function rS(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),o=t.includes("left"),a=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:o,affectsY:a}}function Pa(t,e){return Math.max(0,e-t)}function La(t,e){return Math.max(0,t-e)}function Id(t,e,n){return Math.max(0,e-t,t-n)}function aS(t,e){return t?!e:e}function H9(t,e,n,o,a,i,l,u){let{affectsX:d,affectsY:f}=e;const{isHorizontal:g,isVertical:m}=e,p=g&&m,{xSnapped:x,ySnapped:w}=n,{minWidth:E,maxWidth:S,minHeight:M,maxHeight:N}=o,{x:C,y:R,width:D,height:T,aspectRatio:k}=t;let j=Math.floor(g?x-t.pointerX:0),$=Math.floor(m?w-t.pointerY:0);const K=D+(d?-j:j),U=T+(f?-$:$),Y=-i[0]*D,Z=-i[1]*T;let P=Id(K,E,S),q=Id(U,M,N);if(l){let L=0,F=0;d&&j<0?L=Pa(C+j+Y,l[0][0]):!d&&j>0&&(L=La(C+K+Y,l[1][0])),f&&$<0?F=Pa(R+$+Z,l[0][1]):!f&&$>0&&(F=La(R+U+Z,l[1][1])),P=Math.max(P,L),q=Math.max(q,F)}if(u){let L=0,F=0;d&&j>0?L=La(C+j,u[0][0]):!d&&j<0&&(L=Pa(C+K,u[1][0])),f&&$>0?F=La(R+$,u[0][1]):!f&&$<0&&(F=Pa(R+U,u[1][1])),P=Math.max(P,L),q=Math.max(q,F)}if(a){if(g){const L=Id(K/k,M,N)*k;if(P=Math.max(P,L),l){let F=0;!d&&!f||d&&!f&&p?F=La(R+Z+K/k,l[1][1])*k:F=Pa(R+Z+(d?j:-j)/k,l[0][1])*k,P=Math.max(P,F)}if(u){let F=0;!d&&!f||d&&!f&&p?F=Pa(R+K/k,u[1][1])*k:F=La(R+(d?j:-j)/k,u[0][1])*k,P=Math.max(P,F)}}if(m){const L=Id(U*k,E,S)/k;if(q=Math.max(q,L),l){let F=0;!d&&!f||f&&!d&&p?F=La(C+U*k+Y,l[1][0])/k:F=Pa(C+(f?$:-$)*k+Y,l[0][0])/k,q=Math.max(q,F)}if(u){let F=0;!d&&!f||f&&!d&&p?F=Pa(C+U*k,u[1][0])/k:F=La(C+(f?$:-$)*k,u[0][0])/k,q=Math.max(q,F)}}}$=$+($<0?q:-q),j=j+(j<0?P:-P),a&&(p?K>U*k?$=(aS(d,f)?-j:j)/k:j=(aS(d,f)?-$:$)*k:g?($=j/k,f=d):(j=$*k,d=f));const A=d?C+j:C,B=f?R+$:R;return{width:D+(d?-j:j),height:T+(f?-$:$),x:i[0]*j*(d?-1:1)+A,y:i[1]*$*(f?-1:1)+B}}const aN={width:0,height:0,x:0,y:0},B9={...aN,pointerX:0,pointerY:0,aspectRatio:1};function F9(t){return[[0,0],[t.measured.width,t.measured.height]]}function V9(t,e,n){const o=e.position.x+t.position.x,a=e.position.y+t.position.y,i=t.measured.width??0,l=t.measured.height??0,u=n[0]*i,d=n[1]*l;return[[o-u,a-d],[o+i-u,a+l-d]]}function U9({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:a}){const i=Co(t);let l={controlDirection:rS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function u({controlPosition:f,boundaries:g,keepAspectRatio:m,resizeDirection:p,onResizeStart:x,onResize:w,onResizeEnd:E,shouldResize:S}){let M={...aN},N={...B9};l={boundaries:g,resizeDirection:p,keepAspectRatio:m,controlDirection:rS(f)};let C,R=null,D=[],T,k,j,$=!1;const K=gM().on("start",U=>{const{nodeLookup:Y,transform:Z,snapGrid:P,snapToGrid:q,nodeOrigin:A,paneDomNode:B}=n();if(C=Y.get(e),!C)return;R=B?.getBoundingClientRect()??null;const{xSnapped:L,ySnapped:F}=wc(U.sourceEvent,{transform:Z,snapGrid:P,snapToGrid:q,containerBounds:R});M={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},N={...M,pointerX:L,pointerY:F,aspectRatio:M.width/M.height},T=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(T=Y.get(C.parentId),k=T&&C.extent==="parent"?F9(T):void 0),D=[],j=void 0;for(const[X,I]of Y)if(I.parentId===e&&(D.push({id:X,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent)){const z=V9(I,C,I.origin??A);j?j=[[Math.min(z[0][0],j[0][0]),Math.min(z[0][1],j[0][1])],[Math.max(z[1][0],j[1][0]),Math.max(z[1][1],j[1][1])]]:j=z}x?.(U,{...M})}).on("drag",U=>{const{transform:Y,snapGrid:Z,snapToGrid:P,nodeOrigin:q}=n(),A=wc(U.sourceEvent,{transform:Y,snapGrid:Z,snapToGrid:P,containerBounds:R}),B=[];if(!C)return;const{x:L,y:F,width:X,height:I}=M,z={},H=C.origin??q,{width:G,height:J,x:ae,y:W}=H9(N,l.controlDirection,A,l.boundaries,l.keepAspectRatio,H,k,j),ee=G!==X,oe=J!==I,de=ae!==L&&ee,ge=W!==F&&oe;if(!de&&!ge&&!ee&&!oe)return;if((de||ge||H[0]===1||H[1]===1)&&(z.x=de?ae:M.x,z.y=ge?W:M.y,M.x=z.x,M.y=z.y,D.length>0)){const Ye=ae-L,Pe=W-F;for(const mt of D)mt.position={x:mt.position.x-Ye+H[0]*(G-X),y:mt.position.y-Pe+H[1]*(J-I)},B.push(mt)}if((ee||oe)&&(z.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?G:M.width,z.height=oe&&(!l.resizeDirection||l.resizeDirection==="vertical")?J:M.height,M.width=z.width,M.height=z.height),T&&C.expandParent){const Ye=H[0]*(z.width??0);z.x&&z.x<Ye&&(M.x=Ye,N.x=N.x-(z.x-Ye));const Pe=H[1]*(z.height??0);z.y&&z.y<Pe&&(M.y=Pe,N.y=N.y-(z.y-Pe))}const ne=$9({width:M.width,prevWidth:X,height:M.height,prevHeight:I,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),_e={...M,direction:ne};S?.(U,_e)!==!1&&($=!0,w?.(U,_e),o(z,B))}).on("end",U=>{$&&(E?.(U,{...M}),a?.({...M}),$=!1)});i.call(K)}function d(){i.on(".drag",null)}return{update:u,destroy:d}}var ep={exports:{}},tp={};var sS;function Y9(){if(sS)return tp;sS=1;var t=el(),e=Y5();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var o=typeof Object.is=="function"?Object.is:n,a=e.useSyncExternalStore,i=t.useRef,l=t.useEffect,u=t.useMemo,d=t.useDebugValue;return tp.useSyncExternalStoreWithSelector=function(f,g,m,p,x){var w=i(null);if(w.current===null){var E={hasValue:!1,value:null};w.current=E}else E=w.current;w=u(function(){function M(T){if(!N){if(N=!0,C=T,T=p(T),x!==void 0&&E.hasValue){var k=E.value;if(x(k,T))return R=k}return R=T}if(k=R,o(C,T))return k;var j=p(T);return x!==void 0&&x(k,j)?(C=T,k):(C=T,R=j)}var N=!1,C,R,D=m===void 0?null:m;return[function(){return M(g())},D===null?void 0:function(){return M(D())}]},[g,m,p,x]);var S=a(f,w[0],w[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),d(S),S},tp}var iS;function G9(){return iS||(iS=1,ep.exports=Y9()),ep.exports}var q9=G9();const W9=u0(q9),K9={},lS=t=>{let e;const n=new Set,o=(g,m)=>{const p=typeof g=="function"?g(e):g;if(!Object.is(p,e)){const x=e;e=m??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(w=>w(e,x))}},a=()=>e,d={setState:o,getState:a,getInitialState:()=>f,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(K9?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=e=t(o,a,d);return d},X9=t=>t?lS(t):lS,{useDebugValue:Z9}=ue,{useSyncExternalStoreWithSelector:Q9}=W9,J9=t=>t;function sN(t,e=J9,n){const o=Q9(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Z9(o),o}const cS=(t,e)=>{const n=X9(t),o=(a,i=e)=>sN(n,a,i);return Object.assign(o,n),o},eH=(t,e)=>t?cS(t,e):cS;function rn(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,a]of t)if(!Object.is(a,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}const ah=v.createContext(null),tH=ah.Provider,iN=Cr.error001();function Ct(t,e){const n=v.useContext(ah);if(n===null)throw new Error(iN);return sN(n,t,e)}function an(){const t=v.useContext(ah);if(t===null)throw new Error(iN);return v.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const uS={display:"none"},nH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},lN="react-flow__node-desc",cN="react-flow__edge-desc",oH="react-flow__aria-live",rH=t=>t.ariaLiveMessage,aH=t=>t.ariaLabelConfig;function sH({rfId:t}){const e=Ct(rH);return y.jsx("div",{id:`${oH}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:nH,children:e})}function iH({rfId:t,disableKeyboardA11y:e}){const n=Ct(aH);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${lN}-${t}`,style:uS,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${cN}-${t}`,style:uS,children:n["edge.a11yDescription.default"]}),!e&&y.jsx(sH,{rfId:t})]})}const sh=v.forwardRef(({position:t="top-left",children:e,className:n,style:o,...a},i)=>{const l=`${t}`.split("-");return y.jsx("div",{className:Mn(["react-flow__panel",n,...l]),style:o,ref:i,...a,children:e})});sh.displayName="Panel";function lH({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:y.jsx(sh,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const cH=t=>{const e=[],n=[];for(const[,o]of t.nodeLookup)o.selected&&e.push(o.internals.userNode);for(const[,o]of t.edgeLookup)o.selected&&n.push(o);return{selectedNodes:e,selectedEdges:n}},Pd=t=>t.id;function uH(t,e){return rn(t.selectedNodes.map(Pd),e.selectedNodes.map(Pd))&&rn(t.selectedEdges.map(Pd),e.selectedEdges.map(Pd))}function dH({onSelectionChange:t}){const e=an(),{selectedNodes:n,selectedEdges:o}=Ct(cH,uH);return v.useEffect(()=>{const a={nodes:n,edges:o};t?.(a),e.getState().onSelectionChangeHandlers.forEach(i=>i(a))},[n,o,t]),null}const fH=t=>!!t.onSelectionChangeHandlers;function hH({onSelectionChange:t}){const e=Ct(fH);return t||e?y.jsx(dH,{onSelectionChange:t}):null}const uN=[0,0],mH={x:0,y:0,zoom:1},gH=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],dS=[...gH,"rfId"],pH=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),fS={translateExtent:jc,nodeOrigin:uN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function yH(t){const{setNodes:e,setEdges:n,setMinZoom:o,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:l,reset:u,setDefaultNodesAndEdges:d}=Ct(pH,rn),f=an();v.useEffect(()=>(d(t.defaultNodes,t.defaultEdges),()=>{g.current=fS,u()}),[]);const g=v.useRef(fS);return v.useEffect(()=>{for(const m of dS){const p=t[m],x=g.current[m];p!==x&&(typeof t[m]>"u"||(m==="nodes"?e(p):m==="edges"?n(p):m==="minZoom"?o(p):m==="maxZoom"?a(p):m==="translateExtent"?i(p):m==="nodeExtent"?l(p):m==="ariaLabelConfig"?f.setState({ariaLabelConfig:n9(p)}):m==="fitView"?f.setState({fitViewQueued:p}):m==="fitViewOptions"?f.setState({fitViewOptions:p}):f.setState({[m]:p})))}g.current=t},dS.map(m=>t[m])),null}function hS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function vH(t){const[e,n]=v.useState(t==="system"?null:t);return v.useEffect(()=>{if(t!=="system"){n(t);return}const o=hS(),a=()=>n(o?.matches?"dark":"light");return a(),o?.addEventListener("change",a),()=>{o?.removeEventListener("change",a)}},[t]),e!==null?e:hS()?.matches?"dark":"light"}const mS=typeof document<"u"?document:null;function Lc(t=null,e={target:mS,actInsideInputWithModifier:!0}){const[n,o]=v.useState(!1),a=v.useRef(!1),i=v.useRef(new Set([])),[l,u]=v.useMemo(()=>{if(t!==null){const f=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
56
|
+
`).replace(`
|
|
57
|
+
|
|
58
|
+
`,`
|
|
59
|
+
+`).split(`
|
|
60
|
+
`)),g=f.reduce((m,p)=>m.concat(...p),[]);return[f,g]}return[[],[]]},[t]);return v.useEffect(()=>{const d=e?.target??mS,f=e?.actInsideInputWithModifier??!0;if(t!==null){const g=x=>{if(a.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!a.current||a.current&&!f)&&VM(x))return!1;const E=pS(x.code,u);if(i.current.add(x[E]),gS(l,i.current,!1)){const S=x.composedPath?.()?.[0]||x.target,M=S?.nodeName==="BUTTON"||S?.nodeName==="A";e.preventDefault!==!1&&(a.current||!M)&&x.preventDefault(),o(!0)}},m=x=>{const w=pS(x.code,u);gS(l,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(x[w]),x.key==="Meta"&&i.current.clear(),a.current=!1},p=()=>{i.current.clear(),o(!1)};return d?.addEventListener("keydown",g),d?.addEventListener("keyup",m),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{d?.removeEventListener("keydown",g),d?.removeEventListener("keyup",m),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[t,o]),n}function gS(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(a=>e.has(a)))}function pS(t,e){return e.includes(t)?"code":"key"}const xH=()=>{const t=an();return v.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e?.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e?.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:o}=t.getState();return o?o.scaleTo(e,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[o,a,i],panZoom:l}=t.getState();return l?(await l.setViewport({x:e.x??o,y:e.y??a,zoom:e.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,o]=t.getState().transform;return{x:e,y:n,zoom:o}},setCenter:async(e,n,o)=>t.getState().setCenter(e,n,o),fitBounds:async(e,n)=>{const{width:o,height:a,minZoom:i,maxZoom:l,panZoom:u}=t.getState(),d=xy(e,o,a,i,l,n?.padding??.1);return u?(await u.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:o,snapGrid:a,snapToGrid:i,domNode:l}=t.getState();if(!l)return e;const{x:u,y:d}=l.getBoundingClientRect(),f={x:e.x-u,y:e.y-d},g=n.snapGrid??a,m=n.snapToGrid??i;return ou(f,o,m,g)},flowToScreenPosition:e=>{const{transform:n,domNode:o}=t.getState();if(!o)return e;const{x:a,y:i}=o.getBoundingClientRect(),l=xf(e,n);return{x:l.x+a,y:l.y+i}}}),[])};function dN(t,e){const n=[],o=new Map,a=[];for(const i of t)if(i.type==="add"){a.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const l=o.get(i.id);l?l.push(i):o.set(i.id,[i])}for(const i of e){const l=o.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const u={...i};for(const d of l)bH(d,u);n.push(u)}return a.length&&a.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function bH(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function fN(t,e){return dN(t,e)}function hN(t,e){return dN(t,e)}function Ss(t,e){return{id:t,type:"select",selected:e}}function Ii(t,e=new Set,n=!1){const o=[];for(const[a,i]of t){const l=e.has(a);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),o.push(Ss(i.id,l)))}return o}function yS({items:t=[],lookup:e}){const n=[],o=new Map(t.map(a=>[a.id,a]));for(const[a,i]of t.entries()){const l=e.get(i.id),u=l?.internals?.userNode??l;u!==void 0&&u!==i&&n.push({id:i.id,item:i,type:"replace"}),u===void 0&&n.push({item:i,type:"add",index:a})}for(const[a]of e)o.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function vS(t){return{id:t.id,type:"remove"}}const xS=t=>G$(t),wH=t=>zM(t);function mN(t){return v.forwardRef(t)}const SH=typeof window<"u"?v.useLayoutEffect:v.useEffect;function bS(t){const[e,n]=v.useState(BigInt(0)),[o]=v.useState(()=>CH(()=>n(a=>a+BigInt(1))));return SH(()=>{const a=o.get();a.length&&(t(a),o.reset())},[e]),o}function CH(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const gN=v.createContext(null);function EH({children:t}){const e=an(),n=v.useCallback(u=>{const{nodes:d=[],setNodes:f,hasDefaultNodes:g,onNodesChange:m,nodeLookup:p,fitViewQueued:x,onNodesChangeMiddlewareMap:w}=e.getState();let E=d;for(const M of u)E=typeof M=="function"?M(E):M;let S=yS({items:E,lookup:p});for(const M of w.values())S=M(S);g&&f(E),S.length>0?m?.(S):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:M,nodes:N,setNodes:C}=e.getState();M&&C(N)})},[]),o=bS(n),a=v.useCallback(u=>{const{edges:d=[],setEdges:f,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:p}=e.getState();let x=d;for(const w of u)x=typeof w=="function"?w(x):w;g?f(x):m&&m(yS({items:x,lookup:p}))},[]),i=bS(a),l=v.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return y.jsx(gN.Provider,{value:l,children:t})}function _H(){const t=v.useContext(gN);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const MH=t=>!!t.panZoom;function My(){const t=xH(),e=an(),n=_H(),o=Ct(MH),a=v.useMemo(()=>{const i=m=>e.getState().nodeLookup.get(m),l=m=>{n.nodeQueue.push(m)},u=m=>{n.edgeQueue.push(m)},d=m=>{const{nodeLookup:p,nodeOrigin:x}=e.getState(),w=xS(m)?m:p.get(m.id),E=w.parentId?BM(w.position,w.measured,w.parentId,p,x):w.position,S={...w,position:E,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return Ki(S)},f=(m,p,x={replace:!1})=>{l(w=>w.map(E=>{if(E.id===m){const S=typeof p=="function"?p(E):p;return x.replace&&xS(S)?S:{...E,...S}}return E}))},g=(m,p,x={replace:!1})=>{u(w=>w.map(E=>{if(E.id===m){const S=typeof p=="function"?p(E):p;return x.replace&&wH(S)?S:{...E,...S}}return E}))};return{getNodes:()=>e.getState().nodes.map(m=>({...m})),getNode:m=>i(m)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:m=[]}=e.getState();return m.map(p=>({...p}))},getEdge:m=>e.getState().edgeLookup.get(m),setNodes:l,setEdges:u,addNodes:m=>{const p=Array.isArray(m)?m:[m];n.nodeQueue.push(x=>[...x,...p])},addEdges:m=>{const p=Array.isArray(m)?m:[m];n.edgeQueue.push(x=>[...x,...p])},toObject:()=>{const{nodes:m=[],edges:p=[],transform:x}=e.getState(),[w,E,S]=x;return{nodes:m.map(M=>({...M})),edges:p.map(M=>({...M})),viewport:{x:w,y:E,zoom:S}}},deleteElements:async({nodes:m=[],edges:p=[]})=>{const{nodes:x,edges:w,onNodesDelete:E,onEdgesDelete:S,triggerNodeChanges:M,triggerEdgeChanges:N,onDelete:C,onBeforeDelete:R}=e.getState(),{nodes:D,edges:T}=await Z$({nodesToRemove:m,edgesToRemove:p,nodes:x,edges:w,onBeforeDelete:R}),k=T.length>0,j=D.length>0;if(k){const $=T.map(vS);S?.(T),N($)}if(j){const $=D.map(vS);E?.(D),M($)}return(j||k)&&C?.({nodes:D,edges:T}),{deletedNodes:D,deletedEdges:T}},getIntersectingNodes:(m,p=!0,x)=>{const w=qw(m),E=w?m:d(m),S=x!==void 0;return E?(x||e.getState().nodes).filter(M=>{const N=e.getState().nodeLookup.get(M.id);if(N&&!w&&(M.id===m.id||!N.internals.positionAbsolute))return!1;const C=Ki(S?M:N),R=Ic(C,E);return p&&R>0||R>=C.width*C.height||R>=E.width*E.height}):[]},isNodeIntersecting:(m,p,x=!0)=>{const E=qw(m)?m:d(m);if(!E)return!1;const S=Ic(E,p);return x&&S>0||S>=p.width*p.height||S>=E.width*E.height},updateNode:f,updateNodeData:(m,p,x={replace:!1})=>{f(m,w=>{const E=typeof p=="function"?p(w):p;return x.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},x)},updateEdge:g,updateEdgeData:(m,p,x={replace:!1})=>{g(m,w=>{const E=typeof p=="function"?p(w):p;return x.replace?{...w,data:E}:{...w,data:{...w.data,...E}}},x)},getNodesBounds:m=>{const{nodeLookup:p,nodeOrigin:x}=e.getState();return q$(m,{nodeLookup:p,nodeOrigin:x})},getHandleConnections:({type:m,id:p,nodeId:x})=>Array.from(e.getState().connectionLookup.get(`${x}-${m}${p?`-${p}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:p,nodeId:x})=>Array.from(e.getState().connectionLookup.get(`${x}${m?p?`-${m}-${p}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const p=e.getState().fitViewResolver??t9();return e.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:p}),n.nodeQueue.push(x=>[...x]),p.promise}}},[]);return v.useMemo(()=>({...a,...t,viewportInitialized:o}),[o])}const wS=t=>t.selected,NH=typeof window<"u"?window:void 0;function RH({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=an(),{deleteElements:o}=My(),a=Lc(t,{actInsideInputWithModifier:!1}),i=Lc(e,{target:NH});v.useEffect(()=>{if(a){const{edges:l,nodes:u}=n.getState();o({nodes:u.filter(wS),edges:l.filter(wS)}),n.setState({nodesSelectionActive:!1})}},[a]),v.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function DH(t){const e=an();v.useEffect(()=>{const n=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const o=by(t.current);(o.height===0||o.width===0)&&e.getState().onError?.("004",Cr.error004()),e.setState({width:o.width||500,height:o.height||500})};if(t.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(t.current),()=>{window.removeEventListener("resize",n),o&&t.current&&o.unobserve(t.current)}}},[])}const ih={position:"absolute",width:"100%",height:"100%",top:0,left:0},TH=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function kH({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=Ns.Free,zoomOnDoubleClick:l=!0,panOnDrag:u=!0,defaultViewport:d,translateExtent:f,minZoom:g,maxZoom:m,zoomActivationKeyCode:p,preventScrolling:x=!0,children:w,noWheelClassName:E,noPanClassName:S,onViewportChange:M,isControlledViewport:N,paneClickDistance:C,selectionOnDrag:R}){const D=an(),T=v.useRef(null),{userSelectionActive:k,lib:j,connectionInProgress:$}=Ct(TH,rn),K=Lc(p),U=v.useRef();DH(T);const Y=v.useCallback(Z=>{M?.({x:Z[0],y:Z[1],zoom:Z[2]}),N||D.setState({transform:Z})},[M,N]);return v.useEffect(()=>{if(T.current){U.current=L9({domNode:T.current,minZoom:g,maxZoom:m,translateExtent:f,viewport:d,onDraggingChange:A=>D.setState({paneDragging:A}),onPanZoomStart:(A,B)=>{const{onViewportChangeStart:L,onMoveStart:F}=D.getState();F?.(A,B),L?.(B)},onPanZoom:(A,B)=>{const{onViewportChange:L,onMove:F}=D.getState();F?.(A,B),L?.(B)},onPanZoomEnd:(A,B)=>{const{onViewportChangeEnd:L,onMoveEnd:F}=D.getState();F?.(A,B),L?.(B)}});const{x:Z,y:P,zoom:q}=U.current.getViewport();return D.setState({panZoom:U.current,transform:[Z,P,q],domNode:T.current.closest(".react-flow")}),()=>{U.current?.destroy()}}},[]),v.useEffect(()=>{U.current?.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:u,zoomActivationKeyPressed:K,preventScrolling:x,noPanClassName:S,userSelectionActive:k,noWheelClassName:E,lib:j,onTransformChange:Y,connectionInProgress:$,selectionOnDrag:R,paneClickDistance:C})},[t,e,n,o,a,i,l,u,K,x,S,k,E,j,Y,$,R,C]),y.jsx("div",{className:"react-flow__renderer",ref:T,style:ih,children:w})}const OH=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function AH(){const{userSelectionActive:t,userSelectionRect:e}=Ct(OH,rn);return t&&e?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const np=(t,e)=>n=>{n.target===e.current&&t?.(n)},jH=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function zH({isSelecting:t,selectionKeyPressed:e,selectionMode:n=zc.Full,panOnDrag:o,paneClickDistance:a,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:p,onPaneMouseLeave:x,children:w}){const E=an(),{userSelectionActive:S,elementsSelectable:M,dragging:N,connectionInProgress:C}=Ct(jH,rn),R=M&&(t||S),D=v.useRef(null),T=v.useRef(),k=v.useRef(new Set),j=v.useRef(new Set),$=v.useRef(!1),K=L=>{if($.current||C){$.current=!1;return}d?.(L),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},U=L=>{if(Array.isArray(o)&&o?.includes(2)){L.preventDefault();return}f?.(L)},Y=g?L=>g(L):void 0,Z=L=>{$.current&&(L.stopPropagation(),$.current=!1)},P=L=>{const{domNode:F}=E.getState();if(T.current=F?.getBoundingClientRect(),!T.current)return;const X=L.target===D.current;if(!X&&!!L.target.closest(".nokey")||!t||!(i&&X||e)||L.button!==0||!L.isPrimary)return;L.target?.setPointerCapture?.(L.pointerId),$.current=!1;const{x:H,y:G}=er(L.nativeEvent,T.current);E.setState({userSelectionRect:{width:0,height:0,startX:H,startY:G,x:H,y:G}}),X||(L.stopPropagation(),L.preventDefault())},q=L=>{const{userSelectionRect:F,transform:X,nodeLookup:I,edgeLookup:z,connectionLookup:H,triggerNodeChanges:G,triggerEdgeChanges:J,defaultEdgeOptions:ae,resetSelectedElements:W}=E.getState();if(!T.current||!F)return;const{x:ee,y:oe}=er(L.nativeEvent,T.current),{startX:de,startY:ge}=F;if(!$.current){const Pe=e?0:a;if(Math.hypot(ee-de,oe-ge)<=Pe)return;W(),l?.(L)}$.current=!0;const ne={startX:de,startY:ge,x:ee<de?ee:de,y:oe<ge?oe:ge,width:Math.abs(ee-de),height:Math.abs(oe-ge)},_e=k.current,De=j.current;k.current=new Set(vy(I,ne,X,n===zc.Partial,!0).map(Pe=>Pe.id)),j.current=new Set;const Ye=ae?.selectable??!0;for(const Pe of k.current){const mt=H.get(Pe);if(mt)for(const{edgeId:sn}of mt.values()){const ft=z.get(sn);ft&&(ft.selectable??Ye)&&j.current.add(sn)}}if(!Ww(_e,k.current)){const Pe=Ii(I,k.current,!0);G(Pe)}if(!Ww(De,j.current)){const Pe=Ii(z,j.current);J(Pe)}E.setState({userSelectionRect:ne,userSelectionActive:!0,nodesSelectionActive:!1})},A=L=>{L.button===0&&(L.target?.releasePointerCapture?.(L.pointerId),!S&&L.target===D.current&&E.getState().userSelectionRect&&K?.(L),E.setState({userSelectionActive:!1,userSelectionRect:null}),$.current&&(u?.(L),E.setState({nodesSelectionActive:k.current.size>0})))},B=o===!0||Array.isArray(o)&&o.includes(0);return y.jsxs("div",{className:Mn(["react-flow__pane",{draggable:B,dragging:N,selection:t}]),onClick:R?void 0:np(K,D),onContextMenu:np(U,D),onWheel:np(Y,D),onPointerEnter:R?void 0:m,onPointerMove:R?q:p,onPointerUp:R?A:void 0,onPointerDownCapture:R?P:void 0,onClickCapture:R?Z:void 0,onPointerLeave:x,ref:D,style:ih,children:[w,y.jsx(AH,{})]})}function Jp({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:u,onError:d}=e.getState(),f=u.get(t);if(!f){d?.("012",Cr.error012(t));return}e.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&l)&&(i({nodes:[f],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):a([t])}function pN({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:a,isSelectable:i,nodeClickDistance:l}){const u=an(),[d,f]=v.useState(!1),g=v.useRef();return v.useEffect(()=>{g.current=E9({getStoreItems:()=>u.getState(),onNodeMouseDown:m=>{Jp({id:m,store:u,nodeRef:t})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),v.useEffect(()=>{if(e)g.current?.destroy();else if(t.current)return g.current?.update({noDragClassName:n,handleSelector:o,domNode:t.current,isSelectable:i,nodeId:a,nodeClickDistance:l}),()=>{g.current?.destroy()}},[n,o,e,i,t,a]),d}const IH=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function yN(){const t=an();return v.useCallback(n=>{const{nodeExtent:o,snapToGrid:a,snapGrid:i,nodesDraggable:l,onError:u,updateNodePositions:d,nodeLookup:f,nodeOrigin:g}=t.getState(),m=new Map,p=IH(l),x=a?i[0]:5,w=a?i[1]:5,E=n.direction.x*x*n.factor,S=n.direction.y*w*n.factor;for(const[,M]of f){if(!p(M))continue;let N={x:M.internals.positionAbsolute.x+E,y:M.internals.positionAbsolute.y+S};a&&(N=nu(N,i));const{position:C,positionAbsolute:R}=IM({nodeId:M.id,nextPosition:N,nodeLookup:f,nodeExtent:o,nodeOrigin:g,onError:u});M.position=C,M.internals.positionAbsolute=R,m.set(M.id,M)}d(m)},[])}const Ny=v.createContext(null),PH=Ny.Provider;Ny.Consumer;const vN=()=>v.useContext(Ny),LH=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),$H=(t,e,n)=>o=>{const{connectionClickStartHandle:a,connectionMode:i,connection:l}=o,{fromHandle:u,toHandle:d,isValid:f}=l,g=d?.nodeId===t&&d?.id===e&&d?.type===n;return{connectingFrom:u?.nodeId===t&&u?.id===e&&u?.type===n,connectingTo:g,clickConnecting:a?.nodeId===t&&a?.id===e&&a?.type===n,isPossibleEndHandle:i===qi.Strict?u?.type!==n:t!==u?.nodeId||e!==u?.id,connectionInProcess:!!u,clickConnectionInProcess:!!a,valid:g&&f}};function HH({type:t="source",position:e=qe.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:l,onConnect:u,children:d,className:f,onMouseDown:g,onTouchStart:m,...p},x){const w=l||null,E=t==="target",S=an(),M=vN(),{connectOnClick:N,noPanClassName:C,rfId:R}=Ct(LH,rn),{connectingFrom:D,connectingTo:T,clickConnecting:k,isPossibleEndHandle:j,connectionInProcess:$,clickConnectionInProcess:K,valid:U}=Ct($H(M,w,t),rn);M||S.getState().onError?.("010",Cr.error010());const Y=q=>{const{defaultEdgeOptions:A,onConnect:B,hasDefaultEdges:L}=S.getState(),F={...A,...q};if(L){const{edges:X,setEdges:I}=S.getState();I(l9(F,X))}B?.(F),u?.(F)},Z=q=>{if(!M)return;const A=UM(q.nativeEvent);if(a&&(A&&q.button===0||!A)){const B=S.getState();Qp.onPointerDown(q.nativeEvent,{handleDomNode:q.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:E,handleId:w,nodeId:M,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:B.onConnectEnd,updateConnection:B.updateConnection,onConnect:Y,isValidConnection:n||B.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}A?g?.(q):m?.(q)},P=q=>{const{onClickConnectStart:A,onClickConnectEnd:B,connectionClickStartHandle:L,connectionMode:F,isValidConnection:X,lib:I,rfId:z,nodeLookup:H,connection:G}=S.getState();if(!M||!L&&!a)return;if(!L){A?.(q.nativeEvent,{nodeId:M,handleId:w,handleType:t}),S.setState({connectionClickStartHandle:{nodeId:M,type:t,id:w}});return}const J=FM(q.target),ae=n||X,{connection:W,isValid:ee}=Qp.isValid(q.nativeEvent,{handle:{nodeId:M,id:w,type:t},connectionMode:F,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:ae,flowId:z,doc:J,lib:I,nodeLookup:H});ee&&W&&Y(W);const oe=structuredClone(G);delete oe.inProgress,oe.toPosition=oe.toHandle?oe.toHandle.position:null,B?.(q,oe),S.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":w,"data-nodeid":M,"data-handlepos":e,"data-id":`${R}-${M}-${w}-${t}`,className:Mn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",C,f,{source:!E,target:E,connectable:o,connectablestart:a,connectableend:i,clickconnecting:k,connectingfrom:D,connectingto:T,valid:U,connectionindicator:o&&(!$||j)&&($||K?i:a)}]),onMouseDown:Z,onTouchStart:Z,onClick:N?P:void 0,ref:x,...p,children:d})}const Qi=v.memo(mN(HH));function BH({data:t,isConnectable:e,sourcePosition:n=qe.Bottom}){return y.jsxs(y.Fragment,{children:[t?.label,y.jsx(Qi,{type:"source",position:n,isConnectable:e})]})}function FH({data:t,isConnectable:e,targetPosition:n=qe.Top,sourcePosition:o=qe.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(Qi,{type:"target",position:n,isConnectable:e}),t?.label,y.jsx(Qi,{type:"source",position:o,isConnectable:e})]})}function VH(){return null}function UH({data:t,isConnectable:e,targetPosition:n=qe.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(Qi,{type:"target",position:n,isConnectable:e}),t?.label]})}const bf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},SS={input:BH,default:FH,output:UH,group:VH};function YH(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const GH=t=>{const{width:e,height:n,x:o,y:a}=tu(t.nodeLookup,{filter:i=>!!i.selected});return{width:Jo(e)?e:null,height:Jo(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${o}px,${a}px)`}};function qH({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=an(),{width:a,height:i,transformString:l,userSelectionActive:u}=Ct(GH,rn),d=yN(),f=v.useRef(null);if(v.useEffect(()=>{n||f.current?.focus({preventScroll:!0})},[n]),pN({nodeRef:f}),u||!a||!i)return null;const g=t?p=>{const x=o.getState().nodes.filter(w=>w.selected);t(p,x)}:void 0,m=p=>{Object.prototype.hasOwnProperty.call(bf,p.key)&&(p.preventDefault(),d({direction:bf[p.key],factor:p.shiftKey?4:1}))};return y.jsx("div",{className:Mn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:y.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:a,height:i}})})}const CS=typeof window<"u"?window:void 0,WH=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function xN({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:u,deleteKeyCode:d,selectionKeyCode:f,selectionOnDrag:g,selectionMode:m,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:w,panActivationKeyCode:E,zoomActivationKeyCode:S,elementsSelectable:M,zoomOnScroll:N,zoomOnPinch:C,panOnScroll:R,panOnScrollSpeed:D,panOnScrollMode:T,zoomOnDoubleClick:k,panOnDrag:j,defaultViewport:$,translateExtent:K,minZoom:U,maxZoom:Y,preventScrolling:Z,onSelectionContextMenu:P,noWheelClassName:q,noPanClassName:A,disableKeyboardA11y:B,onViewportChange:L,isControlledViewport:F}){const{nodesSelectionActive:X,userSelectionActive:I}=Ct(WH,rn),z=Lc(f,{target:CS}),H=Lc(E,{target:CS}),G=H||j,J=H||R,ae=g&&G!==!0,W=z||I||ae;return RH({deleteKeyCode:d,multiSelectionKeyCode:w}),y.jsx(kH,{onPaneContextMenu:i,elementsSelectable:M,zoomOnScroll:N,zoomOnPinch:C,panOnScroll:J,panOnScrollSpeed:D,panOnScrollMode:T,zoomOnDoubleClick:k,panOnDrag:!z&&G,defaultViewport:$,translateExtent:K,minZoom:U,maxZoom:Y,zoomActivationKeyCode:S,preventScrolling:Z,noWheelClassName:q,noPanClassName:A,onViewportChange:L,isControlledViewport:F,paneClickDistance:u,selectionOnDrag:ae,children:y.jsxs(zH,{onSelectionStart:p,onSelectionEnd:x,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:G,isSelecting:!!W,selectionMode:m,selectionKeyPressed:z,paneClickDistance:u,selectionOnDrag:ae,children:[t,X&&y.jsx(qH,{onSelectionContextMenu:P,noPanClassName:A,disableKeyboardA11y:B})]})})}xN.displayName="FlowRenderer";const KH=v.memo(xN),XH=t=>e=>t?vy(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function ZH(t){return Ct(v.useCallback(XH(t),[t]),rn)}const QH=t=>t.updateNodeInternals;function JH(){const t=Ct(QH),[e]=v.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(a=>{const i=a.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:a.target,force:!0})}),t(o)}));return v.useEffect(()=>()=>{e?.disconnect()},[e]),e}function eB({node:t,nodeType:e,hasDimensions:n,resizeObserver:o}){const a=an(),i=v.useRef(null),l=v.useRef(null),u=v.useRef(t.sourcePosition),d=v.useRef(t.targetPosition),f=v.useRef(e),g=n&&!!t.internals.handleBounds;return v.useEffect(()=>{i.current&&!t.hidden&&(!g||l.current!==i.current)&&(l.current&&o?.unobserve(l.current),o?.observe(i.current),l.current=i.current)},[g,t.hidden]),v.useEffect(()=>()=>{l.current&&(o?.unobserve(l.current),l.current=null)},[]),v.useEffect(()=>{if(i.current){const m=f.current!==e,p=u.current!==t.sourcePosition,x=d.current!==t.targetPosition;(m||p||x)&&(f.current=e,u.current=t.sourcePosition,d.current=t.targetPosition,a.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:i.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),i}function tB({id:t,onClick:e,onMouseEnter:n,onMouseMove:o,onMouseLeave:a,onContextMenu:i,onDoubleClick:l,nodesDraggable:u,elementsSelectable:d,nodesConnectable:f,nodesFocusable:g,resizeObserver:m,noDragClassName:p,noPanClassName:x,disableKeyboardA11y:w,rfId:E,nodeTypes:S,nodeClickDistance:M,onError:N}){const{node:C,internals:R,isParent:D}=Ct(ee=>{const oe=ee.nodeLookup.get(t),de=ee.parentLookup.has(t);return{node:oe,internals:oe.internals,isParent:de}},rn);let T=C.type||"default",k=S?.[T]||SS[T];k===void 0&&(N?.("003",Cr.error003(T)),T="default",k=S?.default||SS.default);const j=!!(C.draggable||u&&typeof C.draggable>"u"),$=!!(C.selectable||d&&typeof C.selectable>"u"),K=!!(C.connectable||f&&typeof C.connectable>"u"),U=!!(C.focusable||g&&typeof C.focusable>"u"),Y=an(),Z=HM(C),P=eB({node:C,nodeType:T,hasDimensions:Z,resizeObserver:m}),q=pN({nodeRef:P,disabled:C.hidden||!j,noDragClassName:p,handleSelector:C.dragHandle,nodeId:t,isSelectable:$,nodeClickDistance:M}),A=yN();if(C.hidden)return null;const B=ua(C),L=YH(C),F=$||j||e||n||o||a,X=n?ee=>n(ee,{...R.userNode}):void 0,I=o?ee=>o(ee,{...R.userNode}):void 0,z=a?ee=>a(ee,{...R.userNode}):void 0,H=i?ee=>i(ee,{...R.userNode}):void 0,G=l?ee=>l(ee,{...R.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:oe,nodeDragThreshold:de}=Y.getState();$&&(!oe||!j||de>0)&&Jp({id:t,store:Y,nodeRef:P}),e&&e(ee,{...R.userNode})},ae=ee=>{if(!(VM(ee.nativeEvent)||w)){if(kM.includes(ee.key)&&$){const oe=ee.key==="Escape";Jp({id:t,store:Y,unselect:oe,nodeRef:P})}else if(j&&C.selected&&Object.prototype.hasOwnProperty.call(bf,ee.key)){ee.preventDefault();const{ariaLabelConfig:oe}=Y.getState();Y.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),A({direction:bf[ee.key],factor:ee.shiftKey?4:1})}}},W=()=>{if(w||!P.current?.matches(":focus-visible"))return;const{transform:ee,width:oe,height:de,autoPanOnNodeFocus:ge,setCenter:ne}=Y.getState();if(!ge)return;vy(new Map([[t,C]]),{x:0,y:0,width:oe,height:de},ee,!0).length>0||ne(C.position.x+B.width/2,C.position.y+B.height/2,{zoom:ee[2]})};return y.jsx("div",{className:Mn(["react-flow__node",`react-flow__node-${T}`,{[x]:j},C.className,{selected:C.selected,selectable:$,parent:D,draggable:j,dragging:q}]),ref:P,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:F?"all":"none",visibility:Z?"visible":"hidden",...C.style,...L},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:X,onMouseMove:I,onMouseLeave:z,onContextMenu:H,onClick:J,onDoubleClick:G,onKeyDown:U?ae:void 0,tabIndex:U?0:void 0,onFocus:U?W:void 0,role:C.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${lN}-${E}`,"aria-label":C.ariaLabel,...C.domAttributes,children:y.jsx(PH,{value:t,children:y.jsx(k,{id:t,data:C.data,type:T,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:C.selected??!1,selectable:$,draggable:j,deletable:C.deletable??!0,isConnectable:K,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:q,dragHandle:C.dragHandle,zIndex:R.z,parentId:C.parentId,...B})})})}var nB=v.memo(tB);const oB=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function bN(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:a,onError:i}=Ct(oB,rn),l=ZH(t.onlyRenderVisibleElements),u=JH();return y.jsx("div",{className:"react-flow__nodes",style:ih,children:l.map(d=>y.jsx(nB,{id:d,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:u,nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:a,nodeClickDistance:t.nodeClickDistance,onError:i},d))})}bN.displayName="NodeRenderer";const rB=v.memo(bN);function aB(t){return Ct(v.useCallback(n=>{if(!t)return n.edges.map(a=>a.id);const o=[];if(n.width&&n.height)for(const a of n.edges){const i=n.nodeLookup.get(a.source),l=n.nodeLookup.get(a.target);i&&l&&a9({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&o.push(a.id)}return o},[t]),rn)}const sB=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},iB=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ES={[yf.Arrow]:sB,[yf.ArrowClosed]:iB};function lB(t){const e=an();return v.useMemo(()=>Object.prototype.hasOwnProperty.call(ES,t)?ES[t]:(e.getState().onError?.("009",Cr.error009(t)),null),[t])}const cB=({id:t,type:e,color:n,width:o=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:u="auto-start-reverse"})=>{const d=lB(e);return d?y.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:u,refX:"0",refY:"0",children:y.jsx(d,{color:n,strokeWidth:l})}):null},wN=({defaultColor:t,rfId:e})=>{const n=Ct(i=>i.edges),o=Ct(i=>i.defaultEdgeOptions),a=v.useMemo(()=>h9(n,{id:e,defaultColor:t,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,e,t]);return a.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:a.map(i=>y.jsx(cB,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};wN.displayName="MarkerDefinitions";var uB=v.memo(wN);function SN({x:t,y:e,label:n,labelStyle:o,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:u=2,children:d,className:f,...g}){const[m,p]=v.useState({x:1,y:0,width:0,height:0}),x=Mn(["react-flow__edge-textwrapper",f]),w=v.useRef(null);return v.useEffect(()=>{if(w.current){const E=w.current.getBBox();p({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),n?y.jsxs("g",{transform:`translate(${t-m.width/2} ${e-m.height/2})`,className:x,visibility:m.width?"visible":"hidden",...g,children:[a&&y.jsx("rect",{width:m.width+2*l[0],x:-l[0],y:-l[1],height:m.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:u,ry:u}),y.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:w,style:o,children:n}),d]}):null}SN.displayName="EdgeText";const dB=v.memo(SN);function lh({path:t,labelX:e,labelY:n,label:o,labelStyle:a,labelShowBg:i,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,interactionWidth:f=20,...g}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...g,d:t,fill:"none",className:Mn(["react-flow__edge-path",g.className])}),f?y.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,o&&Jo(e)&&Jo(n)?y.jsx(dB,{x:e,y:n,label:o,labelStyle:a,labelShowBg:i,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d}):null]})}function _S({pos:t,x1:e,y1:n,x2:o,y2:a}){return t===qe.Left||t===qe.Right?[.5*(e+o),n]:[e,.5*(n+a)]}function CN({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:a,targetPosition:i=qe.Top}){const[l,u]=_S({pos:n,x1:t,y1:e,x2:o,y2:a}),[d,f]=_S({pos:i,x1:o,y1:a,x2:t,y2:e}),[g,m,p,x]=YM({sourceX:t,sourceY:e,targetX:o,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:f});return[`M${t},${e} C${l},${u} ${d},${f} ${o},${a}`,g,m,p,x]}function EN(t){return v.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:l,targetPosition:u,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:S,interactionWidth:M})=>{const[N,C,R]=CN({sourceX:n,sourceY:o,sourcePosition:l,targetX:a,targetY:i,targetPosition:u}),D=t.isInternal?void 0:e;return y.jsx(lh,{id:D,path:N,labelX:C,labelY:R,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:S,interactionWidth:M})})}const fB=EN({isInternal:!1}),_N=EN({isInternal:!0});fB.displayName="SimpleBezierEdge";_N.displayName="SimpleBezierEdgeInternal";function MN(t){return v.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,sourcePosition:x=qe.Bottom,targetPosition:w=qe.Top,markerEnd:E,markerStart:S,pathOptions:M,interactionWidth:N})=>{const[C,R,D]=Kp({sourceX:n,sourceY:o,sourcePosition:x,targetX:a,targetY:i,targetPosition:w,borderRadius:M?.borderRadius,offset:M?.offset,stepPosition:M?.stepPosition}),T=t.isInternal?void 0:e;return y.jsx(lh,{id:T,path:C,labelX:R,labelY:D,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,markerEnd:E,markerStart:S,interactionWidth:N})})}const NN=MN({isInternal:!1}),RN=MN({isInternal:!0});NN.displayName="SmoothStepEdge";RN.displayName="SmoothStepEdgeInternal";function DN(t){return v.memo(({id:e,...n})=>{const o=t.isInternal?void 0:e;return y.jsx(NN,{...n,id:o,pathOptions:v.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const hB=DN({isInternal:!1}),TN=DN({isInternal:!0});hB.displayName="StepEdge";TN.displayName="StepEdgeInternal";function kN(t){return v.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,markerEnd:x,markerStart:w,interactionWidth:E})=>{const[S,M,N]=WM({sourceX:n,sourceY:o,targetX:a,targetY:i}),C=t.isInternal?void 0:e;return y.jsx(lh,{id:C,path:S,labelX:M,labelY:N,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,markerEnd:x,markerStart:w,interactionWidth:E})})}const mB=kN({isInternal:!1}),ON=kN({isInternal:!0});mB.displayName="StraightEdge";ON.displayName="StraightEdgeInternal";function AN(t){return v.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:l=qe.Bottom,targetPosition:u=qe.Top,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:S,pathOptions:M,interactionWidth:N})=>{const[C,R,D]=GM({sourceX:n,sourceY:o,sourcePosition:l,targetX:a,targetY:i,targetPosition:u,curvature:M?.curvature}),T=t.isInternal?void 0:e;return y.jsx(lh,{id:T,path:C,labelX:R,labelY:D,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:x,style:w,markerEnd:E,markerStart:S,interactionWidth:N})})}const gB=AN({isInternal:!1}),jN=AN({isInternal:!0});gB.displayName="BezierEdge";jN.displayName="BezierEdgeInternal";const MS={default:jN,straight:ON,step:TN,smoothstep:RN,simplebezier:_N},NS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},pB=(t,e,n)=>n===qe.Left?t-e:n===qe.Right?t+e:t,yB=(t,e,n)=>n===qe.Top?t-e:n===qe.Bottom?t+e:t,RS="react-flow__edgeupdater";function DS({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:a,onMouseEnter:i,onMouseOut:l,type:u}){return y.jsx("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:l,className:Mn([RS,`${RS}-${u}`]),cx:pB(e,o,t),cy:yB(n,o,t),r:o,stroke:"transparent",fill:"transparent"})}function vB({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:o,sourceY:a,targetX:i,targetY:l,sourcePosition:u,targetPosition:d,onReconnect:f,onReconnectStart:g,onReconnectEnd:m,setReconnecting:p,setUpdateHover:x}){const w=an(),E=(R,D)=>{if(R.button!==0)return;const{autoPanOnConnect:T,domNode:k,isValidConnection:j,connectionMode:$,connectionRadius:K,lib:U,onConnectStart:Y,onConnectEnd:Z,cancelConnection:P,nodeLookup:q,rfId:A,panBy:B,updateConnection:L}=w.getState(),F=D.type==="target",X=(H,G)=>{p(!1),m?.(H,n,D.type,G)},I=H=>f?.(n,H),z=(H,G)=>{p(!0),g?.(R,n,D.type),Y?.(H,G)};Qp.onPointerDown(R.nativeEvent,{autoPanOnConnect:T,connectionMode:$,connectionRadius:K,domNode:k,handleId:D.id,nodeId:D.nodeId,nodeLookup:q,isTarget:F,edgeUpdaterType:D.type,lib:U,flowId:A,cancelConnection:P,panBy:B,isValidConnection:j,onConnect:I,onConnectStart:z,onConnectEnd:Z,onReconnectEnd:X,updateConnection:L,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},S=R=>E(R,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),M=R=>E(R,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>x(!0),C=()=>x(!1);return y.jsxs(y.Fragment,{children:[(t===!0||t==="source")&&y.jsx(DS,{position:u,centerX:o,centerY:a,radius:e,onMouseDown:S,onMouseEnter:N,onMouseOut:C,type:"source"}),(t===!0||t==="target")&&y.jsx(DS,{position:d,centerX:i,centerY:l,radius:e,onMouseDown:M,onMouseEnter:N,onMouseOut:C,type:"target"})]})}function xB({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:o,onClick:a,onDoubleClick:i,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:f,reconnectRadius:g,onReconnect:m,onReconnectStart:p,onReconnectEnd:x,rfId:w,edgeTypes:E,noPanClassName:S,onError:M,disableKeyboardA11y:N}){let C=Ct(ne=>ne.edgeLookup.get(t));const R=Ct(ne=>ne.defaultEdgeOptions);C=R?{...R,...C}:C;let D=C.type||"default",T=E?.[D]||MS[D];T===void 0&&(M?.("011",Cr.error011(D)),D="default",T=E?.default||MS.default);const k=!!(C.focusable||e&&typeof C.focusable>"u"),j=typeof m<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),$=!!(C.selectable||o&&typeof C.selectable>"u"),K=v.useRef(null),[U,Y]=v.useState(!1),[Z,P]=v.useState(!1),q=an(),{zIndex:A,sourceX:B,sourceY:L,targetX:F,targetY:X,sourcePosition:I,targetPosition:z}=Ct(v.useCallback(ne=>{const _e=ne.nodeLookup.get(C.source),De=ne.nodeLookup.get(C.target);if(!_e||!De)return{zIndex:C.zIndex,...NS};const Ye=f9({id:t,sourceNode:_e,targetNode:De,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:ne.connectionMode,onError:M});return{zIndex:r9({selected:C.selected,zIndex:C.zIndex,sourceNode:_e,targetNode:De,elevateOnSelect:ne.elevateEdgesOnSelect,zIndexMode:ne.zIndexMode}),...Ye||NS}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),rn),H=v.useMemo(()=>C.markerStart?`url('#${Xp(C.markerStart,w)}')`:void 0,[C.markerStart,w]),G=v.useMemo(()=>C.markerEnd?`url('#${Xp(C.markerEnd,w)}')`:void 0,[C.markerEnd,w]);if(C.hidden||B===null||L===null||F===null||X===null)return null;const J=ne=>{const{addSelectedEdges:_e,unselectNodesAndEdges:De,multiSelectionActive:Ye}=q.getState();$&&(q.setState({nodesSelectionActive:!1}),C.selected&&Ye?(De({nodes:[],edges:[C]}),K.current?.blur()):_e([t])),a&&a(ne,C)},ae=i?ne=>{i(ne,{...C})}:void 0,W=l?ne=>{l(ne,{...C})}:void 0,ee=u?ne=>{u(ne,{...C})}:void 0,oe=d?ne=>{d(ne,{...C})}:void 0,de=f?ne=>{f(ne,{...C})}:void 0,ge=ne=>{if(!N&&kM.includes(ne.key)&&$){const{unselectNodesAndEdges:_e,addSelectedEdges:De}=q.getState();ne.key==="Escape"?(K.current?.blur(),_e({edges:[C]})):De([t])}};return y.jsx("svg",{style:{zIndex:A},children:y.jsxs("g",{className:Mn(["react-flow__edge",`react-flow__edge-${D}`,C.className,S,{selected:C.selected,animated:C.animated,inactive:!$&&!a,updating:U,selectable:$}]),onClick:J,onDoubleClick:ae,onContextMenu:W,onMouseEnter:ee,onMouseMove:oe,onMouseLeave:de,onKeyDown:k?ge:void 0,tabIndex:k?0:void 0,role:C.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":k?`${cN}-${w}`:void 0,ref:K,...C.domAttributes,children:[!Z&&y.jsx(T,{id:t,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:$,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:B,sourceY:L,targetX:F,targetY:X,sourcePosition:I,targetPosition:z,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:H,markerEnd:G,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),j&&y.jsx(vB,{edge:C,isReconnectable:j,reconnectRadius:g,onReconnect:m,onReconnectStart:p,onReconnectEnd:x,sourceX:B,sourceY:L,targetX:F,targetY:X,sourcePosition:I,targetPosition:z,setUpdateHover:Y,setReconnecting:P})]})})}var bB=v.memo(xB);const wB=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function zN({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:o,noPanClassName:a,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:u,onEdgeMouseMove:d,onEdgeMouseLeave:f,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:p,onReconnectStart:x,onReconnectEnd:w,disableKeyboardA11y:E}){const{edgesFocusable:S,edgesReconnectable:M,elementsSelectable:N,onError:C}=Ct(wB,rn),R=aB(e);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(uB,{defaultColor:t,rfId:n}),R.map(D=>y.jsx(bB,{id:D,edgesFocusable:S,edgesReconnectable:M,elementsSelectable:N,noPanClassName:a,onReconnect:i,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:f,onClick:g,reconnectRadius:m,onDoubleClick:p,onReconnectStart:x,onReconnectEnd:w,rfId:n,onError:C,edgeTypes:o,disableKeyboardA11y:E},D))]})}zN.displayName="EdgeRenderer";const SB=v.memo(zN),CB=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function EB({children:t}){const e=Ct(CB);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function _B(t){const e=My(),n=v.useRef(!1);v.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const MB=t=>t.panZoom?.syncViewport;function NB(t){const e=Ct(MB),n=an();return v.useEffect(()=>{t&&(e?.(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function RB(t){return t.connection.inProgress?{...t.connection,to:ou(t.connection.to,t.transform)}:{...t.connection}}function DB(t){return RB}function TB(t){const e=DB();return Ct(e,rn)}const kB=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function OB({containerStyle:t,style:e,type:n,component:o}){const{nodesConnectable:a,width:i,height:l,isValid:u,inProgress:d}=Ct(kB,rn);return!(i&&a&&d)?null:y.jsx("svg",{style:t,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:Mn(["react-flow__connection",jM(u)]),children:y.jsx(IN,{style:e,type:n,CustomComponent:o,isValid:u})})})}const IN=({style:t,type:e=Ba.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:a,from:i,fromNode:l,fromHandle:u,fromPosition:d,to:f,toNode:g,toHandle:m,toPosition:p,pointer:x}=TB();if(!a)return;if(n)return y.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:l,fromHandle:u,fromX:i.x,fromY:i.y,toX:f.x,toY:f.y,fromPosition:d,toPosition:p,connectionStatus:jM(o),toNode:g,toHandle:m,pointer:x});let w="";const E={sourceX:i.x,sourceY:i.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:p};switch(e){case Ba.Bezier:[w]=GM(E);break;case Ba.SimpleBezier:[w]=CN(E);break;case Ba.Step:[w]=Kp({...E,borderRadius:0});break;case Ba.SmoothStep:[w]=Kp(E);break;default:[w]=WM(E)}return y.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:t})};IN.displayName="ConnectionLine";const AB={};function TS(t=AB){v.useRef(t),an(),v.useEffect(()=>{},[t])}function jB(){an(),v.useRef(!1),v.useEffect(()=>{},[])}function PN({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:o,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:p,onSelectionEnd:x,connectionLineType:w,connectionLineStyle:E,connectionLineComponent:S,connectionLineContainerStyle:M,selectionKeyCode:N,selectionOnDrag:C,selectionMode:R,multiSelectionKeyCode:D,panActivationKeyCode:T,zoomActivationKeyCode:k,deleteKeyCode:j,onlyRenderVisibleElements:$,elementsSelectable:K,defaultViewport:U,translateExtent:Y,minZoom:Z,maxZoom:P,preventScrolling:q,defaultMarkerColor:A,zoomOnScroll:B,zoomOnPinch:L,panOnScroll:F,panOnScrollSpeed:X,panOnScrollMode:I,zoomOnDoubleClick:z,panOnDrag:H,onPaneClick:G,onPaneMouseEnter:J,onPaneMouseMove:ae,onPaneMouseLeave:W,onPaneScroll:ee,onPaneContextMenu:oe,paneClickDistance:de,nodeClickDistance:ge,onEdgeContextMenu:ne,onEdgeMouseEnter:_e,onEdgeMouseMove:De,onEdgeMouseLeave:Ye,reconnectRadius:Pe,onReconnect:mt,onReconnectStart:sn,onReconnectEnd:ft,noDragClassName:xn,noWheelClassName:ln,noPanClassName:Ft,disableKeyboardA11y:fn,nodeExtent:zt,rfId:Nn,viewport:gn,onViewportChange:In}){return TS(t),TS(e),jB(),_B(n),NB(gn),y.jsx(KH,{onPaneClick:G,onPaneMouseEnter:J,onPaneMouseMove:ae,onPaneMouseLeave:W,onPaneContextMenu:oe,onPaneScroll:ee,paneClickDistance:de,deleteKeyCode:j,selectionKeyCode:N,selectionOnDrag:C,selectionMode:R,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:D,panActivationKeyCode:T,zoomActivationKeyCode:k,elementsSelectable:K,zoomOnScroll:B,zoomOnPinch:L,zoomOnDoubleClick:z,panOnScroll:F,panOnScrollSpeed:X,panOnScrollMode:I,panOnDrag:H,defaultViewport:U,translateExtent:Y,minZoom:Z,maxZoom:P,onSelectionContextMenu:m,preventScrolling:q,noDragClassName:xn,noWheelClassName:ln,noPanClassName:Ft,disableKeyboardA11y:fn,onViewportChange:In,isControlledViewport:!!gn,children:y.jsxs(EB,{children:[y.jsx(SB,{edgeTypes:e,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:mt,onReconnectStart:sn,onReconnectEnd:ft,onlyRenderVisibleElements:$,onEdgeContextMenu:ne,onEdgeMouseEnter:_e,onEdgeMouseMove:De,onEdgeMouseLeave:Ye,reconnectRadius:Pe,defaultMarkerColor:A,noPanClassName:Ft,disableKeyboardA11y:fn,rfId:Nn}),y.jsx(OB,{style:E,type:w,component:S,containerStyle:M}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(rB,{nodeTypes:t,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:g,nodeClickDistance:ge,onlyRenderVisibleElements:$,noPanClassName:Ft,noDragClassName:xn,disableKeyboardA11y:fn,nodeExtent:zt,rfId:Nn}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}PN.displayName="GraphView";const zB=v.memo(PN),kS=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:u,minZoom:d=.5,maxZoom:f=2,nodeOrigin:g,nodeExtent:m,zIndexMode:p="basic"}={})=>{const x=new Map,w=new Map,E=new Map,S=new Map,M=o??e??[],N=n??t??[],C=g??[0,0],R=m??jc;ZM(E,S,M);const D=Zp(N,x,w,{nodeOrigin:C,nodeExtent:R,zIndexMode:p});let T=[0,0,1];if(l&&a&&i){const k=tu(x,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:j,y:$,zoom:K}=xy(k,a,i,d,f,u?.padding??.1);T=[j,$,K]}return{rfId:"1",width:a??0,height:i??0,transform:T,nodes:N,nodesInitialized:D,nodeLookup:x,parentLookup:w,edges:M,edgeLookup:S,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:d,maxZoom:f,translateExtent:jc,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:qi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:u,fitViewResolver:null,connection:{...AM},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Q$,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:OM,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},IB=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:g,nodeExtent:m,zIndexMode:p})=>eH((x,w)=>{async function E(){const{nodeLookup:S,panZoom:M,fitViewOptions:N,fitViewResolver:C,width:R,height:D,minZoom:T,maxZoom:k}=w();M&&(await X$({nodes:S,width:R,height:D,panZoom:M,minZoom:T,maxZoom:k},N),C?.resolve(!0),x({fitViewResolver:null}))}return{...kS({nodes:t,edges:e,width:a,height:i,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:o,zIndexMode:p}),setNodes:S=>{const{nodeLookup:M,parentLookup:N,nodeOrigin:C,elevateNodesOnSelect:R,fitViewQueued:D,zIndexMode:T}=w(),k=Zp(S,M,N,{nodeOrigin:C,nodeExtent:m,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:T});D&&k?(E(),x({nodes:S,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:S,nodesInitialized:k})},setEdges:S=>{const{connectionLookup:M,edgeLookup:N}=w();ZM(M,N,S),x({edges:S})},setDefaultNodesAndEdges:(S,M)=>{if(S){const{setNodes:N}=w();N(S),x({hasDefaultNodes:!0})}if(M){const{setEdges:N}=w();N(M),x({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:M,nodeLookup:N,parentLookup:C,domNode:R,nodeOrigin:D,nodeExtent:T,debug:k,fitViewQueued:j,zIndexMode:$}=w(),{changes:K,updatedInternals:U}=b9(S,N,C,R,D,T,$);U&&(p9(N,C,{nodeOrigin:D,nodeExtent:T,zIndexMode:$}),j?(E(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),K?.length>0&&(k&&console.log("React Flow: trigger node changes",K),M?.(K)))},updateNodePositions:(S,M=!1)=>{const N=[];let C=[];const{nodeLookup:R,triggerNodeChanges:D,connection:T,updateConnection:k,onNodesChangeMiddlewareMap:j}=w();for(const[$,K]of S){const U=R.get($),Y=!!(U?.expandParent&&U?.parentId&&K?.position),Z={id:$,type:"position",position:Y?{x:Math.max(0,K.position.x),y:Math.max(0,K.position.y)}:K.position,dragging:M};if(U&&T.inProgress&&T.fromNode.id===U.id){const P=Is(U,T.fromHandle,qe.Left,!0);k({...T,from:P})}Y&&U.parentId&&N.push({id:$,parentId:U.parentId,rect:{...K.internals.positionAbsolute,width:K.measured.width??0,height:K.measured.height??0}}),C.push(Z)}if(N.length>0){const{parentLookup:$,nodeOrigin:K}=w(),U=_y(N,R,$,K);C.push(...U)}for(const $ of j.values())C=$(C);D(C)},triggerNodeChanges:S=>{const{onNodesChange:M,setNodes:N,nodes:C,hasDefaultNodes:R,debug:D}=w();if(S?.length){if(R){const T=fN(S,C);N(T)}D&&console.log("React Flow: trigger node changes",S),M?.(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:M,setEdges:N,edges:C,hasDefaultEdges:R,debug:D}=w();if(S?.length){if(R){const T=hN(S,C);N(T)}D&&console.log("React Flow: trigger edge changes",S),M?.(S)}},addSelectedNodes:S=>{const{multiSelectionActive:M,edgeLookup:N,nodeLookup:C,triggerNodeChanges:R,triggerEdgeChanges:D}=w();if(M){const T=S.map(k=>Ss(k,!0));R(T);return}R(Ii(C,new Set([...S]),!0)),D(Ii(N))},addSelectedEdges:S=>{const{multiSelectionActive:M,edgeLookup:N,nodeLookup:C,triggerNodeChanges:R,triggerEdgeChanges:D}=w();if(M){const T=S.map(k=>Ss(k,!0));D(T);return}D(Ii(N,new Set([...S]))),R(Ii(C,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:M}={})=>{const{edges:N,nodes:C,nodeLookup:R,triggerNodeChanges:D,triggerEdgeChanges:T}=w(),k=S||C,j=M||N,$=k.map(U=>{const Y=R.get(U.id);return Y&&(Y.selected=!1),Ss(U.id,!1)}),K=j.map(U=>Ss(U.id,!1));D($),T(K)},setMinZoom:S=>{const{panZoom:M,maxZoom:N}=w();M?.setScaleExtent([S,N]),x({minZoom:S})},setMaxZoom:S=>{const{panZoom:M,minZoom:N}=w();M?.setScaleExtent([N,S]),x({maxZoom:S})},setTranslateExtent:S=>{w().panZoom?.setTranslateExtent(S),x({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:M,triggerNodeChanges:N,triggerEdgeChanges:C,elementsSelectable:R}=w();if(!R)return;const D=M.reduce((k,j)=>j.selected?[...k,Ss(j.id,!1)]:k,[]),T=S.reduce((k,j)=>j.selected?[...k,Ss(j.id,!1)]:k,[]);N(D),C(T)},setNodeExtent:S=>{const{nodes:M,nodeLookup:N,parentLookup:C,nodeOrigin:R,elevateNodesOnSelect:D,nodeExtent:T,zIndexMode:k}=w();S[0][0]===T[0][0]&&S[0][1]===T[0][1]&&S[1][0]===T[1][0]&&S[1][1]===T[1][1]||(Zp(M,N,C,{nodeOrigin:R,nodeExtent:S,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:k}),x({nodeExtent:S}))},panBy:S=>{const{transform:M,width:N,height:C,panZoom:R,translateExtent:D}=w();return w9({delta:S,panZoom:R,transform:M,translateExtent:D,width:N,height:C})},setCenter:async(S,M,N)=>{const{width:C,height:R,maxZoom:D,panZoom:T}=w();if(!T)return Promise.resolve(!1);const k=typeof N?.zoom<"u"?N.zoom:D;return await T.setViewport({x:C/2-S*k,y:R/2-M*k,zoom:k},{duration:N?.duration,ease:N?.ease,interpolate:N?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...AM}})},updateConnection:S=>{x({connection:S})},reset:()=>x({...kS()})}},Object.is);function PB({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:o,initialWidth:a,initialHeight:i,initialMinZoom:l,initialMaxZoom:u,initialFitViewOptions:d,fitView:f,nodeOrigin:g,nodeExtent:m,zIndexMode:p,children:x}){const[w]=v.useState(()=>IB({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:f,minZoom:l,maxZoom:u,fitViewOptions:d,nodeOrigin:g,nodeExtent:m,zIndexMode:p}));return y.jsx(tH,{value:w,children:y.jsx(EH,{children:x})})}function LB({children:t,nodes:e,edges:n,defaultNodes:o,defaultEdges:a,width:i,height:l,fitView:u,fitViewOptions:d,minZoom:f,maxZoom:g,nodeOrigin:m,nodeExtent:p,zIndexMode:x}){return v.useContext(ah)?y.jsx(y.Fragment,{children:t}):y.jsx(PB,{initialNodes:e,initialEdges:n,defaultNodes:o,defaultEdges:a,initialWidth:i,initialHeight:l,fitView:u,initialFitViewOptions:d,initialMinZoom:f,initialMaxZoom:g,nodeOrigin:m,nodeExtent:p,zIndexMode:x,children:t})}const $B={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function HB({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:a,nodeTypes:i,edgeTypes:l,onNodeClick:u,onEdgeClick:d,onInit:f,onMove:g,onMoveStart:m,onMoveEnd:p,onConnect:x,onConnectStart:w,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:M,onNodeMouseEnter:N,onNodeMouseMove:C,onNodeMouseLeave:R,onNodeContextMenu:D,onNodeDoubleClick:T,onNodeDragStart:k,onNodeDrag:j,onNodeDragStop:$,onNodesDelete:K,onEdgesDelete:U,onDelete:Y,onSelectionChange:Z,onSelectionDragStart:P,onSelectionDrag:q,onSelectionDragStop:A,onSelectionContextMenu:B,onSelectionStart:L,onSelectionEnd:F,onBeforeDelete:X,connectionMode:I,connectionLineType:z=Ba.Bezier,connectionLineStyle:H,connectionLineComponent:G,connectionLineContainerStyle:J,deleteKeyCode:ae="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:ee=!1,selectionMode:oe=zc.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:ge=Pc()?"Meta":"Control",zoomActivationKeyCode:ne=Pc()?"Meta":"Control",snapToGrid:_e,snapGrid:De,onlyRenderVisibleElements:Ye=!1,selectNodesOnDrag:Pe,nodesDraggable:mt,autoPanOnNodeFocus:sn,nodesConnectable:ft,nodesFocusable:xn,nodeOrigin:ln=uN,edgesFocusable:Ft,edgesReconnectable:fn,elementsSelectable:zt=!0,defaultViewport:Nn=mH,minZoom:gn=.5,maxZoom:In=2,translateExtent:jn=jc,preventScrolling:Ce=!0,nodeExtent:Ve,defaultMarkerColor:Et="#b1b1b7",zoomOnScroll:Xe=!0,zoomOnPinch:at=!0,panOnScroll:gt=!1,panOnScrollSpeed:qt=.5,panOnScrollMode:Wt=Ns.Free,zoomOnDoubleClick:Qn=!0,panOnDrag:_t=!0,onPaneClick:Be,onPaneMouseEnter:nt,onPaneMouseMove:Ue,onPaneMouseLeave:st,onPaneScroll:Lt,onPaneContextMenu:Te,paneClickDistance:Ot=1,nodeClickDistance:Kt=0,children:cn,onReconnect:Pn,onReconnectStart:Dt,onReconnectEnd:Rn,onEdgeContextMenu:Yo,onEdgeDoubleClick:vt,onEdgeMouseEnter:Dn,onEdgeMouseMove:To,onEdgeMouseLeave:Un,reconnectRadius:co=10,onNodesChange:Dr,onEdgesChange:uo,noDragClassName:un="nodrag",noWheelClassName:Tn="nowheel",noPanClassName:ko="nopan",fitView:Tr,fitViewOptions:os,connectOnClick:Q,attributionPosition:re,proOptions:le,defaultEdgeOptions:ye,elevateNodesOnSelect:xe=!0,elevateEdgesOnSelect:Me=!1,disableKeyboardA11y:Ie=!1,autoPanOnConnect:je,autoPanOnNodeDrag:be,autoPanSpeed:Re,connectionRadius:ke,isValidConnection:Ae,onError:ve,style:Oe,id:ot,nodeDragThreshold:St,connectionDragThreshold:Mt,viewport:lt,onViewportChange:It,width:rt,height:ht,colorMode:Pt="light",debug:Yn,onScroll:kn,ariaLabelConfig:Ln,zIndexMode:Qt="basic",...kr},Ze){const fo=ot||"1",lr=vH(Pt),rs=v.useCallback(At=>{At.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),kn?.(At)},[kn]);return y.jsx("div",{"data-testid":"rf__wrapper",...kr,onScroll:rs,style:{...Oe,...$B},ref:Ze,className:Mn(["react-flow",a,lr]),id:ot,role:"application",children:y.jsxs(LB,{nodes:t,edges:e,width:rt,height:ht,fitView:Tr,fitViewOptions:os,minZoom:gn,maxZoom:In,nodeOrigin:ln,nodeExtent:Ve,zIndexMode:Qt,children:[y.jsx(zB,{onInit:f,onNodeClick:u,onEdgeClick:d,onNodeMouseEnter:N,onNodeMouseMove:C,onNodeMouseLeave:R,onNodeContextMenu:D,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:l,connectionLineType:z,connectionLineStyle:H,connectionLineComponent:G,connectionLineContainerStyle:J,selectionKeyCode:W,selectionOnDrag:ee,selectionMode:oe,deleteKeyCode:ae,multiSelectionKeyCode:ge,panActivationKeyCode:de,zoomActivationKeyCode:ne,onlyRenderVisibleElements:Ye,defaultViewport:Nn,translateExtent:jn,minZoom:gn,maxZoom:In,preventScrolling:Ce,zoomOnScroll:Xe,zoomOnPinch:at,zoomOnDoubleClick:Qn,panOnScroll:gt,panOnScrollSpeed:qt,panOnScrollMode:Wt,panOnDrag:_t,onPaneClick:Be,onPaneMouseEnter:nt,onPaneMouseMove:Ue,onPaneMouseLeave:st,onPaneScroll:Lt,onPaneContextMenu:Te,paneClickDistance:Ot,nodeClickDistance:Kt,onSelectionContextMenu:B,onSelectionStart:L,onSelectionEnd:F,onReconnect:Pn,onReconnectStart:Dt,onReconnectEnd:Rn,onEdgeContextMenu:Yo,onEdgeDoubleClick:vt,onEdgeMouseEnter:Dn,onEdgeMouseMove:To,onEdgeMouseLeave:Un,reconnectRadius:co,defaultMarkerColor:Et,noDragClassName:un,noWheelClassName:Tn,noPanClassName:ko,rfId:fo,disableKeyboardA11y:Ie,nodeExtent:Ve,viewport:lt,onViewportChange:It}),y.jsx(yH,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:x,onConnectStart:w,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:M,nodesDraggable:mt,autoPanOnNodeFocus:sn,nodesConnectable:ft,nodesFocusable:xn,edgesFocusable:Ft,edgesReconnectable:fn,elementsSelectable:zt,elevateNodesOnSelect:xe,elevateEdgesOnSelect:Me,minZoom:gn,maxZoom:In,nodeExtent:Ve,onNodesChange:Dr,onEdgesChange:uo,snapToGrid:_e,snapGrid:De,connectionMode:I,translateExtent:jn,connectOnClick:Q,defaultEdgeOptions:ye,fitView:Tr,fitViewOptions:os,onNodesDelete:K,onEdgesDelete:U,onDelete:Y,onNodeDragStart:k,onNodeDrag:j,onNodeDragStop:$,onSelectionDrag:q,onSelectionDragStart:P,onSelectionDragStop:A,onMove:g,onMoveStart:m,onMoveEnd:p,noPanClassName:ko,nodeOrigin:ln,rfId:fo,autoPanOnConnect:je,autoPanOnNodeDrag:be,autoPanSpeed:Re,onError:ve,connectionRadius:ke,isValidConnection:Ae,selectNodesOnDrag:Pe,nodeDragThreshold:St,connectionDragThreshold:Mt,onBeforeDelete:X,debug:Yn,ariaLabelConfig:Ln,zIndexMode:Qt}),y.jsx(hH,{onSelectionChange:Z}),cn,y.jsx(lH,{proOptions:le,position:re}),y.jsx(iH,{rfId:fo,disableKeyboardA11y:Ie})]})})}var BB=mN(HB);function FB(t){const[e,n]=v.useState(t),o=v.useCallback(a=>n(i=>fN(a,i)),[]);return[e,n,o]}function VB(t){const[e,n]=v.useState(t),o=v.useCallback(a=>n(i=>hN(a,i)),[]);return[e,n,o]}function UB({dimensions:t,lineWidth:e,variant:n,className:o}){return y.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Mn(["react-flow__background-pattern",n,o])})}function YB({radius:t,className:e}){return y.jsx("circle",{cx:t,cy:t,r:t,className:Mn(["react-flow__background-pattern","dots",e])})}var Ua;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ua||(Ua={}));const GB={[Ua.Dots]:1,[Ua.Lines]:1,[Ua.Cross]:6},qB=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function LN({id:t,variant:e=Ua.Dots,gap:n=20,size:o,lineWidth:a=1,offset:i=0,color:l,bgColor:u,style:d,className:f,patternClassName:g}){const m=v.useRef(null),{transform:p,patternId:x}=Ct(qB,rn),w=o||GB[e],E=e===Ua.Dots,S=e===Ua.Cross,M=Array.isArray(n)?n:[n,n],N=[M[0]*p[2]||1,M[1]*p[2]||1],C=w*p[2],R=Array.isArray(i)?i:[i,i],D=S?[C,C]:N,T=[R[0]*p[2]||1+D[0]/2,R[1]*p[2]||1+D[1]/2],k=`${x}${t||""}`;return y.jsxs("svg",{className:Mn(["react-flow__background",f]),style:{...d,...ih,"--xy-background-color-props":u,"--xy-background-pattern-color-props":l},ref:m,"data-testid":"rf__background",children:[y.jsx("pattern",{id:k,x:p[0]%N[0],y:p[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:E?y.jsx(YB,{radius:C/2,className:g}):y.jsx(UB,{dimensions:D,lineWidth:a,variant:e,className:g})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}LN.displayName="Background";const WB=v.memo(LN);function KB(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function XB(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function ZB(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function QB(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function JB(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Ld({children:t,className:e,...n}){return y.jsx("button",{type:"button",className:Mn(["react-flow__controls-button",e]),...n,children:t})}const eF=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function $N({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:l,onFitView:u,onInteractiveChange:d,className:f,children:g,position:m="bottom-left",orientation:p="vertical","aria-label":x}){const w=an(),{isInteractive:E,minZoomReached:S,maxZoomReached:M,ariaLabelConfig:N}=Ct(eF,rn),{zoomIn:C,zoomOut:R,fitView:D}=My(),T=()=>{C(),i?.()},k=()=>{R(),l?.()},j=()=>{D(a),u?.()},$=()=>{w.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),d?.(!E)},K=p==="horizontal"?"horizontal":"vertical";return y.jsxs(sh,{className:Mn(["react-flow__controls",K,f]),position:m,style:t,"data-testid":"rf__controls","aria-label":x??N["controls.ariaLabel"],children:[e&&y.jsxs(y.Fragment,{children:[y.jsx(Ld,{onClick:T,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:M,children:y.jsx(KB,{})}),y.jsx(Ld,{onClick:k,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:S,children:y.jsx(XB,{})})]}),n&&y.jsx(Ld,{className:"react-flow__controls-fitview",onClick:j,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:y.jsx(ZB,{})}),o&&y.jsx(Ld,{className:"react-flow__controls-interactive",onClick:$,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:E?y.jsx(JB,{}):y.jsx(QB,{})}),g]})}$N.displayName="Controls";v.memo($N);function tF({id:t,x:e,y:n,width:o,height:a,style:i,color:l,strokeColor:u,strokeWidth:d,className:f,borderRadius:g,shapeRendering:m,selected:p,onClick:x}){const{background:w,backgroundColor:E}=i||{},S=l||w||E;return y.jsx("rect",{className:Mn(["react-flow__minimap-node",{selected:p},f]),x:e,y:n,rx:g,ry:g,width:o,height:a,style:{fill:S,stroke:u,strokeWidth:d},shapeRendering:m,onClick:x?M=>x(M,t):void 0})}const nF=v.memo(tF),oF=t=>t.nodes.map(e=>e.id),op=t=>t instanceof Function?t:()=>t;function rF({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:i=nF,onClick:l}){const u=Ct(oF,rn),d=op(e),f=op(t),g=op(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:u.map(p=>y.jsx(sF,{id:p,nodeColorFunc:d,nodeStrokeColorFunc:f,nodeClassNameFunc:g,nodeBorderRadius:o,nodeStrokeWidth:a,NodeComponent:i,onClick:l,shapeRendering:m},p))})}function aF({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:u,onClick:d}){const{node:f,x:g,y:m,width:p,height:x}=Ct(w=>{const{internals:E}=w.nodeLookup.get(t),S=E.userNode,{x:M,y:N}=E.positionAbsolute,{width:C,height:R}=ua(S);return{node:S,x:M,y:N,width:C,height:R}},rn);return!f||f.hidden||!HM(f)?null:y.jsx(u,{x:g,y:m,width:p,height:x,style:f.style,selected:!!f.selected,className:o(f),color:e(f),borderRadius:a,strokeColor:n(f),strokeWidth:i,shapeRendering:l,onClick:d,id:f.id})}const sF=v.memo(aF);var iF=v.memo(rF);const lF=200,cF=150,uF=t=>!t.hidden,dF=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?$M(tu(t.nodeLookup,{filter:uF}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},fF="react-flow__minimap-desc";function HN({style:t,className:e,nodeStrokeColor:n,nodeColor:o,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:u,bgColor:d,maskColor:f,maskStrokeColor:g,maskStrokeWidth:m,position:p="bottom-right",onClick:x,onNodeClick:w,pannable:E=!1,zoomable:S=!1,ariaLabel:M,inversePan:N,zoomStep:C=1,offsetScale:R=5}){const D=an(),T=v.useRef(null),{boundingRect:k,viewBB:j,rfId:$,panZoom:K,translateExtent:U,flowWidth:Y,flowHeight:Z,ariaLabelConfig:P}=Ct(dF,rn),q=t?.width??lF,A=t?.height??cF,B=k.width/q,L=k.height/A,F=Math.max(B,L),X=F*q,I=F*A,z=R*F,H=k.x-(X-k.width)/2-z,G=k.y-(I-k.height)/2-z,J=X+z*2,ae=I+z*2,W=`${fF}-${$}`,ee=v.useRef(0),oe=v.useRef();ee.current=F,v.useEffect(()=>{if(T.current&&K)return oe.current=T9({domNode:T.current,panZoom:K,getTransform:()=>D.getState().transform,getViewScale:()=>ee.current}),()=>{oe.current?.destroy()}},[K]),v.useEffect(()=>{oe.current?.update({translateExtent:U,width:Y,height:Z,inversePan:N,pannable:E,zoomStep:C,zoomable:S})},[E,S,N,C,U,Y,Z]);const de=x?_e=>{const[De,Ye]=oe.current?.pointer(_e)||[0,0];x(_e,{x:De,y:Ye})}:void 0,ge=w?v.useCallback((_e,De)=>{const Ye=D.getState().nodeLookup.get(De).internals.userNode;w(_e,Ye)},[]):void 0,ne=M??P["minimap.ariaLabel"];return y.jsx(sh,{position:p,style:{...t,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*F:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Mn(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:q,height:A,viewBox:`${H} ${G} ${J} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:T,onClick:de,children:[ne&&y.jsx("title",{id:W,children:ne}),y.jsx(iF,{onClick:ge,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:u}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-z},${G-z}h${J+z*2}v${ae+z*2}h${-J-z*2}z
|
|
61
|
+
M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}HN.displayName="MiniMap";v.memo(HN);const hF=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,mF={[Zi.Line]:"right",[Zi.Handle]:"bottom-right"};function gF({nodeId:t,position:e,variant:n=Zi.Handle,className:o,style:a=void 0,children:i,color:l,minWidth:u=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:p,autoScale:x=!0,shouldResize:w,onResizeStart:E,onResize:S,onResizeEnd:M}){const N=vN(),C=typeof t=="string"?t:N,R=an(),D=v.useRef(null),T=n===Zi.Handle,k=Ct(v.useCallback(hF(T&&x),[T,x]),rn),j=v.useRef(null),$=e??mF[n];v.useEffect(()=>{if(!(!D.current||!C))return j.current||(j.current=U9({domNode:D.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:U,transform:Y,snapGrid:Z,snapToGrid:P,nodeOrigin:q,domNode:A}=R.getState();return{nodeLookup:U,transform:Y,snapGrid:Z,snapToGrid:P,nodeOrigin:q,paneDomNode:A}},onChange:(U,Y)=>{const{triggerNodeChanges:Z,nodeLookup:P,parentLookup:q,nodeOrigin:A}=R.getState(),B=[],L={x:U.x,y:U.y},F=P.get(C);if(F&&F.expandParent&&F.parentId){const X=F.origin??A,I=U.width??F.measured.width??0,z=U.height??F.measured.height??0,H={id:F.id,parentId:F.parentId,rect:{width:I,height:z,...BM({x:U.x??F.position.x,y:U.y??F.position.y},{width:I,height:z},F.parentId,P,X)}},G=_y([H],P,q,A);B.push(...G),L.x=U.x?Math.max(X[0]*I,U.x):void 0,L.y=U.y?Math.max(X[1]*z,U.y):void 0}if(L.x!==void 0&&L.y!==void 0){const X={id:C,type:"position",position:{...L}};B.push(X)}if(U.width!==void 0&&U.height!==void 0){const I={id:C,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};B.push(I)}for(const X of Y){const I={...X,type:"position"};B.push(I)}Z(B)},onEnd:({width:U,height:Y})=>{const Z={id:C,type:"dimensions",resizing:!1,dimensions:{width:U,height:Y}};R.getState().triggerNodeChanges([Z])}})),j.current.update({controlPosition:$,boundaries:{minWidth:u,minHeight:d,maxWidth:f,maxHeight:g},keepAspectRatio:m,resizeDirection:p,onResizeStart:E,onResize:S,onResizeEnd:M,shouldResize:w}),()=>{j.current?.destroy()}},[$,u,d,f,g,m,E,S,M,w]);const K=$.split("-");return y.jsx("div",{className:Mn(["react-flow__resize-control","nodrag",...K,n,o]),ref:D,style:{...a,scale:k,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:i})}v.memo(gF);const pF={timestamptz:"timestamp with time zone",bool:"boolean",bytea:"bytea",jsonb:"jsonb",text:"text",varchar:"character varying",uuid:"uuid",date:"date",time:"time without time zone",timetz:"time with time zone",timestamp:"timestamp without time zone",int2:"smallint",int4:"integer",int8:"bigint",float4:"real",float8:"double precision",numeric:"numeric"};function ru(t){if(t==null||t==="")return"";const e=t.trim().toLowerCase();return pF[e]??t}function yF(t){const e=Ee.c(14),{data:n}=t,{table:o}=n;let a;e[0]!==o.schema?(a=y.jsx("div",{className:"text-xs opacity-80",children:o.schema}),e[0]=o.schema,e[1]=a):a=e[1];let i;e[2]!==o.name?(i=y.jsx("div",{className:"text-base",children:o.name}),e[2]=o.name,e[3]=i):i=e[3];let l;e[4]!==a||e[5]!==i?(l=y.jsxs("div",{className:"bg-primary text-primary-foreground px-3 py-2 rounded-t-lg font-semibold",children:[a,i]}),e[4]=a,e[5]=i,e[6]=l):l=e[6];let u;e[7]!==o.columns?(u=o.columns.map(vF),e[7]=o.columns,e[8]=u):u=e[8];let d;e[9]!==u?(d=y.jsx("div",{className:"divide-y divide-border",children:u}),e[9]=u,e[10]=d):d=e[10];let f;return e[11]!==l||e[12]!==d?(f=y.jsxs("div",{className:"bg-card border border-border rounded-lg shadow-lg w-[250px]",children:[l,d]}),e[11]=l,e[12]=d,e[13]=f):f=e[13],f}function vF(t){return y.jsxs("div",{className:"px-3 py-1.5 text-sm flex items-center justify-between gap-2 hover:bg-accent/50 transition-colors relative",children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"font-medium truncate text-card-foreground",children:t.name}),y.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[ru(t.type),t.nullable?" (nullable)":" (not null)"]})]}),y.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[t.isPrimaryKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6), 0 0 8px 3px rgba(16, 185, 129, 0.3)"},title:"Primary Key"}),t.foreignKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6), 0 0 8px 3px rgba(251, 191, 36, 0.3)"},title:"Foreign Key"})]}),t.foreignKey&&y.jsx(Qi,{type:"source",position:qe.Right,id:`${t.name}-source`,className:"!w-2 !h-2 !border-0 !opacity-0",style:{background:"transparent",top:"50%",transform:"translateY(-50%)",right:0}}),t.isPrimaryKey&&y.jsx(Qi,{type:"target",position:qe.Left,id:`${t.name}-target`,className:"!w-2 !h-2 !border-0 !opacity-0",style:{background:"transparent",top:"50%",transform:"translateY(-50%)",left:0}})]},t.name)}function Ps(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(Dz,{"data-slot":"select",...n}),e[2]=n,e[3]=o):o=e[3],o}function Ka(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(kz,{"data-slot":"select-value",...n}),e[2]=n,e[3]=o):o=e[3],o}function Ls(t){const e=Ee.c(13);let n,o,a,i;e[0]!==t?({className:o,size:i,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?"default":i;let u;e[5]!==o?(u=Ne("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 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:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(Oz,{asChild:!0,children:y.jsx(Os,{className:"text-muted-foreground size-4 pointer-events-none"})}),e[7]=d):d=e[7];let f;return e[8]!==n||e[9]!==a||e[10]!==l||e[11]!==u?(f=y.jsxs(Tz,{"data-slot":"select-trigger","data-size":l,className:u,...a,children:[n,d]}),e[8]=n,e[9]=a,e[10]=l,e[11]=u,e[12]=f):f=e[12],f}function $s(t){const e=Ee.c(28);let n,o,a,i,l,u,d;e[0]!==t?({className:o,children:n,position:i,align:l,side:u,avoidCollisions:d,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=i===void 0?"popper":i,g=l===void 0?"start":l,m=u===void 0?"bottom":u,p=d===void 0?!1:d,x=f==="item-aligned",w=f==="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";let E;e[8]!==o||e[9]!==w?(E=Ne("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",w,o),e[8]=o,e[9]=w,e[10]=E):E=e[10];let S;e[11]===Symbol.for("react.memo_cache_sentinel")?(S=y.jsx(xF,{}),e[11]=S):S=e[11];const M=f==="popper"&&"";let N;e[12]!==M?(N=Ne("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",M),e[12]=M,e[13]=N):N=e[13];let C;e[14]!==n||e[15]!==f||e[16]!==N?(C=y.jsx(zz,{"data-position":f,className:N,children:n}),e[14]=n,e[15]=f,e[16]=N,e[17]=C):C=e[17];let R;e[18]===Symbol.for("react.memo_cache_sentinel")?(R=y.jsx(bF,{}),e[18]=R):R=e[18];let D;return e[19]!==g||e[20]!==p||e[21]!==f||e[22]!==a||e[23]!==m||e[24]!==C||e[25]!==x||e[26]!==E?(D=y.jsx(Az,{children:y.jsxs(jz,{"data-slot":"select-content","data-align-trigger":x,className:E,position:f,align:g,side:m,avoidCollisions:p,...a,children:[S,C,R]})}),e[19]=g,e[20]=p,e[21]=f,e[22]=a,e[23]=m,e[24]=C,e[25]=x,e[26]=E,e[27]=D):D=e[27],D}function io(t){const e=Ee.c(13);let n,o,a;e[0]!==t?({className:o,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);let i;e[4]!==o?(i=Ne("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[4]=o,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:y.jsx(Lz,{children:y.jsx(Vs,{className:"pointer-events-none"})})}),e[6]=l):l=e[6];let u;e[7]!==n?(u=y.jsx(Pz,{children:n}),e[7]=n,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==i||e[11]!==u?(d=y.jsxs(Iz,{"data-slot":"select-item",className:i,...a,children:[l,u]}),e[9]=a,e[10]=i,e[11]=u,e[12]=d):d=e[12],d}function xF(t){const e=Ee.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(qf,{}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==a?(l=y.jsx($z,{"data-slot":"select-scroll-up-button",className:a,...o,children:i}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function bF(t){const e=Ee.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(Os,{}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==a?(l=y.jsx(Hz,{"data-slot":"select-scroll-down-button",className:a,...o,children:i}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function wF(t){const e=Ee.c(39),{nodesDraggable:n,onNodesDraggableChange:o,edgeType:a,onEdgeTypeChange:i,layoutType:l,onLayoutTypeChange:u,onAutoLayout:d}=t;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx("div",{className:"text-xs font-semibold text-card-foreground uppercase tracking-wide",children:"Layout Controls"}),e[0]=f):f=e[0];let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx("span",{className:"text-sm text-muted-foreground",children:"Draggable"}),e[1]=g):g=e[1];const m=n?"default":"secondary";let p;e[2]!==n||e[3]!==o?(p=()=>o(!n),e[2]=n,e[3]=o,e[4]=p):p=e[4];let x;e[5]!==n?(x=n?y.jsx(G8,{className:"h-4 w-4"}):y.jsx(W8,{className:"h-4 w-4"}),e[5]=n,e[6]=x):x=e[6];let w;e[7]!==m||e[8]!==p||e[9]!==x?(w=y.jsxs("div",{className:"flex items-center justify-between",children:[g,y.jsx(vn,{size:"sm",variant:m,onClick:p,className:"h-8 w-8 p-0",children:x})]}),e[7]=m,e[8]=p,e[9]=x,e[10]=w):w=e[10];let E;e[11]===Symbol.for("react.memo_cache_sentinel")?(E=y.jsx("span",{className:"text-sm text-muted-foreground",children:"Layout Mode"}),e[11]=E):E=e[11];let S;e[12]!==u?(S=A=>u(A),e[12]=u,e[13]=S):S=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=y.jsx(Ls,{size:"sm",className:"w-full",children:y.jsx(Ka,{})}),e[14]=M):M=e[14];let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(io,{value:"strict",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(A8,{className:"h-3 w-3"}),y.jsx("span",{children:"Strict Grid"})]})}),e[15]=N):N=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=y.jsxs($s,{position:"popper",children:[N,y.jsx(io,{value:"adapted",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(k8,{className:"h-3 w-3"}),y.jsx("span",{children:"Adapted"})]})})]}),e[16]=C):C=e[16];let R;e[17]!==l||e[18]!==S?(R=y.jsxs("div",{className:"space-y-1.5",children:[E,y.jsxs(Ps,{value:l,onValueChange:S,children:[M,C]})]}),e[17]=l,e[18]=S,e[19]=R):R=e[19];let D;e[20]===Symbol.for("react.memo_cache_sentinel")?(D=y.jsx("span",{className:"text-sm text-muted-foreground",children:"Edge Type"}),e[20]=D):D=e[20];let T;e[21]!==i?(T=A=>i(A),e[21]=i,e[22]=T):T=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx(Ls,{size:"sm",className:"w-full",children:y.jsx(Ka,{})}),e[23]=k):k=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=y.jsx(io,{value:"default",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(xI,{className:"h-3 w-3"}),y.jsx("span",{children:"Bezier"})]})}),e[24]=j):j=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=y.jsx(io,{value:"straight",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(n8,{className:"h-3 w-3"}),y.jsx("span",{children:"Straight"})]})}),e[25]=$):$=e[25];let K;e[26]===Symbol.for("react.memo_cache_sentinel")?(K=y.jsx(io,{value:"step",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(pI,{className:"h-3 w-3"}),y.jsx("span",{children:"Step"})]})}),e[26]=K):K=e[26];let U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsxs($s,{position:"popper",children:[j,$,K,y.jsx(io,{value:"smoothstep",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(wI,{className:"h-3 w-3"}),y.jsx("span",{children:"Smooth Step"})]})})]}),e[27]=U):U=e[27];let Y;e[28]!==a||e[29]!==T?(Y=y.jsxs("div",{className:"space-y-1.5",children:[D,y.jsxs(Ps,{value:a,onValueChange:T,children:[k,U]})]}),e[28]=a,e[29]=T,e[30]=Y):Y=e[30];let Z;e[31]===Symbol.for("react.memo_cache_sentinel")?(Z=y.jsx(CI,{className:"h-4 w-4 mr-2"}),e[31]=Z):Z=e[31];let P;e[32]!==d?(P=y.jsxs(vn,{size:"sm",variant:"secondary",onClick:d,className:"w-full",children:[Z,"Auto Layout"]}),e[32]=d,e[33]=P):P=e[33];let q;return e[34]!==R||e[35]!==Y||e[36]!==P||e[37]!==w?(q=y.jsx("div",{className:"absolute top-4 right-4 z-10",children:y.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg p-3 space-y-3 min-w-[200px]",children:[f,w,R,Y,P]})}),e[34]=R,e[35]=Y,e[36]=P,e[37]=w,e[38]=q):q=e[38],q}function BN(){const t=Ee.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Legend"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6), 0 0 8px 3px rgba(16, 185, 129, 0.3)"}}),y.jsx("span",{className:"text-xs text-card-foreground",children:"Primary Key"})]}),t[1]=n):n=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg px-3 py-2",children:[e,y.jsxs("div",{className:"flex flex-col gap-1.5",children:[n,y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6), 0 0 8px 3px rgba(251, 191, 36, 0.3)"}}),y.jsx("span",{className:"text-xs text-card-foreground",children:"Foreign Key"})]})]})]}),t[2]=o):o=t[2],o}function SF(t){const e=Ee.c(39),{table:n,onClose:o,onVisibilityChange:a,showLegend:i}=t,[l,u]=v.useState(!1),[d,f]=v.useState(!1),[g,m]=v.useState(null);let p,x;e[0]!==a||e[1]!==n?(p=()=>{n&&(m(n),requestAnimationFrame(()=>{u(!0),f(!1),a?.(!0)}))},x=[n,a],e[0]=a,e[1]=n,e[2]=p,e[3]=x):(p=e[2],x=e[3]),v.useEffect(p,x);let w;e[4]!==o||e[5]!==a?(w=()=>{f(!0),u(!1),a?.(!1),setTimeout(()=>{m(null),o()},200)},e[4]=o,e[5]=a,e[6]=w):w=e[6];const E=w;if(!g)return null;const S=`absolute bottom-0 left-0 right-0 z-20 transition-transform duration-200 ease-out ${l&&!d?"translate-y-0":"translate-y-full"}`;let M;e[7]!==i?(M=i&&y.jsx("div",{className:"absolute bottom-full left-4 mb-4",children:y.jsx(BN,{})}),e[7]=i,e[8]=M):M=e[8];let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N={maxHeight:"60vh",minHeight:"250px"},e[9]=N):N=e[9];let C;e[10]!==g.schema?(C=y.jsx("span",{className:"text-xs text-muted-foreground",children:g.schema}),e[10]=g.schema,e[11]=C):C=e[11];let R;e[12]!==g.name?(R=y.jsx("h2",{className:"text-lg font-semibold text-card-foreground",children:g.name}),e[12]=g.name,e[13]=R):R=e[13];let D;e[14]!==C||e[15]!==R?(D=y.jsxs("div",{children:[C,R]}),e[14]=C,e[15]=R,e[16]=D):D=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx(ns,{className:"w-5 h-5 text-muted-foreground"}),e[17]=T):T=e[17];let k;e[18]!==E?(k=y.jsx("button",{onClick:E,className:"p-2 rounded-md hover:bg-accent transition-colors","aria-label":"Close panel",children:T}),e[18]=E,e[19]=k):k=e[19];let j;e[20]!==k||e[21]!==D?(j=y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0",children:[D,k]}),e[20]=k,e[21]=D,e[22]=j):j=e[22];let $;e[23]!==g.columns.length?($=y.jsxs("div",{className:"text-sm text-muted-foreground mb-4",children:[g.columns.length," columns"]}),e[23]=g.columns.length,e[24]=$):$=e[24];let K;e[25]!==g.columns?(K=g.columns.map(CF),e[25]=g.columns,e[26]=K):K=e[26];let U;e[27]!==K?(U=y.jsx("div",{className:"space-y-2",children:K}),e[27]=K,e[28]=U):U=e[28];let Y;e[29]!==$||e[30]!==U?(Y=y.jsxs("div",{className:"flex-1 overflow-y-auto p-4 min-h-0",children:[$,U]}),e[29]=$,e[30]=U,e[31]=Y):Y=e[31];let Z;e[32]!==j||e[33]!==Y?(Z=y.jsxs("div",{className:"bg-card border-t border-border shadow-2xl flex flex-col",style:N,children:[j,Y]}),e[32]=j,e[33]=Y,e[34]=Z):Z=e[34];let P;return e[35]!==Z||e[36]!==S||e[37]!==M?(P=y.jsxs("div",{className:S,children:[M,Z]}),e[35]=Z,e[36]=S,e[37]=M,e[38]=P):P=e[38],P}function CF(t){return y.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-md bg-accent/30 hover:bg-accent/60 transition-colors cursor-default",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),y.jsxs("div",{className:"flex items-center gap-1",children:[t.isPrimaryKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6)"},title:"Primary Key"}),t.foreignKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6)"},title:"Foreign Key"})]})]}),y.jsxs("div",{className:"text-sm text-muted-foreground",children:[ru(t.type),t.nullable&&y.jsx("span",{className:"ml-1 opacity-60",children:"(nullable)"})]})]},t.name)}const EF={table:yF};function e0(t){return 60+t.columns.length*52+20}function OS(t,e){const n=new Map;if(t.length===0)return n;const o=240,a=40,i=40,l=o+a,u=50,d=50,f=t.map(p=>({id:`${p.schema}.${p.name}`,table:p,height:e0(p)}));f.sort((p,x)=>x.height-p.height);const g=Math.max(4,Math.ceil(Math.sqrt(t.length*1.5))),m=new Array(g).fill(d);return f.forEach(({id:p,height:x})=>{let w=0,E=m[0];for(let N=1;N<g;N++)m[N]<E&&(E=m[N],w=N);const S=u+w*l,M=m[w];n.set(p,{x:S,y:M}),m[w]=M+x+i}),n}function _F(t){const e=Ee.c(59),{schemaData:n,nodesDraggable:o,onNodesDraggableChange:a,edgeType:i,onEdgeTypeChange:l,layoutType:u,onLayoutTypeChange:d}=t;let f;e:{if(u==="adapted"){let de;if(e[0]!==n.foreignKeys||e[1]!==n.tables){const ge=OS(n.tables,n.foreignKeys);de=n.tables.map(ne=>{const _e=`${ne.schema}.${ne.name}`,De=ge.get(_e)||{x:50,y:50};return{id:_e,type:"table",position:De,data:{table:ne}}}),e[0]=n.foreignKeys,e[1]=n.tables,e[2]=de}else de=e[2];f=de;break e}let W;e[3]!==n.tables.length?(W=Math.sqrt(n.tables.length),e[3]=n.tables.length,e[4]=W):W=e[4];const ee=Math.ceil(W);let oe;if(e[5]!==ee||e[6]!==n.tables){const de=[];for(let ne=0;ne<ee;ne++)de.push([]);n.tables.forEach((ne,_e)=>{de[_e%ee].push(ne)});const ge=new Map;de.forEach((ne,_e)=>{let De=50;ne.forEach(Ye=>{const Pe=`${Ye.schema}.${Ye.name}`;ge.set(Pe,{x:_e*320+50,y:De}),De=De+(e0(Ye)+60)})}),oe=n.tables.map(ne=>{const _e=`${ne.schema}.${ne.name}`,De=ge.get(_e)||{x:50,y:50};return{id:_e,type:"table",position:De,data:{table:ne}}}),e[5]=ee,e[6]=n.tables,e[7]=oe}else oe=e[7];f=oe}const g=f;let m;if(e[8]!==i||e[9]!==n.foreignKeys||e[10]!==n.tables){let W;e[12]!==n.tables?(W=oe=>{const de=n.tables.find(ne=>`${ne.schema}.${ne.name}`===oe.fromTable),ge=n.tables.find(ne=>`${ne.schema}.${ne.name}`===oe.toTable);return!de||!ge?(console.warn(`Skipping edge: table not found for FK ${oe.constraintName}`),!1):!0},e[12]=n.tables,e[13]=W):W=e[13];let ee;e[14]!==i?(ee=(oe,de)=>({id:`edge-${de}-${oe.constraintName}`,source:oe.fromTable,target:oe.toTable,sourceHandle:`${oe.fromColumn}-source`,targetHandle:`${oe.toColumn}-target`,type:i,style:{stroke:"oklch(1 0 0 / 25%)",strokeWidth:2},animated:!0}),e[14]=i,e[15]=ee):ee=e[15],m=n.foreignKeys.filter(W).map(ee),e[8]=i,e[9]=n.foreignKeys,e[10]=n.tables,e[11]=m}else m=e[11];const p=m,[x,w,E]=FB(g),[S,M,N]=VB(p),[C,R]=v.useState(null),[D,T]=v.useState(!1);let k,j;e[16]!==g||e[17]!==w?(k=()=>{w(g)},j=[g,w],e[16]=g,e[17]=w,e[18]=k,e[19]=j):(k=e[18],j=e[19]),v.useEffect(k,j);let $,K;e[20]!==p||e[21]!==M?($=()=>{M(p)},K=[p,M],e[20]=p,e[21]=M,e[22]=$,e[23]=K):($=e[22],K=e[23]),v.useEffect($,K);let U;e[24]===Symbol.for("react.memo_cache_sentinel")?(U=(W,ee)=>{const oe=ee.data.table;R(oe)},e[24]=U):U=e[24];const Y=U;let Z;e[25]===Symbol.for("react.memo_cache_sentinel")?(Z=()=>{R(null)},e[25]=Z):Z=e[25];const P=Z;let q;e[26]!==u||e[27]!==n.foreignKeys||e[28]!==n.tables||e[29]!==w?(q=()=>{if(u==="adapted"){const W=OS(n.tables,n.foreignKeys);w(ee=>ee.map(oe=>({...oe,position:W.get(oe.id)||oe.position})))}else{const W=Math.ceil(Math.sqrt(n.tables.length)),ee=new Map;n.tables.forEach(oe=>{ee.set(`${oe.schema}.${oe.name}`,oe)}),w(oe=>{const de=[];for(let ne=0;ne<W;ne++)de.push([]);oe.forEach((ne,_e)=>{de[_e%W].push(ne)});const ge=new Map;return de.forEach((ne,_e)=>{let De=50;ne.forEach(Ye=>{ge.set(Ye.id,{x:_e*320+50,y:De});const Pe=ee.get(Ye.id);Pe?De=De+(e0(Pe)+60):De=De+260})}),oe.map(ne=>({...ne,position:ge.get(ne.id)||ne.position}))})}},e[26]=u,e[27]=n.foreignKeys,e[28]=n.tables,e[29]=w,e[30]=q):q=e[30];const A=q;let B,L;e[31]===Symbol.for("react.memo_cache_sentinel")?(B={padding:.2},L={hideAttribution:!0},e[31]=B,e[32]=L):(B=e[31],L=e[32]);let F;e[33]===Symbol.for("react.memo_cache_sentinel")?(F=y.jsx(WB,{gap:20,size:1,color:"var(--muted-foreground)"}),e[33]=F):F=e[33];let X;e[34]!==S||e[35]!==x||e[36]!==o||e[37]!==N||e[38]!==E?(X=y.jsx(BB,{nodes:x,edges:S,nodeTypes:EF,onNodesChange:E,onEdgesChange:N,onNodeClick:Y,nodesDraggable:o,nodesConnectable:!1,fitView:!0,fitViewOptions:B,proOptions:L,className:"bg-background",children:F}),e[34]=S,e[35]=x,e[36]=o,e[37]=N,e[38]=E,e[39]=X):X=e[39];let I;e[40]!==i||e[41]!==A||e[42]!==u||e[43]!==o||e[44]!==l||e[45]!==d||e[46]!==a?(I=y.jsx(wF,{nodesDraggable:o,onNodesDraggableChange:a,edgeType:i,onEdgeTypeChange:l,layoutType:u,onLayoutTypeChange:d,onAutoLayout:A}),e[40]=i,e[41]=A,e[42]=u,e[43]=o,e[44]=l,e[45]=d,e[46]=a,e[47]=I):I=e[47];const z=`absolute left-4 z-20 transition-all duration-200 ease-out ${D?"opacity-0 pointer-events-none":"bottom-4 opacity-100"}`;let H;e[48]===Symbol.for("react.memo_cache_sentinel")?(H=y.jsx(BN,{}),e[48]=H):H=e[48];let G;e[49]!==z?(G=y.jsx("div",{className:z,children:H}),e[49]=z,e[50]=G):G=e[50];let J;e[51]!==D||e[52]!==C?(J=y.jsx(SF,{table:C,onClose:P,onVisibilityChange:T,showLegend:D}),e[51]=D,e[52]=C,e[53]=J):J=e[53];let ae;return e[54]!==X||e[55]!==I||e[56]!==G||e[57]!==J?(ae=y.jsxs("div",{className:"w-full h-full bg-background relative",children:[X,I,G,J]}),e[54]=X,e[55]=I,e[56]=G,e[57]=J,e[58]=ae):ae=e[58],ae}async function MF(t){const e=await fetch("/api/schema",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t})});if(!e.ok){let o=`HTTP error! status: ${e.status}`;try{const a=await e.json();o=a.error||o,console.error("API error response:",a)}catch{const i=await e.text().catch(()=>"");console.error("Failed to parse error response. Raw response:",i)}throw new Error(o)}const n=await e.json();if(!n.success||!n.data)throw new Error(n.error||"Failed to fetch schema data");return n.data}function FN({connection:t}){const[e,n]=v.useState(null),[o,a]=v.useState(!1),[i,l]=v.useState(null),u=v.useCallback(async()=>{if(t?.connectionString){a(!0),l(null);try{const d=await MF(t.connectionString);n(d)}catch(d){const f=d instanceof Error?d.message:"Failed to load schema data";l(f),console.error("Error loading schema data:",d),n(null)}finally{a(!1)}}},[t?.connectionString]);return v.useEffect(()=>{t?.connectionString&&u()},[t?.connectionString,u]),{schemaData:e,loading:o,error:i,refetch:u}}function NF(t){const e=Ee.c(26),{schemaData:n,selectedSchema:o,setSelectedSchema:a}=t;let i;e:{if(!n){let w;e[0]===Symbol.for("react.memo_cache_sentinel")?(w=[],e[0]=w):w=e[0],i=w;break e}let x;if(e[1]!==n.tables){const w=new Set(n.tables.map(DF));x=Array.from(w).sort(),e[1]=n.tables,e[2]=x}else x=e[2];i=x}const l=i;let u,d;e[3]!==n||e[4]!==o||e[5]!==a?(u=()=>{n&&o!=="all"&&(n.tables.some(w=>w.schema===o)||a("all"))},d=[n,o,a],e[3]=n,e[4]=o,e[5]=a,e[6]=u,e[7]=d):(u=e[6],d=e[7]),v.useEffect(u,d);let f;e:{if(!n||o==="all"){f=n;break e}let x,w;if(e[8]!==n.tables||e[9]!==o){let C;e[12]!==o?(C=R=>R.schema===o,e[12]=o,e[13]=C):C=e[13],x=n.tables.filter(C),w=new Set(x.map(RF)),e[8]=n.tables,e[9]=o,e[10]=x,e[11]=w}else x=e[10],w=e[11];const E=w;let S;if(e[14]!==n.foreignKeys||e[15]!==E){let C;e[17]!==E?(C=R=>E.has(R.fromTable)&&E.has(R.toTable),e[17]=E,e[18]=C):C=e[18],S=n.foreignKeys.filter(C),e[14]=n.foreignKeys,e[15]=E,e[16]=S}else S=e[16];const M=S;let N;e[19]!==M||e[20]!==x?(N={tables:x,foreignKeys:M},e[19]=M,e[20]=x,e[21]=N):N=e[21],f=N}const g=f,m=g?.tables.length??0;let p;return e[22]!==l||e[23]!==g||e[24]!==m?(p={availableSchemas:l,filteredSchemaData:g,filteredTableCount:m},e[22]=l,e[23]=g,e[24]=m,e[25]=p):p=e[25],p}function RF(t){return`${t.schema}.${t.name}`}function DF(t){return t.schema}function VN(t,e,n){const o=JSON.stringify,a=JSON.parse,i=n?.validate,[l,u]=v.useState(()=>{try{const f=localStorage.getItem(t);if(f!==null){const g=a(f);return i&&i(g),g}}catch(f){console.warn(`Failed to read localStorage key "${t}":`,f)}return e});v.useEffect(()=>{try{localStorage.setItem(t,o(l))}catch(f){console.warn(`Failed to write localStorage key "${t}":`,f)}},[t,l,o]);const d=v.useCallback(f=>{u(g=>f instanceof Function?f(g):f)},[]);return[l,d]}const TF=["default","straight","step","smoothstep"],kF=["strict","adapted"],ki={selectedSchema:"all",nodesDraggable:!0,edgeType:"default",layoutType:"strict"};function ic(t){if(!t||typeof t!="object")return ki;const e=t;return{selectedSchema:typeof e.selectedSchema=="string"?e.selectedSchema:ki.selectedSchema,nodesDraggable:typeof e.nodesDraggable=="boolean"?e.nodesDraggable:ki.nodesDraggable,edgeType:TF.includes(e.edgeType)?e.edgeType:ki.edgeType,layoutType:kF.includes(e.layoutType)?e.layoutType:ki.layoutType}}function OF(){const t=Ee.c(16),[e,n]=VN("fb-schema-view",ki);let o;t[0]!==e?(o=ic(e),t[0]=e,t[1]=o):o=t[1];const a=o;let i;t[2]!==n?(i=w=>{n(E=>({...ic(E),selectedSchema:w}))},t[2]=n,t[3]=i):i=t[3];const l=i;let u;t[4]!==n?(u=w=>{n(E=>({...ic(E),nodesDraggable:w}))},t[4]=n,t[5]=u):u=t[5];const d=u;let f;t[6]!==n?(f=w=>{n(E=>({...ic(E),edgeType:w}))},t[6]=n,t[7]=f):f=t[7];const g=f;let m;t[8]!==n?(m=w=>{n(E=>({...ic(E),layoutType:w}))},t[8]=n,t[9]=m):m=t[9];const p=m;let x;return t[10]!==g||t[11]!==p||t[12]!==d||t[13]!==l||t[14]!==a?(x={viewState:a,setSelectedSchema:l,setNodesDraggable:d,setEdgeType:g,setLayoutType:p},t[10]=g,t[11]=p,t[12]=d,t[13]=l,t[14]=a,t[15]=x):x=t[15],x}function AF(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("size-4 animate-spin",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(U8,{role:"status","aria-label":"Loading",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ch(){const t=Ee.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx("div",{className:"flex items-center gap-4",children:y.jsx(AF,{})}),t[0]=e):e=t[0],e}function jF(){const t=Ee.c(39),{selectedConnection:e}=Xf();let n;t[0]!==e?(n={connection:e},t[0]=e,t[1]=n):n=t[1];const{schemaData:o,loading:a,error:i}=FN(n),{viewState:l,setSelectedSchema:u,setNodesDraggable:d,setEdgeType:f,setLayoutType:g}=OF();let m;t[2]!==o||t[3]!==u||t[4]!==l.selectedSchema?(m={schemaData:o,selectedSchema:l.selectedSchema,setSelectedSchema:u},t[2]=o,t[3]=u,t[4]=l.selectedSchema,t[5]=m):m=t[5];const{availableSchemas:p,filteredSchemaData:x,filteredTableCount:w}=NF(m);if(!e){let $;return t[6]===Symbol.for("react.memo_cache_sentinel")?($=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Please select a database connection to view schema"})}),t[6]=$):$=t[6],$}if(!e.connectionString){let $;return t[7]===Symbol.for("react.memo_cache_sentinel")?($=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Connection selected but missing connection string"})}),t[7]=$):$=t[7],$}if(a){let $;return t[8]===Symbol.for("react.memo_cache_sentinel")?($=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx(ch,{})}),t[8]=$):$=t[8],$}if(i){let $;return t[9]!==i?($=y.jsx("div",{className:"h-full flex items-center justify-center p-6",children:y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md",children:i})}),t[9]=i,t[10]=$):$=t[10],$}if(!x)return null;let E;t[11]!==x||t[12]!==f||t[13]!==g||t[14]!==d||t[15]!==l.edgeType||t[16]!==l.layoutType||t[17]!==l.nodesDraggable?(E=y.jsx(_F,{schemaData:x,nodesDraggable:l.nodesDraggable,onNodesDraggableChange:d,edgeType:l.edgeType,onEdgeTypeChange:f,layoutType:l.layoutType,onLayoutTypeChange:g}),t[11]=x,t[12]=f,t[13]=g,t[14]=d,t[15]=l.edgeType,t[16]=l.layoutType,t[17]=l.nodesDraggable,t[18]=E):E=t[18];let S;t[19]===Symbol.for("react.memo_cache_sentinel")?(S=y.jsx("h1",{className:"text-xl font-bold text-card-foreground",children:"Database Schema"}),t[19]=S):S=t[19];let M;t[20]!==p||t[21]!==u||t[22]!==l.selectedSchema?(M=p.length>1&&y.jsxs(Ps,{value:l.selectedSchema,onValueChange:u,children:[y.jsx(Ls,{size:"sm",className:"w-[180px]",children:y.jsx(Ka,{placeholder:"Select schema"})}),y.jsxs($s,{position:"popper",align:"start",children:[y.jsx(io,{value:"all",children:"All Schemas"}),p.map(zF)]})]}),t[20]=p,t[21]=u,t[22]=l.selectedSchema,t[23]=M):M=t[23];let N;t[24]!==M?(N=y.jsxs("div",{className:"flex items-center justify-between gap-4 mb-2",children:[S,M]}),t[24]=M,t[25]=N):N=t[25];const C=e.name||e.databaseName||"Unnamed connection",R=w===1?"table":"tables";let D;t[26]!==x.foreignKeys.length||t[27]!==w||t[28]!==R?(D=y.jsxs("span",{className:"ml-2",children:["• ",w," ",R," • ",x.foreignKeys.length," relationships"]}),t[26]=x.foreignKeys.length,t[27]=w,t[28]=R,t[29]=D):D=t[29];let T;t[30]!==C||t[31]!==D?(T=y.jsxs("p",{className:"text-sm text-muted-foreground",children:[C,D]}),t[30]=C,t[31]=D,t[32]=T):T=t[32];let k;t[33]!==N||t[34]!==T?(k=y.jsx("div",{className:"absolute top-4 left-4 z-10",children:y.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg px-4 py-3",children:[N,T]})}),t[33]=N,t[34]=T,t[35]=k):k=t[35];let j;return t[36]!==k||t[37]!==E?(j=y.jsxs("div",{className:"h-full w-full relative",children:[E,k]}),t[36]=k,t[37]=E,t[38]=j):j=t[38],j}function zF(t){return y.jsx(io,{value:t,children:t},t)}function IF(t){const e=Ee.c(48),{tables:n,selectedTable:o,selectedSchema:a,onSchemaChange:i,onSingleClick:l,onDoubleClick:u}=t,[d,f]=v.useState("");let g;if(e[0]!==n){const k=new Set(n.map($F));g=Array.from(k).sort(),e[0]=n,e[1]=g}else g=e[1];const m=g;let p;if(e[2]!==d||e[3]!==a||e[4]!==n){let k;e[6]!==d||e[7]!==a?(k=j=>{const $=j.name.toLowerCase().includes(d.toLowerCase()),K=a==="all"||j.schema===a;return $&&K},e[6]=d,e[7]=a,e[8]=k):k=e[8],p=n.filter(k),e[2]=d,e[3]=a,e[4]=n,e[5]=p}else p=e[5];const x=p;let w,E,S,M;if(e[9]!==m||e[10]!==x||e[11]!==u||e[12]!==i||e[13]!==l||e[14]!==d||e[15]!==a||e[16]!==o?.name||e[17]!==o?.schema){const k=x.reduce(LF,{}),j=Object.keys(k).sort();S="h-full flex flex-col bg-card border-r border-border";let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=y.jsx("h2",{className:"text-sm font-semibold text-card-foreground",children:"Tables"}),e[22]=$):$=e[22];let K;e[23]!==m||e[24]!==i||e[25]!==a?(K=m.length>1&&y.jsxs(Ps,{value:a,onValueChange:i,children:[y.jsx(Ls,{className:"w-full h-8 text-sm",children:y.jsx(Ka,{placeholder:"All schemas"})}),y.jsxs($s,{position:"popper",sideOffset:4,align:"start",children:[y.jsx(io,{value:"all",children:"All schemas"}),m.map(PF)]})]}),e[23]=m,e[24]=i,e[25]=a,e[26]=K):K=e[26];let U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(Wf,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e[27]=U):U=e[27];let Y;e[28]===Symbol.for("react.memo_cache_sentinel")?(Y=P=>f(P.target.value),e[28]=Y):Y=e[28];let Z;e[29]!==d?(Z=y.jsxs("div",{className:"relative",children:[U,y.jsx(Ui,{placeholder:"Search tables...",value:d,onChange:Y,className:"pl-8 h-8 text-sm"})]}),e[29]=d,e[30]=Z):Z=e[30],e[31]!==Z||e[32]!==K?(M=y.jsxs("div",{className:"p-3 border-b border-border shrink-0 space-y-2",children:[$,K,Z]}),e[31]=Z,e[32]=K,e[33]=M):M=e[33],w="flex-1 overflow-y-auto p-2",E=j.map(P=>y.jsxs("div",{className:"mb-2",children:[j.length>1&&y.jsx("div",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:P}),y.jsx("div",{className:"space-y-0.5",children:k[P].map(q=>{const A=o?.name===q.name&&o?.schema===q.schema;return y.jsxs("button",{onClick:()=>l(q),onDoubleClick:()=>u(q),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-sm transition-colors text-left ${A?"bg-primary text-primary-foreground":"hover:bg-accent text-card-foreground"}`,children:[y.jsx(Kf,{className:"w-4 h-4 shrink-0"}),y.jsx("span",{className:"truncate flex-1",children:q.name}),A&&y.jsx(F_,{className:"w-4 h-4 shrink-0"})]},`${q.schema}.${q.name}`)})})]},P)),e[9]=m,e[10]=x,e[11]=u,e[12]=i,e[13]=l,e[14]=d,e[15]=a,e[16]=o?.name,e[17]=o?.schema,e[18]=w,e[19]=E,e[20]=S,e[21]=M}else w=e[18],E=e[19],S=e[20],M=e[21];let N;e[34]!==x.length?(N=x.length===0&&y.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No tables found"}),e[34]=x.length,e[35]=N):N=e[35];let C;e[36]!==w||e[37]!==E||e[38]!==N?(C=y.jsxs("div",{className:w,children:[E,N]}),e[36]=w,e[37]=E,e[38]=N,e[39]=C):C=e[39];const R=x.length===1?"table":"tables";let D;e[40]!==x.length||e[41]!==R?(D=y.jsx("div",{className:"p-3 border-t border-border shrink-0",children:y.jsxs("p",{className:"text-xs text-muted-foreground",children:[x.length," ",R]})}),e[40]=x.length,e[41]=R,e[42]=D):D=e[42];let T;return e[43]!==D||e[44]!==S||e[45]!==M||e[46]!==C?(T=y.jsxs("div",{className:S,children:[M,C,D]}),e[43]=D,e[44]=S,e[45]=M,e[46]=C,e[47]=T):T=e[47],T}function PF(t){return y.jsx(io,{value:t,children:t},t)}function LF(t,e){return t[e.schema]||(t[e.schema]=[]),t[e.schema].push(e),t}function $F(t){return t.schema}function UN(t,e){return typeof t=="string"?t:t?.(e)}function AS(t){return!!t&&typeof t=="object"&&"id"in t&&"name"in t&&"size"in t&&"type"in t}function jS(t,e){return e.find(n=>n.value===t||n.value.toLowerCase()===t.toLowerCase()||n.label.toLowerCase()===t.toLowerCase())?.value}function tn(t,e){return`${t}:${e}`}function Bo(t){const e=t.split(":"),n=e[0],o=e[1];if(n&&o){const a=parseInt(n,10);if(!Number.isNaN(a))return{rowIndex:a,columnId:o}}return{rowIndex:0,columnId:""}}function t0(t){return{short:36,medium:56,tall:76,"extra-tall":96}[t]}function YN(t){return{short:1,medium:2,tall:3,"extra-tall":4}[t]}function GN(t){const{column:e,nextColumn:n,isLastColumn:o}=t,a=e.getIsPinned(),i=a==="right"&&e.getIsFirstColumn("right"),l=a==="right"&&e.getIsLastColumn("right");return{showEndBorder:!(n?.getIsPinned()==="right"&&n?.getIsFirstColumn("right"))&&(o||!l),showStartBorder:i}}function qN(t){const{column:e,dir:n="ltr",withBorder:o=!1}=t,a=e.getIsPinned(),i=a==="left"&&e.getIsLastColumn("left"),l=a==="right"&&e.getIsFirstColumn("right"),u=n==="rtl",d=a==="left"?`${e.getStart("left")}px`:void 0,f=a==="right"?`${e.getAfter("right")}px`:void 0;return{boxShadow:o?i?u?"4px 0 4px -4px var(--border) inset":"-4px 0 4px -4px var(--border) inset":l?u?"-4px 0 4px -4px var(--border) inset":"4px 0 4px -4px var(--border) inset":void 0:void 0,left:u?f:d,right:u?d:f,opacity:a?.97:1,position:a?"sticky":"relative",background:"var(--background)",width:e.getSize(),zIndex:a?1:void 0}}function zS(t){if(t==="left"||t==="right"||t==="home"||t==="end")return t;if(t==="pageleft")return"left";if(t==="pageright")return"right"}function Ni(t){const{container:e,targetCell:n,tableRef:o,direction:a,viewportOffset:i,isRtl:l}=t,u=e.getBoundingClientRect(),d=n.getBoundingClientRect(),f=e.scrollLeft<0,g=l||f,m=o.current,p=m?.getLeftVisibleLeafColumns()??[],x=m?.getRightVisibleLeafColumns()??[],w=p.reduce((T,k)=>T+k.getSize(),0),E=x.reduce((T,k)=>T+k.getSize(),0),S=g?u.left+E+i:u.left+w+i,M=g?u.right-w-i:u.right-E-i;if(d.left>=S&&d.right<=M)return;const C=d.left<S,R=d.right>M;let D=0;a?(g?a==="right"||a==="home":a==="right"||a==="end")?D=d.right-M:D=-(S-d.left):R?D=d.right-M:C&&(D=-(S-d.left)),e.scrollLeft+=D}function IS(t){return t instanceof Element&&(t.closest("[data-grid-cell-editor]")||t.closest("[data-grid-popover]"))!==null}function HF(t){switch(t){case"short-text":return{label:"Short text",icon:r8};case"long-text":return{label:"Long text",icon:hI};case"number":return{label:"Number",icon:z8};case"url":return{label:"URL",icon:L8};case"checkbox":return{label:"Checkbox",icon:lI};case"select":return{label:"Select",icon:F8};case"multi-select":return{label:"Multi-select",icon:H8};case"date":return{label:"Date",icon:s8};case"file":return{label:"File",icon:U_};default:return null}}function PS(t){if(!t||t.trim()==="")return"";const e=t.trim();return/^(javascript|data|vbscript|file):/i.test(e)?"":e.startsWith("http://")||e.startsWith("https://")?e:`http://${e}`}function WN(t){if(!t)return null;if(t instanceof Date)return t;if(typeof t!="string")return null;const[e,n,o]=t.split("-").map(Number);if(!e||!n||!o)return null;const a=new Date(e,n-1,o);return a.getFullYear()!==e||a.getMonth()!==n-1||a.getDate()!==o?null:a}function BF(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${o}`}function FF(t){if(!t)return"";const e=WN(t);return e?e.toLocaleDateString():typeof t=="string"?t:""}function rp(t){if(t<=0||!Number.isFinite(t))return"0 B";const e=1024,n=["B","KB","MB","GB"],o=Math.min(n.length-1,Math.floor(Math.log(t)/Math.log(e)));return`${Number.parseFloat((t/e**o).toFixed(1))} ${n[o]}`}function LS(t){return t.startsWith("image/")?C8:t.startsWith("video/")?_8:t.startsWith("audio/")?w8:t.includes("pdf")?Sw:t.includes("zip")||t.includes("rar")?x8:t.includes("word")||t.includes("document")||t.includes("doc")?Sw:t.includes("sheet")||t.includes("excel")||t.includes("xls")?N8:t.includes("presentation")||t.includes("powerpoint")||t.includes("ppt")?J8:U_}function VF(t){const e=Ee.c(88);let n,o,a,i,l;e[0]!==t?({header:o,table:l,className:n,onPointerDown:a,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=o.column,d=u.columnDef.meta?.label?u.columnDef.meta.label:typeof u.columnDef.header=="string"?u.columnDef.header:u.id;let f,g,m,p,x,w,E,S,M,N,C,R,D,T;if(e[6]!==n||e[7]!==u||e[8]!==a||e[9]!==l){const F=l.getState().columnSizingInfo.isResizingColumn,I=u.columnDef.meta?.cell?.variant;let z;e[24]!==I?(z=HF(I),e[24]=I,e[25]=z):z=e[25],p=z,m=u.columnDef.meta?.columnType;let H;e[26]!==u?(H=u.getIsPinned(),e[26]=u,e[27]=H):H=e[27];const G=H;x=G==="left",w=G==="right";let J;e[28]!==u.id||e[29]!==l?(J=ge=>{l.setSorting(ne=>{const _e=ne.findIndex(Ye=>Ye.id===u.id),De={id:u.id,desc:ge==="desc"};if(_e>=0){const Ye=[...ne];return Ye[_e]=De,Ye}else return[...ne,De]})},e[28]=u.id,e[29]=l,e[30]=J):J=e[30],N=J;let ae;e[31]!==u.id||e[32]!==l?(ae=()=>{l.setSorting(ge=>ge.filter(ne=>ne.id!==u.id))},e[31]=u.id,e[32]=l,e[33]=ae):ae=e[33],M=ae;let W;e[34]!==u?(W=()=>{u.pin("left")},e[34]=u,e[35]=W):W=e[35],E=W;let ee;e[36]!==u?(ee=()=>{u.pin("right")},e[36]=u,e[37]=ee):ee=e[37],S=ee;let oe;e[38]!==u?(oe=()=>{u.pin(!1)},e[38]=u,e[39]=oe):oe=e[39],R=oe;let de;e[40]!==u.id||e[41]!==a||e[42]!==l.options.meta?(de=ge=>{a?.(ge),!ge.defaultPrevented&&ge.button===0&&l.options.meta?.onColumnClick?.(u.id)},e[40]=u.id,e[41]=a,e[42]=l.options.meta,e[43]=de):de=e[43],C=de,g=iy,T=!1,f=ly,D=Ne("flex size-full items-center justify-between gap-2 p-2 text-sm hover:bg-accent/40 data-[state=open]:bg-accent/40 [&_svg]:size-4",F&&"pointer-events-none",n),e[6]=n,e[7]=u,e[8]=a,e[9]=l,e[10]=f,e[11]=g,e[12]=m,e[13]=p,e[14]=x,e[15]=w,e[16]=E,e[17]=S,e[18]=M,e[19]=N,e[20]=C,e[21]=R,e[22]=D,e[23]=T}else f=e[10],g=e[11],m=e[12],p=e[13],x=e[14],w=e[15],E=e[16],S=e[17],M=e[18],N=e[19],C=e[20],R=e[21],D=e[22],T=e[23];let k;e[44]!==d?(k=y.jsx("span",{className:"shrink-0 whitespace-nowrap font-medium",children:d}),e[44]=d,e[45]=k):k=e[45];let j;e[46]!==m||e[47]!==p?(j=m?y.jsx("span",{className:"min-w-0 shrink truncate text-xs text-muted-foreground",children:ru(m)}):p&&y.jsxs(Z0,{delayDuration:100,children:[y.jsx(Q0,{asChild:!0,children:y.jsx(p.icon,{className:"size-3.5 shrink-0 text-muted-foreground"})}),y.jsx(J0,{side:"top",children:y.jsx("p",{children:p.label})})]}),e[46]=m,e[47]=p,e[48]=j):j=e[48];let $;e[49]!==k||e[50]!==j?($=y.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden",children:[k,j]}),e[49]=k,e[50]=j,e[51]=$):$=e[51];let K;e[52]===Symbol.for("react.memo_cache_sentinel")?(K=y.jsx(Os,{className:"shrink-0 text-muted-foreground"}),e[52]=K):K=e[52];let U;e[53]!==f||e[54]!==C||e[55]!==i||e[56]!==D||e[57]!==$?(U=y.jsxs(f,{className:D,onPointerDown:C,...i,children:[$,K]}),e[53]=f,e[54]=C,e[55]=i,e[56]=D,e[57]=$,e[58]=U):U=e[58];let Y;e[59]!==u||e[60]!==M||e[61]!==N?(Y=u.getCanSort()&&y.jsxs(y.Fragment,{children:[y.jsxs(Mw,{className:"relative ltr:pr-8 ltr:pl-2 rtl:pr-2 rtl:pl-8 [&>span:first-child]:ltr:right-2 [&>span:first-child]:ltr:left-auto [&>span:first-child]:rtl:right-auto [&>span:first-child]:rtl:left-2 [&_svg]:text-muted-foreground",checked:u.getIsSorted()==="asc",onSelect:()=>N("asc"),children:[y.jsx(qf,{}),"Sort asc"]}),y.jsxs(Mw,{className:"relative ltr:pr-8 ltr:pl-2 rtl:pr-2 rtl:pl-8 [&>span:first-child]:ltr:right-2 [&>span:first-child]:ltr:left-auto [&>span:first-child]:rtl:right-auto [&>span:first-child]:rtl:left-2 [&_svg]:text-muted-foreground",checked:u.getIsSorted()==="desc",onSelect:()=>N("desc"),children:[y.jsx(Os,{}),"Sort desc"]}),u.getIsSorted()&&y.jsxs(Vo,{onSelect:M,children:[y.jsx(ns,{}),"Remove sort"]})]}),e[59]=u,e[60]=M,e[61]=N,e[62]=Y):Y=e[62];let Z;e[63]!==u||e[64]!==x||e[65]!==w||e[66]!==E||e[67]!==S||e[68]!==R?(Z=u.getCanPin()&&y.jsxs(y.Fragment,{children:[u.getCanSort()&&y.jsx(cf,{}),x?y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:R,children:[y.jsx(Cw,{}),"Unpin from left"]}):y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:E,children:[y.jsx(Ew,{}),"Pin to left"]}),w?y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:R,children:[y.jsx(Cw,{}),"Unpin from right"]}):y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:S,children:[y.jsx(Ew,{}),"Pin to right"]})]}),e[63]=u,e[64]=x,e[65]=w,e[66]=E,e[67]=S,e[68]=R,e[69]=Z):Z=e[69];let P;e[70]!==u?(P=u.getCanHide()&&y.jsxs(y.Fragment,{children:[y.jsx(cf,{}),y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:()=>u.toggleVisibility(!1),children:[y.jsx(y8,{}),"Hide column"]})]}),e[70]=u,e[71]=P):P=e[71];let q;e[72]!==P||e[73]!==Y||e[74]!==Z?(q=y.jsxs(cy,{align:"start",sideOffset:0,className:"w-60",children:[Y,Z,P]}),e[72]=P,e[73]=Y,e[74]=Z,e[75]=q):q=e[75];let A;e[76]!==g||e[77]!==q||e[78]!==T||e[79]!==U?(A=y.jsxs(g,{modal:T,children:[U,q]}),e[76]=g,e[77]=q,e[78]=T,e[79]=U,e[80]=A):A=e[80];let B;e[81]!==o||e[82]!==d||e[83]!==l?(B=o.column.getCanResize()&&y.jsx(UF,{header:o,table:l,label:d}),e[81]=o,e[82]=d,e[83]=l,e[84]=B):B=e[84];let L;return e[85]!==A||e[86]!==B?(L=y.jsxs(y.Fragment,{children:[A,B]}),e[85]=A,e[86]=B,e[87]=L):L=e[87],L}const UF=v.memo(YF,(t,e)=>{const n=t.header.column,o=e.header.column;return!(n.getIsResizing()!==o.getIsResizing()||n.getSize()!==o.getSize()||t.label!==e.label)});function YF(t){const e=Ee.c(23),{header:n,table:o,label:a}=t;let i;e[0]!==o?(i=o._getDefaultColumnDef(),e[0]=o,e[1]=i):i=e[1];const l=i;let u;e[2]!==n.column?(u=()=>{n.column.resetSize()},e[2]=n.column,e[3]=u):u=e[3];const d=u,f=`Resize ${a} column`;let g;e[4]!==n.column?(g=n.column.getSize(),e[4]=n.column,e[5]=g):g=e[5];const m=l.minSize,p=l.maxSize;let x;e[6]!==n.column?(x=n.column.getIsResizing()?"bg-primary":"opacity-0 hover:opacity-100",e[6]=n.column,e[7]=x):x=e[7];let w;e[8]!==x?(w=Ne("absolute -end-px top-0 z-50 h-full w-0.5 cursor-ew-resize touch-none select-none bg-border transition-opacity after:absolute after:inset-y-0 after:start-1/2 after:h-full after:w-[18px] after:-translate-x-1/2 after:content-[''] hover:bg-primary focus:bg-primary focus:outline-none",x),e[8]=x,e[9]=w):w=e[9];let E;e[10]!==n?(E=n.getResizeHandler(),e[10]=n,e[11]=E):E=e[11];let S;e[12]!==n?(S=n.getResizeHandler(),e[12]=n,e[13]=S):S=e[13];let M;return e[14]!==l.maxSize||e[15]!==l.minSize||e[16]!==d||e[17]!==S||e[18]!==f||e[19]!==g||e[20]!==w||e[21]!==E?(M=y.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuenow":g,"aria-valuemin":m,"aria-valuemax":p,tabIndex:0,className:w,onDoubleClick:d,onMouseDown:E,onTouchStart:S}),e[14]=l.maxSize,e[15]=l.minSize,e[16]=d,e[17]=S,e[18]=f,e[19]=g,e[20]=w,e[21]=E,e[22]=M):M=e[22],M}const KN=typeof window<"u"?v.useLayoutEffect:v.useEffect;function au(t){const e=Ee.c(2),n=v.useRef(t);let o;return e[0]!==t?(o=()=>{n.current=t},e[0]=t,e[1]=o):o=e[1],KN(o),n}function GF(t){const e=Ee.c(11),{tableMeta:n,columns:o,contextMenu:a}=t,i=n?.onContextMenuOpenChange,l=n?.selectionState,u=n?.dataGridRef,d=n?.onDataUpdate,f=n?.onRowsDelete,g=n?.onCellsCopy,m=n?.onCellsCut;if(!a.open)return null;let p;return e[0]!==o||e[1]!==a||e[2]!==u||e[3]!==g||e[4]!==m||e[5]!==i||e[6]!==d||e[7]!==f||e[8]!==l||e[9]!==n?(p=y.jsx(qF,{tableMeta:n,columns:o,dataGridRef:u,contextMenu:a,onContextMenuOpenChange:i,selectionState:l,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m}),e[0]=o,e[1]=a,e[2]=u,e[3]=g,e[4]=m,e[5]=i,e[6]=d,e[7]=f,e[8]=l,e[9]=n,e[10]=p):p=e[10],p}const qF=v.memo(WF,(t,e)=>{if(t.contextMenu.open!==e.contextMenu.open)return!1;if(!e.contextMenu.open)return!0;if(t.contextMenu.x!==e.contextMenu.x||t.contextMenu.y!==e.contextMenu.y)return!1;const n=t.selectionState?.selectedCells?.size??0,o=e.selectionState?.selectedCells?.size??0;return n===o});function WF(t){const e=Ee.c(48),{tableMeta:n,columns:o,dataGridRef:a,contextMenu:i,onContextMenuOpenChange:l,selectionState:u,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m}=t;let p;e[0]!==o||e[1]!==a||e[2]!==g||e[3]!==m||e[4]!==d||e[5]!==f||e[6]!==u?(p={dataGridRef:a,selectionState:u,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m,columns:o},e[0]=o,e[1]=a,e[2]=g,e[3]=m,e[4]=d,e[5]=f,e[6]=u,e[7]=p):p=e[7];const x=au(p),w=`${i.x}px`,E=`${i.y}px`;let S;e[8]!==w||e[9]!==E?(S={position:"fixed",left:w,top:E,width:"1px",height:"1px",padding:0,margin:0,border:"none",background:"transparent",pointerEvents:"none",opacity:0},e[8]=w,e[9]=E,e[10]=S):S=e[10];const M=S;let N;e[11]!==x?(N=G=>{G.preventDefault(),x.current.dataGridRef?.current?.focus()},e[11]=x,e[12]=N):N=e[12];const C=N;let R;e[13]!==x?(R=()=>{x.current.onCellsCopy?.()},e[13]=x,e[14]=R):R=e[14];const D=R;let T;e[15]!==x?(T=()=>{x.current.onCellsCut?.()},e[15]=x,e[16]=T):T=e[16];const k=T;let j;e[17]!==x?(j=()=>{const{selectionState:G,columns:J,onDataUpdate:ae}=x.current;if(!G?.selectedCells||G.selectedCells.size===0)return;const W=[];for(const ee of G.selectedCells){const{rowIndex:oe,columnId:de}=Bo(ee),ne=J.find(De=>De.id?De.id===de:"accessorKey"in De?De.accessorKey===de:!1)?.meta?.cell?.variant;let _e="";ne==="multi-select"||ne==="file"?_e=[]:ne==="number"||ne==="date"?_e=null:ne==="checkbox"&&(_e=!1),W.push({rowIndex:oe,columnId:de,value:_e})}ae?.(W),En.success(`${W.length} cell${W.length!==1?"s":""} cleared`)},e[17]=x,e[18]=j):j=e[18];const $=j;let K;e[19]!==x?(K=async()=>{const{selectionState:G,onRowsDelete:J}=x.current;if(!G?.selectedCells||G.selectedCells.size===0)return;const ae=new Set;for(const oe of G.selectedCells){const{rowIndex:de}=Bo(oe);ae.add(de)}const W=Array.from(ae).sort(KF),ee=W.length;await J?.(W),En.success(`${ee} row${ee!==1?"s":""} deleted`)},e[19]=x,e[20]=K):K=e[20];const U=K;let Y;e[21]!==M?(Y=y.jsx(ly,{style:M}),e[21]=M,e[22]=Y):Y=e[22];let Z;e[23]===Symbol.for("react.memo_cache_sentinel")?(Z=y.jsx(V_,{}),e[23]=Z):Z=e[23];let P;e[24]!==D?(P=y.jsxs(Vo,{onSelect:D,children:[Z,"Copy"]}),e[24]=D,e[25]=P):P=e[25];const q=n?.readOnly;let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=y.jsx(tI,{}),e[26]=A):A=e[26];let B;e[27]!==k||e[28]!==q?(B=y.jsxs(Vo,{onSelect:k,disabled:q,children:[A,"Cut"]}),e[27]=k,e[28]=q,e[29]=B):B=e[29];const L=n?.readOnly;let F;e[30]===Symbol.for("react.memo_cache_sentinel")?(F=y.jsx(g8,{}),e[30]=F):F=e[30];let X;e[31]!==$||e[32]!==L?(X=y.jsxs(Vo,{onSelect:$,disabled:L,children:[F,"Clear"]}),e[31]=$,e[32]=L,e[33]=X):X=e[33];let I;e[34]!==U||e[35]!==f?(I=f&&y.jsxs(y.Fragment,{children:[y.jsx(cf,{}),y.jsxs(Vo,{variant:"destructive",onSelect:U,children:[y.jsx(G_,{}),"Delete rows"]})]}),e[34]=U,e[35]=f,e[36]=I):I=e[36];let z;e[37]!==C||e[38]!==P||e[39]!==B||e[40]!==X||e[41]!==I?(z=y.jsxs(cy,{"data-grid-popover":"",align:"start",className:"w-48",onCloseAutoFocus:C,children:[P,B,X,I]}),e[37]=C,e[38]=P,e[39]=B,e[40]=X,e[41]=I,e[42]=z):z=e[42];let H;return e[43]!==i.open||e[44]!==l||e[45]!==Y||e[46]!==z?(H=y.jsxs(iy,{open:i.open,onOpenChange:l,children:[Y,z]}),e[43]=i.open,e[44]=l,e[45]=Y,e[46]=z,e[47]=H):H=e[47],H}function KF(t,e){return t-e}function XF(t){const e=Ee.c(4),{tableMeta:n,pasteDialog:o}=t,a=n?.onPasteDialogOpenChange,i=n?.onCellsPaste;if(!o.open)return null;let l;return e[0]!==i||e[1]!==a||e[2]!==o?(l=y.jsx(ZF,{pasteDialog:o,onPasteDialogOpenChange:a,onCellsPaste:i}),e[0]=i,e[1]=a,e[2]=o,e[3]=l):l=e[3],l}const ZF=v.memo(QF,(t,e)=>t.pasteDialog.open!==e.pasteDialog.open?!1:e.pasteDialog.open?t.pasteDialog.rowsNeeded===e.pasteDialog.rowsNeeded:!0);function QF(t){const e=Ee.c(39),{pasteDialog:n,onPasteDialogOpenChange:o,onCellsPaste:a}=t;let i;e[0]!==a||e[1]!==o?(i={onPasteDialogOpenChange:o,onCellsPaste:a},e[0]=a,e[1]=o,e[2]=i):i=e[2];const l=au(i),u=v.useRef(null);let d;e[3]!==l?(d=P=>{l.current.onPasteDialogOpenChange?.(P)},e[3]=l,e[4]=d):d=e[4];const f=d;let g;e[5]!==l?(g=()=>{l.current.onPasteDialogOpenChange?.(!1)},e[5]=l,e[6]=g):g=e[6];const m=g;let p;e[7]!==l?(p=()=>{l.current.onCellsPaste?.(u.current?.checked??!1)},e[7]=l,e[8]=p):p=e[8];const x=p;let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx(oy,{children:"Do you want to add more rows?"}),e[9]=w):w=e[9];let E;e[10]!==n.rowsNeeded?(E=y.jsx("strong",{children:n.rowsNeeded}),e[10]=n.rowsNeeded,e[11]=E):E=e[11];const S=n.rowsNeeded!==1?"s":"";let M;e[12]!==E||e[13]!==S?(M=y.jsxs(ny,{children:[w,y.jsxs(ry,{children:["We need ",E," additional row",S," to paste everything from your clipboard."]})]}),e[12]=E,e[13]=S,e[14]=M):M=e[14];let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx($S,{ref:u,name:"expand-option",value:"expand",defaultChecked:!0}),e[15]=N):N=e[15];let C;e[16]===Symbol.for("react.memo_cache_sentinel")?(C=y.jsx("span",{className:"font-medium text-sm leading-none",children:"Create new rows"}),e[16]=C):C=e[16];const R=n.rowsNeeded!==1?"s":"";let D;e[17]!==n.rowsNeeded||e[18]!==R?(D=y.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[N,y.jsxs("div",{className:"flex flex-col gap-1",children:[C,y.jsxs("span",{className:"text-muted-foreground text-sm",children:["Add ",n.rowsNeeded," new row",R," to the table and paste all data"]})]})]}),e[17]=n.rowsNeeded,e[18]=R,e[19]=D):D=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx($S,{name:"expand-option",value:"no-expand"}),e[20]=T):T=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[T,y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{className:"font-medium text-sm leading-none",children:"Keep current rows"}),y.jsx("span",{className:"text-muted-foreground text-sm",children:"Paste only what fits in the existing rows"})]})]}),e[21]=k):k=e[21];let j;e[22]!==D?(j=y.jsxs("div",{className:"flex flex-col gap-3 py-1",children:[D,k]}),e[22]=D,e[23]=j):j=e[23];let $;e[24]!==m?($=y.jsx(vn,{variant:"outline",onClick:m,children:"Cancel"}),e[24]=m,e[25]=$):$=e[25];let K;e[26]!==x?(K=y.jsx(vn,{onClick:x,children:"Continue"}),e[26]=x,e[27]=K):K=e[27];let U;e[28]!==$||e[29]!==K?(U=y.jsxs(J_,{children:[$,K]}),e[28]=$,e[29]=K,e[30]=U):U=e[30];let Y;e[31]!==j||e[32]!==U||e[33]!==M?(Y=y.jsxs(ty,{"data-grid-popover":"",children:[M,j,U]}),e[31]=j,e[32]=U,e[33]=M,e[34]=Y):Y=e[34];let Z;return e[35]!==f||e[36]!==n.open||e[37]!==Y?(Z=y.jsx(ey,{open:n.open,onOpenChange:f,children:Y}),e[35]=f,e[36]=n.open,e[37]=Y,e[38]=Z):Z=e[38],Z}function $S(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("relative size-4 shrink-0 appearance-none rounded-full border border-input bg-background shadow-xs outline-none transition-[color,box-shadow]","text-primary focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","checked:before:absolute checked:before:start-1/2 checked:before:top-1/2 checked:before:size-2 checked:before:-translate-x-1/2 checked:before:-translate-y-1/2 checked:before:rounded-full checked:before:bg-primary checked:before:content-['']","dark:bg-input/30",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("input",{type:"radio",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function HS(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function JF(...t){return e=>{let n=!1;const o=t.map(a=>{const i=HS(a,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<o.length;a++){const i=o[a];typeof i=="function"?i():HS(t[a],null)}}}}function XN(...t){return v.useCallback(JF(...t),t)}function da(t){const e=Ee.c(85);let n,o,a,i,l,u,d,f,g,m,p,x,w,E,S;e[0]!==t?({tableMeta:S,rowIndex:E,columnId:o,isEditing:i,isFocused:l,isSelected:d,isSearchMatch:u,isActiveSearchMatch:a,readOnly:p,rowHeight:w,className:n,onClick:f,onKeyDown:g,ref:x,...m}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d,e[8]=f,e[9]=g,e[10]=m,e[11]=p,e[12]=x,e[13]=w,e[14]=E,e[15]=S):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7],f=e[8],g=e[9],m=e[10],p=e[11],x=e[12],w=e[13],E=e[14],S=e[15]);const M=S?.cellMapRef;let N;e[16]!==M||e[17]!==o||e[18]!==E?(N=ne=>{if(!M)return;const _e=tn(E,o);ne?M.current.set(_e,ne):M.current.delete(_e)},e[16]=M,e[17]=o,e[18]=E,e[19]=N):N=e[19];const R=XN(x,N);let D;e[20]!==o||e[21]!==i||e[22]!==l||e[23]!==f||e[24]!==p||e[25]!==E||e[26]!==S?(D=ne=>{i||(ne.preventDefault(),f?.(ne),l&&!p?S?.onCellEditingStart?.(E,o):S?.onCellClick?.(E,o,ne))},e[20]=o,e[21]=i,e[22]=l,e[23]=f,e[24]=p,e[25]=E,e[26]=S,e[27]=D):D=e[27];const T=D;let k;e[28]!==o||e[29]!==i||e[30]!==E||e[31]!==S?(k=ne=>{i||S?.onCellContextMenu?.(E,o,ne)},e[28]=o,e[29]=i,e[30]=E,e[31]=S,e[32]=k):k=e[32];const j=k;let $;e[33]!==o||e[34]!==i||e[35]!==E||e[36]!==S?($=ne=>{i||(ne.preventDefault(),S?.onCellDoubleClick?.(E,o))},e[33]=o,e[34]=i,e[35]=E,e[36]=S,e[37]=$):$=e[37];const K=$;let U;e[38]!==o||e[39]!==i||e[40]!==l||e[41]!==g||e[42]!==p||e[43]!==E||e[44]!==S?(U=ne=>{if(g?.(ne),!ne.defaultPrevented&&!(ne.key==="ArrowUp"||ne.key==="ArrowDown"||ne.key==="ArrowLeft"||ne.key==="ArrowRight"||ne.key==="Home"||ne.key==="End"||ne.key==="PageUp"||ne.key==="PageDown"||ne.key==="Tab")&&l&&!i&&!p){if(ne.key==="F2"||ne.key==="Enter"){ne.preventDefault(),ne.stopPropagation(),S?.onCellEditingStart?.(E,o);return}if(ne.key===" "){ne.preventDefault(),ne.stopPropagation(),S?.onCellEditingStart?.(E,o);return}ne.key.length===1&&!ne.ctrlKey&&!ne.metaKey&&(ne.preventDefault(),ne.stopPropagation(),S?.onCellEditingStart?.(E,o))}},e[38]=o,e[39]=i,e[40]=l,e[41]=g,e[42]=p,e[43]=E,e[44]=S,e[45]=U):U=e[45];const Y=U;let Z;e[46]!==o||e[47]!==i||e[48]!==E||e[49]!==S?(Z=ne=>{i||S?.onCellMouseDown?.(E,o,ne)},e[46]=o,e[47]=i,e[48]=E,e[49]=S,e[50]=Z):Z=e[50];const P=Z;let q;e[51]!==o||e[52]!==i||e[53]!==E||e[54]!==S?(q=()=>{i||S?.onCellMouseEnter?.(E,o)},e[51]=o,e[52]=i,e[53]=E,e[54]=S,e[55]=q):q=e[55];const A=q;let B;e[56]!==i||e[57]!==S?(B=()=>{i||S?.onCellMouseUp?.()},e[56]=i,e[57]=S,e[58]=B):B=e[58];const L=B,F=i?"":void 0,X=l?"":void 0,I=d?"":void 0,z=l&&!i?0:-1,H=u&&!a,G=d&&!i,J=!i,ae=!i&&w==="short",W=!i&&w==="medium",ee=!i&&w==="tall",oe=!i&&w==="extra-tall";let de;e[59]!==n||e[60]!==a||e[61]!==l||e[62]!==H||e[63]!==G||e[64]!==J||e[65]!==ae||e[66]!==W||e[67]!==ee||e[68]!==oe?(de=Ne("size-full px-2 py-1.5 text-start text-sm outline-none has-data-[slot=checkbox]:pt-2.5",{"ring-1 ring-ring ring-inset":l,"bg-yellow-100 dark:bg-yellow-900/30":H,"bg-orange-200 dark:bg-orange-900/50":a,"bg-primary/10":G,"cursor-default":J,"**:data-[slot=grid-cell-content]:line-clamp-1":ae,"**:data-[slot=grid-cell-content]:line-clamp-2":W,"**:data-[slot=grid-cell-content]:line-clamp-3":ee,"**:data-[slot=grid-cell-content]:line-clamp-4":oe},n),e[59]=n,e[60]=a,e[61]=l,e[62]=H,e[63]=G,e[64]=J,e[65]=ae,e[66]=W,e[67]=ee,e[68]=oe,e[69]=de):de=e[69];let ge;return e[70]!==R||e[71]!==T||e[72]!==j||e[73]!==K||e[74]!==Y||e[75]!==P||e[76]!==A||e[77]!==L||e[78]!==m||e[79]!==X||e[80]!==I||e[81]!==z||e[82]!==de||e[83]!==F?(ge=y.jsx("div",{role:"button","data-slot":"grid-cell-wrapper","data-editing":F,"data-focused":X,"data-selected":I,tabIndex:z,...m,ref:R,className:de,onClick:T,onContextMenu:j,onDoubleClick:K,onMouseDown:P,onMouseEnter:A,onMouseUp:L,onKeyDown:Y}),e[70]=R,e[71]=T,e[72]=j,e[73]=K,e[74]=Y,e[75]=P,e[76]=A,e[77]=L,e[78]=m,e[79]=X,e[80]=I,e[81]=z,e[82]=de,e[83]=F,e[84]=ge):ge=e[84],ge}function eV(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const tV={},vc={};function _s(t,e){try{const o=(tV[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return o in vc?vc[o]:BS(o,o.split(":"))}catch{if(t in vc)return vc[t];const n=t?.match(nV);return n?BS(t,n.slice(1)):NaN}}const nV=/([+-]\d\d):?(\d\d)?/;function BS(t,e){const n=+(e[0]||0),o=+(e[1]||0),a=+(e[2]||0)/60;return vc[t]=n*60+o>0?n*60+o+a:n*60-o-a}class vr extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(_s(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),ZN(this),n0(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new vr(...n,e):new vr(Date.now(),e)}withTimeZone(e){return new vr(+this,e)}getTimezoneOffset(){const e=-_s(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),n0(this),+this}[Symbol.for("constructDateFrom")](e){return new vr(+new Date(e),this.timeZone)}}const FS=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!FS.test(t))return;const e=t.replace(FS,"$1UTC");vr.prototype[e]&&(t.startsWith("get")?vr.prototype[t]=function(){return this.internal[e]()}:(vr.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),oV(this),+this},vr.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),n0(this),+this}))});function n0(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-_s(t.timeZone,t)*60))}function oV(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),ZN(t)}function ZN(t){const e=_s(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);const a=-new Date(+t).getTimezoneOffset(),i=-new Date(+o).getTimezoneOffset(),l=a-i,u=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();l&&u&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+l);const d=a-n;d&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+d);const f=new Date(+t);f.setUTCSeconds(0);const g=a>0?f.getSeconds():(f.getSeconds()-60)%60,m=Math.round(-(_s(t.timeZone,t)*60))%60;(m||g)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+g));const p=_s(t.timeZone,t),x=p>0?Math.floor(p):Math.ceil(p),E=-new Date(+t).getTimezoneOffset()-x,S=x!==n,M=E-d;if(S&&M){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+M);const N=_s(t.timeZone,t),C=N>0?Math.floor(N):Math.ceil(N),R=x-C;R&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+R))}}class Wn extends vr{static tz(e,...n){return n.length?new Wn(...n,e):new Wn(Date.now(),e)}toISOString(){const[e,n,o]=this.tzComponents(),a=`${e}${n}:${o}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,o,a]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${o} ${n} ${a}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,o,a]=this.tzComponents();return`${e} GMT${n}${o}${a} (${eV(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",o=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),a=String(Math.abs(e)%60).padStart(2,"0");return[n,o,a]}withTimeZone(e){return new Wn(+this,e)}[Symbol.for("constructDateFrom")](e){return new Wn(+new Date(e),this.timeZone)}}const QN=6048e5,rV=864e5,VS=Symbol.for("constructDateFrom");function _n(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&VS in t?t[VS](e):t instanceof Date?new t.constructor(e):new Date(e)}function Gt(t,e){return _n(e||t,t)}function JN(t,e,n){const o=Gt(t,n?.in);return isNaN(e)?_n(t,NaN):(e&&o.setDate(o.getDate()+e),o)}function eR(t,e,n){const o=Gt(t,n?.in);if(isNaN(e))return _n(t,NaN);if(!e)return o;const a=o.getDate(),i=_n(t,o.getTime());i.setMonth(o.getMonth()+e+1,0);const l=i.getDate();return a>=l?i:(o.setFullYear(i.getFullYear(),i.getMonth(),a),o)}let aV={};function su(){return aV}function Ji(t,e){const n=su(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Gt(t,e?.in),i=a.getDay(),l=(i<o?7:0)+i-o;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}function $c(t,e){return Ji(t,{...e,weekStartsOn:1})}function tR(t,e){const n=Gt(t,e?.in),o=n.getFullYear(),a=_n(n,0);a.setFullYear(o+1,0,4),a.setHours(0,0,0,0);const i=$c(a),l=_n(n,0);l.setFullYear(o,0,4),l.setHours(0,0,0,0);const u=$c(l);return n.getTime()>=i.getTime()?o+1:n.getTime()>=u.getTime()?o:o-1}function US(t){const e=Gt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function fl(t,...e){const n=_n.bind(null,e.find(o=>typeof o=="object"));return e.map(n)}function Hc(t,e){const n=Gt(t,e?.in);return n.setHours(0,0,0,0),n}function Ry(t,e,n){const[o,a]=fl(n?.in,t,e),i=Hc(o),l=Hc(a),u=+i-US(i),d=+l-US(l);return Math.round((u-d)/rV)}function sV(t,e){const n=tR(t,e),o=_n(t,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),$c(o)}function iV(t,e,n){return JN(t,e*7,n)}function lV(t,e,n){return eR(t,e*12,n)}function cV(t,e){let n,o=e?.in;return t.forEach(a=>{!o&&typeof a=="object"&&(o=_n.bind(null,a));const i=Gt(a,o);(!n||n<i||isNaN(+i))&&(n=i)}),_n(o,n||NaN)}function uV(t,e){let n,o=e?.in;return t.forEach(a=>{!o&&typeof a=="object"&&(o=_n.bind(null,a));const i=Gt(a,o);(!n||n>i||isNaN(+i))&&(n=i)}),_n(o,n||NaN)}function dV(t,e,n){const[o,a]=fl(n?.in,t,e);return+Hc(o)==+Hc(a)}function nR(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function fV(t){return!(!nR(t)&&typeof t!="number"||isNaN(+Gt(t)))}function oR(t,e,n){const[o,a]=fl(n?.in,t,e),i=o.getFullYear()-a.getFullYear(),l=o.getMonth()-a.getMonth();return i*12+l}function hV(t,e){const n=Gt(t,e?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function rR(t,e){const[n,o]=fl(t,e.start,e.end);return{start:n,end:o}}function mV(t,e){const{start:n,end:o}=rR(e?.in,t);let a=+n>+o;const i=a?+n:+o,l=a?o:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setMonth(l.getMonth()+u);return a?d.reverse():d}function gV(t,e){const n=Gt(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function pV(t,e){const n=Gt(t,e?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}function aR(t,e){const n=Gt(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function yV(t,e){const{start:n,end:o}=rR(e?.in,t);let a=+n>+o;const i=a?+n:+o,l=a?o:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setFullYear(l.getFullYear()+u);return a?d.reverse():d}function sR(t,e){const n=su(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Gt(t,e?.in),i=a.getDay(),l=(i<o?-7:0)+6-(i-o);return a.setDate(a.getDate()+l),a.setHours(23,59,59,999),a}function vV(t,e){return sR(t,{...e,weekStartsOn:1})}const xV={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},bV=(t,e,n)=>{let o;const a=xV[t];return typeof a=="string"?o=a:e===1?o=a.one:o=a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function ap(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const wV={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},SV={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},CV={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},EV={date:ap({formats:wV,defaultWidth:"full"}),time:ap({formats:SV,defaultWidth:"full"}),dateTime:ap({formats:CV,defaultWidth:"full"})},_V={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},MV=(t,e,n,o)=>_V[t];function lc(t){return(e,n)=>{const o=n?.context?String(n.context):"standalone";let a;if(o==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,u=n?.width?String(n.width):l;a=t.formattingValues[u]||t.formattingValues[l]}else{const l=t.defaultWidth,u=n?.width?String(n.width):t.defaultWidth;a=t.values[u]||t.values[l]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const NV={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},RV={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},DV={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},TV={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},kV={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},OV={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},AV=(t,e)=>{const n=Number(t),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},jV={ordinalNumber:AV,era:lc({values:NV,defaultWidth:"wide"}),quarter:lc({values:RV,defaultWidth:"wide",argumentCallback:t=>t-1}),month:lc({values:DV,defaultWidth:"wide"}),day:lc({values:TV,defaultWidth:"wide"}),dayPeriod:lc({values:kV,defaultWidth:"wide",formattingValues:OV,defaultFormattingWidth:"wide"})};function cc(t){return(e,n={})=>{const o=n.width,a=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const l=i[0],u=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(u)?IV(u,m=>m.test(l)):zV(u,m=>m.test(l));let f;f=t.valueCallback?t.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const g=e.slice(l.length);return{value:f,rest:g}}}function zV(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function IV(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function PV(t){return(e,n={})=>{const o=e.match(t.matchPattern);if(!o)return null;const a=o[0],i=e.match(t.parsePattern);if(!i)return null;let l=t.valueCallback?t.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const u=e.slice(a.length);return{value:l,rest:u}}}const LV=/^(\d+)(th|st|nd|rd)?/i,$V=/\d+/i,HV={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},BV={any:[/^b/i,/^(a|c)/i]},FV={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},VV={any:[/1/i,/2/i,/3/i,/4/i]},UV={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},YV={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},GV={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},qV={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},WV={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},KV={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},XV={ordinalNumber:PV({matchPattern:LV,parsePattern:$V,valueCallback:t=>parseInt(t,10)}),era:cc({matchPatterns:HV,defaultMatchWidth:"wide",parsePatterns:BV,defaultParseWidth:"any"}),quarter:cc({matchPatterns:FV,defaultMatchWidth:"wide",parsePatterns:VV,defaultParseWidth:"any",valueCallback:t=>t+1}),month:cc({matchPatterns:UV,defaultMatchWidth:"wide",parsePatterns:YV,defaultParseWidth:"any"}),day:cc({matchPatterns:GV,defaultMatchWidth:"wide",parsePatterns:qV,defaultParseWidth:"any"}),dayPeriod:cc({matchPatterns:WV,defaultMatchWidth:"any",parsePatterns:KV,defaultParseWidth:"any"})},Oi={code:"en-US",formatDistance:bV,formatLong:EV,formatRelative:MV,localize:jV,match:XV,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ZV(t,e){const n=Gt(t,e?.in);return Ry(n,aR(n))+1}function Dy(t,e){const n=Gt(t,e?.in),o=+$c(n)-+sV(n);return Math.round(o/QN)+1}function iR(t,e){const n=Gt(t,e?.in),o=n.getFullYear(),a=su(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=_n(e?.in||t,0);l.setFullYear(o+1,0,i),l.setHours(0,0,0,0);const u=Ji(l,e),d=_n(e?.in||t,0);d.setFullYear(o,0,i),d.setHours(0,0,0,0);const f=Ji(d,e);return+n>=+u?o+1:+n>=+f?o:o-1}function QV(t,e){const n=su(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=iR(t,e),i=_n(e?.in||t,0);return i.setFullYear(a,0,o),i.setHours(0,0,0,0),Ji(i,e)}function Ty(t,e){const n=Gt(t,e?.in),o=+Ji(n,e)-+QV(n,e);return Math.round(o/QN)+1}function Bt(t,e){const n=t<0?"-":"",o=Math.abs(t).toString().padStart(e,"0");return n+o}const $a={y(t,e){const n=t.getFullYear(),o=n>0?n:1-n;return Bt(e==="yy"?o%100:o,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Bt(n+1,2)},d(t,e){return Bt(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Bt(t.getHours()%12||12,e.length)},H(t,e){return Bt(t.getHours(),e.length)},m(t,e){return Bt(t.getMinutes(),e.length)},s(t,e){return Bt(t.getSeconds(),e.length)},S(t,e){const n=e.length,o=t.getMilliseconds(),a=Math.trunc(o*Math.pow(10,n-3));return Bt(a,e.length)}},Ri={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},YS={G:function(t,e,n){const o=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const o=t.getFullYear(),a=o>0?o:1-o;return n.ordinalNumber(a,{unit:"year"})}return $a.y(t,e)},Y:function(t,e,n,o){const a=iR(t,o),i=a>0?a:1-a;if(e==="YY"){const l=i%100;return Bt(l,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Bt(i,e.length)},R:function(t,e){const n=tR(t);return Bt(n,e.length)},u:function(t,e){const n=t.getFullYear();return Bt(n,e.length)},Q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return Bt(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return Bt(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,n){const o=t.getMonth();switch(e){case"M":case"MM":return $a.M(t,e);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,n){const o=t.getMonth();switch(e){case"L":return String(o+1);case"LL":return Bt(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,n,o){const a=Ty(t,o);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):Bt(a,e.length)},I:function(t,e,n){const o=Dy(t);return e==="Io"?n.ordinalNumber(o,{unit:"week"}):Bt(o,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):$a.d(t,e)},D:function(t,e,n){const o=ZV(t);return e==="Do"?n.ordinalNumber(o,{unit:"dayOfYear"}):Bt(o,e.length)},E:function(t,e,n){const o=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,n,o){const a=t.getDay(),i=(a-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Bt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,o){const a=t.getDay(),i=(a-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Bt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const o=t.getDay(),a=o===0?7:o;switch(e){case"i":return String(a);case"ii":return Bt(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const o=t.getHours();let a;switch(o===12?a=Ri.noon:o===0?a=Ri.midnight:a=o/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const o=t.getHours();let a;switch(o>=17?a=Ri.evening:o>=12?a=Ri.afternoon:o>=4?a=Ri.morning:a=Ri.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let o=t.getHours()%12;return o===0&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return $a.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):$a.H(t,e)},K:function(t,e,n){const o=t.getHours()%12;return e==="Ko"?n.ordinalNumber(o,{unit:"hour"}):Bt(o,e.length)},k:function(t,e,n){let o=t.getHours();return o===0&&(o=24),e==="ko"?n.ordinalNumber(o,{unit:"hour"}):Bt(o,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):$a.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):$a.s(t,e)},S:function(t,e){return $a.S(t,e)},X:function(t,e,n){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(e){case"X":return qS(o);case"XXXX":case"XX":return Cs(o);default:return Cs(o,":")}},x:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"x":return qS(o);case"xxxx":case"xx":return Cs(o);default:return Cs(o,":")}},O:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+GS(o,":");default:return"GMT"+Cs(o,":")}},z:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+GS(o,":");default:return"GMT"+Cs(o,":")}},t:function(t,e,n){const o=Math.trunc(+t/1e3);return Bt(o,e.length)},T:function(t,e,n){return Bt(+t,e.length)}};function GS(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),a=Math.trunc(o/60),i=o%60;return i===0?n+String(a):n+String(a)+e+Bt(i,2)}function qS(t,e){return t%60===0?(t>0?"-":"+")+Bt(Math.abs(t)/60,2):Cs(t,e)}function Cs(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),a=Bt(Math.trunc(o/60),2),i=Bt(o%60,2);return n+a+e+i}const WS=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},lR=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},JV=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],o=n[1],a=n[2];if(!a)return WS(t,e);let i;switch(o){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",WS(o,e)).replace("{{time}}",lR(a,e))},eU={p:lR,P:JV},tU=/^D+$/,nU=/^Y+$/,oU=["D","DD","YY","YYYY"];function rU(t){return tU.test(t)}function aU(t){return nU.test(t)}function sU(t,e,n){const o=iU(t,e,n);if(console.warn(o),oU.includes(t))throw new RangeError(o)}function iU(t,e,n){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const lU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uU=/^'([^]*?)'?$/,dU=/''/g,fU=/[a-zA-Z]/;function xc(t,e,n){const o=su(),a=n?.locale??o.locale??Oi,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,u=Gt(t,n?.in);if(!fV(u))throw new RangeError("Invalid time value");let d=e.match(cU).map(g=>{const m=g[0];if(m==="p"||m==="P"){const p=eU[m];return p(g,a.formatLong)}return g}).join("").match(lU).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const m=g[0];if(m==="'")return{isToken:!1,value:hU(g)};if(YS[m])return{isToken:!0,value:g};if(m.match(fU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const f={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return d.map(g=>{if(!g.isToken)return g.value;const m=g.value;(!n?.useAdditionalWeekYearTokens&&aU(m)||!n?.useAdditionalDayOfYearTokens&&rU(m))&&sU(m,e,String(t));const p=YS[m[0]];return p(u,m,a.localize,f)}).join("")}function hU(t){const e=t.match(uU);return e?e[1].replace(dU,"'"):t}function mU(t,e){const n=Gt(t,e?.in),o=n.getFullYear(),a=n.getMonth(),i=_n(n,0);return i.setFullYear(o,a+1,0),i.setHours(0,0,0,0),i.getDate()}function gU(t,e){return Gt(t,e?.in).getMonth()}function pU(t,e){return Gt(t,e?.in).getFullYear()}function yU(t,e){return+Gt(t)>+Gt(e)}function vU(t,e){return+Gt(t)<+Gt(e)}function xU(t,e,n){const[o,a]=fl(n?.in,t,e);return o.getFullYear()===a.getFullYear()&&o.getMonth()===a.getMonth()}function bU(t,e,n){const[o,a]=fl(n?.in,t,e);return o.getFullYear()===a.getFullYear()}function wU(t,e,n){const o=Gt(t,n?.in),a=o.getFullYear(),i=o.getDate(),l=_n(t,0);l.setFullYear(a,e,15),l.setHours(0,0,0,0);const u=mU(l);return o.setMonth(e,Math.min(i,u)),o}function SU(t,e,n){const o=Gt(t,n?.in);return isNaN(+o)?_n(t,NaN):(o.setFullYear(e),o)}const KS=5,CU=4;function EU(t,e){const n=e.startOfMonth(t),o=n.getDay()>0?n.getDay():7,a=e.addDays(t,-o+1),i=e.addDays(a,KS*7-1);return e.getMonth(t)===e.getMonth(i)?KS:CU}function cR(t,e){const n=e.startOfMonth(t),o=n.getDay();return o===1?n:o===0?e.addDays(n,-6):e.addDays(n,-1*(o-1))}function _U(t,e){const n=cR(t,e),o=EU(t,e);return e.addDays(n,o*7-1)}const uR={...Oi,labels:{labelDayButton:(t,e,n,o)=>{let a;o&&typeof o.format=="function"?a=o.format.bind(o):a=(l,u)=>xc(l,u,{locale:Oi,...n});let i=a(t,"PPPP");return e.today&&(i=`Today, ${i}`),e.selected&&(i=`${i}, selected`),i},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:t=>`Week ${t}`,labelYearDropdown:"Choose the Year",labelGrid:(t,e,n)=>{let o;return n&&typeof n.format=="function"?o=n.format.bind(n):o=(a,i)=>xc(a,i,{locale:Oi,...e}),o(t,"LLLL yyyy")},labelGridcell:(t,e,n,o)=>{let a;o&&typeof o.format=="function"?a=o.format.bind(o):a=(l,u)=>xc(l,u,{locale:Oi,...n});let i=a(t,"PPPP");return e?.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(t,e,n)=>{let o;return n&&typeof n.format=="function"?o=n.format.bind(n):o=(a,i)=>xc(a,i,{locale:Oi,...e}),o(t,"cccc")}}};class Mo{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Wn.tz(this.options.timeZone):new this.Date,this.newDate=(o,a,i)=>this.overrides?.newDate?this.overrides.newDate(o,a,i):this.options.timeZone?new Wn(o,a,i,this.options.timeZone):new Date(o,a,i),this.addDays=(o,a)=>this.overrides?.addDays?this.overrides.addDays(o,a):JN(o,a),this.addMonths=(o,a)=>this.overrides?.addMonths?this.overrides.addMonths(o,a):eR(o,a),this.addWeeks=(o,a)=>this.overrides?.addWeeks?this.overrides.addWeeks(o,a):iV(o,a),this.addYears=(o,a)=>this.overrides?.addYears?this.overrides.addYears(o,a):lV(o,a),this.differenceInCalendarDays=(o,a)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(o,a):Ry(o,a),this.differenceInCalendarMonths=(o,a)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(o,a):oR(o,a),this.eachMonthOfInterval=o=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(o):mV(o),this.eachYearOfInterval=o=>{const a=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(o):yV(o),i=new Set(a.map(u=>this.getYear(u)));if(i.size===a.length)return a;const l=[];return i.forEach(u=>{l.push(new Date(u,0,1))}),l},this.endOfBroadcastWeek=o=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(o):_U(o,this),this.endOfISOWeek=o=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(o):vV(o),this.endOfMonth=o=>this.overrides?.endOfMonth?this.overrides.endOfMonth(o):hV(o),this.endOfWeek=(o,a)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(o,a):sR(o,this.options),this.endOfYear=o=>this.overrides?.endOfYear?this.overrides.endOfYear(o):pV(o),this.format=(o,a,i)=>{const l=this.overrides?.format?this.overrides.format(o,a,this.options):xc(o,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=o=>this.overrides?.getISOWeek?this.overrides.getISOWeek(o):Dy(o),this.getMonth=(o,a)=>this.overrides?.getMonth?this.overrides.getMonth(o,this.options):gU(o,this.options),this.getYear=(o,a)=>this.overrides?.getYear?this.overrides.getYear(o,this.options):pU(o,this.options),this.getWeek=(o,a)=>this.overrides?.getWeek?this.overrides.getWeek(o,this.options):Ty(o,this.options),this.isAfter=(o,a)=>this.overrides?.isAfter?this.overrides.isAfter(o,a):yU(o,a),this.isBefore=(o,a)=>this.overrides?.isBefore?this.overrides.isBefore(o,a):vU(o,a),this.isDate=o=>this.overrides?.isDate?this.overrides.isDate(o):nR(o),this.isSameDay=(o,a)=>this.overrides?.isSameDay?this.overrides.isSameDay(o,a):dV(o,a),this.isSameMonth=(o,a)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(o,a):xU(o,a),this.isSameYear=(o,a)=>this.overrides?.isSameYear?this.overrides.isSameYear(o,a):bU(o,a),this.max=o=>this.overrides?.max?this.overrides.max(o):cV(o),this.min=o=>this.overrides?.min?this.overrides.min(o):uV(o),this.setMonth=(o,a)=>this.overrides?.setMonth?this.overrides.setMonth(o,a):wU(o,a),this.setYear=(o,a)=>this.overrides?.setYear?this.overrides.setYear(o,a):SU(o,a),this.startOfBroadcastWeek=(o,a)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(o,this):cR(o,this),this.startOfDay=o=>this.overrides?.startOfDay?this.overrides.startOfDay(o):Hc(o),this.startOfISOWeek=o=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(o):$c(o),this.startOfMonth=o=>this.overrides?.startOfMonth?this.overrides.startOfMonth(o):gV(o),this.startOfWeek=(o,a)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(o,this.options):Ji(o,this.options),this.startOfYear=o=>this.overrides?.startOfYear?this.overrides.startOfYear(o):aR(o),this.options={locale:uR,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),o={};for(let a=0;a<10;a++)o[a.toString()]=n.format(a);return o}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,o=>n[o]||o)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&Mo.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:o,numerals:a}=this.options,i=n?.code;if(i&&Mo.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:o,numberingSystem:a}).format(e)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,l)}}Mo.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Rr=new Mo;class dR{constructor(e,n,o=Rr){this.date=e,this.displayMonth=n,this.outside=!!(n&&!o.isSameMonth(e,n)),this.dateLib=o,this.isoDate=o.format(e,"yyyy-MM-dd"),this.displayMonthId=o.format(n,"yyyy-MM"),this.dateMonthId=o.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class MU{constructor(e,n){this.date=e,this.weeks=n}}class NU{constructor(e,n){this.days=n,this.weekNumber=e}}function RU(t){return ue.createElement("button",{...t})}function DU(t){return ue.createElement("span",{...t})}function TU(t){const{size:e=24,orientation:n="left",className:o}=t;return ue.createElement("svg",{className:o,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&ue.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&ue.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&ue.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&ue.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function kU(t){const{day:e,modifiers:n,...o}=t;return ue.createElement("td",{...o})}function OU(t){const{day:e,modifiers:n,...o}=t,a=ue.useRef(null);return ue.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),ue.createElement("button",{ref:a,...o})}var Ge;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Ge||(Ge={}));var dn;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(dn||(dn={}));var tr;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(tr||(tr={}));var wo;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(wo||(wo={}));function AU(t){const{options:e,className:n,components:o,classNames:a,...i}=t,l=[a[Ge.Dropdown],n].join(" "),u=e?.find(({value:d})=>d===i.value);return ue.createElement("span",{"data-disabled":i.disabled,className:a[Ge.DropdownRoot]},ue.createElement(o.Select,{className:l,...i},e?.map(({value:d,label:f,disabled:g})=>ue.createElement(o.Option,{key:d,value:d,disabled:g},f))),ue.createElement("span",{className:a[Ge.CaptionLabel],"aria-hidden":!0},u?.label,ue.createElement(o.Chevron,{orientation:"down",size:18,className:a[Ge.Chevron]})))}function jU(t){return ue.createElement("div",{...t})}function zU(t){return ue.createElement("div",{...t})}function IU(t){const{calendarMonth:e,displayIndex:n,...o}=t;return ue.createElement("div",{...o},t.children)}function PU(t){const{calendarMonth:e,displayIndex:n,...o}=t;return ue.createElement("div",{...o})}function LU(t){return ue.createElement("table",{...t})}function $U(t){return ue.createElement("div",{...t})}const fR=v.createContext(void 0);function iu(){const t=v.useContext(fR);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function HU(t){const{components:e}=iu();return ue.createElement(e.Dropdown,{...t})}function BU(t){const{onPreviousClick:e,onNextClick:n,previousMonth:o,nextMonth:a,...i}=t,{components:l,classNames:u,labels:{labelPrevious:d,labelNext:f}}=iu(),g=v.useCallback(p=>{a&&n?.(p)},[a,n]),m=v.useCallback(p=>{o&&e?.(p)},[o,e]);return ue.createElement("nav",{...i},ue.createElement(l.PreviousMonthButton,{type:"button",className:u[Ge.PreviousMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":d(o),onClick:m},ue.createElement(l.Chevron,{disabled:o?void 0:!0,className:u[Ge.Chevron],orientation:"left"})),ue.createElement(l.NextMonthButton,{type:"button",className:u[Ge.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":f(a),onClick:g},ue.createElement(l.Chevron,{disabled:a?void 0:!0,orientation:"right",className:u[Ge.Chevron]})))}function FU(t){const{components:e}=iu();return ue.createElement(e.Button,{...t})}function VU(t){return ue.createElement("option",{...t})}function UU(t){const{components:e}=iu();return ue.createElement(e.Button,{...t})}function YU(t){const{rootRef:e,...n}=t;return ue.createElement("div",{...n,ref:e})}function GU(t){return ue.createElement("select",{...t})}function qU(t){const{week:e,...n}=t;return ue.createElement("tr",{...n})}function WU(t){return ue.createElement("th",{...t})}function KU(t){return ue.createElement("thead",{"aria-hidden":!0},ue.createElement("tr",{...t}))}function XU(t){const{week:e,...n}=t;return ue.createElement("th",{...n})}function ZU(t){return ue.createElement("th",{...t})}function QU(t){return ue.createElement("tbody",{...t})}function JU(t){const{components:e}=iu();return ue.createElement(e.Dropdown,{...t})}const eY=Object.freeze(Object.defineProperty({__proto__:null,Button:RU,CaptionLabel:DU,Chevron:TU,Day:kU,DayButton:OU,Dropdown:AU,DropdownNav:jU,Footer:zU,Month:IU,MonthCaption:PU,MonthGrid:LU,Months:$U,MonthsDropdown:HU,Nav:BU,NextMonthButton:FU,Option:VU,PreviousMonthButton:UU,Root:YU,Select:GU,Week:qU,WeekNumber:XU,WeekNumberHeader:ZU,Weekday:WU,Weekdays:KU,Weeks:QU,YearsDropdown:JU},Symbol.toStringTag,{value:"Module"}));function ea(t,e,n=!1,o=Rr){let{from:a,to:i}=t;const{differenceInCalendarDays:l,isSameDay:u}=o;return a&&i?(l(i,a)<0&&([a,i]=[i,a]),l(e,a)>=(n?1:0)&&l(i,e)>=(n?1:0)):!n&&i?u(i,e):!n&&a?u(a,e):!1}function ky(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function uh(t){return!!(t&&typeof t=="object"&&"from"in t)}function Oy(t){return!!(t&&typeof t=="object"&&"after"in t)}function Ay(t){return!!(t&&typeof t=="object"&&"before"in t)}function hR(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function mR(t,e){return Array.isArray(t)&&t.every(e.isDate)}function ta(t,e,n=Rr){const o=Array.isArray(e)?e:[e],{isSameDay:a,differenceInCalendarDays:i,isAfter:l}=n;return o.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return a(t,u);if(mR(u,n))return u.some(d=>a(t,d));if(uh(u))return ea(u,t,!1,n);if(hR(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(t.getDay()):u.dayOfWeek===t.getDay();if(ky(u)){const d=i(u.before,t),f=i(u.after,t),g=d>0,m=f<0;return l(u.before,u.after)?m&&g:g||m}return Oy(u)?i(t,u.after)>0:Ay(u)?i(u.before,t)>0:typeof u=="function"?u(t):!1})}function tY(t,e,n,o,a){const{disabled:i,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:f,today:g=a.today()}=e,{isSameDay:m,isSameMonth:p,startOfMonth:x,isBefore:w,endOfMonth:E,isAfter:S}=a,M=n&&x(n),N=o&&E(o),C={[dn.focused]:[],[dn.outside]:[],[dn.disabled]:[],[dn.hidden]:[],[dn.today]:[]},R={};for(const D of t){const{date:T,displayMonth:k}=D,j=!!(k&&!p(T,k)),$=!!(M&&w(T,M)),K=!!(N&&S(T,N)),U=!!(i&&ta(T,i,a)),Y=!!(l&&ta(T,l,a))||$||K||!f&&!d&&j||f&&d===!1&&j,Z=m(T,g);j&&C.outside.push(D),U&&C.disabled.push(D),Y&&C.hidden.push(D),Z&&C.today.push(D),u&&Object.keys(u).forEach(P=>{const q=u?.[P];q&&ta(T,q,a)&&(R[P]?R[P].push(D):R[P]=[D])})}return D=>{const T={[dn.focused]:!1,[dn.disabled]:!1,[dn.hidden]:!1,[dn.outside]:!1,[dn.today]:!1},k={};for(const j in C){const $=C[j];T[j]=$.some(K=>K===D)}for(const j in R)k[j]=R[j].some($=>$===D);return{...T,...k}}}function nY(t,e,n={}){return Object.entries(t).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):e[dn[i]]?a.push(e[dn[i]]):e[tr[i]]&&a.push(e[tr[i]]),a),[e[Ge.Day]])}function oY(t){return{...eY,...t}}function rY(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,o])=>{n.startsWith("data-")&&(e[n]=o)}),e}function jy(){const t={};for(const e in Ge)t[Ge[e]]=`rdp-${Ge[e]}`;for(const e in dn)t[dn[e]]=`rdp-${dn[e]}`;for(const e in tr)t[tr[e]]=`rdp-${tr[e]}`;for(const e in wo)t[wo[e]]=`rdp-${wo[e]}`;return t}function gR(t,e,n){return(n??new Mo(e)).formatMonthYear(t)}const aY=gR;function sY(t,e,n){return(n??new Mo(e)).format(t,"d")}function iY(t,e=Rr){return e.format(t,"LLLL")}function lY(t,e,n){return(n??new Mo(e)).format(t,"cccccc")}function cY(t,e=Rr){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function uY(){return""}function pR(t,e=Rr){return e.format(t,"yyyy")}const dY=pR,fY=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:gR,formatDay:sY,formatMonthCaption:aY,formatMonthDropdown:iY,formatWeekNumber:cY,formatWeekNumberHeader:uY,formatWeekdayName:lY,formatYearCaption:dY,formatYearDropdown:pR},Symbol.toStringTag,{value:"Module"}));function hY(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...fY,...t}}function zy(t,e,n,o){let a=(o??new Mo(n)).format(t,"PPPP");return e.today&&(a=`Today, ${a}`),e.selected&&(a=`${a}, selected`),a}const mY=zy;function Iy(t,e,n){return(n??new Mo(e)).formatMonthYear(t)}const gY=Iy;function yR(t,e,n,o){let a=(o??new Mo(n)).format(t,"PPPP");return e?.today&&(a=`Today, ${a}`),a}function vR(t){return"Choose the Month"}function xR(){return""}const pY="Go to the Next Month";function bR(t,e){return pY}function wR(t){return"Go to the Previous Month"}function SR(t,e,n){return(n??new Mo(e)).format(t,"cccc")}function CR(t,e){return`Week ${t}`}function ER(t){return"Week Number"}function _R(t){return"Choose the Year"}const yY=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:gY,labelDay:mY,labelDayButton:zy,labelGrid:Iy,labelGridcell:yR,labelMonthDropdown:vR,labelNav:xR,labelNext:bR,labelPrevious:wR,labelWeekNumber:CR,labelWeekNumberHeader:ER,labelWeekday:SR,labelYearDropdown:_R},Symbol.toStringTag,{value:"Module"})),Ko=(t,e,n)=>e||(n?typeof n=="function"?n:(...o)=>n:t);function vY(t,e){const n=e.locale?.labels??{};return{...yY,...t??{},labelDayButton:Ko(zy,t?.labelDayButton,n.labelDayButton),labelMonthDropdown:Ko(vR,t?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Ko(bR,t?.labelNext,n.labelNext),labelPrevious:Ko(wR,t?.labelPrevious,n.labelPrevious),labelWeekNumber:Ko(CR,t?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Ko(_R,t?.labelYearDropdown,n.labelYearDropdown),labelGrid:Ko(Iy,t?.labelGrid,n.labelGrid),labelGridcell:Ko(yR,t?.labelGridcell,n.labelGridcell),labelNav:Ko(xR,t?.labelNav,n.labelNav),labelWeekNumberHeader:Ko(ER,t?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Ko(SR,t?.labelWeekday,n.labelWeekday)}}function xY(t,e,n,o,a){const{startOfMonth:i,startOfYear:l,endOfYear:u,eachMonthOfInterval:d,getMonth:f}=a;return d({start:l(t),end:u(t)}).map(p=>{const x=o.formatMonthDropdown(p,a),w=f(p),E=e&&p<i(e)||n&&p>i(n)||!1;return{value:w,label:x,disabled:E}})}function bY(t,e={},n={}){let o={...e?.[Ge.Day]};return Object.entries(t).filter(([,a])=>a===!0).forEach(([a])=>{o={...o,...n?.[a]}}),o}function wY(t,e,n,o){const a=o??t.today(),i=n?t.startOfBroadcastWeek(a,t):e?t.startOfISOWeek(a):t.startOfWeek(a),l=[];for(let u=0;u<7;u++){const d=t.addDays(i,u);l.push(d)}return l}function SY(t,e,n,o,a=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:u,getYear:d}=o,f=i(t),g=l(e),m=u({start:f,end:g});return a&&m.reverse(),m.map(p=>{const x=n.formatYearDropdown(p,o);return{value:d(p),label:x,disabled:!1}})}function CY(t,e={}){const{weekStartsOn:n,locale:o}=e,a=n??o?.options?.weekStartsOn??0,i=u=>{const d=typeof u=="number"||typeof u=="string"?new Date(u):u;return new Wn(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,t)},l=u=>{const d=i(u);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>i(Wn.tz(t)),newDate:(u,d,f)=>new Wn(u,d,f,12,0,0,t),startOfDay:u=>i(u),startOfWeek:(u,d)=>{const f=i(u),g=d?.weekStartsOn??a,m=(f.getDay()-g+7)%7;return f.setDate(f.getDate()-m),f},startOfISOWeek:u=>{const d=i(u),f=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-f),d},startOfMonth:u=>{const d=i(u);return d.setDate(1),d},startOfYear:u=>{const d=i(u);return d.setMonth(0,1),d},endOfWeek:(u,d)=>{const f=i(u),p=(((d?.weekStartsOn??a)+6)%7-f.getDay()+7)%7;return f.setDate(f.getDate()+p),f},endOfISOWeek:u=>{const d=i(u),f=(7-d.getDay())%7;return d.setDate(d.getDate()+f),d},endOfMonth:u=>{const d=i(u);return d.setMonth(d.getMonth()+1,0),d},endOfYear:u=>{const d=i(u);return d.setMonth(11,31),d},eachMonthOfInterval:u=>{const d=i(u.start),f=i(u.end),g=[],m=new Wn(d.getFullYear(),d.getMonth(),1,12,0,0,t),p=f.getFullYear()*12+f.getMonth();for(;m.getFullYear()*12+m.getMonth()<=p;)g.push(new Wn(m,t)),m.setMonth(m.getMonth()+1,1);return g},addDays:(u,d)=>{const f=i(u);return f.setDate(f.getDate()+d),f},addWeeks:(u,d)=>{const f=i(u);return f.setDate(f.getDate()+d*7),f},addMonths:(u,d)=>{const f=i(u);return f.setMonth(f.getMonth()+d),f},addYears:(u,d)=>{const f=i(u);return f.setFullYear(f.getFullYear()+d),f},eachYearOfInterval:u=>{const d=i(u.start),f=i(u.end),g=[],m=new Wn(d.getFullYear(),0,1,12,0,0,t);for(;m.getFullYear()<=f.getFullYear();)g.push(new Wn(m,t)),m.setFullYear(m.getFullYear()+1,0,1);return g},getWeek:(u,d)=>{const f=l(u);return Ty(f,{weekStartsOn:d?.weekStartsOn??a,firstWeekContainsDate:d?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1})},getISOWeek:u=>{const d=l(u);return Dy(d)},differenceInCalendarDays:(u,d)=>{const f=l(u),g=l(d);return Ry(f,g)},differenceInCalendarMonths:(u,d)=>{const f=l(u),g=l(d);return oR(f,g)}}}const lu=t=>t instanceof HTMLElement?t:null,sp=t=>[...t.querySelectorAll("[data-animated-month]")??[]],EY=t=>lu(t.querySelector("[data-animated-month]")),ip=t=>lu(t.querySelector("[data-animated-caption]")),lp=t=>lu(t.querySelector("[data-animated-weeks]")),_Y=t=>lu(t.querySelector("[data-animated-nav]")),MY=t=>lu(t.querySelector("[data-animated-weekdays]"));function NY(t,e,{classNames:n,months:o,focused:a,dateLib:i}){const l=v.useRef(null),u=v.useRef(o),d=v.useRef(!1);v.useLayoutEffect(()=>{const f=u.current;if(u.current=o,!e||!t.current||!(t.current instanceof HTMLElement)||o.length===0||f.length===0||o.length!==f.length)return;const g=i.isSameMonth(o[0].date,f[0].date),m=i.isAfter(o[0].date,f[0].date),p=m?n[wo.caption_after_enter]:n[wo.caption_before_enter],x=m?n[wo.weeks_after_enter]:n[wo.weeks_before_enter],w=l.current,E=t.current.cloneNode(!0);if(E instanceof HTMLElement?(sp(E).forEach(C=>{if(!(C instanceof HTMLElement))return;const R=EY(C);R&&C.contains(R)&&C.removeChild(R);const D=ip(C);D&&D.classList.remove(p);const T=lp(C);T&&T.classList.remove(x)}),l.current=E):l.current=null,d.current||g||a)return;const S=w instanceof HTMLElement?sp(w):[],M=sp(t.current);if(M?.every(N=>N instanceof HTMLElement)&&S&&S.every(N=>N instanceof HTMLElement)){d.current=!0,t.current.style.isolation="isolate";const N=_Y(t.current);N&&(N.style.zIndex="1"),M.forEach((C,R)=>{const D=S[R];if(!D)return;C.style.position="relative",C.style.overflow="hidden";const T=ip(C);T&&T.classList.add(p);const k=lp(C);k&&k.classList.add(x);const j=()=>{d.current=!1,t.current&&(t.current.style.isolation=""),N&&(N.style.zIndex=""),T&&T.classList.remove(p),k&&k.classList.remove(x),C.style.position="",C.style.overflow="",C.contains(D)&&C.removeChild(D)};D.style.pointerEvents="none",D.style.position="absolute",D.style.overflow="hidden",D.setAttribute("aria-hidden","true");const $=MY(D);$&&($.style.opacity="0");const K=ip(D);K&&(K.classList.add(m?n[wo.caption_before_exit]:n[wo.caption_after_exit]),K.addEventListener("animationend",j));const U=lp(D);U&&U.classList.add(m?n[wo.weeks_before_exit]:n[wo.weeks_after_exit]),C.insertBefore(D,C.firstChild)})}})}function RY(t,e,n,o){const a=t[0],i=t[t.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:g,differenceInCalendarMonths:m,endOfBroadcastWeek:p,endOfISOWeek:x,endOfMonth:w,endOfWeek:E,isAfter:S,startOfBroadcastWeek:M,startOfISOWeek:N,startOfWeek:C}=o,R=d?M(a,o):l?N(a):C(a),D=d?p(i):l?x(w(i)):E(w(i)),T=e&&(d?p(e):l?x(e):E(e)),k=T&&S(D,T)?T:D,j=g(k,R),$=m(i,a)+1,K=[];for(let Z=0;Z<=j;Z++){const P=f(R,Z);K.push(P)}const Y=(d?35:42)*$;if(u&&K.length<Y){const Z=Y-K.length;for(let P=0;P<Z;P++){const q=f(K[K.length-1],1);K.push(q)}}return K}function DY(t){const e=[];return t.reduce((n,o)=>{const a=o.weeks.reduce((i,l)=>i.concat(l.days.slice()),e.slice());return n.concat(a.slice())},e.slice())}function TY(t,e,n,o){const{numberOfMonths:a=1}=n,i=[];for(let l=0;l<a;l++){const u=o.addMonths(t,l);if(e&&u>e)break;i.push(u)}return i}function XS(t,e,n,o){const{month:a,defaultMonth:i,today:l=o.today(),numberOfMonths:u=1}=t;let d=a||i||l;const{differenceInCalendarMonths:f,addMonths:g,startOfMonth:m}=o;if(n&&f(n,d)<u-1){const p=-1*(u-1);d=g(n,p)}return e&&f(d,e)<0&&(d=e),m(d)}function kY(t,e,n,o){const{addDays:a,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:u,endOfWeek:d,getISOWeek:f,getWeek:g,startOfBroadcastWeek:m,startOfISOWeek:p,startOfWeek:x}=o,w=t.reduce((E,S)=>{const M=n.broadcastCalendar?m(S,o):n.ISOWeek?p(S):x(S),N=n.broadcastCalendar?i(S):n.ISOWeek?l(u(S)):d(u(S)),C=e.filter(k=>k>=M&&k<=N),R=n.broadcastCalendar?35:42;if(n.fixedWeeks&&C.length<R){const k=e.filter(j=>{const $=R-C.length;return j>N&&j<=a(N,$)});C.push(...k)}const D=C.reduce((k,j)=>{const $=n.ISOWeek?f(j):g(j),K=k.find(Y=>Y.weekNumber===$),U=new dR(j,S,o);return K?K.days.push(U):k.push(new NU($,[U])),k},[]),T=new MU(S,D);return E.push(T),E},[]);return n.reverseMonths?w.reverse():w}function OY(t,e){let{startMonth:n,endMonth:o}=t;const{startOfYear:a,startOfDay:i,startOfMonth:l,endOfMonth:u,addYears:d,endOfYear:f,newDate:g,today:m}=e,{fromYear:p,toYear:x,fromMonth:w,toMonth:E}=t;!n&&w&&(n=w),!n&&p&&(n=e.newDate(p,0,1)),!o&&E&&(o=E),!o&&x&&(o=g(x,11,31));const S=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=l(n):p?n=g(p,0,1):!n&&S&&(n=a(d(t.today??m(),-100))),o?o=u(o):x?o=g(x,11,31):!o&&S&&(o=f(t.today??m())),[n&&i(n),o&&i(o)]}function AY(t,e,n,o){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=o,f=a?i:1,g=l(t);if(!e)return u(g,f);if(!(d(e,t)<i))return u(g,f)}function jY(t,e,n,o){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=o,f=a?i??1:1,g=l(t);if(!e)return u(g,-f);if(!(d(g,e)<=0))return u(g,-f)}function zY(t){const e=[];return t.reduce((n,o)=>n.concat(o.weeks.slice()),e.slice())}function dh(t,e){const[n,o]=v.useState(t);return[e===void 0?n:e,o]}function IY(t,e){const[n,o]=OY(t,e),{startOfMonth:a,endOfMonth:i}=e,l=XS(t,n,o,e),[u,d]=dh(l,t.month?l:void 0);v.useEffect(()=>{const R=XS(t,n,o,e);d(R)},[t.timeZone]);const{months:f,weeks:g,days:m,previousMonth:p,nextMonth:x}=v.useMemo(()=>{const R=TY(u,o,{numberOfMonths:t.numberOfMonths},e),D=RY(R,t.endMonth?i(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},e),T=kY(R,D,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},e),k=zY(T),j=DY(T),$=jY(u,n,t,e),K=AY(u,o,t,e);return{months:T,weeks:k,days:j,previousMonth:$,nextMonth:K}},[e,u.getTime(),o?.getTime(),n?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:w,onMonthChange:E}=t,S=R=>g.some(D=>D.days.some(T=>T.isEqualTo(R))),M=R=>{if(w)return;let D=a(R);n&&D<a(n)&&(D=a(n)),o&&D>a(o)&&(D=a(o)),d(D),E?.(D)};return{months:f,weeks:g,days:m,navStart:n,navEnd:o,previousMonth:p,nextMonth:x,goToMonth:M,goToDay:R=>{S(R)||M(R.date)}}}var mr;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(mr||(mr={}));function ZS(t){return!t[dn.disabled]&&!t[dn.hidden]&&!t[dn.outside]}function PY(t,e,n,o){let a,i=-1;for(const l of t){const u=e(l);ZS(u)&&(u[dn.focused]&&i<mr.FocusedModifier?(a=l,i=mr.FocusedModifier):o?.isEqualTo(l)&&i<mr.LastFocused?(a=l,i=mr.LastFocused):n(l.date)&&i<mr.Selected?(a=l,i=mr.Selected):u[dn.today]&&i<mr.Today&&(a=l,i=mr.Today))}return a||(a=t.find(l=>ZS(e(l)))),a}function LY(t,e,n,o,a,i,l){const{ISOWeek:u,broadcastCalendar:d}=i,{addDays:f,addMonths:g,addWeeks:m,addYears:p,endOfBroadcastWeek:x,endOfISOWeek:w,endOfWeek:E,max:S,min:M,startOfBroadcastWeek:N,startOfISOWeek:C,startOfWeek:R}=l;let T={day:f,week:m,month:g,year:p,startOfWeek:k=>d?N(k,l):u?C(k):R(k),endOfWeek:k=>d?x(k):u?w(k):E(k)}[t](n,e==="after"?1:-1);return e==="before"&&o?T=S([o,T]):e==="after"&&a&&(T=M([a,T])),T}function MR(t,e,n,o,a,i,l,u=0){if(u>365)return;const d=LY(t,e,n.date,o,a,i,l),f=!!(i.disabled&&ta(d,i.disabled,l)),g=!!(i.hidden&&ta(d,i.hidden,l)),m=d,p=new dR(d,m,l);return!f&&!g?p:MR(t,e,p,o,a,i,l,u+1)}function $Y(t,e,n,o,a){const{autoFocus:i}=t,[l,u]=v.useState(),d=PY(e.days,n,o||(()=>!1),l),[f,g]=v.useState(i?d:void 0);return{isFocusTarget:E=>!!d?.isEqualTo(E),setFocused:g,focused:f,blur:()=>{u(f),g(void 0)},moveFocus:(E,S)=>{if(!f)return;const M=MR(E,S,f,e.navStart,e.navEnd,t,a);M&&(t.disableNavigation&&!e.days.some(C=>C.isEqualTo(M))||(e.goToDay(M),g(M)))}}}function HY(t,e){const{selected:n,required:o,onSelect:a}=t,[i,l]=dh(n,a?n:void 0),u=a?n:i,{isSameDay:d}=e,f=x=>u?.some(w=>d(w,x))??!1,{min:g,max:m}=t;return{selected:u,select:(x,w,E)=>{let S=[...u??[]];if(f(x)){if(u?.length===g||o&&u?.length===1)return;S=u?.filter(M=>!d(M,x))}else u?.length===m?S=[x]:S=[...S,x];return a||l(S),a?.(S,x,w,E),S},isSelected:f}}function BY(t,e,n=0,o=0,a=!1,i=Rr){const{from:l,to:u}=e||{},{isSameDay:d,isAfter:f,isBefore:g}=i;let m;if(!l&&!u)m={from:t,to:n>0?void 0:t};else if(l&&!u)d(l,t)?n===0?m={from:l,to:t}:a?m={from:l,to:void 0}:m=void 0:g(t,l)?m={from:t,to:l}:m={from:l,to:t};else if(l&&u)if(d(l,t)&&d(u,t))a?m={from:l,to:u}:m=void 0;else if(d(l,t))m={from:l,to:n>0?void 0:t};else if(d(u,t))m={from:t,to:n>0?void 0:t};else if(g(t,l))m={from:t,to:u};else if(f(t,l))m={from:l,to:t};else if(f(t,u))m={from:l,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const p=i.differenceInCalendarDays(m.to,m.from);o>0&&p>o?m={from:t,to:void 0}:n>1&&p<n&&(m={from:t,to:void 0})}return m}function FY(t,e,n=Rr){const o=Array.isArray(e)?e:[e];let a=t.from;const i=n.differenceInCalendarDays(t.to,t.from),l=Math.min(i,6);for(let u=0;u<=l;u++){if(o.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function QS(t,e,n=Rr){return ea(t,e.from,!1,n)||ea(t,e.to,!1,n)||ea(e,t.from,!1,n)||ea(e,t.to,!1,n)}function VY(t,e,n=Rr){const o=Array.isArray(e)?e:[e];if(o.filter(u=>typeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?ea(t,u,!1,n):mR(u,n)?u.some(d=>ea(t,d,!1,n)):uh(u)?u.from&&u.to?QS(t,{from:u.from,to:u.to},n):!1:hR(u)?FY(t,u.dayOfWeek,n):ky(u)?n.isAfter(u.before,u.after)?QS(t,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):ta(t.from,u,n)||ta(t.to,u,n):Oy(u)||Ay(u)?ta(t.from,u,n)||ta(t.to,u,n):!1))return!0;const l=o.filter(u=>typeof u=="function");if(l.length){let u=t.from;const d=n.differenceInCalendarDays(t.to,t.from);for(let f=0;f<=d;f++){if(l.some(g=>g(u)))return!0;u=n.addDays(u,1)}}return!1}function UY(t,e){const{disabled:n,excludeDisabled:o,selected:a,required:i,onSelect:l}=t,[u,d]=dh(a,l?a:void 0),f=l?a:u;return{selected:f,select:(p,x,w)=>{const{min:E,max:S}=t,M=p?BY(p,f,E,S,i,e):void 0;return o&&n&&M?.from&&M.to&&VY({from:M.from,to:M.to},n,e)&&(M.from=p,M.to=void 0),l||d(M),l?.(M,p,x,w),M},isSelected:p=>f&&ea(f,p,!1,e)}}function YY(t,e){const{selected:n,required:o,onSelect:a}=t,[i,l]=dh(n,a?n:void 0),u=a?n:i,{isSameDay:d}=e;return{selected:u,select:(m,p,x)=>{let w=m;return!o&&u&&u&&d(m,u)&&(w=void 0),a||l(w),a?.(w,m,p,x),w},isSelected:m=>u?d(u,m):!1}}function GY(t,e){const n=YY(t,e),o=HY(t,e),a=UY(t,e);switch(t.mode){case"single":return n;case"multiple":return o;case"range":return a;default:return}}function Fo(t,e){return t instanceof Wn&&t.timeZone===e?t:new Wn(t,e)}function Di(t,e,n){return Fo(t,e)}function JS(t,e,n){return typeof t=="boolean"||typeof t=="function"?t:t instanceof Date?Di(t,e):Array.isArray(t)?t.map(o=>o instanceof Date?Di(o,e):o):uh(t)?{...t,from:t.from?Fo(t.from,e):t.from,to:t.to?Fo(t.to,e):t.to}:ky(t)?{before:Di(t.before,e),after:Di(t.after,e)}:Oy(t)?{after:Di(t.after,e)}:Ay(t)?{before:Di(t.before,e)}:t}function cp(t,e,n){return t&&(Array.isArray(t)?t.map(o=>JS(o,e)):JS(t,e))}function qY(t){let e=t;const n=e.timeZone;if(n&&(e={...t,timeZone:n},e.today&&(e.today=Fo(e.today,n)),e.month&&(e.month=Fo(e.month,n)),e.defaultMonth&&(e.defaultMonth=Fo(e.defaultMonth,n)),e.startMonth&&(e.startMonth=Fo(e.startMonth,n)),e.endMonth&&(e.endMonth=Fo(e.endMonth,n)),e.mode==="single"&&e.selected?e.selected=Fo(e.selected,n):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(Be=>Fo(Be,n)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?Fo(e.selected.from,n):e.selected.from,to:e.selected.to?Fo(e.selected.to,n):e.selected.to}),e.disabled!==void 0&&(e.disabled=cp(e.disabled,n)),e.hidden!==void 0&&(e.hidden=cp(e.hidden,n)),e.modifiers)){const Be={};Object.keys(e.modifiers).forEach(nt=>{Be[nt]=cp(e.modifiers?.[nt],n)}),e.modifiers=Be}const{components:o,formatters:a,labels:i,dateLib:l,locale:u,classNames:d}=v.useMemo(()=>{const Be={...uR,...e.locale},nt=e.broadcastCalendar?1:e.weekStartsOn,Ue=e.noonSafe&&e.timeZone?CY(e.timeZone,{weekStartsOn:nt,locale:Be}):void 0,st=e.dateLib&&Ue?{...Ue,...e.dateLib}:e.dateLib??Ue,Lt=new Mo({locale:Be,weekStartsOn:nt,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},st);return{dateLib:Lt,components:oY(e.components),formatters:hY(e.formatters),labels:vY(e.labels,Lt.options),locale:Be,classNames:{...jy(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.noonSafe,e.components,e.formatters,e.labels,e.classNames]);e.today||(e={...e,today:l.today()});const{captionLayout:f,mode:g,navLayout:m,numberOfMonths:p=1,onDayBlur:x,onDayClick:w,onDayFocus:E,onDayKeyDown:S,onDayMouseEnter:M,onDayMouseLeave:N,onNextClick:C,onPrevClick:R,showWeekNumber:D,styles:T}=e,{formatCaption:k,formatDay:j,formatMonthDropdown:$,formatWeekNumber:K,formatWeekNumberHeader:U,formatWeekdayName:Y,formatYearDropdown:Z}=a,P=IY(e,l),{days:q,months:A,navStart:B,navEnd:L,previousMonth:F,nextMonth:X,goToMonth:I}=P,z=tY(q,e,B,L,l),{isSelected:H,select:G,selected:J}=GY(e,l)??{},{blur:ae,focused:W,isFocusTarget:ee,moveFocus:oe,setFocused:de}=$Y(e,P,z,H??(()=>!1),l),{labelDayButton:ge,labelGridcell:ne,labelGrid:_e,labelMonthDropdown:De,labelNav:Ye,labelPrevious:Pe,labelNext:mt,labelWeekday:sn,labelWeekNumber:ft,labelWeekNumberHeader:xn,labelYearDropdown:ln}=i,Ft=v.useMemo(()=>wY(l,e.ISOWeek,e.broadcastCalendar,e.today),[l,e.ISOWeek,e.broadcastCalendar,e.today]),fn=g!==void 0||w!==void 0,zt=v.useCallback(()=>{F&&(I(F),R?.(F))},[F,I,R]),Nn=v.useCallback(()=>{X&&(I(X),C?.(X))},[I,X,C]),gn=v.useCallback((Be,nt)=>Ue=>{Ue.preventDefault(),Ue.stopPropagation(),de(Be),!nt.disabled&&(G?.(Be.date,nt,Ue),w?.(Be.date,nt,Ue))},[G,w,de]),In=v.useCallback((Be,nt)=>Ue=>{de(Be),E?.(Be.date,nt,Ue)},[E,de]),jn=v.useCallback((Be,nt)=>Ue=>{ae(),x?.(Be.date,nt,Ue)},[ae,x]),Ce=v.useCallback((Be,nt)=>Ue=>{const st={ArrowLeft:[Ue.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[Ue.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[Ue.shiftKey?"year":"week","after"],ArrowUp:[Ue.shiftKey?"year":"week","before"],PageUp:[Ue.shiftKey?"year":"month","before"],PageDown:[Ue.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(st[Ue.key]){Ue.preventDefault(),Ue.stopPropagation();const[Lt,Te]=st[Ue.key];oe(Lt,Te)}S?.(Be.date,nt,Ue)},[oe,S,e.dir]),Ve=v.useCallback((Be,nt)=>Ue=>{M?.(Be.date,nt,Ue)},[M]),Et=v.useCallback((Be,nt)=>Ue=>{N?.(Be.date,nt,Ue)},[N]),Xe=v.useCallback(Be=>nt=>{const Ue=Number(nt.target.value),st=l.setMonth(l.startOfMonth(Be),Ue);I(st)},[l,I]),at=v.useCallback(Be=>nt=>{const Ue=Number(nt.target.value),st=l.setYear(l.startOfMonth(Be),Ue);I(st)},[l,I]),{className:gt,style:qt}=v.useMemo(()=>({className:[d[Ge.Root],e.className].filter(Boolean).join(" "),style:{...T?.[Ge.Root],...e.style}}),[d,e.className,e.style,T]),Wt=rY(e),Qn=v.useRef(null);NY(Qn,!!e.animate,{classNames:d,months:A,focused:W,dateLib:l});const _t={dayPickerProps:e,selected:J,select:G,isSelected:H,months:A,nextMonth:X,previousMonth:F,goToMonth:I,getModifiers:z,components:o,classNames:d,styles:T,labels:i,formatters:a};return ue.createElement(fR.Provider,{value:_t},ue.createElement(o.Root,{rootRef:e.animate?Qn:void 0,className:gt,style:qt,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...Wt},ue.createElement(o.Months,{className:d[Ge.Months],style:T?.[Ge.Months]},!e.hideNavigation&&!m&&ue.createElement(o.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[Ge.Nav],style:T?.[Ge.Nav],"aria-label":Ye(),onPreviousClick:zt,onNextClick:Nn,previousMonth:F,nextMonth:X}),A.map((Be,nt)=>ue.createElement(o.Month,{"data-animated-month":e.animate?"true":void 0,className:d[Ge.Month],style:T?.[Ge.Month],key:nt,displayIndex:nt,calendarMonth:Be},m==="around"&&!e.hideNavigation&&nt===0&&ue.createElement(o.PreviousMonthButton,{type:"button",className:d[Ge.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":Pe(F),onClick:zt,"data-animated-button":e.animate?"true":void 0},ue.createElement(o.Chevron,{disabled:F?void 0:!0,className:d[Ge.Chevron],orientation:e.dir==="rtl"?"right":"left"})),ue.createElement(o.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:d[Ge.MonthCaption],style:T?.[Ge.MonthCaption],calendarMonth:Be,displayIndex:nt},f?.startsWith("dropdown")?ue.createElement(o.DropdownNav,{className:d[Ge.Dropdowns],style:T?.[Ge.Dropdowns]},(()=>{const Ue=f==="dropdown"||f==="dropdown-months"?ue.createElement(o.MonthsDropdown,{key:"month",className:d[Ge.MonthsDropdown],"aria-label":De(),classNames:d,components:o,disabled:!!e.disableNavigation,onChange:Xe(Be.date),options:xY(Be.date,B,L,a,l),style:T?.[Ge.Dropdown],value:l.getMonth(Be.date)}):ue.createElement("span",{key:"month"},$(Be.date,l)),st=f==="dropdown"||f==="dropdown-years"?ue.createElement(o.YearsDropdown,{key:"year",className:d[Ge.YearsDropdown],"aria-label":ln(l.options),classNames:d,components:o,disabled:!!e.disableNavigation,onChange:at(Be.date),options:SY(B,L,a,l,!!e.reverseYears),style:T?.[Ge.Dropdown],value:l.getYear(Be.date)}):ue.createElement("span",{key:"year"},Z(Be.date,l));return l.getMonthYearOrder()==="year-first"?[st,Ue]:[Ue,st]})(),ue.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(Be.date,l.options,l))):ue.createElement(o.CaptionLabel,{className:d[Ge.CaptionLabel],role:"status","aria-live":"polite"},k(Be.date,l.options,l))),m==="around"&&!e.hideNavigation&&nt===p-1&&ue.createElement(o.NextMonthButton,{type:"button",className:d[Ge.NextMonthButton],tabIndex:X?void 0:-1,"aria-disabled":X?void 0:!0,"aria-label":mt(X),onClick:Nn,"data-animated-button":e.animate?"true":void 0},ue.createElement(o.Chevron,{disabled:X?void 0:!0,className:d[Ge.Chevron],orientation:e.dir==="rtl"?"left":"right"})),nt===p-1&&m==="after"&&!e.hideNavigation&&ue.createElement(o.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[Ge.Nav],style:T?.[Ge.Nav],"aria-label":Ye(),onPreviousClick:zt,onNextClick:Nn,previousMonth:F,nextMonth:X}),ue.createElement(o.MonthGrid,{role:"grid","aria-multiselectable":g==="multiple"||g==="range","aria-label":_e(Be.date,l.options,l)||void 0,className:d[Ge.MonthGrid],style:T?.[Ge.MonthGrid]},!e.hideWeekdays&&ue.createElement(o.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:d[Ge.Weekdays],style:T?.[Ge.Weekdays]},D&&ue.createElement(o.WeekNumberHeader,{"aria-label":xn(l.options),className:d[Ge.WeekNumberHeader],style:T?.[Ge.WeekNumberHeader],scope:"col"},U()),Ft.map(Ue=>ue.createElement(o.Weekday,{"aria-label":sn(Ue,l.options,l),className:d[Ge.Weekday],key:String(Ue),style:T?.[Ge.Weekday],scope:"col"},Y(Ue,l.options,l)))),ue.createElement(o.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:d[Ge.Weeks],style:T?.[Ge.Weeks]},Be.weeks.map(Ue=>ue.createElement(o.Week,{className:d[Ge.Week],key:Ue.weekNumber,style:T?.[Ge.Week],week:Ue},D&&ue.createElement(o.WeekNumber,{week:Ue,style:T?.[Ge.WeekNumber],"aria-label":ft(Ue.weekNumber,{locale:u}),className:d[Ge.WeekNumber],scope:"row",role:"rowheader"},K(Ue.weekNumber,l)),Ue.days.map(st=>{const{date:Lt}=st,Te=z(st);if(Te[dn.focused]=!Te.hidden&&!!W?.isEqualTo(st),Te[tr.selected]=H?.(Lt)||Te.selected,uh(J)){const{from:Pn,to:Dt}=J;Te[tr.range_start]=!!(Pn&&Dt&&l.isSameDay(Lt,Pn)),Te[tr.range_end]=!!(Pn&&Dt&&l.isSameDay(Lt,Dt)),Te[tr.range_middle]=ea(J,Lt,!0,l)}const Ot=bY(Te,T,e.modifiersStyles),Kt=nY(Te,d,e.modifiersClassNames),cn=!fn&&!Te.hidden?ne(Lt,Te,l.options,l):void 0;return ue.createElement(o.Day,{key:`${st.isoDate}_${st.displayMonthId}`,day:st,modifiers:Te,className:Kt.join(" "),style:Ot,role:"gridcell","aria-selected":Te.selected||void 0,"aria-label":cn,"data-day":st.isoDate,"data-month":st.outside?st.dateMonthId:void 0,"data-selected":Te.selected||void 0,"data-disabled":Te.disabled||void 0,"data-hidden":Te.hidden||void 0,"data-outside":st.outside||void 0,"data-focused":Te.focused||void 0,"data-today":Te.today||void 0},!Te.hidden&&fn?ue.createElement(o.DayButton,{className:d[Ge.DayButton],style:T?.[Ge.DayButton],type:"button",day:st,modifiers:Te,disabled:!Te.focused&&Te.disabled||void 0,"aria-disabled":Te.focused&&Te.disabled||void 0,tabIndex:ee(st)?0:-1,"aria-label":ge(Lt,Te,l.options,l),onClick:gn(st,Te),onBlur:jn(st,Te),onFocus:In(st,Te),onKeyDown:Ce(st,Te),onMouseEnter:Ve(st,Te),onMouseLeave:Et(st,Te)},j(Lt,l.options,l)):!Te.hidden&&j(st.date,l.options,l))})))))))),e.footer&&ue.createElement(o.Footer,{className:d[Ge.Footer],style:T?.[Ge.Footer],role:"status","aria-live":"polite"},e.footer)))}function WY({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:o="label",buttonVariant:a="ghost",locale:i,formatters:l,components:u,...d}){const f=jy();return y.jsx(qY,{showOutsideDays:n,className:Ne("p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-background group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:o,locale:i,formatters:{formatMonthDropdown:g=>g.toLocaleString(i?.code,{month:"short"}),...l},classNames:{root:Ne("w-fit",f.root),months:Ne("flex gap-4 flex-col md:flex-row relative",f.months),month:Ne("flex flex-col w-full gap-4",f.month),nav:Ne("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",f.nav),button_previous:Ne($p({variant:a}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_previous),button_next:Ne($p({variant:a}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_next),month_caption:Ne("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",f.month_caption),dropdowns:Ne("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",f.dropdowns),dropdown_root:Ne("relative rounded-(--cell-radius)",f.dropdown_root),dropdown:Ne("absolute bg-popover inset-0 opacity-0",f.dropdown),caption_label:Ne("select-none font-medium",o==="label"?"text-sm":"rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5",f.caption_label),table:"w-full border-collapse",weekdays:Ne("flex",f.weekdays),weekday:Ne("text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none",f.weekday),week:Ne("flex w-full mt-2",f.week),week_number_header:Ne("select-none w-(--cell-size)",f.week_number_header),week_number:Ne("text-[0.8rem] select-none text-muted-foreground",f.week_number),day:Ne("relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none",d.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)":"[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",f.day),range_start:Ne("rounded-l-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate",f.range_start),range_middle:Ne("rounded-none",f.range_middle),range_end:Ne("rounded-r-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate",f.range_end),today:Ne("bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none",f.today),outside:Ne("text-muted-foreground aria-selected:text-muted-foreground",f.outside),disabled:Ne("text-muted-foreground opacity-50",f.disabled),hidden:Ne("invisible",f.hidden),...e},components:{Root:({className:g,rootRef:m,...p})=>y.jsx("div",{"data-slot":"calendar",ref:m,className:Ne(g),...p}),Chevron:({className:g,orientation:m,...p})=>m==="left"?y.jsx(B_,{className:Ne("size-4",g),...p}):m==="right"?y.jsx(F_,{className:Ne("size-4",g),...p}):y.jsx(Os,{className:Ne("size-4",g),...p}),DayButton:({...g})=>y.jsx(KY,{locale:i,...g}),WeekNumber:({children:g,...m})=>y.jsx("td",{...m,children:y.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:g})}),...u},...d})}function KY(t){const e=Ee.c(21);let n,o,a,i,l;e[0]!==t?({className:n,day:o,modifiers:i,locale:a,...l}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=jy(),d=v.useRef(null);let f,g;e[6]!==i.focused?(f=()=>{i.focused&&d.current?.focus()},g=[i.focused],e[6]=i.focused,e[7]=f,e[8]=g):(f=e[7],g=e[8]),v.useEffect(f,g);const m=vn,p="ghost",x="icon";let w;e[9]!==o.date||e[10]!==a?.code?(w=o.date.toLocaleDateString(a?.code),e[9]=o.date,e[10]=a?.code,e[11]=w):w=e[11];const E=i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,S=i.range_start,M=i.range_end,N=i.range_middle,C=Ne("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70",u.day,n);let R;return e[12]!==m||e[13]!==i.range_end||e[14]!==i.range_middle||e[15]!==i.range_start||e[16]!==l||e[17]!==C||e[18]!==w||e[19]!==E?(R=y.jsx(m,{ref:d,variant:p,size:x,"data-day":w,"data-selected-single":E,"data-range-start":S,"data-range-end":M,"data-range-middle":N,className:C,...l}),e[12]=m,e[13]=i.range_end,e[14]=i.range_middle,e[15]=i.range_start,e[16]=l,e[17]=C,e[18]=w,e[19]=E,e[20]=R):R=e[20],R}function XY(t){const e=Ee.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[3px] aria-invalid:ring-[3px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(_2,{"data-slot":"checkbox-indicator",className:"[&>svg]:size-3.5 grid place-content-center text-current transition-none",children:y.jsx(Vs,{})}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==a?(l=y.jsx(C2,{"data-slot":"checkbox",className:a,...o,children:i}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}var eC=1,ZY=.9,QY=.8,JY=.17,up=.1,dp=.999,eG=.9999,tG=.99,nG=/[\\\/_+.#"@\[\(\{&]/,oG=/[\\\/_+.#"@\[\(\{&]/g,rG=/[\s-]/,NR=/[\s-]/g;function o0(t,e,n,o,a,i,l){if(i===e.length)return a===t.length?eC:tG;var u=`${a},${i}`;if(l[u]!==void 0)return l[u];for(var d=o.charAt(i),f=n.indexOf(d,a),g=0,m,p,x,w;f>=0;)m=o0(t,e,n,o,f+1,i+1,l),m>g&&(f===a?m*=eC:nG.test(t.charAt(f-1))?(m*=QY,x=t.slice(a,f-1).match(oG),x&&a>0&&(m*=Math.pow(dp,x.length))):rG.test(t.charAt(f-1))?(m*=ZY,w=t.slice(a,f-1).match(NR),w&&a>0&&(m*=Math.pow(dp,w.length))):(m*=JY,a>0&&(m*=Math.pow(dp,f-a))),t.charAt(f)!==e.charAt(i)&&(m*=eG)),(m<up&&n.charAt(f-1)===o.charAt(i+1)||o.charAt(i+1)===o.charAt(i)&&n.charAt(f-1)!==o.charAt(i))&&(p=o0(t,e,n,o,f+1,i+2,l),p*up>m&&(m=p*up)),m>g&&(g=m),f=n.indexOf(d,f+1);return l[u]=g,g}function tC(t){return t.toLowerCase().replace(NR," ")}function aG(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,o0(t,e,tC(t),tC(e),0,0,{})}var uc='[cmdk-group=""]',fp='[cmdk-group-items=""]',sG='[cmdk-group-heading=""]',RR='[cmdk-item=""]',nC=`${RR}:not([aria-disabled="true"])`,r0="cmdk-item-select",Ai="data-value",iG=(t,e,n)=>aG(t,e,n),DR=v.createContext(void 0),cu=()=>v.useContext(DR),TR=v.createContext(void 0),Py=()=>v.useContext(TR),kR=v.createContext(void 0),OR=v.forwardRef((t,e)=>{let n=ji(()=>{var z,H;return{search:"",value:(H=(z=t.value)!=null?z:t.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=ji(()=>new Set),a=ji(()=>new Map),i=ji(()=>new Map),l=ji(()=>new Set),u=AR(t),{label:d,children:f,value:g,onValueChange:m,filter:p,shouldFilter:x,loop:w,disablePointerSelection:E=!1,vimBindings:S=!0,...M}=t,N=Vn(),C=Vn(),R=Vn(),D=v.useRef(null),T=vG();Hs(()=>{if(g!==void 0){let z=g.trim();n.current.value=z,k.emit()}},[g]),Hs(()=>{T(6,Z)},[]);let k=v.useMemo(()=>({subscribe:z=>(l.current.add(z),()=>l.current.delete(z)),snapshot:()=>n.current,setState:(z,H,G)=>{var J,ae,W,ee;if(!Object.is(n.current[z],H)){if(n.current[z]=H,z==="search")Y(),K(),T(1,U);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(R);oe?oe.focus():(J=document.getElementById(N))==null||J.focus()}if(T(7,()=>{var oe;n.current.selectedItemId=(oe=P())==null?void 0:oe.id,k.emit()}),G||T(5,Z),((ae=u.current)==null?void 0:ae.value)!==void 0){let oe=H??"";(ee=(W=u.current).onValueChange)==null||ee.call(W,oe);return}}k.emit()}},emit:()=>{l.current.forEach(z=>z())}}),[]),j=v.useMemo(()=>({value:(z,H,G)=>{var J;H!==((J=i.current.get(z))==null?void 0:J.value)&&(i.current.set(z,{value:H,keywords:G}),n.current.filtered.items.set(z,$(H,G)),T(2,()=>{K(),k.emit()}))},item:(z,H)=>(o.current.add(z),H&&(a.current.has(H)?a.current.get(H).add(z):a.current.set(H,new Set([z]))),T(3,()=>{Y(),K(),n.current.value||U(),k.emit()}),()=>{i.current.delete(z),o.current.delete(z),n.current.filtered.items.delete(z);let G=P();T(4,()=>{Y(),G?.getAttribute("id")===z&&U(),k.emit()})}),group:z=>(a.current.has(z)||a.current.set(z,new Set),()=>{i.current.delete(z),a.current.delete(z)}),filter:()=>u.current.shouldFilter,label:d||t["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:N,inputId:R,labelId:C,listInnerRef:D}),[]);function $(z,H){var G,J;let ae=(J=(G=u.current)==null?void 0:G.filter)!=null?J:iG;return z?ae(z,n.current.search,H):0}function K(){if(!n.current.search||u.current.shouldFilter===!1)return;let z=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(J=>{let ae=a.current.get(J),W=0;ae.forEach(ee=>{let oe=z.get(ee);W=Math.max(oe,W)}),H.push([J,W])});let G=D.current;q().sort((J,ae)=>{var W,ee;let oe=J.getAttribute("id"),de=ae.getAttribute("id");return((W=z.get(de))!=null?W:0)-((ee=z.get(oe))!=null?ee:0)}).forEach(J=>{let ae=J.closest(fp);ae?ae.appendChild(J.parentElement===ae?J:J.closest(`${fp} > *`)):G.appendChild(J.parentElement===G?J:J.closest(`${fp} > *`))}),H.sort((J,ae)=>ae[1]-J[1]).forEach(J=>{var ae;let W=(ae=D.current)==null?void 0:ae.querySelector(`${uc}[${Ai}="${encodeURIComponent(J[0])}"]`);W?.parentElement.appendChild(W)})}function U(){let z=q().find(G=>G.getAttribute("aria-disabled")!=="true"),H=z?.getAttribute(Ai);k.setState("value",H||void 0)}function Y(){var z,H,G,J;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=o.current.size;return}n.current.filtered.groups=new Set;let ae=0;for(let W of o.current){let ee=(H=(z=i.current.get(W))==null?void 0:z.value)!=null?H:"",oe=(J=(G=i.current.get(W))==null?void 0:G.keywords)!=null?J:[],de=$(ee,oe);n.current.filtered.items.set(W,de),de>0&&ae++}for(let[W,ee]of a.current)for(let oe of ee)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(W);break}n.current.filtered.count=ae}function Z(){var z,H,G;let J=P();J&&(((z=J.parentElement)==null?void 0:z.firstChild)===J&&((G=(H=J.closest(uc))==null?void 0:H.querySelector(sG))==null||G.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function P(){var z;return(z=D.current)==null?void 0:z.querySelector(`${RR}[aria-selected="true"]`)}function q(){var z;return Array.from(((z=D.current)==null?void 0:z.querySelectorAll(nC))||[])}function A(z){let H=q()[z];H&&k.setState("value",H.getAttribute(Ai))}function B(z){var H;let G=P(),J=q(),ae=J.findIndex(ee=>ee===G),W=J[ae+z];(H=u.current)!=null&&H.loop&&(W=ae+z<0?J[J.length-1]:ae+z===J.length?J[0]:J[ae+z]),W&&k.setState("value",W.getAttribute(Ai))}function L(z){let H=P(),G=H?.closest(uc),J;for(;G&&!J;)G=z>0?pG(G,uc):yG(G,uc),J=G?.querySelector(nC);J?k.setState("value",J.getAttribute(Ai)):B(z)}let F=()=>A(q().length-1),X=z=>{z.preventDefault(),z.metaKey?F():z.altKey?L(1):B(1)},I=z=>{z.preventDefault(),z.metaKey?A(0):z.altKey?L(-1):B(-1)};return v.createElement(et.div,{ref:e,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:z=>{var H;(H=M.onKeyDown)==null||H.call(M,z);let G=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||G))switch(z.key){case"n":case"j":{S&&z.ctrlKey&&X(z);break}case"ArrowDown":{X(z);break}case"p":case"k":{S&&z.ctrlKey&&I(z);break}case"ArrowUp":{I(z);break}case"Home":{z.preventDefault(),A(0);break}case"End":{z.preventDefault(),F();break}case"Enter":{z.preventDefault();let J=P();if(J){let ae=new Event(r0);J.dispatchEvent(ae)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:bG},d),fh(t,z=>v.createElement(TR.Provider,{value:k},v.createElement(DR.Provider,{value:j},z))))}),lG=v.forwardRef((t,e)=>{var n,o;let a=Vn(),i=v.useRef(null),l=v.useContext(kR),u=cu(),d=AR(t),f=(o=(n=d.current)==null?void 0:n.forceMount)!=null?o:l?.forceMount;Hs(()=>{if(!f)return u.item(a,l?.id)},[f]);let g=jR(a,i,[t.value,t.children,i],t.keywords),m=Py(),p=Xa(T=>T.value&&T.value===g.current),x=Xa(T=>f||u.filter()===!1?!0:T.search?T.filtered.items.get(a)>0:!0);v.useEffect(()=>{let T=i.current;if(!(!T||t.disabled))return T.addEventListener(r0,w),()=>T.removeEventListener(r0,w)},[x,t.onSelect,t.disabled]);function w(){var T,k;E(),(k=(T=d.current).onSelect)==null||k.call(T,g.current)}function E(){m.setState("value",g.current,!0)}if(!x)return null;let{disabled:S,value:M,onSelect:N,forceMount:C,keywords:R,...D}=t;return v.createElement(et.div,{ref:aa(i,e),...D,id:a,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!p,"data-disabled":!!S,"data-selected":!!p,onPointerMove:S||u.getDisablePointerSelection()?void 0:E,onClick:S?void 0:w},t.children)}),cG=v.forwardRef((t,e)=>{let{heading:n,children:o,forceMount:a,...i}=t,l=Vn(),u=v.useRef(null),d=v.useRef(null),f=Vn(),g=cu(),m=Xa(x=>a||g.filter()===!1?!0:x.search?x.filtered.groups.has(l):!0);Hs(()=>g.group(l),[]),jR(l,u,[t.value,t.heading,d]);let p=v.useMemo(()=>({id:l,forceMount:a}),[a]);return v.createElement(et.div,{ref:aa(u,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&v.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),fh(t,x=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(kR.Provider,{value:p},x))))}),uG=v.forwardRef((t,e)=>{let{alwaysRender:n,...o}=t,a=v.useRef(null),i=Xa(l=>!l.search);return!n&&!i?null:v.createElement(et.div,{ref:aa(a,e),...o,"cmdk-separator":"",role:"separator"})}),dG=v.forwardRef((t,e)=>{let{onValueChange:n,...o}=t,a=t.value!=null,i=Py(),l=Xa(f=>f.search),u=Xa(f=>f.selectedItemId),d=cu();return v.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),v.createElement(et.input,{ref:e,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?t.value:l,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),fG=v.forwardRef((t,e)=>{let{children:n,label:o="Suggestions",...a}=t,i=v.useRef(null),l=v.useRef(null),u=Xa(f=>f.selectedItemId),d=cu();return v.useEffect(()=>{if(l.current&&i.current){let f=l.current,g=i.current,m,p=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let x=f.offsetHeight;g.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return p.observe(f),()=>{cancelAnimationFrame(m),p.unobserve(f)}}},[]),v.createElement(et.div,{ref:aa(i,e),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":o,id:d.listId},fh(t,f=>v.createElement("div",{ref:aa(l,d.listInnerRef),"cmdk-list-sizer":""},f)))}),hG=v.forwardRef((t,e)=>{let{open:n,onOpenChange:o,overlayClassName:a,contentClassName:i,container:l,...u}=t;return v.createElement(C0,{open:n,onOpenChange:o},v.createElement(E0,{container:l},v.createElement(_0,{"cmdk-overlay":"",className:a}),v.createElement(M0,{"aria-label":t.label,"cmdk-dialog":"",className:i},v.createElement(OR,{ref:e,...u}))))}),mG=v.forwardRef((t,e)=>Xa(n=>n.filtered.count===0)?v.createElement(et.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),gG=v.forwardRef((t,e)=>{let{progress:n,children:o,label:a="Loading...",...i}=t;return v.createElement(et.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},fh(t,l=>v.createElement("div",{"aria-hidden":!0},l)))}),Us=Object.assign(OR,{List:fG,Item:lG,Input:dG,Group:cG,Separator:uG,Dialog:hG,Empty:mG,Loading:gG});function pG(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function yG(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function AR(t){let e=v.useRef(t);return Hs(()=>{e.current=t}),e}var Hs=typeof window>"u"?v.useEffect:v.useLayoutEffect;function ji(t){let e=v.useRef();return e.current===void 0&&(e.current=t()),e}function Xa(t){let e=Py(),n=()=>t(e.snapshot());return v.useSyncExternalStore(e.subscribe,n,n)}function jR(t,e,n,o=[]){let a=v.useRef(),i=cu();return Hs(()=>{var l;let u=(()=>{var f;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(f=g.current.textContent)==null?void 0:f.trim():a.current}})(),d=o.map(f=>f.trim());i.value(t,u,d),(l=e.current)==null||l.setAttribute(Ai,u),a.current=u}),a}var vG=()=>{let[t,e]=v.useState(),n=ji(()=>new Map);return Hs(()=>{n.current.forEach(o=>o()),n.current=new Map},[t]),(o,a)=>{n.current.set(o,a),e({})}};function xG(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function fh({asChild:t,children:e},n){return t&&v.isValidElement(e)?v.cloneElement(xG(e),{ref:e.ref},n(e.props.children)):n(e)}var bG={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function wG(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("border-input dark:bg-input/30 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:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("textarea",{"data-slot":"textarea",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function SG(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-9 rounded-md border shadow-xs transition-[color,box-shadow] has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"input-group",role:"group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const CG=Cf("text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.25rem] has-[>kbd]:ml-[-0.15rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.25rem] has-[>kbd]:mr-[-0.15rem] order-last","block-start":"px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function EG(t){const e=Ee.c(11);let n,o,a;e[0]!==t?({className:n,align:a,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);const i=a===void 0?"inline-start":a;let l;e[4]!==i||e[5]!==n?(l=Ne(CG({align:i}),n),e[4]=i,e[5]=n,e[6]=l):l=e[6];let u;return e[7]!==i||e[8]!==o||e[9]!==l?(u=y.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:l,onClick:_G,...o}),e[7]=i,e[8]=o,e[9]=l,e[10]=u):u=e[10],u}function _G(t){t.target.closest("button")||t.currentTarget.parentElement?.querySelector("input")?.focus()}function MG(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Us,{"data-slot":"command",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function NG(t){const e=Ee.c(11);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]!==o||e[6]!==a?(i=y.jsx(Us.Input,{"data-slot":"command-input",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(EG,{children:y.jsx(Wf,{className:"size-4 shrink-0 opacity-50"})}),e[8]=l):l=e[8];let u;return e[9]!==i?(u=y.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:y.jsxs(SG,{className:"bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[i,l]})}),e[9]=i,e[10]=u):u=e[10],u}function RG(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Us.List,{"data-slot":"command-list",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function DG(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("py-6 text-center text-sm",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Us.Empty,{"data-slot":"command-empty",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function oC(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("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",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Us.Group,{"data-slot":"command-group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function TG(t){const e=Ee.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Ne("bg-border -mx-1 h-px w-auto",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Us.Separator,{"data-slot":"command-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function rC(t){const e=Ee.c(11);let n,o,a;e[0]!==t?({className:o,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);let i;e[4]!==o?(i=Ne("data-selected:bg-muted data-selected:text-foreground data-selected:**:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=dialog-content]_&]:rounded-lg! group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[4]=o,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(Vs,{className:"ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[6]=l):l=e[6];let u;return e[7]!==n||e[8]!==a||e[9]!==i?(u=y.jsxs(Us.Item,{"data-slot":"command-item",className:i,...a,children:[n,l]}),e[7]=n,e[8]=a,e[9]=i,e[10]=u):u=e[10],u}function hh(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(nz,{"data-slot":"popover",...n}),e[2]=n,e[3]=o):o=e[3],o}function mh(t){const e=Ee.c(12);let n,o,a,i;e[0]!==t?({className:n,align:a,sideOffset:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"center":a,u=i===void 0?4:i;let d;e[5]!==n?(d=Ne("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",n),e[5]=n,e[6]=d):d=e[6];let f;return e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==d?(f=y.jsx(rz,{children:y.jsx(az,{"data-slot":"popover-content",align:l,sideOffset:u,className:d,...o})}),e[7]=l,e[8]=o,e[9]=u,e[10]=d,e[11]=f):f=e[11],f}function gh(t){const e=Ee.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(oz,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=o):o=e[3],o}const aC=new Map,kG=16,OG=4,AG=40;function jG({label:t,cacheKey:e,iconSize:n,maxWidth:o,className:a}){const i=aC.get(e);if(i!==void 0)return i;const l=document.createElement("div");if(l.className=`inline-flex items-center rounded-md border px-1.5 text-xs font-semibold h-5 gap-1 shrink-0 absolute invisible pointer-events-none ${a??""}`,l.style.whiteSpace="nowrap",n){const d=document.createElement("span");d.className="shrink-0",d.style.width=`${n}px`,d.style.height=`${n}px`,l.appendChild(d)}if(o){const d=document.createElement("span");d.className="truncate",d.style.maxWidth=`${o}px`,d.textContent=t,l.appendChild(d)}else l.textContent=t;document.body.appendChild(l);const u=l.offsetWidth;return document.body.removeChild(l),aC.set(e,u),u}function zR(t){const e=Ee.c(25),{items:n,getLabel:o,containerRef:a,lineCount:i,cacheKeyPrefix:l,containerPadding:u,badgeGap:d,overflowBadgeWidth:f,iconSize:g,maxWidth:m,className:p}=t,x=l===void 0?"":l,w=u===void 0?kG:u,E=d===void 0?OG:d,S=f===void 0?AG:f,[M,N]=v.useState(0);let C,R;e[0]!==w||e[1]!==a?(C=()=>{if(!a.current)return;const k=function(){if(a.current){const K=a.current.clientWidth-w;N(K)}};k();const j=new ResizeObserver(k);return j.observe(a.current),()=>{j.disconnect()}},R=[a,w],e[0]=w,e[1]=a,e[2]=C,e[3]=R):(C=e[2],R=e[3]),v.useEffect(C,R);let D;e:{if(!M||n.length===0){let Y;e[4]!==M||e[5]!==n?(Y={visibleItems:n,hiddenCount:0,containerWidth:M},e[4]=M,e[5]=n,e[6]=Y):Y=e[6],D=Y;break e}let k=0,j=1,$;if(e[7]!==E||e[8]!==x||e[9]!==p||e[10]!==M||e[11]!==j||e[12]!==k||e[13]!==o||e[14]!==g||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==S){$=[];for(const Y of n){const Z=o(Y),P=x?`${x}:${Z}`:Z,A=jG({label:Z,cacheKey:P,iconSize:g,maxWidth:m,className:p})+E;if(k+A<=M)k=k+A,$.push(Y);else if(j<i)j++,k=A,$.push(Y);else{k+S>M&&$.length>0&&$.pop();break}}e[7]=E,e[8]=x,e[9]=p,e[10]=M,e[11]=j,e[12]=k,e[13]=o,e[14]=g,e[15]=n,e[16]=i,e[17]=m,e[18]=S,e[19]=$,e[20]=k}else $=e[19],k=e[20];const K=Math.max(0,n.length-$.length);let U;e[21]!==M||e[22]!==K||e[23]!==$?(U={visibleItems:$,hiddenCount:K,containerWidth:M},e[21]=M,e[22]=K,e[23]=$,e[24]=U):U=e[24],D=U}return D}function zG(t){const e=Ee.c(3),n=v.useRef(t);let o;e[0]!==t?(o=()=>{n.current=t},e[0]=t,e[1]=o):o=e[1],v.useEffect(o);let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(...i)=>{const l=i;return n.current?.(...l)},e[2]=a):a=e[2],a}function IR(t,e){const n=Ee.c(5),o=zG(t),a=v.useRef(0);let i,l;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>()=>window.clearTimeout(a.current),l=[],n[0]=i,n[1]=l):(i=n[0],l=n[1]),v.useEffect(i,l);let u;return n[2]!==e||n[3]!==o?(u=(...f)=>{const g=f;window.clearTimeout(a.current),a.current=window.setTimeout(()=>o(...g),e)},n[2]=e,n[3]=o,n[4]=u):u=n[4],u}function PR(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function sC({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=PR(t.getValue()),[p,x]=v.useState(m),w=v.useRef(null),E=v.useRef(null),S=v.useRef(m);m!==S.current&&(S.current=m,x(m),w.current&&!i&&(w.current.textContent=m));const M=v.useCallback(()=>{const D=w.current?.textContent??"";!g&&D!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}),e?.onCellEditingStop?.()},[e,n,o,m,g]),N=v.useCallback(D=>{const T=D.currentTarget.textContent??"";x(T)},[]),C=v.useCallback(D=>{if(i)if(D.key==="Enter"){D.preventDefault();const T=w.current?.textContent??"";T!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(D.key==="Tab"){D.preventDefault();const T=w.current?.textContent??"";T!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.({direction:D.shiftKey?"left":"right"})}else D.key==="Escape"&&(D.preventDefault(),x(m),w.current?.blur());else l&&D.key.length===1&&!D.ctrlKey&&!D.metaKey&&(x(D.key),queueMicrotask(()=>{if(w.current&&w.current.contentEditable==="true"){w.current.textContent=D.key;const T=document.createRange(),k=window.getSelection();T.selectNodeContents(w.current),T.collapse(!1),k?.removeAllRanges(),k?.addRange(T)}}))},[i,l,m,e,n,o]);v.useEffect(()=>{if(i&&w.current&&(w.current.focus(),!w.current.textContent&&p&&(w.current.textContent=p),w.current.textContent)){const D=document.createRange(),T=window.getSelection();D.selectNodeContents(w.current),D.collapse(!1),T?.removeAllRanges(),T?.addRange(D)}},[i,p]);const R=i?"":p??"";return y.jsx(da,{ref:E,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:C,children:y.jsx("div",{role:"textbox","data-slot":"grid-cell-content",contentEditable:i,tabIndex:-1,ref:w,onBlur:M,onInput:N,suppressContentEditableWarning:!0,className:Ne("size-full overflow-hidden outline-none",{"whitespace-nowrap **:inline **:whitespace-nowrap [&_br]:hidden":i}),children:R})})}function IG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=PR(t.getValue()),[p,x]=v.useState(m),w=v.useRef(null),E=v.useRef(null),S=v.useRef(null),M=-(E.current?.clientHeight??0),N=v.useRef(m);m!==N.current&&(N.current=m,x(m));const C=IR(Y=>{g||e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Y})},300),R=v.useCallback(()=>{!g&&p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.()},[e,p,m,n,o,g]),D=v.useCallback(()=>{x(m??""),g||e?.onDataUpdate?.({rowIndex:n,columnId:o,value:m}),e?.onCellEditingStop?.()},[e,m,n,o,g]),T=v.useCallback(Y=>{Y&&!g?e?.onCellEditingStart?.(n,o):(!g&&p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.())},[e,p,m,n,o,g]),k=v.useCallback(Y=>{if(Y.preventDefault(),w.current){w.current.focus();const Z=w.current.value.length;if(w.current.setSelectionRange(Z,Z),S.current){const P=S.current;S.current=null,requestAnimationFrame(()=>{w.current&&document.activeElement===w.current&&(document.execCommand("insertText",!1,P),w.current.scrollTop=w.current.scrollHeight)})}else w.current.scrollTop=w.current.scrollHeight}},[]),j=v.useCallback(Y=>{i&&!l&&!g&&Y.key.length===1&&!Y.ctrlKey&&!Y.metaKey&&(S.current=Y.key)},[i,l,g]),$=v.useCallback(()=>{!g&&p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.()},[e,p,m,n,o,g]),K=v.useCallback(Y=>{const Z=Y.target.value;x(Z),C(Z)},[C]),U=v.useCallback(Y=>{if(Y.key==="Escape")Y.preventDefault(),D();else if(Y.key==="Enter"&&(Y.ctrlKey||Y.metaKey))Y.preventDefault(),R();else if(Y.key==="Tab"){Y.preventDefault(),p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.({direction:Y.shiftKey?"left":"right"});return}Y.stopPropagation()},[R,D,p,m,e,n,o]);return y.jsxs(hh,{open:l,onOpenChange:T,children:[y.jsx(gh,{asChild:!0,children:y.jsx(da,{ref:E,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:j,children:y.jsx("span",{"data-slot":"grid-cell-content",children:p})})}),y.jsx(mh,{"data-grid-cell-editor":"",align:"start",side:"bottom",sideOffset:M,className:"w-[400px] rounded-none p-0",onOpenAutoFocus:k,children:y.jsx(wG,{placeholder:"Enter text...",className:"max-h-[300px] min-h-[150px] resize-none overflow-y-auto rounded-none border-0 shadow-none focus-visible:ring-1 focus-visible:ring-ring",ref:w,value:p,onBlur:$,onChange:K,onKeyDown:U})})]})}function PG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,x]=v.useState(String(m??"")),w=v.useRef(null),E=v.useRef(null),S=t.column.columnDef.meta?.cell,M=S?.variant==="number"?S:null,N=M?.min,C=M?.max,R=M?.step,D=v.useRef(l),T=v.useRef(m);m!==T.current&&(T.current=m,x(String(m??"")));const k=v.useCallback(()=>{const K=p===""?null:Number(p);!g&&K!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:K}),e?.onCellEditingStop?.()},[e,n,o,m,p,g]),j=v.useCallback(K=>{x(K.target.value)},[]),$=v.useCallback(K=>{if(l)if(K.key==="Enter"){K.preventDefault();const U=p===""?null:Number(p);U!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:U}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(K.key==="Tab"){K.preventDefault();const U=p===""?null:Number(p);U!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:U}),e?.onCellEditingStop?.({direction:K.shiftKey?"left":"right"})}else K.key==="Escape"&&(K.preventDefault(),x(String(m??"")),w.current?.blur());else i&&(K.key==="Backspace"?x(""):K.key.length===1&&!K.ctrlKey&&!K.metaKey&&x(K.key))},[l,i,m,e,n,o,p]);return v.useEffect(()=>{const K=D.current;D.current=l,l&&!K&&w.current&&w.current.focus()},[l]),y.jsx(da,{ref:E,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:$,children:l?y.jsx("input",{type:"number",ref:w,value:p,min:N,max:C,step:R,className:"w-full border-none bg-transparent p-0 outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onBlur:k,onChange:j}):y.jsx("span",{"data-slot":"grid-cell-content",children:p})})}function LG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,x]=v.useState(m??""),w=v.useRef(null),E=v.useRef(null),S=v.useRef(m);m!==S.current&&(S.current=m,x(m??""),w.current&&!i&&(w.current.textContent=m??""));const M=v.useCallback(()=>{const j=w.current?.textContent?.trim()??"";!g&&j!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:j||null}),e?.onCellEditingStop?.()},[e,n,o,m,g]),N=v.useCallback(j=>{const $=j.currentTarget.textContent??"";x($)},[]),C=v.useCallback(j=>{if(i)if(j.key==="Enter"){j.preventDefault();const $=w.current?.textContent?.trim()??"";!g&&$!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:$||null}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(j.key==="Tab"){j.preventDefault();const $=w.current?.textContent?.trim()??"";!g&&$!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:$||null}),e?.onCellEditingStop?.({direction:j.shiftKey?"left":"right"})}else j.key==="Escape"&&(j.preventDefault(),x(m??""),w.current?.blur());else l&&!g&&j.key.length===1&&!j.ctrlKey&&!j.metaKey&&(x(j.key),queueMicrotask(()=>{if(w.current&&w.current.contentEditable==="true"){w.current.textContent=j.key;const $=document.createRange(),K=window.getSelection();$.selectNodeContents(w.current),$.collapse(!1),K?.removeAllRanges(),K?.addRange($)}}))},[i,l,m,e,n,o,g]),R=v.useCallback(j=>{if(i){j.preventDefault();return}if(!PS(p)){j.preventDefault(),En.error("Invalid URL",{description:"URL contains a dangerous protocol (javascript:, data:, vbscript:, or file:)"});return}j.stopPropagation()},[i,p]);v.useEffect(()=>{if(i&&w.current&&(w.current.focus(),!w.current.textContent&&p&&(w.current.textContent=p),w.current.textContent)){const j=document.createRange(),$=window.getSelection();j.selectNodeContents(w.current),j.collapse(!1),$?.removeAllRanges(),$?.addRange(j)}},[i,p]);const D=i?"":p??"",T=D?PS(D):"",k=D&&!T;return y.jsx(da,{ref:E,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:C,children:!i&&D?y.jsx("div",{"data-slot":"grid-cell-content",className:"size-full overflow-hidden",children:y.jsx("a",{"data-focused":l&&!k?"":void 0,"data-invalid":k?"":void 0,href:T,target:"_blank",rel:"noopener noreferrer",className:"truncate text-primary underline decoration-primary/30 underline-offset-2 hover:decoration-primary/60 data-invalid:cursor-not-allowed data-focused:text-foreground data-invalid:text-destructive data-focused:decoration-foreground/50 data-invalid:decoration-destructive/50 data-focused:hover:decoration-foreground/70 data-invalid:hover:decoration-destructive/70",onClick:R,children:D})}):y.jsx("div",{role:"textbox","data-slot":"grid-cell-content",contentEditable:i,tabIndex:-1,ref:w,onBlur:M,onInput:N,suppressContentEditableWarning:!0,className:Ne("size-full overflow-hidden outline-none",{"whitespace-nowrap **:inline **:whitespace-nowrap [&_br]:hidden":i}),children:D})})}function $G({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isSelected:l,isSearchMatch:u,isActiveSearchMatch:d,readOnly:f}){const g=t.getValue(),[m,p]=v.useState(!!g),x=v.useRef(null),w=v.useRef(g);g!==w.current&&(w.current=g,p(!!g));const E=v.useCallback(D=>{f||(p(D),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}))},[e,n,o,f]),S=v.useCallback(D=>{i&&!f&&(D.key===" "||D.key==="Enter")?(D.preventDefault(),D.stopPropagation(),E(!m)):i&&D.key==="Tab"&&(D.preventDefault(),e?.onCellEditingStop?.({direction:D.shiftKey?"left":"right"}))},[i,m,E,e,f]),M=v.useCallback(D=>{i&&!f&&(D.preventDefault(),D.stopPropagation(),E(!m))},[i,m,E,f]),N=v.useCallback(D=>{D.stopPropagation()},[]),C=v.useCallback(D=>{D.stopPropagation()},[]),R=v.useCallback(D=>{D.stopPropagation()},[]);return y.jsx(da,{ref:x,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:!1,isFocused:i,isSelected:l,isSearchMatch:u,isActiveSearchMatch:d,readOnly:f,className:"flex size-full justify-center",onClick:M,onKeyDown:S,children:y.jsx(XY,{checked:m,onCheckedChange:E,disabled:f,className:"border-primary",onClick:N,onMouseDown:C,onDoubleClick:R})})}function HG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,x]=v.useState(m),w=v.useRef(null),E=t.column.columnDef.meta?.cell,S=E?.variant==="select"?E.options:[],M=v.useRef(m);m!==M.current&&(M.current=m,x(m));const N=v.useCallback(T=>{g||(x(T),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.())},[e,n,o,g]),C=v.useCallback(T=>{T&&!g?e?.onCellEditingStart?.(n,o):e?.onCellEditingStop?.()},[e,n,o,g]),R=v.useCallback(T=>{l&&T.key==="Escape"?(T.preventDefault(),x(m),e?.onCellEditingStop?.()):i&&T.key==="Tab"&&(T.preventDefault(),e?.onCellEditingStop?.({direction:T.shiftKey?"left":"right"}))},[l,i,m,e]),D=S.find(T=>T.value===p)?.label??p;return y.jsx(da,{ref:w,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:R,children:l?y.jsxs(Ps,{value:p,onValueChange:N,open:l,onOpenChange:C,children:[y.jsx(Ls,{size:"sm",className:"size-full items-start border-none p-0 shadow-none focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden",children:D?y.jsx(oa,{variant:"secondary",className:"whitespace-pre-wrap px-1.5 py-px",children:y.jsx(Ka,{})}):y.jsx(Ka,{})}),y.jsx($s,{"data-grid-cell-editor":"",align:"start",alignOffset:-8,sideOffset:-8,className:"min-w-[calc(var(--radix-select-trigger-width)+16px)]",children:S.map(T=>y.jsx(io,{value:T.value,children:T.label},T.value))})]}):D?y.jsx(oa,{"data-slot":"grid-cell-content",variant:"secondary",className:"whitespace-pre-wrap px-1.5 py-px",children:D}):null})}function BG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=v.useMemo(()=>t.getValue()??[],[t]),p=tn(n,o),x=v.useRef(p),[w,E]=v.useState(m),[S,M]=v.useState(""),N=v.useRef(null),C=v.useRef(null),R=t.column.columnDef.meta?.cell,D=R?.variant==="multi-select"?R.options:[],T=-(N.current?.clientHeight??0),k=v.useRef(m);m!==k.current&&(k.current=m,E(m)),x.current!==p&&(x.current=p,M(""));const j=v.useCallback(F=>{if(g)return;const X=w.includes(F)?w.filter(I=>I!==F):[...w,F];E(X),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:X}),M(""),queueMicrotask(()=>C.current?.focus())},[w,e,n,o,g]),$=v.useCallback((F,X)=>{if(g)return;X?.stopPropagation(),X?.preventDefault();const I=w.filter(z=>z!==F);E(I),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:I}),setTimeout(()=>C.current?.focus(),0)},[w,e,n,o,g]),K=v.useCallback(()=>{g||(E([]),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:[]}),queueMicrotask(()=>C.current?.focus()))},[e,n,o,g]),U=v.useCallback(F=>{F&&!g?e?.onCellEditingStart?.(n,o):(M(""),e?.onCellEditingStop?.())},[e,n,o,g]),Y=v.useCallback(F=>{F.preventDefault(),C.current?.focus()},[]),Z=v.useCallback(F=>{l&&F.key==="Escape"?(F.preventDefault(),E(m),M(""),e?.onCellEditingStop?.()):i&&F.key==="Tab"&&(F.preventDefault(),M(""),e?.onCellEditingStop?.({direction:F.shiftKey?"left":"right"}))},[l,i,m,e]),P=v.useCallback(F=>{if(F.key==="Backspace"&&S===""&&w.length>0){F.preventDefault();const X=w[w.length-1];X&&$(X)}F.key==="Escape"&&F.stopPropagation()},[S,w,$]),q=w.map(F=>D.find(X=>X.value===F)?.label??F).filter(Boolean),A=YN(a),{visibleItems:B,hiddenCount:L}=zR({items:q,getLabel:F=>F,containerRef:N,lineCount:A});return y.jsxs(da,{ref:N,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:Z,children:[l?y.jsxs(hh,{open:l,onOpenChange:U,children:[y.jsx(gh,{asChild:!0,children:y.jsx("div",{className:"absolute inset-0"})}),y.jsx(mh,{"data-grid-cell-editor":"",align:"start",sideOffset:T,className:"w-[300px] rounded-none p-0",onOpenAutoFocus:Y,children:y.jsxs(MG,{className:"**:data-[slot=command-input-wrapper]:h-auto **:data-[slot=command-input-wrapper]:border-none **:data-[slot=command-input-wrapper]:p-0 [&_[data-slot=command-input-wrapper]_svg]:hidden",children:[y.jsxs("div",{className:"flex min-h-9 flex-wrap items-center gap-1 border-b px-3 py-1.5",children:[w.map(F=>{const I=D.find(z=>z.value===F)?.label??F;return y.jsxs(oa,{variant:"secondary",className:"gap-1 px-1.5 py-px",children:[I,y.jsx("button",{type:"button",onClick:z=>$(F,z),onPointerDown:z=>{z.preventDefault(),z.stopPropagation()},children:y.jsx(ns,{className:"size-3"})})]},F)}),y.jsx(NG,{ref:C,value:S,onValueChange:M,onKeyDown:P,placeholder:"Search...",className:"h-auto flex-1 p-0"})]}),y.jsxs(RG,{className:"max-h-full",children:[y.jsx(DG,{children:"No options found."}),y.jsx(oC,{className:"max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",children:D.map(F=>{const X=w.includes(F.value);return y.jsxs(rC,{value:F.label,onSelect:()=>j(F.value),children:[y.jsx("div",{className:Ne("flex size-4 items-center justify-center rounded-sm border border-primary",X?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:y.jsx(Vs,{className:"size-3"})}),y.jsx("span",{children:F.label})]},F.value)})}),w.length>0&&y.jsxs(y.Fragment,{children:[y.jsx(TG,{}),y.jsx(oC,{children:y.jsx(rC,{onSelect:K,className:"justify-center text-muted-foreground",children:"Clear all"})})]})]})]})})]}):null,q.length>0?y.jsxs("div",{className:"flex flex-wrap items-center gap-1 overflow-hidden",children:[B.map((F,X)=>y.jsx(oa,{variant:"secondary",className:"px-1.5 py-px",children:F},w[X])),L>0&&y.jsxs(oa,{variant:"outline",className:"px-1.5 py-px text-muted-foreground",children:["+",L]})]}):null]})}function FG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,x]=v.useState(m??""),w=v.useRef(null),E=v.useRef(m);m!==E.current&&(E.current=m,x(m??""));const S=p?WN(p)??void 0:void 0,M=v.useCallback(R=>{if(!R||g)return;const D=BF(R);x(D),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}),e?.onCellEditingStop?.()},[e,n,o,g]),N=v.useCallback(R=>{R&&!g?e?.onCellEditingStart?.(n,o):e?.onCellEditingStop?.()},[e,n,o,g]),C=v.useCallback(R=>{l&&R.key==="Escape"?(R.preventDefault(),x(m),e?.onCellEditingStop?.()):i&&R.key==="Tab"&&(R.preventDefault(),e?.onCellEditingStop?.({direction:R.shiftKey?"left":"right"}))},[l,i,m,e]);return y.jsx(da,{ref:w,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:C,children:y.jsxs(hh,{open:l,onOpenChange:N,children:[y.jsx(gh,{asChild:!0,children:y.jsx("span",{"data-slot":"grid-cell-content",children:FF(p)})}),l&&y.jsx(mh,{"data-grid-cell-editor":"",align:"start",alignOffset:-8,className:"w-auto p-0",children:y.jsx(WY,{autoFocus:!0,captionLayout:"dropdown",mode:"single",defaultMonth:S??new Date,selected:S,onSelect:M})})]})})}function VG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=v.useMemo(()=>t.getValue()??[],[t]),p=tn(n,o),x=v.useRef(p),w=v.useId(),E=v.useId(),[S,M]=v.useState(m),[N,C]=v.useState(new Set),[R,D]=v.useState(new Set),[T,k]=v.useState(!1),[j,$]=v.useState(!1),[K,U]=v.useState(null),Y=N.size>0,Z=R.size>0,P=Y||Z,q=v.useRef(null),A=v.useRef(null),B=v.useRef(null),L=t.column.columnDef.meta?.cell,F=-(q.current?.clientHeight??0),X=L?.variant==="file"?L:null,I=X?.maxFileSize??10*1024*1024,z=X?.maxFiles??10,H=X?.accept,G=X?.multiple??!1,J=v.useMemo(()=>H?H.split(",").map(Ce=>Ce.trim()):null,[H]),ae=v.useRef(m);if(m!==ae.current){ae.current=m;for(const Ce of S)Ce.url&&URL.revokeObjectURL(Ce.url);M(m),U(null)}x.current!==p&&(x.current=p,U(null));const W=v.useCallback(Ce=>{if(I&&Ce.size>I)return`File size exceeds ${rp(I)}`;if(J){const Ve=`.${Ce.name.split(".").pop()}`;if(!J.some(Xe=>{if(Xe.endsWith("/*")){const at=Xe.slice(0,-2);return Ce.type.startsWith(`${at}/`)}return Xe.startsWith(".")?Ve.toLowerCase()===Xe.toLowerCase():Ce.type===Xe}))return"File type not accepted"}return null},[I,J]),ee=v.useCallback(async(Ce,Ve=!1)=>{if(g||P)return;if(U(null),z&&S.length+Ce.length>z){const at=`Maximum ${z} files allowed`;U(at),En(at),setTimeout(()=>{U(null)},2e3);return}const Et=[],Xe=[];for(const at of Ce){const gt=W(at);if(gt){Et.push({name:at.name,reason:gt});continue}Xe.push(at)}if(Et.length>0){const at=Et[0];if(at){U(at.reason);const gt=at.name.length>20?`${at.name.slice(0,20)}...`:at.name;Et.length===1?En(at.reason,{description:`"${gt}" has been rejected`}):En(at.reason,{description:`"${gt}" and ${Et.length-1} more rejected`}),setTimeout(()=>{U(null)},2e3)}}if(Xe.length>0)if(Ve){const at=Xe.map(qt=>({id:crypto.randomUUID(),name:qt.name,size:qt.size,type:qt.type,url:URL.createObjectURL(qt)})),gt=[...S,...at];M(gt),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:gt})}else{const at=Xe.map(_t=>({id:crypto.randomUUID(),name:_t.name,size:_t.size,type:_t.type,url:void 0})),gt=[...S,...at];M(gt);const qt=new Set(at.map(_t=>_t.id));C(qt);let Wt=[];if(e?.onFilesUpload)try{Wt=await e.onFilesUpload({files:Xe,rowIndex:n,columnId:o})}catch(_t){En.error(_t instanceof Error?_t.message:`Failed to upload ${Xe.length} file${Xe.length!==1?"s":""}`),M(Be=>Be.filter(nt=>!qt.has(nt.id))),C(new Set);return}else Wt=Xe.map((_t,Be)=>({id:at[Be]?.id??crypto.randomUUID(),name:_t.name,size:_t.size,type:_t.type,url:URL.createObjectURL(_t)}));const Qn=gt.map(_t=>qt.has(_t.id)?Wt.find(Be=>Be.name===_t.name)??_t:_t).filter(_t=>_t.url!==void 0);M(Qn),C(new Set),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Qn})}},[S,z,W,e,n,o,g,P]),oe=v.useCallback(async Ce=>{if(g||P)return;U(null);const Ve=S.find(Xe=>Xe.id===Ce);if(!Ve)return;if(D(Xe=>new Set(Xe).add(Ce)),e?.onFilesDelete)try{await e.onFilesDelete({fileIds:[Ce],rowIndex:n,columnId:o})}catch(Xe){En.error(Xe instanceof Error?Xe.message:`Failed to delete ${Ve.name}`),D(at=>{const gt=new Set(at);return gt.delete(Ce),gt});return}Ve.url?.startsWith("blob:")&&URL.revokeObjectURL(Ve.url);const Et=S.filter(Xe=>Xe.id!==Ce);M(Et),D(Xe=>{const at=new Set(Xe);return at.delete(Ce),at}),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Et})},[S,e,n,o,g,P]),de=v.useCallback(async()=>{if(g||P)return;U(null);const Ce=S.map(Ve=>Ve.id);if(D(new Set(Ce)),e?.onFilesDelete&&S.length>0)try{await e.onFilesDelete({fileIds:Ce,rowIndex:n,columnId:o})}catch(Ve){En.error(Ve instanceof Error?Ve.message:"Failed to delete files"),D(new Set);return}for(const Ve of S)Ve.url?.startsWith("blob:")&&URL.revokeObjectURL(Ve.url);M([]),D(new Set),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:[]})},[S,e,n,o,g,P]),ge=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation(),Ce.dataTransfer.types.includes("Files")&&k(!0)},[]),ne=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation();const Ve=Ce.currentTarget.getBoundingClientRect(),Et=Ce.clientX,Xe=Ce.clientY;(Et<=Ve.left||Et>=Ve.right||Xe<=Ve.top||Xe>=Ve.bottom)&&k(!1)},[]),_e=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation()},[]),De=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation(),k(!1);const Ve=Array.from(Ce.dataTransfer.files);Ve.length>0&&ee(Ve,!1)},[ee]),Ye=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation(),$(!0)},[]),Pe=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation();const Ve=Ce.currentTarget.getBoundingClientRect(),Et=Ce.clientX,Xe=Ce.clientY;(Et<=Ve.left||Et>=Ve.right||Xe<=Ve.top||Xe>=Ve.bottom)&&$(!1)},[]),mt=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation()},[]),sn=v.useCallback(Ce=>{Ce.preventDefault(),Ce.stopPropagation(),$(!1);const Ve=Array.from(Ce.dataTransfer.files);ee(Ve,!1)},[ee]),ft=v.useCallback(()=>{A.current?.click()},[]),xn=v.useCallback(Ce=>{(Ce.key==="Enter"||Ce.key===" ")&&(Ce.preventDefault(),ft())},[ft]),ln=v.useCallback(Ce=>{const Ve=Array.from(Ce.target.files??[]);ee(Ve,!1),Ce.target.value=""},[ee]),Ft=v.useCallback(Ce=>{Ce&&!g?(U(null),e?.onCellEditingStart?.(n,o)):(U(null),e?.onCellEditingStop?.())},[e,n,o,g]),fn=v.useCallback(Ce=>{Ce.stopPropagation()},[]),zt=v.useCallback(Ce=>{Ce.preventDefault(),queueMicrotask(()=>{B.current?.focus()})},[]),Nn=v.useCallback(Ce=>{l?Ce.key==="Escape"?(Ce.preventDefault(),M(m),U(null),e?.onCellEditingStop?.()):Ce.key===" "?(Ce.preventDefault(),ft()):Ce.key==="Tab"&&(Ce.preventDefault(),e?.onCellEditingStop?.({direction:Ce.shiftKey?"left":"right"})):i&&Ce.key==="Enter"?(Ce.preventDefault(),e?.onCellEditingStart?.(n,o)):i&&Ce.key==="Tab"&&(Ce.preventDefault(),e?.onCellEditingStop?.({direction:Ce.shiftKey?"left":"right"}))},[l,i,m,e,ft,n,o]);v.useEffect(()=>()=>{for(const Ce of S)Ce.url&&URL.revokeObjectURL(Ce.url)},[S]);const gn=YN(a),{visibleItems:In,hiddenCount:jn}=zR({items:S,getLabel:Ce=>Ce.name,containerRef:q,lineCount:gn,cacheKeyPrefix:"file",iconSize:12,maxWidth:100});return y.jsxs(da,{ref:q,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,className:Ne({"ring-1 ring-primary/80 ring-inset":T}),onDragEnter:ge,onDragLeave:ne,onDragOver:_e,onDrop:De,onKeyDown:Nn,children:[l?y.jsxs(hh,{open:l,onOpenChange:Ft,children:[y.jsx(gh,{asChild:!0,children:y.jsx("div",{className:"absolute inset-0"})}),y.jsx(mh,{"data-grid-cell-editor":"",align:"start",sideOffset:F,className:"w-[400px] rounded-none p-0",onEscapeKeyDown:fn,onOpenAutoFocus:zt,children:y.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[y.jsx("span",{id:w,className:"sr-only",children:"File upload"}),y.jsxs("div",{role:"region","aria-labelledby":w,"aria-describedby":E,"aria-invalid":!!K,"aria-disabled":P,"data-dragging":j?"":void 0,"data-invalid":K?"":void 0,"data-disabled":P?"":void 0,tabIndex:j||P?-1:0,className:"flex cursor-pointer flex-col items-center justify-center gap-2 rounded-md border-2 border-dashed p-6 outline-none transition-colors hover:bg-accent/30 focus-visible:border-ring/50 data-disabled:pointer-events-none data-dragging:border-primary/30 data-invalid:border-destructive data-dragging:bg-accent/30 data-disabled:opacity-50 data-invalid:ring-destructive/20",ref:B,onClick:ft,onDragEnter:Ye,onDragLeave:Pe,onDragOver:mt,onDrop:sn,onKeyDown:xn,children:[y.jsx(_w,{className:"size-8 text-muted-foreground"}),y.jsxs("div",{className:"text-center text-sm",children:[y.jsx("p",{className:"font-medium",children:j?"Drop files here":"Drag files here"}),y.jsx("p",{className:"text-muted-foreground text-xs",children:"or click to browse"})]}),y.jsx("p",{id:E,className:"text-muted-foreground text-xs",children:I?`Max size: ${rp(I)}${z?` • Max ${z} files`:""}`:z?`Max ${z} files`:"Select files to upload"})]}),y.jsx("input",{type:"file","aria-labelledby":w,"aria-describedby":E,multiple:G,accept:H,className:"sr-only",ref:A,onChange:ln}),S.length>0&&y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("p",{className:"font-medium text-muted-foreground text-xs",children:[S.length," ",S.length===1?"file":"files"]}),y.jsx(vn,{type:"button",variant:"ghost",size:"sm",className:"h-6 text-muted-foreground text-xs",onClick:de,disabled:P,children:"Clear all"})]}),y.jsx("div",{className:"max-h-[200px] space-y-1 overflow-y-auto",children:S.map(Ce=>{const Ve=LS(Ce.type),Et=N.has(Ce.id),Xe=R.has(Ce.id),at=Et||Xe;return y.jsxs("div",{"data-pending":at?"":void 0,className:"flex items-center gap-2 rounded-md border bg-muted/50 px-2 py-1.5 data-pending:opacity-60",children:[Ve&&y.jsx(Ve,{className:"size-4 shrink-0 text-muted-foreground"}),y.jsxs("div",{className:"flex-1 overflow-hidden",children:[y.jsx("p",{className:"truncate text-sm",children:Ce.name}),y.jsx("p",{className:"text-muted-foreground text-xs",children:Et?"Uploading...":Xe?"Deleting...":rp(Ce.size)})]}),y.jsx(vn,{type:"button",variant:"ghost",size:"icon",className:"size-5 rounded-sm",onClick:()=>oe(Ce.id),disabled:P,children:y.jsx(ns,{className:"size-3"})})]},Ce.id)})})]})]})})]}):null,T?y.jsxs("div",{className:"flex items-center justify-center gap-2 text-primary text-sm",children:[y.jsx(_w,{className:"size-4"}),y.jsx("span",{children:"Drop files here"})]}):S.length>0?y.jsxs("div",{className:"flex flex-wrap items-center gap-1 overflow-hidden",children:[In.map(Ce=>{if(N.has(Ce.id))return y.jsx(DI,{className:"h-5 shrink-0 px-1.5",style:{width:`${Math.min(Ce.name.length*8+30,100)}px`}},Ce.id);const Et=LS(Ce.type);return y.jsxs(oa,{variant:"secondary",className:"gap-1 px-1.5 py-px",children:[Et&&y.jsx(Et,{className:"size-3 shrink-0"}),y.jsx("span",{className:"max-w-[100px] truncate",children:Ce.name})]},Ce.id)}),jn>0&&y.jsxs(oa,{variant:"outline",className:"px-1.5 py-px text-muted-foreground",children:["+",jn]})]}):null]})}const UG=v.memo(YG,(t,e)=>{if(t.isFocused!==e.isFocused||t.isEditing!==e.isEditing||t.isSelected!==e.isSelected||t.isSearchMatch!==e.isSearchMatch||t.isActiveSearchMatch!==e.isActiveSearchMatch||t.readOnly!==e.readOnly||t.rowIndex!==e.rowIndex||t.columnId!==e.columnId||t.rowHeight!==e.rowHeight)return!1;const n=t.cell.row.original[t.columnId],o=e.cell.row.original[e.columnId];return!(n!==o||t.cell.row.id!==e.cell.row.id)});function YG(t){const e=Ee.c(13),{cell:n,tableMeta:o,rowIndex:a,columnId:i,isFocused:l,isEditing:u,isSelected:d,isSearchMatch:f,isActiveSearchMatch:g,readOnly:m,rowHeight:p}=t,w=n.column.columnDef.meta?.cell?.variant??"text";let E;e:switch(w){case"short-text":{E=sC;break e}case"long-text":{E=IG;break e}case"number":{E=PG;break e}case"url":{E=LG;break e}case"checkbox":{E=$G;break e}case"select":{E=HG;break e}case"multi-select":{E=BG;break e}case"date":{E=FG;break e}case"file":{E=VG;break e}default:E=sC}let S;return e[0]!==E||e[1]!==n||e[2]!==i||e[3]!==g||e[4]!==u||e[5]!==l||e[6]!==f||e[7]!==d||e[8]!==m||e[9]!==p||e[10]!==a||e[11]!==o?(S=y.jsx(E,{cell:n,tableMeta:o,rowIndex:a,columnId:i,rowHeight:p,isEditing:u,isFocused:l,isSelected:d,isSearchMatch:f,isActiveSearchMatch:g,readOnly:m}),e[0]=E,e[1]=n,e[2]=i,e[3]=g,e[4]=u,e[5]=l,e[6]=f,e[7]=d,e[8]=m,e[9]=p,e[10]=a,e[11]=o,e[12]=S):S=e[12],S}const GG=v.memo(qG,(t,e)=>{const n=t.virtualItem.index,o=e.virtualItem.index;if(t.row.id!==e.row.id||t.row.original!==e.row.original||t.virtualItem.start!==e.virtualItem.start)return!1;const a=t.focusedCell?.rowIndex===n,i=e.focusedCell?.rowIndex===o;if(a!==i||i&&a&&t.focusedCell?.columnId!==e.focusedCell?.columnId)return!1;const l=t.editingCell?.rowIndex===n,u=e.editingCell?.rowIndex===o;return!(l!==u||u&&l&&t.editingCell?.columnId!==e.editingCell?.columnId||t.cellSelectionKeys!==e.cellSelectionKeys||t.columnVisibility!==e.columnVisibility||t.rowHeight!==e.rowHeight||t.columnPinning!==e.columnPinning||t.readOnly!==e.readOnly||t.searchMatchColumns!==e.searchMatchColumns||t.activeSearchMatch?.columnId!==e.activeSearchMatch?.columnId||t.dir!==e.dir||t.adjustLayout!==e.adjustLayout||t.stretchColumns!==e.stretchColumns)});function qG(t){const e=Ee.c(63);let n,o,a,i,l,u,d,f,g,m,p,x,w,E,S,M,N,C,R,D,T;e[0]!==t?({row:E,tableMeta:D,virtualItem:T,measureElement:m,rowMapRef:M,rowHeight:S,columnVisibility:u,columnPinning:l,focusedCell:g,editingCell:f,cellSelectionKeys:a,searchMatchColumns:N,activeSearchMatch:n,dir:d,readOnly:x,stretchColumns:C,adjustLayout:o,className:i,style:R,ref:w,...p}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d,e[8]=f,e[9]=g,e[10]=m,e[11]=p,e[12]=x,e[13]=w,e[14]=E,e[15]=S,e[16]=M,e[17]=N,e[18]=C,e[19]=R,e[20]=D,e[21]=T):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7],f=e[8],g=e[9],m=e[10],p=e[11],x=e[12],w=e[13],E=e[14],S=e[15],M=e[16],N=e[17],C=e[18],R=e[19],D=e[20],T=e[21]);const k=T.index;let j;e[22]!==m||e[23]!==M||e[24]!==k?(j=Y=>{typeof k>"u"||(Y?(m(Y),M.current?.set(k,Y)):M.current?.delete(k))},e[22]=m,e[23]=M,e[24]=k,e[25]=j):j=e[25];const K=XN(w,j);let U;if(e[26]!==n?.columnId||e[27]!==o||e[28]!==a||e[29]!==i||e[30]!==l||e[31]!==u||e[32]!==d||e[33]!==f?.columnId||e[34]!==f?.rowIndex||e[35]!==g?.columnId||e[36]!==g?.rowIndex||e[37]!==p||e[38]!==x||e[39]!==E||e[40]!==S||e[41]!==K||e[42]!==N||e[43]!==C||e[44]!==R||e[45]!==D||e[46]!==T.start||e[47]!==k){const Y=E.getIsSelected();let Z;e[49]!==E?(Z=E.getVisibleCells(),e[49]=E,e[50]=Z):Z=e[50];const P=Z,q=E.id,A=!o&&"will-change-transform";let B;e[51]!==i||e[52]!==A?(B=Ne("absolute flex w-full border-b",A,i),e[51]=i,e[52]=A,e[53]=B):B=e[53];let L;e[54]!==S?(L=t0(S),e[54]=S,e[55]=L):L=e[55];const F=`${L}px`;let X;e[56]!==o||e[57]!==T.start?(X=o?{top:`${T.start}px`}:{transform:`translateY(${T.start}px)`},e[56]=o,e[57]=T.start,e[58]=X):X=e[58];let I;e[59]!==R||e[60]!==F||e[61]!==X?(I={height:F,...X,...R},e[59]=R,e[60]=F,e[61]=X,e[62]=I):I=e[62],U=y.jsx("div",{role:"row","aria-rowindex":k+2,"aria-selected":Y,"data-index":k,"data-slot":"grid-row",tabIndex:-1,...p,ref:K,className:B,style:I,children:P.map((z,H)=>{const G=z.column.id,J=g?.rowIndex===k&&g?.columnId===G,ae=f?.rowIndex===k&&f?.columnId===G,W=a?.has(tn(k,G))??!1,ee=N?.has(G)??!1,oe=n?.columnId===G,de=P[H+1],ge=H===P.length-1,{showEndBorder:ne,showStartBorder:_e}=GN({column:z.column,nextColumn:de?.column,isLastColumn:ge});return y.jsx("div",{role:"gridcell","aria-colindex":H+1,"data-highlighted":J?"":void 0,"data-slot":"grid-cell",tabIndex:-1,className:Ne({grow:C&&G!=="select","border-e":ne&&G!=="select","border-s":_e&&G!=="select"}),style:{...qN({column:z.column,dir:d}),width:`calc(var(--col-${G}-size) * 1px)`},children:typeof z.column.columnDef.header=="function"?y.jsx("div",{className:Ne("size-full px-3 py-1.5",{"bg-primary/10":Y}),children:UN(z.column.columnDef.cell,z.getContext())}):y.jsx(UG,{cell:z,tableMeta:D,rowIndex:k,columnId:G,rowHeight:S,isFocused:J,isEditing:ae,isSelected:W,isSearchMatch:ee,isActiveSearchMatch:oe,readOnly:x})},z.id)})},q),e[26]=n?.columnId,e[27]=o,e[28]=a,e[29]=i,e[30]=l,e[31]=u,e[32]=d,e[33]=f?.columnId,e[34]=f?.rowIndex,e[35]=g?.columnId,e[36]=g?.rowIndex,e[37]=p,e[38]=x,e[39]=E,e[40]=S,e[41]=K,e[42]=N,e[43]=C,e[44]=R,e[45]=D,e[46]=T.start,e[47]=k,e[48]=U}else U=e[48];return U}const WG=v.memo(KG,(t,e)=>{if(t.searchOpen!==e.searchOpen)return!1;if(!e.searchOpen)return!0;if(t.searchQuery!==e.searchQuery||t.matchIndex!==e.matchIndex||t.searchMatches.length!==e.searchMatches.length)return!1;for(let n=0;n<t.searchMatches.length;n++){const o=t.searchMatches[n],a=e.searchMatches[n];if(!o||!a||o.rowIndex!==a.rowIndex||o.columnId!==a.columnId)return!1}return!0});function KG(t){const e=Ee.c(57),{searchMatches:n,matchIndex:o,searchOpen:a,onSearchOpenChange:i,searchQuery:l,onSearchQueryChange:u,onSearch:d,onNavigateToNextMatch:f,onNavigateToPrevMatch:g}=t;let m;e[0]!==f||e[1]!==g||e[2]!==d||e[3]!==i||e[4]!==u?(m={onSearchOpenChange:i,onSearchQueryChange:u,onSearch:d,onNavigateToNextMatch:f,onNavigateToPrevMatch:g},e[0]=f,e[1]=g,e[2]=d,e[3]=i,e[4]=u,e[5]=m):m=e[5];const p=au(m),x=v.useRef(null);let w,E;e[6]!==a?(w=()=>{a&&requestAnimationFrame(()=>{x.current?.focus()})},E=[a],e[6]=a,e[7]=w,e[8]=E):(w=e[7],E=e[8]),v.useEffect(w,E);let S,M;e[9]!==p||e[10]!==a?(S=()=>{if(!a)return;const ne=function(De){De.key==="Escape"&&(De.preventDefault(),p.current.onSearchOpenChange(!1))};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},M=[a,p],e[9]=p,e[10]=a,e[11]=S,e[12]=M):(S=e[11],M=e[12]),v.useEffect(S,M);let N;e[13]!==p?(N=ne=>{ne.stopPropagation(),ne.key==="Enter"&&(ne.preventDefault(),ne.shiftKey?p.current.onNavigateToPrevMatch():p.current.onNavigateToNextMatch())},e[13]=p,e[14]=N):N=e[14];const C=N;let R;e[15]!==p?(R=ne=>{p.current.onSearch(ne)},e[15]=p,e[16]=R):R=e[16];const D=IR(R,150);let T;e[17]!==D||e[18]!==p?(T=ne=>{const _e=ne.target.value;p.current.onSearchQueryChange(_e),D(_e)},e[17]=D,e[18]=p,e[19]=T):T=e[19];const k=T,j=XG;let $;e[20]===Symbol.for("react.memo_cache_sentinel")?($=ne=>j(ne),e[20]=$):$=e[20];const K=$;let U;e[21]===Symbol.for("react.memo_cache_sentinel")?(U=ne=>j(ne),e[21]=U):U=e[21];const Y=U;let Z;e[22]!==p?(Z=()=>{p.current.onSearchOpenChange(!1)},e[22]=p,e[23]=Z):Z=e[23];const P=Z;let q;e[24]!==p?(q=()=>{p.current.onNavigateToPrevMatch()},e[24]=p,e[25]=q):q=e[25];const A=q;let B;e[26]!==p?(B=()=>{p.current.onNavigateToNextMatch()},e[26]=p,e[27]=B):B=e[27];const L=B;if(!a)return null;let F;e[28]!==k||e[29]!==C||e[30]!==l?(F=y.jsx(Ui,{autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Find in table...",className:"h-8 w-64",ref:x,value:l,onChange:k,onKeyDown:C}),e[28]=k,e[29]=C,e[30]=l,e[31]=F):F=e[31];const X=n.length===0;let I;e[32]===Symbol.for("react.memo_cache_sentinel")?(I=y.jsx(qf,{}),e[32]=I):I=e[32];let z;e[33]!==A||e[34]!==X?(z=y.jsx(vn,{"aria-label":"Previous match",variant:"ghost",size:"icon",className:"size-7",onClick:A,onPointerDown:K,disabled:X,children:I}),e[33]=A,e[34]=X,e[35]=z):z=e[35];const H=n.length===0;let G;e[36]===Symbol.for("react.memo_cache_sentinel")?(G=y.jsx(Os,{}),e[36]=G):G=e[36];let J;e[37]!==L||e[38]!==H?(J=y.jsx(vn,{"aria-label":"Next match",variant:"ghost",size:"icon",className:"size-7",onClick:L,onPointerDown:Y,disabled:H,children:G}),e[37]=L,e[38]=H,e[39]=J):J=e[39];let ae;e[40]===Symbol.for("react.memo_cache_sentinel")?(ae=y.jsx(ns,{}),e[40]=ae):ae=e[40];let W;e[41]!==P?(W=y.jsx(vn,{"aria-label":"Close search",variant:"ghost",size:"icon",className:"size-7",onClick:P,children:ae}),e[41]=P,e[42]=W):W=e[42];let ee;e[43]!==z||e[44]!==J||e[45]!==W?(ee=y.jsxs("div",{className:"flex items-center gap-1",children:[z,J,W]}),e[43]=z,e[44]=J,e[45]=W,e[46]=ee):ee=e[46];let oe;e[47]!==F||e[48]!==ee?(oe=y.jsxs("div",{className:"flex items-center gap-2",children:[F,ee]}),e[47]=F,e[48]=ee,e[49]=oe):oe=e[49];let de;e[50]!==o||e[51]!==n.length||e[52]!==l?(de=y.jsx("div",{className:"flex items-center gap-1 whitespace-nowrap text-muted-foreground text-xs",children:n.length>0?y.jsxs("span",{children:[o+1," of ",n.length]}):l?y.jsx("span",{children:"No results"}):y.jsx("span",{children:"Type to search"})}),e[50]=o,e[51]=n.length,e[52]=l,e[53]=de):de=e[53];let ge;return e[54]!==oe||e[55]!==de?(ge=y.jsxs("div",{role:"search","data-slot":"grid-search",className:"fade-in-0 slide-in-from-top-2 absolute end-4 top-4 z-50 flex animate-in flex-col gap-2 rounded-lg border bg-background p-2 shadow-lg",children:[oe,de]}),e[54]=oe,e[55]=de,e[56]=ge):ge=e[56],ge}function XG(t){const e=t.target;e instanceof HTMLElement&&(e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId),t.button===0&&t.ctrlKey===!1&&t.pointerType==="mouse"&&!(t.target instanceof HTMLInputElement)&&t.preventDefault())}const ZG=new Set;function QG({dataGridRef:t,headerRef:e,rowMapRef:n,footerRef:o,dir:a="ltr",table:i,tableMeta:l,virtualTotalSize:u,virtualItems:d,measureElement:f,columns:g,columnSizeVars:m,searchState:p,searchMatchesByRow:x,activeSearchMatch:w,cellSelectionMap:E,focusedCell:S,editingCell:M,rowHeight:N,contextMenu:C,pasteDialog:R,onRowAdd:D,height:T=600,width:k,stretchColumns:j=!1,adjustLayout:$=!1,className:K,...U}){const Y=i.getRowModel().rows,Z=l?.readOnly??!1,P=i.getState().columnVisibility,q=i.getState().columnPinning,A=au(D),B=v.useCallback(X=>{A.current?.(X)},[A]),L=v.useCallback(X=>{X.preventDefault()},[]),F=v.useCallback(X=>{A.current&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),A.current())},[A]);return y.jsxs("div",{"data-slot":"grid-wrapper",dir:a,...U,className:Ne("relative flex min-w-0 min-h-0 flex-col",K),style:{width:k??"100%",maxWidth:k??"100%",height:"100%"},children:[p&&y.jsx(WG,{...p}),y.jsx(GF,{tableMeta:l,columns:g,contextMenu:C}),y.jsx(XF,{tableMeta:l,pasteDialog:R}),y.jsx("div",{role:"grid","aria-label":"Data grid","aria-rowcount":Y.length+(D?1:0),"aria-colcount":g.length,"data-slot":"grid",tabIndex:0,ref:t,className:"relative select-none overflow-x-auto overflow-y-auto rounded-md border focus:outline-none",style:{...m,maxHeight:`${T}px`,width:k??"100%",maxWidth:k??"100%",minWidth:0},onContextMenu:L,children:y.jsxs("div",{className:"grid",style:{width:i.getTotalSize(),minWidth:i.getTotalSize()},children:[y.jsx("div",{role:"rowgroup","data-slot":"grid-header",ref:e,className:"sticky top-0 z-10 grid border-b bg-background",children:i.getHeaderGroups().map((X,I)=>y.jsx("div",{role:"row","aria-rowindex":I+1,"data-slot":"grid-header-row",tabIndex:-1,className:"flex w-full",children:X.headers.map((z,H)=>{const J=i.getState().sorting.find(ge=>ge.id===z.column.id),ae=z.column.getCanSort(),W=X.headers[H+1],ee=H===X.headers.length-1,{showEndBorder:oe,showStartBorder:de}=GN({column:z.column,nextColumn:W?.column,isLastColumn:ee});return y.jsx("div",{role:"columnheader","aria-colindex":H+1,"aria-sort":J?.desc===!1?"ascending":J?.desc===!0?"descending":ae?"none":void 0,"data-slot":"grid-header-cell",tabIndex:-1,className:Ne("relative",{grow:j&&z.column.id!=="select","border-e":oe&&z.column.id!=="select","border-s":de&&z.column.id!=="select"}),style:{...qN({column:z.column,dir:a}),width:`calc(var(--header-${z.id}-size) * 1px)`},children:z.isPlaceholder?null:typeof z.column.columnDef.header=="function"?y.jsx("div",{className:"size-full px-3 py-1.5",children:UN(z.column.columnDef.header,z.getContext())}):y.jsx(VF,{header:z,table:i})},z.id)})},X.id))}),y.jsx("div",{role:"rowgroup","data-slot":"grid-body",className:"relative grid",style:{height:`${u}px`,contain:$?"layout paint":"strict"},children:d.map(X=>{const I=Y[X.index];if(!I)return null;const z=E?.get(X.index)??ZG,H=x?.get(X.index)??null,G=w?.rowIndex===X.index;return y.jsx(GG,{row:I,tableMeta:l,rowMapRef:n,virtualItem:X,measureElement:f,rowHeight:N,columnVisibility:P,columnPinning:q,focusedCell:S,editingCell:M,cellSelectionKeys:z,searchMatchColumns:H,activeSearchMatch:G?w:null,dir:a,adjustLayout:$,stretchColumns:j,readOnly:Z},I.id)})}),!Z&&B&&y.jsx("div",{role:"rowgroup","data-slot":"grid-footer",ref:o,className:"sticky bottom-0 z-10 grid border-t bg-background",children:y.jsx("div",{role:"row","aria-rowindex":Y.length+2,"data-slot":"grid-add-row",tabIndex:-1,className:"flex w-full",children:y.jsx("div",{role:"gridcell",tabIndex:0,className:"relative flex h-9 grow items-center bg-muted/30 transition-colors hover:bg-muted/50 focus:bg-muted/50 focus:outline-none",style:{width:i.getTotalSize(),minWidth:i.getTotalSize()},onClick:B,onKeyDown:F,children:y.jsxs("div",{className:"sticky start-0 flex items-center gap-2 px-3 text-muted-foreground",children:[y.jsx(X0,{className:"size-3.5"}),y.jsx("span",{className:"text-sm",children:"Add row"})]})})})})]})})]})}function Fa(t,e){return typeof t=="function"?t(e):t}function No(t,e){return n=>{e.setState(o=>({...o,[t]:Fa(n,o[t])}))}}function ph(t){return t instanceof Function}function JG(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function eq(t,e){const n=[],o=a=>{a.forEach(i=>{n.push(i);const l=e(i);l!=null&&l.length&&o(l)})};return o(t),n}function Qe(t,e,n){let o=[],a;return i=>{let l;n.key&&n.debug&&(l=Date.now());const u=t(i);if(!(u.length!==o.length||u.some((g,m)=>o[m]!==g)))return a;o=u;let f;if(n.key&&n.debug&&(f=Date.now()),a=e(...u),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-l)*100)/100,m=Math.round((Date.now()-f)*100)/100,p=m/16,x=(w,E)=>{for(w=String(w);w.length<E;)w=" "+w;return w};console.info(`%c⏱ ${x(m,5)} /${x(g,5)} ms`,`
|
|
62
|
+
font-size: .6rem;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n?.key)}return a}}function Je(t,e,n,o){return{debug:()=>{var a;return(a=t?.debugAll)!=null?a:t[e]},key:!1,onChange:o}}function tq(t,e,n,o){const a=()=>{var l;return(l=i.getValue())!=null?l:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:a,getContext:Qe(()=>[t,n,e,i],(l,u,d,f)=>({table:l,column:u,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),Je(t.options,"debugCells"))};return t._features.forEach(l=>{l.createCell==null||l.createCell(i,n,e,t)},{}),i}function nq(t,e,n,o){var a,i;const u={...t._getDefaultColumnDef(),...e},d=u.accessorKey;let f=(a=(i=u.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?a:typeof u.header=="string"?u.header:void 0,g;if(u.accessorFn?g=u.accessorFn:d&&(d.includes(".")?g=p=>{let x=p;for(const E of d.split(".")){var w;x=(w=x)==null?void 0:w[E]}return x}:g=p=>p[u.accessorKey]),!f)throw new Error;let m={id:`${String(f)}`,accessorFn:g,parent:o,depth:n,columnDef:u,columns:[],getFlatColumns:Qe(()=>[!0],()=>{var p;return[m,...(p=m.columns)==null?void 0:p.flatMap(x=>x.getFlatColumns())]},Je(t.options,"debugColumns")),getLeafColumns:Qe(()=>[t._getOrderColumnsFn()],p=>{var x;if((x=m.columns)!=null&&x.length){let w=m.columns.flatMap(E=>E.getLeafColumns());return p(w)}return[m]},Je(t.options,"debugColumns"))};for(const p of t._features)p.createColumn==null||p.createColumn(m,t);return m}const qn="debugHeaders";function iC(t,e,n){var o;let i={id:(o=n.id)!=null?o:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],u=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(u),l.push(d)};return u(i),l},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(l=>{l.createHeader==null||l.createHeader(i,t)}),i}const oq={createTable:t=>{t.getHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,a)=>{var i,l;const u=(i=o?.map(m=>n.find(p=>p.id===m)).filter(Boolean))!=null?i:[],d=(l=a?.map(m=>n.find(p=>p.id===m)).filter(Boolean))!=null?l:[],f=n.filter(m=>!(o!=null&&o.includes(m.id))&&!(a!=null&&a.includes(m.id)));return $d(e,[...u,...f,...d],t)},Je(t.options,qn)),t.getCenterHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,a)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(a!=null&&a.includes(i.id))),$d(e,n,t,"center")),Je(t.options,qn)),t.getLeftHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var a;const i=(a=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return $d(e,i,t,"left")},Je(t.options,qn)),t.getRightHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var a;const i=(a=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return $d(e,i,t,"right")},Je(t.options,qn)),t.getFooterGroups=Qe(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getLeftFooterGroups=Qe(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getCenterFooterGroups=Qe(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getRightFooterGroups=Qe(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getFlatHeaders=Qe(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getLeftFlatHeaders=Qe(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getCenterFlatHeaders=Qe(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getRightFlatHeaders=Qe(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getCenterLeafHeaders=Qe(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Je(t.options,qn)),t.getLeftLeafHeaders=Qe(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Je(t.options,qn)),t.getRightLeafHeaders=Qe(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Je(t.options,qn)),t.getLeafHeaders=Qe(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var a,i,l,u,d,f;return[...(a=(i=e[0])==null?void 0:i.headers)!=null?a:[],...(l=(u=n[0])==null?void 0:u.headers)!=null?l:[],...(d=(f=o[0])==null?void 0:f.headers)!=null?d:[]].map(g=>g.getLeafHeaders()).flat()},Je(t.options,qn))}};function $d(t,e,n,o){var a,i;let l=0;const u=function(p,x){x===void 0&&(x=1),l=Math.max(l,x),p.filter(w=>w.getIsVisible()).forEach(w=>{var E;(E=w.columns)!=null&&E.length&&u(w.columns,x+1)},0)};u(t);let d=[];const f=(p,x)=>{const w={depth:x,id:[o,`${x}`].filter(Boolean).join("_"),headers:[]},E=[];p.forEach(S=>{const M=[...E].reverse()[0],N=S.column.depth===w.depth;let C,R=!1;if(N&&S.column.parent?C=S.column.parent:(C=S.column,R=!0),M&&M?.column===C)M.subHeaders.push(S);else{const D=iC(n,C,{id:[o,x,C.id,S?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${E.filter(T=>T.column===C).length}`:void 0,depth:x,index:E.length});D.subHeaders.push(S),E.push(D)}w.headers.push(S),S.headerGroup=w}),d.push(w),x>0&&f(E,x-1)},g=e.map((p,x)=>iC(n,p,{depth:l,index:x}));f(g,l-1),d.reverse();const m=p=>p.filter(w=>w.column.getIsVisible()).map(w=>{let E=0,S=0,M=[0];w.subHeaders&&w.subHeaders.length?(M=[],m(w.subHeaders).forEach(C=>{let{colSpan:R,rowSpan:D}=C;E+=R,M.push(D)})):E=1;const N=Math.min(...M);return S=S+N,w.colSpan=E,w.rowSpan=S,{colSpan:E,rowSpan:S}});return m((a=(i=d[0])==null?void 0:i.headers)!=null?a:[]),d}const Ly=(t,e,n,o,a,i,l)=>{let u={id:e,index:o,original:n,depth:a,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(u._valuesCache.hasOwnProperty(d))return u._valuesCache[d];const f=t.getColumn(d);if(f!=null&&f.accessorFn)return u._valuesCache[d]=f.accessorFn(u.original,o),u._valuesCache[d]},getUniqueValues:d=>{if(u._uniqueValuesCache.hasOwnProperty(d))return u._uniqueValuesCache[d];const f=t.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(u._uniqueValuesCache[d]=f.columnDef.getUniqueValues(u.original,o),u._uniqueValuesCache[d]):(u._uniqueValuesCache[d]=[u.getValue(d)],u._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=u.getValue(d))!=null?f:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>eq(u.subRows,d=>d.subRows),getParentRow:()=>u.parentId?t.getRow(u.parentId,!0):void 0,getParentRows:()=>{let d=[],f=u;for(;;){const g=f.getParentRow();if(!g)break;d.push(g),f=g}return d.reverse()},getAllCells:Qe(()=>[t.getAllLeafColumns()],d=>d.map(f=>tq(t,u,f,f.id)),Je(t.options,"debugRows")),_getAllCellsByColumnId:Qe(()=>[u.getAllCells()],d=>d.reduce((f,g)=>(f[g.column.id]=g,f),{}),Je(t.options,"debugRows"))};for(let d=0;d<t._features.length;d++){const f=t._features[d];f==null||f.createRow==null||f.createRow(u,t)}return u},rq={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},LR=(t,e,n)=>{var o,a;const i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((a=t.getValue(e))==null||(a=a.toString())==null||(a=a.toLowerCase())==null)&&a.includes(i))};LR.autoRemove=t=>nr(t);const $R=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};$R.autoRemove=t=>nr(t);const HR=(t,e,n)=>{var o;return((o=t.getValue(e))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};HR.autoRemove=t=>nr(t);const BR=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};BR.autoRemove=t=>nr(t);const FR=(t,e,n)=>!n.some(o=>{var a;return!((a=t.getValue(e))!=null&&a.includes(o))});FR.autoRemove=t=>nr(t)||!(t!=null&&t.length);const VR=(t,e,n)=>n.some(o=>{var a;return(a=t.getValue(e))==null?void 0:a.includes(o)});VR.autoRemove=t=>nr(t)||!(t!=null&&t.length);const UR=(t,e,n)=>t.getValue(e)===n;UR.autoRemove=t=>nr(t);const YR=(t,e,n)=>t.getValue(e)==n;YR.autoRemove=t=>nr(t);const $y=(t,e,n)=>{let[o,a]=n;const i=t.getValue(e);return i>=o&&i<=a};$y.resolveFilterValue=t=>{let[e,n]=t,o=typeof e!="number"?parseFloat(e):e,a=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(o)?-1/0:o,l=n===null||Number.isNaN(a)?1/0:a;if(i>l){const u=i;i=l,l=u}return[i,l]};$y.autoRemove=t=>nr(t)||nr(t[0])&&nr(t[1]);const Qr={includesString:LR,includesStringSensitive:$R,equalsString:HR,arrIncludes:BR,arrIncludesAll:FR,arrIncludesSome:VR,equals:UR,weakEquals:YR,inNumberRange:$y};function nr(t){return t==null||t===""}const aq={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:No("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);return typeof o=="string"?Qr.includesString:typeof o=="number"?Qr.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Qr.equals:Array.isArray(o)?Qr.arrIncludes:Qr.weakEquals},t.getFilterFn=()=>{var n,o;return ph(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(o=e.options.filterFns)==null?void 0:o[t.columnDef.filterFn])!=null?n:Qr[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,o,a;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((o=e.options.enableColumnFilters)!=null?o:!0)&&((a=e.options.enableFilters)!=null?a:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(o=>o.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,o;return(n=(o=e.getState().columnFilters)==null?void 0:o.findIndex(a=>a.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(o=>{const a=t.getFilterFn(),i=o?.find(g=>g.id===t.id),l=Fa(n,i?i.value:void 0);if(lC(a,l,t)){var u;return(u=o?.filter(g=>g.id!==t.id))!=null?u:[]}const d={id:t.id,value:l};if(i){var f;return(f=o?.map(g=>g.id===t.id?d:g))!=null?f:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=a=>{var i;return(i=Fa(e,a))==null?void 0:i.filter(l=>{const u=n.find(d=>d.id===l.id);if(u){const d=u.getFilterFn();if(lC(d,l.value,u))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},t.resetColumnFilters=e=>{var n,o;t.setColumnFilters(e?[]:(n=(o=t.initialState)==null?void 0:o.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function lC(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const sq=(t,e,n)=>n.reduce((o,a)=>{const i=a.getValue(t);return o+(typeof i=="number"?i:0)},0),iq=(t,e,n)=>{let o;return n.forEach(a=>{const i=a.getValue(t);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},lq=(t,e,n)=>{let o;return n.forEach(a=>{const i=a.getValue(t);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},cq=(t,e,n)=>{let o,a;return n.forEach(i=>{const l=i.getValue(t);l!=null&&(o===void 0?l>=l&&(o=a=l):(o>l&&(o=l),a<l&&(a=l)))}),[o,a]},uq=(t,e)=>{let n=0,o=0;if(e.forEach(a=>{let i=a.getValue(t);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},dq=(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!JG(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),a=n.sort((i,l)=>i-l);return n.length%2!==0?a[o]:(a[o-1]+a[o])/2},fq=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),hq=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,mq=(t,e)=>e.length,hp={sum:sq,min:iq,max:lq,extent:cq,mean:uq,median:dq,unique:fq,uniqueCount:hq,count:mq},gq={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:No("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(o=>o!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,o;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((o=e.options.enableGrouping)!=null?o:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);if(typeof o=="number")return hp.sum;if(Object.prototype.toString.call(o)==="[object Date]")return hp.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return ph(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(o=e.options.aggregationFns)==null?void 0:o[t.columnDef.aggregationFn])!=null?n:hp[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,o;t.setGrouping(e?[]:(n=(o=t.initialState)==null?void 0:o.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const o=e.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(t._groupingValuesCache[n]=o.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,o)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var a;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function pq(t,e,n){if(!(e!=null&&e.length)||!n)return t;const o=t.filter(i=>!e.includes(i.id));return n==="remove"?o:[...e.map(i=>t.find(l=>l.id===i)).filter(Boolean),...o]}const yq={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:No("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Qe(n=>[Sc(e,n)],n=>n.findIndex(o=>o.id===t.id),Je(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var o;return((o=Sc(e,n)[0])==null?void 0:o.id)===t.id},t.getIsLastColumn=n=>{var o;const a=Sc(e,n);return((o=a[a.length-1])==null?void 0:o.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Qe(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>a=>{let i=[];if(!(e!=null&&e.length))i=a;else{const l=[...e],u=[...a];for(;u.length&&l.length;){const d=l.shift(),f=u.findIndex(g=>g.id===d);f>-1&&i.push(u.splice(f,1)[0])}i=[...i,...u]}return pq(i,n,o)},Je(t.options,"debugTable"))}},mp=()=>({left:[],right:[]}),vq={getInitialState:t=>({columnPinning:mp(),...t}),getDefaultOptions:t=>({onColumnPinningChange:No("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(a=>a.id).filter(Boolean);e.setColumnPinning(a=>{var i,l;if(n==="right"){var u,d;return{left:((u=a?.left)!=null?u:[]).filter(m=>!(o!=null&&o.includes(m))),right:[...((d=a?.right)!=null?d:[]).filter(m=>!(o!=null&&o.includes(m))),...o]}}if(n==="left"){var f,g;return{left:[...((f=a?.left)!=null?f:[]).filter(m=>!(o!=null&&o.includes(m))),...o],right:((g=a?.right)!=null?g:[]).filter(m=>!(o!=null&&o.includes(m)))}}return{left:((i=a?.left)!=null?i:[]).filter(m=>!(o!=null&&o.includes(m))),right:((l=a?.right)!=null?l:[]).filter(m=>!(o!=null&&o.includes(m)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var a,i,l;return((a=o.columnDef.enablePinning)!=null?a:!0)&&((i=(l=e.options.enableColumnPinning)!=null?l:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(u=>u.id),{left:o,right:a}=e.getState().columnPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>a?.includes(u));return i?"left":l?"right":!1},t.getPinnedIndex=()=>{var n,o;const a=t.getIsPinned();return a?(n=(o=e.getState().columnPinning)==null||(o=o[a])==null?void 0:o.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Qe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,a)=>{const i=[...o??[],...a??[]];return n.filter(l=>!i.includes(l.column.id))},Je(e.options,"debugRows")),t.getLeftVisibleCells=Qe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Je(e.options,"debugRows")),t.getRightVisibleCells=Qe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Je(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,o;return t.setColumnPinning(e?mp():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:mp())},t.getIsSomeColumnsPinned=e=>{var n;const o=t.getState().columnPinning;if(!e){var a,i;return!!((a=o.left)!=null&&a.length||(i=o.right)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t.getLeftLeafColumns=Qe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(a=>a.id===o)).filter(Boolean),Je(t.options,"debugColumns")),t.getRightLeafColumns=Qe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(a=>a.id===o)).filter(Boolean),Je(t.options,"debugColumns")),t.getCenterLeafColumns=Qe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o)=>{const a=[...n??[],...o??[]];return e.filter(i=>!a.includes(i.id))},Je(t.options,"debugColumns"))}};function xq(t){return t||(typeof document<"u"?document:null)}const Hd={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},gp=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),bq={getDefaultColumnDef:()=>Hd,getInitialState:t=>({columnSizing:{},columnSizingInfo:gp(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:No("columnSizing",t),onColumnSizingInfoChange:No("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,o,a;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Hd.minSize,(o=i??t.columnDef.size)!=null?o:Hd.size),(a=t.columnDef.maxSize)!=null?a:Hd.maxSize)},t.getStart=Qe(n=>[n,Sc(e,n),e.getState().columnSizing],(n,o)=>o.slice(0,t.getIndex(n)).reduce((a,i)=>a+i.getSize(),0),Je(e.options,"debugColumns")),t.getAfter=Qe(n=>[n,Sc(e,n),e.getState().columnSizing],(n,o)=>o.slice(t.getIndex(n)+1).reduce((a,i)=>a+i.getSize(),0),Je(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:o,...a}=n;return a})},t.getCanResize=()=>{var n,o;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((o=e.options.enableColumnResizing)!=null?o:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const o=a=>{if(a.subHeaders.length)a.subHeaders.forEach(o);else{var i;n+=(i=a.column.getSize())!=null?i:0}};return o(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const o=e.getColumn(t.column.id),a=o?.getCanResize();return i=>{if(!o||!a||(i.persist==null||i.persist(),pp(i)&&i.touches&&i.touches.length>1))return;const l=t.getSize(),u=t?t.getLeafHeaders().map(M=>[M.column.id,M.column.getSize()]):[[o.id,o.getSize()]],d=pp(i)?Math.round(i.touches[0].clientX):i.clientX,f={},g=(M,N)=>{typeof N=="number"&&(e.setColumnSizingInfo(C=>{var R,D;const T=e.options.columnResizeDirection==="rtl"?-1:1,k=(N-((R=C?.startOffset)!=null?R:0))*T,j=Math.max(k/((D=C?.startSize)!=null?D:0),-.999999);return C.columnSizingStart.forEach($=>{let[K,U]=$;f[K]=Math.round(Math.max(U+U*j,0)*100)/100}),{...C,deltaOffset:k,deltaPercentage:j}}),(e.options.columnResizeMode==="onChange"||M==="end")&&e.setColumnSizing(C=>({...C,...f})))},m=M=>g("move",M),p=M=>{g("end",M),e.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},x=xq(n),w={moveHandler:M=>m(M.clientX),upHandler:M=>{x?.removeEventListener("mousemove",w.moveHandler),x?.removeEventListener("mouseup",w.upHandler),p(M.clientX)}},E={moveHandler:M=>(M.cancelable&&(M.preventDefault(),M.stopPropagation()),m(M.touches[0].clientX),!1),upHandler:M=>{var N;x?.removeEventListener("touchmove",E.moveHandler),x?.removeEventListener("touchend",E.upHandler),M.cancelable&&(M.preventDefault(),M.stopPropagation()),p((N=M.touches[0])==null?void 0:N.clientX)}},S=wq()?{passive:!1}:!1;pp(i)?(x?.addEventListener("touchmove",E.moveHandler,S),x?.addEventListener("touchend",E.upHandler,S)):(x?.addEventListener("mousemove",w.moveHandler,S),x?.addEventListener("mouseup",w.upHandler,S)),e.setColumnSizingInfo(M=>({...M,startOffset:d,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:o.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?gp():(n=t.initialState.columnSizingInfo)!=null?n:gp())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0}}};let Bd=null;function wq(){if(typeof Bd=="boolean")return Bd;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Bd=t,Bd}function pp(t){return t.type==="touchstart"}const Sq={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:No("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;const a=t.columns;return(n=a.length?a.some(i=>i.getIsVisible()):(o=e.getState().columnVisibility)==null?void 0:o[t.id])!=null?n:!0},t.getCanHide=()=>{var n,o;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((o=e.options.enableHiding)!=null?o:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Qe(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),Je(e.options,"debugRows")),t.getVisibleCells=Qe(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,a)=>[...n,...o,...a],Je(e.options,"debugRows"))},createTable:t=>{const e=(n,o)=>Qe(()=>[o(),o().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Je(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var o;t.setColumnVisibility(n?{}:(o=t.initialState.columnVisibility)!=null?o:{})},t.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((a,i)=>({...a,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;t.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function Sc(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const Cq={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},Eq={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:No("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const o=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,o,a,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=e.options.enableGlobalFilter)!=null?o:!0)&&((a=e.options.enableFilters)!=null?a:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Qr.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return ph(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:Qr[o]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},_q={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:No("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var o,a;if(!e){t._queue(()=>{e=!0});return}if((o=(a=t.options.autoResetAll)!=null?a:t.options.autoResetExpanded)!=null?o:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=o=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(o),t.toggleAllRowsExpanded=o=>{o??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=o=>{var a,i;t.setExpanded(o?{}:(a=(i=t.initialState)==null?void 0:i.expanded)!=null?a:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const o=t.getState().expanded;return o===!0||Object.values(o).some(Boolean)},t.getIsAllRowsExpanded=()=>{const o=t.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||t.getRowModel().flatRows.some(a=>!a.getIsExpanded()))},t.getExpandedDepth=()=>{let o=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const l=i.split(".");o=Math.max(o,l.length)}),o},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(o=>{var a;const i=o===!0?!0:!!(o!=null&&o[t.id]);let l={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(u=>{l[u]=!0}):l=o,n=(a=n)!=null?a:!i,!i&&n)return{...l,[t.id]:!0};if(i&&!n){const{[t.id]:u,...d}=l;return d}return o})},t.getIsExpanded=()=>{var n;const o=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:o===!0||o?.[t.id])},t.getCanExpand=()=>{var n,o,a;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((o=e.options.enableExpanding)!=null?o:!0)&&!!((a=t.subRows)!=null&&a.length)},t.getIsAllParentsExpanded=()=>{let n=!0,o=t;for(;n&&o.parentId;)o=e.getRow(o.parentId,!0),n=o.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},a0=0,s0=10,yp=()=>({pageIndex:a0,pageSize:s0}),Mq={getInitialState:t=>({...t,pagination:{...yp(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:No("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var o,a;if(!e){t._queue(()=>{e=!0});return}if((o=(a=t.options.autoResetAll)!=null?a:t.options.autoResetPageIndex)!=null?o:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=o=>{const a=i=>Fa(o,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(a)},t.resetPagination=o=>{var a;t.setPagination(o?yp():(a=t.initialState.pagination)!=null?a:yp())},t.setPageIndex=o=>{t.setPagination(a=>{let i=Fa(o,a.pageIndex);const l=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...a,pageIndex:i}})},t.resetPageIndex=o=>{var a,i;t.setPageIndex(o?a0:(a=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?a:a0)},t.resetPageSize=o=>{var a,i;t.setPageSize(o?s0:(a=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?a:s0)},t.setPageSize=o=>{t.setPagination(a=>{const i=Math.max(1,Fa(o,a.pageSize)),l=a.pageSize*a.pageIndex,u=Math.floor(l/i);return{...a,pageIndex:u,pageSize:i}})},t.setPageCount=o=>t.setPagination(a=>{var i;let l=Fa(o,(i=t.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...a,pageCount:l}}),t.getPageOptions=Qe(()=>[t.getPageCount()],o=>{let a=[];return o&&o>0&&(a=[...new Array(o)].fill(null).map((i,l)=>l)),a},Je(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:o}=t.getState().pagination,a=t.getPageCount();return a===-1?!0:a===0?!1:o<a-1},t.previousPage=()=>t.setPageIndex(o=>o-1),t.nextPage=()=>t.setPageIndex(o=>o+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var o;return(o=t.options.pageCount)!=null?o:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var o;return(o=t.options.rowCount)!=null?o:t.getPrePaginationRowModel().rows.length}}},vp=()=>({top:[],bottom:[]}),Nq={getInitialState:t=>({rowPinning:vp(),...t}),getDefaultOptions:t=>({onRowPinningChange:No("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,o,a)=>{const i=o?t.getLeafRows().map(d=>{let{id:f}=d;return f}):[],l=a?t.getParentRows().map(d=>{let{id:f}=d;return f}):[],u=new Set([...l,t.id,...i]);e.setRowPinning(d=>{var f,g;if(n==="bottom"){var m,p;return{top:((m=d?.top)!=null?m:[]).filter(E=>!(u!=null&&u.has(E))),bottom:[...((p=d?.bottom)!=null?p:[]).filter(E=>!(u!=null&&u.has(E))),...Array.from(u)]}}if(n==="top"){var x,w;return{top:[...((x=d?.top)!=null?x:[]).filter(E=>!(u!=null&&u.has(E))),...Array.from(u)],bottom:((w=d?.bottom)!=null?w:[]).filter(E=>!(u!=null&&u.has(E)))}}return{top:((f=d?.top)!=null?f:[]).filter(E=>!(u!=null&&u.has(E))),bottom:((g=d?.bottom)!=null?g:[]).filter(E=>!(u!=null&&u.has(E)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:a}=e.options;return typeof o=="function"?o(t):(n=o??a)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:o,bottom:a}=e.getState().rowPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>a?.includes(u));return i?"top":l?"bottom":!1},t.getPinnedIndex=()=>{var n,o;const a=t.getIsPinned();if(!a)return-1;const i=(n=a==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(l=>{let{id:u}=l;return u});return(o=i?.indexOf(t.id))!=null?o:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?vp():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:vp())},t.getIsSomeRowsPinned=e=>{var n;const o=t.getState().rowPinning;if(!e){var a,i;return!!((a=o.top)!=null&&a.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t._getPinnedRows=(e,n,o)=>{var a;return((a=t.options.keepPinnedRows)==null||a?(n??[]).map(l=>{const u=t.getRow(l,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(l=>e.find(u=>u.id===l))).filter(Boolean).map(l=>({...l,position:o}))},t.getTopRows=Qe(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),Je(t.options,"debugRows")),t.getBottomRows=Qe(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),Je(t.options,"debugRows")),t.getCenterRows=Qe(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,o)=>{const a=new Set([...n??[],...o??[]]);return e.filter(i=>!a.has(i.id))},Je(t.options,"debugRows"))}},Rq={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:No("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const o={...n},a=t.getPreGroupedRowModel().flatRows;return e?a.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):a.forEach(i=>{delete o[i.id]}),o})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const o=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),a={...n};return t.getRowModel().rows.forEach(i=>{i0(a,i.id,o,!0,t)}),a}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Qe(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?xp(t,n):{rows:[],flatRows:[],rowsById:{}},Je(t.options,"debugTable")),t.getFilteredSelectedRowModel=Qe(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?xp(t,n):{rows:[],flatRows:[],rowsById:{}},Je(t.options,"debugTable")),t.getGroupedSelectedRowModel=Qe(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?xp(t,n):{rows:[],flatRows:[],rowsById:{}},Je(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let o=!!(e.length&&Object.keys(n).length);return o&&e.some(a=>a.getCanSelect()&&!n[a.id])&&(o=!1),o},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=t.getState();let o=!!e.length;return o&&e.some(a=>!n[a.id])&&(o=!1),o},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,o)=>{const a=t.getIsSelected();e.setRowSelection(i=>{var l;if(n=typeof n<"u"?n:!a,t.getCanSelect()&&a===n)return i;const u={...i};return i0(u,t.id,n,(l=o?.selectChildren)!=null?l:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Hy(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return l0(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return l0(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return o=>{var a;n&&t.toggleSelected((a=o.target)==null?void 0:a.checked)}}}},i0=(t,e,n,o,a)=>{var i;const l=a.getRow(e,!0);n?(l.getCanMultiSelect()||Object.keys(t).forEach(u=>delete t[u]),l.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(u=>i0(t,u.id,n,o,a))};function xp(t,e){const n=t.getState().rowSelection,o=[],a={},i=function(l,u){return l.map(d=>{var f;const g=Hy(d,n);if(g&&(o.push(d),a[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:i(d.subRows)}),g)return d}).filter(Boolean)};return{rows:i(e.rows),flatRows:o,rowsById:a}}function Hy(t,e){var n;return(n=e[t.id])!=null?n:!1}function l0(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let a=!0,i=!1;return t.subRows.forEach(l=>{if(!(i&&!a)&&(l.getCanSelect()&&(Hy(l,e)?i=!0:a=!1),l.subRows&&l.subRows.length)){const u=l0(l,e);u==="all"?i=!0:(u==="some"&&(i=!0),a=!1)}}),a?"all":i?"some":!1}const c0=/([0-9]+)/gm,Dq=(t,e,n)=>GR(Za(t.getValue(n)).toLowerCase(),Za(e.getValue(n)).toLowerCase()),Tq=(t,e,n)=>GR(Za(t.getValue(n)),Za(e.getValue(n))),kq=(t,e,n)=>By(Za(t.getValue(n)).toLowerCase(),Za(e.getValue(n)).toLowerCase()),Oq=(t,e,n)=>By(Za(t.getValue(n)),Za(e.getValue(n))),Aq=(t,e,n)=>{const o=t.getValue(n),a=e.getValue(n);return o>a?1:o<a?-1:0},jq=(t,e,n)=>By(t.getValue(n),e.getValue(n));function By(t,e){return t===e?0:t>e?1:-1}function Za(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function GR(t,e){const n=t.split(c0).filter(Boolean),o=e.split(c0).filter(Boolean);for(;n.length&&o.length;){const a=n.shift(),i=o.shift(),l=parseInt(a,10),u=parseInt(i,10),d=[l,u].sort();if(isNaN(d[0])){if(a>i)return 1;if(i>a)return-1;continue}if(isNaN(d[1]))return isNaN(l)?-1:1;if(l>u)return 1;if(u>l)return-1}return n.length-o.length}const dc={alphanumeric:Dq,alphanumericCaseSensitive:Tq,text:kq,textCaseSensitive:Oq,datetime:Aq,basic:jq},zq={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:No("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const a of n){const i=a?.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return dc.datetime;if(typeof i=="string"&&(o=!0,i.split(c0).length>1))return dc.alphanumeric}return o?dc.text:dc.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,o;if(!t)throw new Error;return ph(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(o=e.options.sortingFns)==null?void 0:o[t.columnDef.sortingFn])!=null?n:dc[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const a=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(l=>{const u=l?.find(x=>x.id===t.id),d=l?.findIndex(x=>x.id===t.id);let f=[],g,m=i?n:a==="desc";if(l!=null&&l.length&&t.getCanMultiSort()&&o?u?g="toggle":g="add":l!=null&&l.length&&d!==l.length-1?g="replace":u?g="toggle":g="replace",g==="toggle"&&(i||a||(g="remove")),g==="add"){var p;f=[...l,{id:t.id,desc:m}],f.splice(0,f.length-((p=e.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else g==="toggle"?f=l.map(x=>x.id===t.id?{...x,desc:m}:x):g==="remove"?f=l.filter(x=>x.id!==t.id):f=[{id:t.id,desc:m}];return f})},t.getFirstSortDir=()=>{var n,o;return((n=(o=t.columnDef.sortDescFirst)!=null?o:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var o,a;const i=t.getFirstSortDir(),l=t.getIsSorted();return l?l!==i&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(a=e.options.enableMultiRemove)!=null)||a)?!1:l==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,o;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((o=e.options.enableSorting)!=null?o:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,o;return(n=(o=t.columnDef.enableMultiSort)!=null?o:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const o=(n=e.getState().sorting)==null?void 0:n.find(a=>a.id===t.id);return o?o.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,o;return(n=(o=e.getState().sorting)==null?void 0:o.findIndex(a=>a.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return o=>{n&&(o.persist==null||o.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(o):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,o;t.setSorting(e?[]:(n=(o=t.initialState)==null?void 0:o.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Iq=[oq,Sq,yq,vq,rq,aq,Cq,Eq,zq,gq,_q,Mq,Nq,Rq,bq];function Pq(t){var e,n;const o=[...Iq,...(e=t._features)!=null?e:[]];let a={_features:o};const i=a._features.reduce((p,x)=>Object.assign(p,x.getDefaultOptions==null?void 0:x.getDefaultOptions(a)),{}),l=p=>a.options.mergeOptions?a.options.mergeOptions(i,p):{...i,...p};let d={...{},...(n=t.initialState)!=null?n:{}};a._features.forEach(p=>{var x;d=(x=p.getInitialState==null?void 0:p.getInitialState(d))!=null?x:d});const f=[];let g=!1;const m={_features:o,options:{...i,...t},initialState:d,_queue:p=>{f.push(p),g||(g=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();g=!1}).catch(x=>setTimeout(()=>{throw x})))},reset:()=>{a.setState(a.initialState)},setOptions:p=>{const x=Fa(p,a.options);a.options=l(x)},getState:()=>a.options.state,setState:p=>{a.options.onStateChange==null||a.options.onStateChange(p)},_getRowId:(p,x,w)=>{var E;return(E=a.options.getRowId==null?void 0:a.options.getRowId(p,x,w))!=null?E:`${w?[w.id,x].join("."):x}`},getCoreRowModel:()=>(a._getCoreRowModel||(a._getCoreRowModel=a.options.getCoreRowModel(a)),a._getCoreRowModel()),getRowModel:()=>a.getPaginationRowModel(),getRow:(p,x)=>{let w=(x?a.getPrePaginationRowModel():a.getRowModel()).rowsById[p];if(!w&&(w=a.getCoreRowModel().rowsById[p],!w))throw new Error;return w},_getDefaultColumnDef:Qe(()=>[a.options.defaultColumn],p=>{var x;return p=(x=p)!=null?x:{},{header:w=>{const E=w.header.column.columnDef;return E.accessorKey?E.accessorKey:E.accessorFn?E.id:null},cell:w=>{var E,S;return(E=(S=w.renderValue())==null||S.toString==null?void 0:S.toString())!=null?E:null},...a._features.reduce((w,E)=>Object.assign(w,E.getDefaultColumnDef==null?void 0:E.getDefaultColumnDef()),{}),...p}},Je(t,"debugColumns")),_getColumnDefs:()=>a.options.columns,getAllColumns:Qe(()=>[a._getColumnDefs()],p=>{const x=function(w,E,S){return S===void 0&&(S=0),w.map(M=>{const N=nq(a,M,S,E),C=M;return N.columns=C.columns?x(C.columns,N,S+1):[],N})};return x(p)},Je(t,"debugColumns")),getAllFlatColumns:Qe(()=>[a.getAllColumns()],p=>p.flatMap(x=>x.getFlatColumns()),Je(t,"debugColumns")),_getAllFlatColumnsById:Qe(()=>[a.getAllFlatColumns()],p=>p.reduce((x,w)=>(x[w.id]=w,x),{}),Je(t,"debugColumns")),getAllLeafColumns:Qe(()=>[a.getAllColumns(),a._getOrderColumnsFn()],(p,x)=>{let w=p.flatMap(E=>E.getLeafColumns());return x(w)},Je(t,"debugColumns")),getColumn:p=>a._getAllFlatColumnsById()[p]};Object.assign(a,m);for(let p=0;p<a._features.length;p++){const x=a._features[p];x==null||x.createTable==null||x.createTable(a)}return a}function Lq(){return t=>Qe(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(a,i,l){i===void 0&&(i=0);const u=[];for(let f=0;f<a.length;f++){const g=Ly(t,t._getRowId(a[f],f,l),a[f],f,i,void 0,l?.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,u.push(g),t.options.getSubRows){var d;g.originalSubRows=t.options.getSubRows(a[f],f),(d=g.originalSubRows)!=null&&d.length&&(g.subRows=o(g.originalSubRows,i+1,g))}}return u};return n.rows=o(e),n},Je(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function $q(t,e,n){return n.options.filterFromLeafRows?Hq(t,e,n):Bq(t,e,n)}function Hq(t,e,n){var o;const a=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,u=function(d,f){f===void 0&&(f=0);const g=[];for(let p=0;p<d.length;p++){var m;let x=d[p];const w=Ly(n,x.id,x.original,x.index,x.depth,void 0,x.parentId);if(w.columnFilters=x.columnFilters,(m=x.subRows)!=null&&m.length&&f<l){if(w.subRows=u(x.subRows,f+1),x=w,e(x)&&!w.subRows.length){g.push(x),i[x.id]=x,a.push(x);continue}if(e(x)||w.subRows.length){g.push(x),i[x.id]=x,a.push(x);continue}}else x=w,e(x)&&(g.push(x),i[x.id]=x,a.push(x))}return g};return{rows:u(t),flatRows:a,rowsById:i}}function Bq(t,e,n){var o;const a=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,u=function(d,f){f===void 0&&(f=0);const g=[];for(let p=0;p<d.length;p++){let x=d[p];if(e(x)){var m;if((m=x.subRows)!=null&&m.length&&f<l){const E=Ly(n,x.id,x.original,x.index,x.depth,void 0,x.parentId);E.subRows=u(x.subRows,f+1),x=E}g.push(x),a.push(x),i[x.id]=x}}return g};return{rows:u(t),flatRows:a,rowsById:i}}function Fq(){return t=>Qe(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let p=0;p<e.flatRows.length;p++)e.flatRows[p].columnFilters={},e.flatRows[p].columnFiltersMeta={};return e}const a=[],i=[];(n??[]).forEach(p=>{var x;const w=t.getColumn(p.id);if(!w)return;const E=w.getFilterFn();E&&a.push({id:p.id,filterFn:E,resolvedValue:(x=E.resolveFilterValue==null?void 0:E.resolveFilterValue(p.value))!=null?x:p.value})});const l=(n??[]).map(p=>p.id),u=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(p=>p.getCanGlobalFilter());o&&u&&d.length&&(l.push("__global__"),d.forEach(p=>{var x;i.push({id:p.id,filterFn:u,resolvedValue:(x=u.resolveFilterValue==null?void 0:u.resolveFilterValue(o))!=null?x:o})}));let f,g;for(let p=0;p<e.flatRows.length;p++){const x=e.flatRows[p];if(x.columnFilters={},a.length)for(let w=0;w<a.length;w++){f=a[w];const E=f.id;x.columnFilters[E]=f.filterFn(x,E,f.resolvedValue,S=>{x.columnFiltersMeta[E]=S})}if(i.length){for(let w=0;w<i.length;w++){g=i[w];const E=g.id;if(g.filterFn(x,E,g.resolvedValue,S=>{x.columnFiltersMeta[E]=S})){x.columnFilters.__global__=!0;break}}x.columnFilters.__global__!==!0&&(x.columnFilters.__global__=!1)}}const m=p=>{for(let x=0;x<l.length;x++)if(p.columnFilters[l[x]]===!1)return!1;return!0};return $q(e.rows,m,t)},Je(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function Vq(){return t=>Qe(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const o=t.getState().sorting,a=[],i=o.filter(d=>{var f;return(f=t.getColumn(d.id))==null?void 0:f.getCanSort()}),l={};i.forEach(d=>{const f=t.getColumn(d.id);f&&(l[d.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const u=d=>{const f=d.map(g=>({...g}));return f.sort((g,m)=>{for(let x=0;x<i.length;x+=1){var p;const w=i[x],E=l[w.id],S=E.sortUndefined,M=(p=w?.desc)!=null?p:!1;let N=0;if(S){const C=g.getValue(w.id),R=m.getValue(w.id),D=C===void 0,T=R===void 0;if(D||T){if(S==="first")return D?-1:1;if(S==="last")return D?1:-1;N=D&&T?0:D?S:-S}}if(N===0&&(N=E.sortingFn(g,m,w.id)),N!==0)return M&&(N*=-1),E.invertSorting&&(N*=-1),N}return g.index-m.index}),f.forEach(g=>{var m;a.push(g),(m=g.subRows)!=null&&m.length&&(g.subRows=u(g.subRows))}),f};return{rows:u(n.rows),flatRows:a,rowsById:n.rowsById}},Je(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function Uq(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=v.useState(()=>({current:Pq(e)})),[o,a]=v.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...o,...t.state},onStateChange:l=>{a(l),t.onStateChange==null||t.onStateChange(l)}})),n.current}function Ti(t,e,n){let o=n.initialDeps??[],a,i=!0;function l(){var u,d,f;let g;n.key&&((u=n.debug)!=null&&u.call(n))&&(g=Date.now());const m=t();if(!(m.length!==o.length||m.some((w,E)=>o[E]!==w)))return a;o=m;let x;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(x=Date.now()),a=e(...m),n.key&&((f=n.debug)!=null&&f.call(n))){const w=Math.round((Date.now()-g)*100)/100,E=Math.round((Date.now()-x)*100)/100,S=E/16,M=(N,C)=>{for(N=String(N);N.length<C;)N=" "+N;return N};console.info(`%c⏱ ${M(E,5)} /${M(w,5)} ms`,`
|
|
65
|
+
font-size: .6rem;
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(a),i=!1,a}return l.updateDeps=u=>{o=u},l}function cC(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const Yq=(t,e)=>Math.abs(t-e)<1.01,Gq=(t,e,n)=>{let o;return function(...a){t.clearTimeout(o),o=t.setTimeout(()=>e.apply(this,a),n)}},uC=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},qq=t=>t,Wq=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),o=[];for(let a=e;a<=n;a++)o.push(a);return o},Kq=(t,e)=>{const n=t.scrollElement;if(!n)return;const o=t.targetWindow;if(!o)return;const a=l=>{const{width:u,height:d}=l;e({width:Math.round(u),height:Math.round(d)})};if(a(uC(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(l=>{const u=()=>{const d=l[0];if(d?.borderBoxSize){const f=d.borderBoxSize[0];if(f){a({width:f.inlineSize,height:f.blockSize});return}}a(uC(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},dC={passive:!0},fC=typeof window>"u"?!0:"onscrollend"in window,Xq=(t,e)=>{const n=t.scrollElement;if(!n)return;const o=t.targetWindow;if(!o)return;let a=0;const i=t.options.useScrollendEvent&&fC?()=>{}:Gq(o,()=>{e(a,!1)},t.options.isScrollingResetDelay),l=g=>()=>{const{horizontal:m,isRtl:p}=t.options;a=m?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),e(a,g)},u=l(!0),d=l(!1);n.addEventListener("scroll",u,dC);const f=t.options.useScrollendEvent&&fC;return f&&n.addEventListener("scrollend",d,dC),()=>{n.removeEventListener("scroll",u),f&&n.removeEventListener("scrollend",d)}},Zq=(t,e,n)=>{if(e?.borderBoxSize){const o=e.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},Qq=(t,{adjustments:e=0,behavior:n},o)=>{var a,i;const l=t+e;(i=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||i.call(a,{[o.options.horizontal?"left":"top"]:l,behavior:n})};class Jq{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(i=>{const l=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var a;(a=o())==null||a.disconnect(),n=null},observe:a=>{var i;return(i=o())==null?void 0:i.observe(a,{box:"border-box"})},unobserve:a=>{var i;return(i=o())==null?void 0:i.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,a])=>{typeof a>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:qq,rangeExtractor:Wq,onChange:()=>{},measureElement:Zq,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,a;(a=(o=this.options).onChange)==null||a.call(o,this,n)},this.maybeNotify=Ti(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=i,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const a=new Map,i=new Map;for(let l=o-1;l>=0;l--){const u=n[l];if(a.has(u.lane))continue;const d=i.get(u.lane);if(d==null||u.end>d.end?i.set(u.lane,u):u.end<d.end&&a.set(u.lane,!0),a.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,u)=>l.end===u.end?l.index-u.index:l.end-u.end)[0]:void 0},this.getMeasurementOptions=Ti(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,o,a,i,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:a,getItemKey:i,enabled:l,lanes:u}),{key:!1}),this.getMeasurements=Ti(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:a,getItemKey:i,enabled:l,lanes:u},d)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const f=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const g=this.measurementsCache.slice(0,f),m=new Array(u).fill(void 0);for(let p=0;p<f;p++){const x=g[p];x&&(m[x.lane]=p)}for(let p=f;p<n;p++){const x=i(p),w=this.laneAssignments.get(p);let E,S;if(w!==void 0&&this.options.lanes>1){E=w;const R=m[E],D=R!==void 0?g[R]:void 0;S=D?D.end+this.options.gap:o+a}else{const R=this.options.lanes===1?g[p-1]:this.getFurthestMeasurement(g,p);S=R?R.end+this.options.gap:o+a,E=R?R.lane:p%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(p,E)}const M=d.get(x),N=typeof M=="number"?M:this.options.estimateSize(p),C=S+N;g[p]={index:p,start:S,size:N,end:C,key:x,lane:E},m[E]=p}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ti(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,a,i)=>this.range=n.length>0&&o>0?eW({measurements:n,outerSize:o,scrollOffset:a,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ti(()=>{let n=null,o=null;const a=this.calculateRange();return a&&(n=a.startIndex,o=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,a,i,l)=>i===null||l===null?[]:n({startIndex:i,endIndex:l,overscan:o,count:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,a=n.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const a=this.indexFromElement(n),i=this.measurementsCache[a];if(!i)return;const l=i.key,u=this.elementsCache.get(l);u!==n&&(u&&this.observer.unobserve(u),this.observer.observe(n),this.elementsCache.set(l,n)),n.isConnected&&this.resizeItem(a,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const a=this.measurementsCache[n];if(!a)return;const i=this.itemSizeCache.get(a.key)??a.size,l=o-i;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,l,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,a)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(a))});return}this._measureElement(n,void 0)},this.getVirtualItems=Ti(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const a=[];for(let i=0,l=n.length;i<l;i++){const u=n[i],d=o[u];a.push(d)}return a},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return cC(o[qR(0,o.length-1,a=>cC(o[a]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,o,a=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();o==="auto"&&(o=n>=l+i?"end":"start"),o==="center"?n+=(a-i)/2:o==="end"&&(n-=i);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.measurementsCache[n];if(!a)return;const i=this.getSize(),l=this.getScrollOffset();if(o==="auto")if(a.end>=l+i-this.options.scrollPaddingEnd)o="end";else if(a.start<=l+this.options.scrollPaddingStart)o="start";else return[l,o];if(o==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),o];const u=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,o,a.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:a}={})=>{a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:a})},this.scrollToIndex=(n,{align:o="auto",behavior:a}={})=>{a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let i=0;const l=10,u=f=>{if(!this.targetWindow)return;const g=this.getOffsetForIndex(n,f);if(!g){console.warn("Failed to get offset for index:",n);return}const[m,p]=g;this._scrollToOffset(m,{adjustments:void 0,behavior:a}),this.targetWindow.requestAnimationFrame(()=>{const x=()=>{if(this.currentScrollToIndex!==n)return;const w=this.getScrollOffset(),E=this.getOffsetForIndex(n,p);if(!E){console.warn("Failed to get offset for index:",n);return}Yq(E[0],w)||d(p)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(x):x()})},d=f=>{this.targetWindow&&this.currentScrollToIndex===n&&(i++,i<l?this.targetWindow.requestAnimationFrame(()=>u(f)):console.warn(`Failed to scroll to index ${n} after ${l} attempts.`))};u(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let a;if(o.length===0)a=this.options.paddingStart;else if(this.options.lanes===1)a=((n=o[o.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let l=o.length-1;for(;l>=0&&i.some(u=>u===null);){const u=o[l];i[u.lane]===null&&(i[u.lane]=u.end),l--}a=Math.max(...i.filter(u=>u!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:a})=>{this.options.scrollToFn(n,{behavior:a,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}const qR=(t,e,n,o)=>{for(;t<=e;){const a=(t+e)/2|0,i=n(a);if(i<o)t=a+1;else if(i>o)e=a-1;else return a}return t>0?t-1:0};function eW({measurements:t,outerSize:e,scrollOffset:n,lanes:o}){const a=t.length-1,i=d=>t[d].start;if(t.length<=o)return{startIndex:0,endIndex:a};let l=qR(0,a,i,n),u=l;if(o===1)for(;u<a&&t[u].end<n+e;)u++;else if(o>1){const d=Array(o).fill(0);for(;u<a&&d.some(g=>g<n+e);){const g=t[u];d[g.lane]=g.end,u++}const f=Array(o).fill(n+e);for(;l>=0&&f.some(g=>g>=n);){const g=t[l];f[g.lane]=g.start,l--}l=Math.max(0,l-l%o),u=Math.min(a,u+(o-1-u%o))}return{startIndex:l,endIndex:u}}const hC=typeof document<"u"?v.useLayoutEffect:v.useEffect;function tW({useFlushSync:t=!0,...e}){const n=v.useReducer(()=>({}),{})[1],o={...e,onChange:(i,l)=>{var u;t&&l?rl.flushSync(n):n(),(u=e.onChange)==null||u.call(e,i,l)}},[a]=v.useState(()=>new Jq(o));return a.setOptions(o),hC(()=>a._didMount(),[]),hC(()=>a._willUpdate()),a}function nW(t){return tW({observeElementRect:Kq,observeElementOffset:Xq,scrollToFn:Qq,...t})}function bp(t){const e=Ee.c(2),n=v.useRef(null);if(n.current===null){let o;e[0]!==t?(o=t(),e[0]=t,e[1]=o):o=e[1],n.current=o}return n}const oW="short",rW=6,Ho=1,mC=5,aW=16,sW=60,iW=800,gC="f",pC=["select","actions"],lW=/^[\w.-]+\.[a-z]{2,}(\/\S*)?$/i,cW=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}.*)?$/,uW=new Set(["true","1","yes","checked"]),dW=new Set(["true","false","1","0","yes","no","checked","unchecked"]);function bo(t,e){const n=Ee.c(3);let o;n[0]!==e||n[1]!==t?(o=()=>e(t.getState()),n[0]=e,n[1]=t,n[2]=o):o=n[2];const a=o;return v.useSyncExternalStore(t.subscribe,a,a)}function fW({data:t,columns:e,rowHeight:n=oW,overscan:o=rW,dir:a,initialState:i,...l}){const u=_f(a),d=v.useRef(null),f=v.useRef(null),g=v.useRef(null),m=v.useRef(null),p=v.useRef(new Map),x=v.useRef(new Map),w=v.useRef(null),E=v.useRef(!1),S=au({...l,data:t,columns:e,initialState:i}),M=bp(()=>new Set),N=bp(()=>({sorting:i?.sorting??[],columnFilters:i?.columnFilters??[],rowHeight:n,rowSelection:i?.rowSelection??{},selectionState:{selectedCells:new Set,selectionRange:null,isSelecting:!1},focusedCell:null,editingCell:null,cutCells:new Set,contextMenu:{open:!1,x:0,y:0},searchQuery:"",searchMatches:[],matchIndex:-1,searchOpen:!1,lastClickedRowIndex:null,pasteDialog:{open:!1,rowsNeeded:0,clipboardText:""}})),C=v.useMemo(()=>{let Q=!1,re=!1;return{subscribe:le=>(M.current.add(le),()=>M.current.delete(le)),getState:()=>N.current,setState:(le,ye)=>{Object.is(N.current[le],ye)||(N.current[le]=ye,Q?re=!0:re||(re=!0,queueMicrotask(()=>{re=!1,C.notify()})))},notify:()=>{for(const le of M.current)le()},batch:le=>{if(Q){le();return}Q=!0;const ye=re;re=!1;try{le()}finally{Q=!1,(re||ye)&&(re=!1,C.notify())}}}},[M,N]),R=bo(C,Q=>Q.focusedCell),D=bo(C,Q=>Q.editingCell),T=bo(C,Q=>Q.selectionState),k=bo(C,Q=>Q.searchQuery),j=bo(C,Q=>Q.searchMatches),$=bo(C,Q=>Q.matchIndex),K=bo(C,Q=>Q.searchOpen),U=bo(C,Q=>Q.sorting),Y=bo(C,Q=>Q.columnFilters),Z=bo(C,Q=>Q.rowSelection),P=bo(C,Q=>Q.rowHeight),q=bo(C,Q=>Q.contextMenu),A=bo(C,Q=>Q.pasteDialog),B=t0(P),L=bp(()=>new Map),F=v.useMemo(()=>{const Q=T.selectedCells;if(Q.size===0)return L.current.clear(),null;const re=new Map;for(const ye of Q){const{rowIndex:xe}=Bo(ye);let Me=re.get(xe);Me||(Me=new Set,re.set(xe,Me)),Me.add(ye)}const le=new Map;for(const[ye,xe]of re){const Me=L.current.get(ye);Me&&Me.size===xe.size&&[...xe].every(Ie=>Me.has(Ie))?le.set(ye,Me):le.set(ye,xe)}return L.current=le,le},[T.selectedCells,L]),X=v.useRef(null),I=v.useCallback(Q=>{const re=f.current?.getRowModel().rows;if(re){if(X.current?.rows!==re){const le=new Map;for(const[ye,xe]of re.entries())le.set(xe.id,ye+1);X.current={rows:re,map:le}}return X.current.map.get(Q)}},[]),z=v.useMemo(()=>e.map(Q=>{if(Q.id)return Q.id;if("accessorKey"in Q)return Q.accessorKey}).filter(Q=>!!Q),[e]),H=v.useMemo(()=>z.filter(Q=>!pC.includes(Q)),[z]),G=v.useCallback(Q=>{if(S.current.readOnly)return;const re=Array.isArray(Q)?Q:[Q];if(re.length===0)return;const le=f.current,ye=S.current.data,xe=le?.getRowModel().rows,Me=new Map;for(const be of re)if(!xe||!le){const Re=Me.get(be.rowIndex)??[];Re.push({columnId:be.columnId,value:be.value}),Me.set(be.rowIndex,Re)}else{const Re=xe[be.rowIndex];if(!Re)continue;const ke=Re.original,Ae=ye.indexOf(ke),ve=Ae!==-1?Ae:be.rowIndex,Oe=Me.get(ve)??[];Oe.push({columnId:be.columnId,value:be.value}),Me.set(ve,Oe)}const Ie=xe?.length??ye.length,je=new Array(Ie);for(let be=0;be<Ie;be++){const Re=Me.get(be),ke=ye[be],Ae=xe?.[be];if(Re){const Oe={...ke??Ae?.original??{}};for(const{columnId:ot,value:St}of Re)Oe[ot]=St;je[be]=Oe}else je[be]=ke??Ae?.original??{}}S.current.onDataChange?.(je)},[S]),J=v.useCallback((Q,re)=>C.getState().selectionState.selectedCells.has(tn(Q,re)),[C]),ae=v.useCallback(()=>{C.batch(()=>{C.setState("selectionState",{selectedCells:new Set,selectionRange:null,isSelecting:!1}),C.setState("rowSelection",{})})},[C]),W=v.useCallback(()=>{const Q=new Set,ye=(f.current?.getRowModel().rows??[]).length??S.current.data.length;for(let Ie=0;Ie<ye;Ie++)for(const je of z)Q.add(tn(Ie,je));const xe=z[0],Me=z[z.length-1];C.setState("selectionState",{selectedCells:Q,selectionRange:z.length>0&&ye>0&&xe&&Me?{start:{rowIndex:0,columnId:xe},end:{rowIndex:ye-1,columnId:Me}}:null,isSelecting:!1})},[z,S,C]),ee=v.useCallback(Q=>{const ye=(f.current?.getRowModel().rows??[]).length??S.current.data.length;if(ye===0)return;const xe=new Set;for(let Me=0;Me<ye;Me++)xe.add(tn(Me,Q));C.setState("selectionState",{selectedCells:xe,selectionRange:{start:{rowIndex:0,columnId:Q},end:{rowIndex:ye-1,columnId:Q}},isSelecting:!1})},[S,C]),oe=v.useCallback((Q,re,le=!1)=>{const ye=z.indexOf(Q.columnId),xe=z.indexOf(re.columnId),Me=Math.min(Q.rowIndex,re.rowIndex),Ie=Math.max(Q.rowIndex,re.rowIndex),je=Math.min(ye,xe),be=Math.max(ye,xe),Re=new Set;for(let ke=Me;ke<=Ie;ke++)for(let Ae=je;Ae<=be;Ae++){const ve=z[Ae];ve&&Re.add(tn(ke,ve))}C.setState("selectionState",{selectedCells:Re,selectionRange:{start:Q,end:re},isSelecting:le})},[z,C]),de=v.useCallback(async()=>{const Q=C.getState();let re;if(Q.selectionState.selectedCells.size)re=Array.from(Q.selectionState.selectedCells);else{if(!Q.focusedCell)return;re=[tn(Q.focusedCell.rowIndex,Q.focusedCell.columnId)]}const ye=f.current?.getRowModel().rows;if(!ye)return;const xe=[];for(const ve of re){const{columnId:Oe}=Bo(ve);Oe&&!xe.includes(Oe)&&xe.push(Oe)}const Me=new Map;for(const ve of re){const{rowIndex:Oe,columnId:ot}=Bo(ve),St=ye[Oe];if(St){const Mt=St.getVisibleCells().find(lt=>lt.column.id===ot);if(Mt){const lt=Mt.getValue(),It=Mt.column.columnDef?.meta?.cell?.variant;let rt="";It==="file"||It==="multi-select"?rt=lt?JSON.stringify(lt):"":lt instanceof Date?rt=lt.toISOString():rt=String(lt??""),Me.set(ve,rt)}}}const Ie=new Set,je=new Set;for(const ve of re){const{rowIndex:Oe,columnId:ot}=Bo(ve);Ie.add(Oe);const St=xe.indexOf(ot);St>=0&&je.add(St)}const be=Array.from(Ie).sort((ve,Oe)=>ve-Oe),ke=Array.from(je).sort((ve,Oe)=>ve-Oe).map(ve=>xe[ve]),Ae=be.map(ve=>ke.map(Oe=>{const ot=`${ve}:${Oe}`;return Me.get(ot)??""}).join(" ")).join(`
|
|
68
|
+
`);try{await navigator.clipboard.writeText(Ae),C.getState().cutCells.size>0&&C.setState("cutCells",new Set),En.success(`${re.length} cell${re.length!==1?"s":""} copied`)}catch(ve){En.error(ve instanceof Error?ve.message:"Failed to copy to clipboard")}},[C]),ge=v.useCallback(async()=>{if(S.current.readOnly)return;const Q=C.getState();let re;if(Q.selectionState.selectedCells.size)re=Array.from(Q.selectionState.selectedCells);else{if(!Q.focusedCell)return;re=[tn(Q.focusedCell.rowIndex,Q.focusedCell.columnId)]}const ye=f.current?.getRowModel().rows;if(!ye)return;const xe=[];for(const ve of re){const{columnId:Oe}=Bo(ve);Oe&&!xe.includes(Oe)&&xe.push(Oe)}const Me=new Map;for(const ve of re){const{rowIndex:Oe,columnId:ot}=Bo(ve),St=ye[Oe];if(St){const Mt=St.getVisibleCells().find(lt=>lt.column.id===ot);if(Mt){const lt=Mt.getValue(),It=Mt.column.columnDef?.meta?.cell?.variant;let rt="";It==="file"||It==="multi-select"?rt=lt?JSON.stringify(lt):"":lt instanceof Date?rt=lt.toISOString():rt=String(lt??""),Me.set(ve,rt)}}}const Ie=new Set,je=new Set;for(const ve of re){const{rowIndex:Oe,columnId:ot}=Bo(ve);Ie.add(Oe);const St=xe.indexOf(ot);St>=0&&je.add(St)}const be=Array.from(Ie).sort((ve,Oe)=>ve-Oe),ke=Array.from(je).sort((ve,Oe)=>ve-Oe).map(ve=>xe[ve]),Ae=be.map(ve=>ke.map(Oe=>{const ot=`${ve}:${Oe}`;return Me.get(ot)??""}).join(" ")).join(`
|
|
69
|
+
`);try{await navigator.clipboard.writeText(Ae),C.setState("cutCells",new Set(re)),En.success(`${re.length} cell${re.length!==1?"s":""} cut`)}catch(ve){En.error(ve instanceof Error?ve.message:"Failed to cut to clipboard")}},[C,S]),ne=v.useCallback(Q=>{Q&&document.activeElement!==Q&&requestAnimationFrame(()=>{Q.focus()})},[]),_e=v.useCallback(async(Q=!1)=>{if(S.current.readOnly)return;const re=C.getState();if(!re.focusedCell)return;const le=f.current,ye=le?.getRowModel().rows;if(ye)try{let xe=re.pasteDialog.clipboardText;if(!xe&&(xe=await navigator.clipboard.readText(),!xe))return;const Ie=xe.split(`
|
|
70
|
+
`).filter(Pt=>Pt.length>0).map(Pt=>Pt.split(" ")),je=re.focusedCell.rowIndex,be=H.indexOf(re.focusedCell.columnId);if(be===-1)return;const Re=ye.length??S.current.data.length,ke=je+Ie.length-Re;if(ke>0&&!Q&&S.current.onRowAdd&&!re.pasteDialog.clipboardText){C.setState("pasteDialog",{open:!0,rowsNeeded:ke,clipboardText:xe});return}if(Q&&ke>0){const Pt=Re+ke;if(S.current.onRowsAdd)await S.current.onRowsAdd(ke);else if(S.current.onRowAdd)for(let Qt=0;Qt<ke;Qt++)await S.current.onRowAdd();let Yn=0;const kn=50;let Ln=f.current?.getRowModel().rows.length??0;for(;Ln<Pt&&Yn<kn;)await new Promise(Qt=>setTimeout(Qt,100)),Ln=f.current?.getRowModel().rows.length??0,Yn++}const Ae=[],ve=le?.getAllColumns()??[];let Oe=0,ot=je,St=be;const It=f.current?.getRowModel().rows?.length??0;let rt=0;const ht=new Map(ve.map(Pt=>[Pt.id,Pt]));for(let Pt=0;Pt<Ie.length;Pt++){const Yn=Ie[Pt];if(!Yn)continue;const kn=je+Pt;if(kn>=It)break;for(let Ln=0;Ln<Yn.length;Ln++){const Qt=be+Ln;if(Qt>=H.length)break;const kr=H[Qt];if(!kr)continue;const Ze=Yn[Ln]??"",lr=ht.get(kr)?.columnDef?.meta?.cell,rs=lr?.variant;let At=Ze,Jn=!1;switch(rs){case"number":{if(!Ze)At=null;else{const Xt=Number.parseFloat(Ze);Number.isNaN(Xt)?Jn=!0:At=Xt}break}case"checkbox":{if(!Ze)At=!1;else{const Xt=Ze.toLowerCase();dW.has(Xt)?At=uW.has(Xt):Jn=!0}break}case"date":{if(!Ze)At=null;else{const Xt=new Date(Ze);Number.isNaN(Xt.getTime())?Jn=!0:At=Xt}break}case"select":{const Xt=lr?.options??[];if(!Ze)At="";else{const Nt=jS(Ze,Xt);Nt?At=Nt:Jn=!0}break}case"multi-select":{const Xt=lr?.options??[];let Nt=[];try{const Or=JSON.parse(Ze);Array.isArray(Or)&&(Nt=Or.filter(uu=>typeof uu=="string"))}catch{Nt=Ze?Ze.split(",").map(Or=>Or.trim()):[]}const fa=Nt.map(Or=>jS(Or,Xt)).filter(Boolean);Nt.length>0&&fa.length===0?Jn=!0:At=fa;break}case"file":{if(!Ze)At=[];else try{const Xt=JSON.parse(Ze);if(!Array.isArray(Xt))Jn=!0;else{const Nt=Xt.filter(AS);Xt.length>0&&Nt.length===0?Jn=!0:At=Nt}}catch{Jn=!0}break}case"url":{if(!Ze)At="";else{const Xt=Ze[0];if(Xt==="["||Xt==="{")Jn=!0;else try{new URL(Ze),At=Ze}catch{lW.test(Ze)?At=Ze:Jn=!0}}break}default:{if(!Ze){At="";break}if(cW.test(Ze)){const Nt=new Date(Ze);if(!Number.isNaN(Nt.getTime())){At=Nt.toLocaleDateString();break}}const Xt=Ze[0];if(Xt==="["||Xt==="{"||Xt==="t"||Xt==="f")try{const Nt=JSON.parse(Ze);Array.isArray(Nt)?Nt.length>0&&Nt.every(AS)?At=Nt.map(fa=>fa.name).join(", "):Nt.every(fa=>typeof fa=="string")&&(At=Nt.join(", ")):typeof Nt=="boolean"&&(At=Nt?"Checked":"Unchecked")}catch{const Nt=Ze.toLowerCase();(Nt==="true"||Nt==="false")&&(At=Nt==="true"?"Checked":"Unchecked")}}}if(Jn){rt++,ot=Math.max(ot,kn),St=Math.max(St,Qt);continue}Ae.push({rowIndex:kn,columnId:kr,value:At}),Oe++,ot=Math.max(ot,kn),St=Math.max(St,Qt)}}if(Ae.length>0){S.current.onPaste&&await S.current.onPaste(Ae);const Pt=[...Ae];if(re.cutCells.size>0){for(const kn of re.cutCells){const{rowIndex:Ln,columnId:Qt}=Bo(kn),Ze=ve.find(lr=>lr.id===Qt)?.columnDef?.meta?.cell?.variant;let fo="";Ze==="multi-select"||Ze==="file"?fo=[]:Ze==="number"||Ze==="date"?fo=null:Ze==="checkbox"&&(fo=!1),Pt.push({rowIndex:Ln,columnId:Qt,value:fo})}C.setState("cutCells",new Set)}G(Pt),rt>0?En.success(`${Oe} cell${Oe!==1?"s":""} pasted, ${rt} skipped`):En.success(`${Oe} cell${Oe!==1?"s":""} pasted`);const Yn=H[St];Yn&&oe({rowIndex:je,columnId:re.focusedCell.columnId},{rowIndex:ot,columnId:Yn}),ne(d.current)}else rt>0&&En.error(`${rt} cell${rt!==1?"s":""} skipped pasting for invalid data`);re.pasteDialog.open&&C.setState("pasteDialog",{open:!1,rowsNeeded:0,clipboardText:""})}catch(xe){En.error(xe instanceof Error?xe.message:"Failed to paste. Please try again.")}},[C,H,S,G,oe,ne]),De=v.useCallback((Q=!1)=>{if(Q){E.current=!1;return}setTimeout(()=>{E.current=!1},300)},[]),Ye=v.useCallback((Q,re)=>{E.current=!0,requestAnimationFrame(()=>{const le=tn(Q,re),ye=x.current.get(le);if(!ye){const xe=d.current;xe&&xe.focus(),De();return}ye.focus(),De()})},[De]),Pe=v.useCallback((Q,re)=>{C.batch(()=>{C.setState("focusedCell",{rowIndex:Q,columnId:re}),C.setState("editingCell",null)}),!C.getState().searchOpen&&Ye(Q,re)},[C,Ye]),mt=v.useCallback(async Q=>{if(S.current.readOnly||!S.current.onRowsDelete||Q.length===0)return;const le=f.current?.getRowModel().rows;if(!le||le.length===0)return;const xe=C.getState().focusedCell?.columnId??H[0],Me=Math.min(...Q),Ie=[];for(const je of Q){const be=le[je];be&&Ie.push(be.original)}await S.current.onRowsDelete(Ie,Q),C.batch(()=>{C.setState("selectionState",{selectedCells:new Set,selectionRange:null,isSelecting:!1}),C.setState("rowSelection",{}),C.setState("editingCell",null)}),requestAnimationFrame(()=>{const Re=(f.current?.getRowModel().rows??[]).length??S.current.data.length;if(Re>0&&xe){const ke=Math.min(Me,Re-1);Pe(ke,xe)}})},[S,C,H,Pe]),sn=v.useCallback(Q=>{const re=C.getState();if(!re.focusedCell)return;const{rowIndex:le,columnId:ye}=re.focusedCell,xe=H.indexOf(ye),Me=g.current,be=(f.current?.getRowModel().rows??[]).length??S.current.data.length;let Re=le,ke=ye;const Ae=u==="rtl";switch(Q){case"up":Re=Math.max(0,le-1);break;case"down":Re=Math.min(be-1,le+1);break;case"left":if(Ae){if(xe<H.length-1){const ve=H[xe+1];ve&&(ke=ve)}}else if(xe>0){const ve=H[xe-1];ve&&(ke=ve)}break;case"right":if(Ae){if(xe>0){const ve=H[xe-1];ve&&(ke=ve)}}else if(xe<H.length-1){const ve=H[xe+1];ve&&(ke=ve)}break;case"home":H.length>0&&(ke=H[0]??ye);break;case"end":H.length>0&&(ke=H[H.length-1]??ye);break;case"ctrl+home":Re=0,H.length>0&&(ke=H[0]??ye);break;case"ctrl+end":Re=Math.max(0,be-1),H.length>0&&(ke=H[H.length-1]??ye);break;case"ctrl+up":Re=0;break;case"ctrl+down":Re=Math.max(0,be-1);break;case"pageup":if(Me){const Oe=Me.getVirtualItems().length??10;Re=Math.max(0,le-Oe)}else Re=Math.max(0,le-10);break;case"pagedown":if(Me){const Oe=Me.getVirtualItems().length??10;Re=Math.min(be-1,le+Oe)}else Re=Math.min(be-1,le+10);break;case"pageleft":if(xe>0){const ve=Math.max(0,xe-mC),Oe=H[ve];Oe&&(ke=Oe)}break;case"pageright":if(xe<H.length-1){const ve=Math.min(H.length-1,xe+mC),Oe=H[ve];Oe&&(ke=Oe)}break}if(Re!==le||ke!==ye){Pe(Re,ke);const ve=d.current;if(!ve)return;const Oe=p.current.get(Re),ot=tn(Re,ke),St=x.current.get(ot);if(!Oe){if(Me){const Mt=Q==="up"||Q==="pageup"||Q==="ctrl+up"||Q==="ctrl+home"?"start":Q==="down"||Q==="pagedown"||Q==="ctrl+down"||Q==="ctrl+end"?"end":"center";Me.scrollToIndex(Re,{align:Mt}),ke!==ye&&requestAnimationFrame(()=>{const lt=tn(Re,ke),It=x.current.get(lt);if(It){const rt=zS(Q);Ni({container:ve,targetCell:It,tableRef:f,viewportOffset:Ho,direction:rt,isRtl:u==="rtl"})}})}else{const Mt=t0(P),lt=Re*Mt;ve.scrollTop=lt}return}Re!==le&&Oe&&requestAnimationFrame(()=>{const Mt=ve.getBoundingClientRect(),lt=m.current?.getBoundingClientRect().height??0,It=w.current?.getBoundingClientRect().height??0,rt=Mt.top+lt+Ho,ht=Mt.bottom-It-Ho,Pt=Oe.getBoundingClientRect();Pt.top>=rt&&Pt.bottom<=ht||(Q==="up"||Q==="down"||Q==="pageup"||Q==="pagedown"||Q==="ctrl+up"||Q==="ctrl+down"||Q==="ctrl+home"||Q==="ctrl+end")&&(Q==="down"||Q==="pagedown"||Q==="ctrl+down"||Q==="ctrl+end"?ve.scrollTop+=Pt.bottom-ht:ve.scrollTop-=rt-Pt.top)}),ke!==ye&&St&&requestAnimationFrame(()=>{const Mt=zS(Q);Ni({container:ve,targetCell:St,tableRef:f,viewportOffset:Ho,direction:Mt,isRtl:u==="rtl"})})}},[u,C,H,Pe,S,P]),ft=v.useCallback((Q,re)=>{S.current.readOnly||C.batch(()=>{C.setState("focusedCell",{rowIndex:Q,columnId:re}),C.setState("editingCell",{rowIndex:Q,columnId:re})})},[C,S]),xn=v.useCallback(Q=>{const le=C.getState().editingCell;if(C.setState("editingCell",null),Q?.moveToNextRow&&le){const{rowIndex:ye,columnId:xe}=le,je=(f.current?.getRowModel().rows??[]).length??S.current.data.length,be=ye+1;be<je&&requestAnimationFrame(()=>{Pe(be,xe)})}else if(Q?.direction&&le){const{rowIndex:ye,columnId:xe}=le;Pe(ye,xe),requestAnimationFrame(()=>{sn(Q.direction??"right")})}else if(le){const{rowIndex:ye,columnId:xe}=le;Ye(ye,xe)}},[C,S,Pe,sn,Ye]),ln=v.useCallback(Q=>{if(Q){C.setState("searchOpen",!0);return}const re=C.getState(),le=re.matchIndex>=0&&re.searchMatches[re.matchIndex];C.batch(()=>{C.setState("searchOpen",!1),C.setState("searchQuery",""),C.setState("searchMatches",[]),C.setState("matchIndex",-1),le&&C.setState("focusedCell",{rowIndex:le.rowIndex,columnId:le.columnId})}),d.current&&document.activeElement!==d.current&&d.current.focus()},[C]),Ft=v.useCallback(Q=>{if(!Q.trim()){C.batch(()=>{C.setState("searchMatches",[]),C.setState("matchIndex",-1)});return}const re=[],ye=f.current?.getRowModel().rows??[],xe=Q.toLowerCase();for(let Me=0;Me<ye.length;Me++){const Ie=ye[Me];if(Ie)for(const je of z){const be=Ie.getVisibleCells().find(Ae=>Ae.column.id===je);if(!be)continue;const Re=be.getValue();String(Re??"").toLowerCase().includes(xe)&&re.push({rowIndex:Me,columnId:je})}}if(C.batch(()=>{C.setState("searchMatches",re),C.setState("matchIndex",re.length>0?0:-1)}),re.length>0&&re[0]){const Me=re[0];g.current?.scrollToIndex(Me.rowIndex,{align:"center"})}},[z,C]),fn=v.useCallback(Q=>C.setState("searchQuery",Q),[C]),zt=v.useCallback(()=>{const Q=C.getState();if(Q.searchMatches.length===0)return;const re=Q.matchIndex-1<0?Q.searchMatches.length-1:Q.matchIndex-1,le=Q.searchMatches[re];le&&(g.current?.scrollToIndex(le.rowIndex,{align:"center"}),requestAnimationFrame(()=>{C.setState("matchIndex",re),requestAnimationFrame(()=>{Pe(le.rowIndex,le.columnId)})}))},[C,Pe]),Nn=v.useCallback(()=>{const Q=C.getState();if(Q.searchMatches.length===0)return;const re=(Q.matchIndex+1)%Q.searchMatches.length,le=Q.searchMatches[re];le&&(g.current?.scrollToIndex(le.rowIndex,{align:"center"}),requestAnimationFrame(()=>{C.setState("matchIndex",re),requestAnimationFrame(()=>{Pe(le.rowIndex,le.columnId)})}))},[C,Pe]),gn=v.useCallback((Q,re)=>C.getState().searchMatches.some(ye=>ye.rowIndex===Q&&ye.columnId===re),[C]),In=v.useCallback((Q,re)=>{const le=C.getState();if(le.matchIndex<0)return!1;const ye=le.searchMatches[le.matchIndex];return ye?.rowIndex===Q&&ye?.columnId===re},[C]),jn=v.useMemo(()=>{if(j.length===0)return null;const Q=new Map;for(const re of j){let le=Q.get(re.rowIndex);le||(le=new Set,Q.set(re.rowIndex,le)),le.add(re.columnId)}return Q},[j]),Ce=v.useMemo(()=>$<0||j.length===0?null:j[$]??null,[j,$]),Ve=v.useCallback(()=>{C.getState().editingCell&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),C.batch(()=>{C.setState("focusedCell",null),C.setState("editingCell",null)})},[C]),Et=v.useCallback((Q,re,le)=>{if(le?.button===2)return;const ye=C.getState(),xe=ye.focusedCell;function Me(){requestAnimationFrame(()=>{const be=d.current,Re=tn(Q,re),ke=x.current.get(Re);be&&ke&&Ni({container:be,targetCell:ke,tableRef:f,viewportOffset:Ho,isRtl:u==="rtl"})})}if(le){if(le.ctrlKey||le.metaKey){le.preventDefault();const be=tn(Q,re),Re=new Set(ye.selectionState.selectedCells);Re.has(be)?Re.delete(be):Re.add(be),C.setState("selectionState",{selectedCells:Re,selectionRange:null,isSelecting:!1}),Pe(Q,re),Me();return}if(le.shiftKey&&ye.focusedCell){le.preventDefault(),oe(ye.focusedCell,{rowIndex:Q,columnId:re}),Me();return}}const Ie=ye.selectionState.selectedCells.size>0,je=Object.keys(ye.rowSelection).length>0;if(Ie&&!ye.selectionState.isSelecting){const be=tn(Q,re);if(!ye.selectionState.selectedCells.has(be))ae();else{Pe(Q,re),Me();return}}else je&&re!=="select"&&ae();xe?.rowIndex===Q&&xe?.columnId===re?ft(Q,re):(Pe(Q,re),Me())},[C,Pe,ft,oe,ae,u]),Xe=v.useCallback((Q,re,le)=>{le?.defaultPrevented||ft(Q,re)},[ft]),at=v.useCallback((Q,re,le)=>{if(le.button!==2&&(le.preventDefault(),!le.ctrlKey&&!le.metaKey&&!le.shiftKey)){const ye=tn(Q,re);C.batch(()=>{C.setState("selectionState",{selectedCells:S.current.enableSingleCellSelection?new Set([ye]):new Set,selectionRange:{start:{rowIndex:Q,columnId:re},end:{rowIndex:Q,columnId:re}},isSelecting:!0}),C.setState("rowSelection",{})})}},[C,S]),gt=v.useCallback((Q,re)=>{const le=C.getState();if(le.selectionState.isSelecting&&le.selectionState.selectionRange){const ye=le.selectionState.selectionRange.start,xe={rowIndex:Q,columnId:re};(le.focusedCell?.rowIndex!==ye.rowIndex||le.focusedCell?.columnId!==ye.columnId)&&Pe(ye.rowIndex,ye.columnId),oe(ye,xe,!0)}},[C,oe,Pe]),qt=v.useCallback(()=>{const Q=C.getState();C.setState("selectionState",{...Q.selectionState,isSelecting:!1})},[C]),Wt=v.useCallback((Q,re,le)=>{le.preventDefault(),le.stopPropagation();const ye=C.getState(),xe=tn(Q,re);ye.selectionState.selectedCells.has(xe)||C.batch(()=>{C.setState("selectionState",{selectedCells:new Set([xe]),selectionRange:{start:{rowIndex:Q,columnId:re},end:{rowIndex:Q,columnId:re}},isSelecting:!1}),C.setState("focusedCell",{rowIndex:Q,columnId:re})}),C.setState("contextMenu",{open:!0,x:le.clientX,y:le.clientY})},[C]),Qn=v.useCallback(Q=>{if(!Q){const re=C.getState().contextMenu;C.setState("contextMenu",{open:!1,x:re.x,y:re.y})}},[C]),_t=v.useCallback(Q=>{const re=C.getState(),le=typeof Q=="function"?Q(re.sorting):Q;C.setState("sorting",le),S.current.onSortingChange?.(le)},[C,S]),Be=v.useCallback(Q=>{const re=C.getState(),le=typeof Q=="function"?Q(re.columnFilters):Q;C.setState("columnFilters",le),S.current.onColumnFiltersChange?.(le)},[C,S]),nt=v.useCallback(Q=>{const re=C.getState(),le=typeof Q=="function"?Q(re.rowSelection):Q,ye=Object.keys(le).filter(Ie=>le[Ie]),xe=new Set,Me=f.current?.getRowModel().rows??[];for(const Ie of ye){const je=Me.findIndex(be=>be.id===Ie);if(je!==-1)for(const be of z)xe.add(tn(je,be))}C.batch(()=>{C.setState("rowSelection",le),C.setState("selectionState",{selectedCells:xe,selectionRange:null,isSelecting:!1}),C.setState("focusedCell",null),C.setState("editingCell",null)})},[C,z]),Ue=v.useCallback((Q,re,le)=>{const ye=C.getState(),xe=f.current?.getRowModel().rows??[],Me=xe[Q];if(Me){if(le&&ye.lastClickedRowIndex!==null){const Ie=Math.min(ye.lastClickedRowIndex,Q),je=Math.max(ye.lastClickedRowIndex,Q),be={...ye.rowSelection};for(let Re=Ie;Re<=je;Re++){const ke=xe[Re];ke&&(be[ke.id]=re)}nt(be)}else nt({...ye.rowSelection,[Me.id]:re});C.setState("lastClickedRowIndex",Q)}},[C,nt]),st=v.useCallback(Q=>{const re=C.getState(),le=typeof Q=="function"?Q(re.rowHeight):Q;C.setState("rowHeight",le),S.current.onRowHeightChange?.(le)},[C,S]),Lt=v.useCallback(Q=>{if(!S.current.enableColumnSelection){ae();return}ee(Q)},[S,ee,ae]),Te=v.useCallback(Q=>{Q||C.setState("pasteDialog",{open:!1,rowsNeeded:0,clipboardText:""})},[C]),Ot=v.useMemo(()=>({minSize:sW,maxSize:iW}),[]),Kt=v.useMemo(()=>({...S.current.meta,dataGridRef:d,cellMapRef:x,get focusedCell(){return C.getState().focusedCell},get editingCell(){return C.getState().editingCell},get selectionState(){return C.getState().selectionState},get searchOpen(){return C.getState().searchOpen},get contextMenu(){return C.getState().contextMenu},get pasteDialog(){return C.getState().pasteDialog},get rowHeight(){return C.getState().rowHeight},get readOnly(){return S.current.readOnly},getIsCellSelected:J,getIsSearchMatch:gn,getIsActiveSearchMatch:In,getVisualRowIndex:I,onRowHeightChange:st,onRowSelect:Ue,onDataUpdate:G,onRowsDelete:S.current.onRowsDelete?mt:void 0,onColumnClick:Lt,onCellClick:Et,onCellDoubleClick:Xe,onCellMouseDown:at,onCellMouseEnter:gt,onCellMouseUp:qt,onCellContextMenu:Wt,onCellEditingStart:ft,onCellEditingStop:xn,onCellsCopy:de,onCellsCut:ge,onCellsPaste:_e,onSelectionClear:ae,onFilesUpload:S.current.onFilesUpload?S.current.onFilesUpload:void 0,onFilesDelete:S.current.onFilesDelete?S.current.onFilesDelete:void 0,onContextMenuOpenChange:Qn,onPasteDialogOpenChange:Te}),[S,C,J,gn,In,I,st,Ue,G,mt,Lt,Et,Xe,at,gt,qt,Wt,ft,xn,de,ge,_e,ae,Qn,Te]),cn=v.useMemo(()=>Lq(),[]),Pn=v.useMemo(()=>Fq(),[]),Dt=v.useMemo(()=>Vq(),[]),Rn=v.useMemo(()=>({...S.current.state,sorting:U,columnFilters:Y,rowSelection:Z}),[S,U,Y,Z]),Yo=v.useMemo(()=>({...S.current,data:t,columns:e,defaultColumn:Ot,initialState:S.current.initialState,state:Rn,onRowSelectionChange:nt,onSortingChange:_t,onColumnFiltersChange:Be,columnResizeMode:"onChange",columnResizeDirection:u,getCoreRowModel:cn,getFilteredRowModel:Pn,getSortedRowModel:Dt,meta:Kt}),[S,t,e,Ot,Rn,u,nt,_t,Be,cn,Pn,Dt,Kt]),vt=Uq(Yo);f.current||(f.current=vt);const Dn=v.useMemo(()=>{const Q=vt.getFlatHeaders(),re={};for(const le of Q)re[`--header-${le.id}-size`]=le.getSize(),re[`--col-${le.column.id}-size`]=le.column.getSize();return re},[vt.getState().columnSizingInfo,vt.getState().columnSizing]),To=v.useSyncExternalStore(v.useCallback(()=>()=>{},[]),v.useCallback(()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.userAgent.indexOf("Firefox")!==-1,[]),v.useCallback(()=>!1,[])),Un=v.useMemo(()=>{const Q=vt.getState().columnPinning;return To&&((Q.left?.length??0)>0||(Q.right?.length??0)>0)},[To,vt.getState().columnPinning]),co=nW({count:vt.getRowModel().rows.length,getScrollElement:()=>d.current,estimateSize:()=>B,overscan:o,measureElement:To?void 0:Q=>Q?.getBoundingClientRect().height});g.current||(g.current=co);const Dr=v.useCallback(async Q=>{const re=Q?.rowIndex??0,le=Q?.columnId;E.current=!0;const ye=S.current.columns.map(Ie=>{if(Ie.id)return Ie.id;if("accessorKey"in Ie)return Ie.accessorKey}).filter(Ie=>!!Ie).filter(Ie=>!pC.includes(Ie)),xe=le??ye[0];if(!xe){De(!0);return}async function Me(Ie){if(!xe)return;const je=S.current.data.length;if(re>=je&&Ie>0){await new Promise(ot=>setTimeout(ot,50)),await Me(Ie-1);return}const be=Math.min(re,Math.max(0,je-1)),Re=be>je/2;co.scrollToIndex(be,{align:Re?"end":"start"}),await new Promise(ot=>requestAnimationFrame(ot));const ke=d.current,Ae=p.current.get(be);if(ke&&Ae){const ot=ke.getBoundingClientRect(),St=m.current?.getBoundingClientRect().height??0,Mt=w.current?.getBoundingClientRect().height??0,lt=ot.top+St+Ho,It=ot.bottom-Mt-Ho,rt=Ae.getBoundingClientRect();rt.top>=lt&&rt.bottom<=It||(rt.top<lt?ke.scrollTop-=lt-rt.top:rt.bottom>It&&(ke.scrollTop+=rt.bottom-It))}C.batch(()=>{C.setState("focusedCell",{rowIndex:be,columnId:xe}),C.setState("editingCell",null)});const ve=tn(be,xe),Oe=x.current.get(ve);Oe?(Oe.focus(),De()):Ie>0?(await new Promise(ot=>requestAnimationFrame(ot)),await Me(Ie-1)):(d.current?.focus(),De())}await Me(aW)},[co,S,C,De]),uo=v.useCallback(async Q=>{if(S.current.readOnly||!S.current.onRowAdd)return;const re=S.current.data.length;let le;try{le=await S.current.onRowAdd(Q)}catch{return}if(le===null||Q?.defaultPrevented)return;ae();const ye=le.rowIndex??re,xe=le.columnId;Dr({rowIndex:ye,columnId:xe})},[S,Dr,ae]),un=v.useCallback(Q=>{const re=C.getState(),{key:le,ctrlKey:ye,metaKey:xe,shiftKey:Me,altKey:Ie}=Q,je=ye||xe;if(S.current.enableSearch&&je&&!Me&&le===gC){Q.preventDefault(),ln(!0);return}if(S.current.enableSearch&&re.searchOpen&&!re.editingCell){if(le==="Enter"){Q.preventDefault(),Me?zt():Nn();return}if(le==="Escape"){Q.preventDefault(),ln(!1);return}return}if(re.editingCell)return;if(je&&(le==="Backspace"||le==="Delete")&&!S.current.readOnly&&S.current.onRowsDelete){const Re=new Set;if(Object.keys(re.rowSelection).length>0){const ve=f.current?.getRowModel().rows??[];for(const Oe of ve)re.rowSelection[Oe.id]&&Re.add(Oe.index)}else if(re.selectionState.selectedCells.size>0)for(const Ae of re.selectionState.selectedCells){const{rowIndex:ve}=Bo(Ae);Re.add(ve)}else re.focusedCell&&Re.add(re.focusedCell.rowIndex);Re.size>0&&(Q.preventDefault(),mt(Array.from(Re)));return}if(!re.focusedCell)return;let be=null;if(je&&!Me&&le==="a"){Q.preventDefault(),W();return}if(je&&!Me&&le==="c"){Q.preventDefault(),de();return}if(je&&!Me&&le==="x"&&!S.current.readOnly){Q.preventDefault(),ge();return}if(S.current.enablePaste&&je&&!Me&&le==="v"&&!S.current.readOnly){Q.preventDefault(),_e();return}if((le==="Delete"||le==="Backspace")&&!je&&!S.current.readOnly){const Re=re.selectionState.selectedCells.size>0?Array.from(re.selectionState.selectedCells):re.focusedCell?[tn(re.focusedCell.rowIndex,re.focusedCell.columnId)]:[];if(Re.length>0){Q.preventDefault();const ke=[],ve=f.current?.getAllColumns()??[];for(const Oe of Re){const{rowIndex:ot,columnId:St}=Bo(Oe),lt=ve.find(rt=>rt.id===St)?.columnDef?.meta?.cell?.variant;let It="";lt==="multi-select"||lt==="file"?It=[]:lt==="number"||lt==="date"?It=null:lt==="checkbox"&&(It=!1),ke.push({rowIndex:ot,columnId:St,value:It})}G(ke),re.selectionState.selectedCells.size>0&&ae(),re.cutCells.size>0&&C.setState("cutCells",new Set)}return}if(le==="Enter"&&Me&&!S.current.readOnly&&S.current.onRowAdd){Q.preventDefault();const Re=S.current.data.length,ke=re.focusedCell.columnId;Promise.resolve(S.current.onRowAdd()).then(async Ae=>{if(Ae===null)return;ae();const ve=Ae.rowIndex??Re,Oe=Ae.columnId??ke;Dr({rowIndex:ve,columnId:Oe})}).catch(()=>{});return}switch(le){case"ArrowUp":if(Ie&&!je&&!Me)be="pageup";else if(je&&Me){const Re=re.selectionState.selectionRange?.end||re.focusedCell,ke=H.indexOf(Re.columnId),Ae=re.selectionState.selectionRange?.start||re.focusedCell;oe(Ae,{rowIndex:0,columnId:H[ke]??Re.columnId});const ve=g.current;ve&&ve.scrollToIndex(0,{align:"start"}),ne(d.current),Q.preventDefault();return}else je&&!Me?be="ctrl+up":be="up";break;case"ArrowDown":if(Ie&&!je&&!Me)be="pagedown";else if(je&&Me){const Re=f.current?.getRowModel().rows.length||S.current.data.length,ke=re.selectionState.selectionRange?.end||re.focusedCell,Ae=H.indexOf(ke.columnId),ve=re.selectionState.selectionRange?.start||re.focusedCell;oe(ve,{rowIndex:Math.max(0,Re-1),columnId:H[Ae]??ke.columnId});const Oe=g.current;Oe&&Oe.scrollToIndex(Math.max(0,Re-1),{align:"end"}),ne(d.current),Q.preventDefault();return}else je&&!Me?be="ctrl+down":be="down";break;case"ArrowLeft":if(je&&Me){const Re=re.selectionState.selectionRange?.end||re.focusedCell,ke=re.selectionState.selectionRange?.start||re.focusedCell,Ae=u==="rtl"?H[H.length-1]:H[0];if(Ae){oe(ke,{rowIndex:Re.rowIndex,columnId:Ae});const ve=d.current,Oe=tn(Re.rowIndex,Ae),ot=x.current.get(Oe);ve&&ot&&Ni({container:ve,targetCell:ot,tableRef:f,viewportOffset:Ho,direction:"home",isRtl:u==="rtl"}),ne(ve)}Q.preventDefault();return}else je&&!Me?be="home":be="left";break;case"ArrowRight":if(je&&Me){const Re=re.selectionState.selectionRange?.end||re.focusedCell,ke=re.selectionState.selectionRange?.start||re.focusedCell,Ae=u==="rtl"?H[0]:H[H.length-1];if(Ae){oe(ke,{rowIndex:Re.rowIndex,columnId:Ae});const ve=d.current,Oe=tn(Re.rowIndex,Ae),ot=x.current.get(Oe);ve&&ot&&Ni({container:ve,targetCell:ot,tableRef:f,viewportOffset:Ho,direction:"end",isRtl:u==="rtl"}),ne(ve)}Q.preventDefault();return}else je&&!Me?be="end":be="right";break;case"Home":be=je?"ctrl+home":"home";break;case"End":be=je?"ctrl+end":"end";break;case"PageUp":be=Ie?"pageleft":"pageup";break;case"PageDown":be=Ie?"pageright":"pagedown";break;case"Escape":Q.preventDefault(),re.selectionState.selectedCells.size>0||Object.keys(re.rowSelection).length>0?ae():Ve();return;case"Tab":Q.preventDefault(),u==="rtl"?be=Q.shiftKey?"right":"left":be=Q.shiftKey?"left":"right";break}if(be)if(Q.preventDefault(),Me&&le!=="Tab"&&re.focusedCell){const Re=re.selectionState.selectionRange?.end||re.focusedCell,ke=H.indexOf(Re.columnId);let Ae=Re.rowIndex,ve=Re.columnId;const Oe=u==="rtl",ot=f.current?.getRowModel().rows.length||S.current.data.length;switch(be){case"up":Ae=Math.max(0,Re.rowIndex-1);break;case"down":Ae=Math.min(ot-1,Re.rowIndex+1);break;case"left":if(Oe){if(ke<H.length-1){const ht=H[ke+1];ht&&(ve=ht)}}else if(ke>0){const ht=H[ke-1];ht&&(ve=ht)}break;case"right":if(Oe){if(ke>0){const ht=H[ke-1];ht&&(ve=ht)}}else if(ke<H.length-1){const ht=H[ke+1];ht&&(ve=ht)}break;case"home":H.length>0&&(ve=H[0]??ve);break;case"end":H.length>0&&(ve=H[H.length-1]??ve);break}const St=re.selectionState.selectionRange?.start||re.focusedCell;oe(St,{rowIndex:Ae,columnId:ve});const Mt=d.current,lt=p.current.get(Ae),It=tn(Ae,ve),rt=x.current.get(It);if(Ae!==Re.rowIndex&&(be==="up"||be==="down"))if(Mt&<){const ht=Mt.getBoundingClientRect(),Pt=m.current?.getBoundingClientRect().height??0,Yn=w.current?.getBoundingClientRect().height??0,kn=ht.top+Pt+Ho,Ln=ht.bottom-Yn-Ho,Qt=lt.getBoundingClientRect();if(!(Qt.top>=kn&&Qt.bottom<=Ln)){const Ze=be==="down"?Qt.bottom-Ln:kn-Qt.top;be==="down"?Mt.scrollTop+=Ze:Mt.scrollTop-=Ze,ne(Mt)}}else{const ht=g.current;if(ht){const Pt=be==="up"?"start":"end";ht.scrollToIndex(Ae,{align:Pt}),ne(Mt)}}ve!==Re.columnId&&(be==="left"||be==="right"||be==="home"||be==="end")&&Mt&&rt&&Ni({container:Mt,targetCell:rt,tableRef:f,viewportOffset:Ho,direction:be,isRtl:Oe})}else re.selectionState.selectedCells.size>0&&ae(),sn(be)},[u,C,S,Ve,sn,W,de,ge,_e,G,ae,H,oe,ln,Nn,zt,mt,ne,Dr]),Tn=v.useMemo(()=>{if(S.current.enableSearch)return{searchMatches:j,matchIndex:$,searchOpen:K,onSearchOpenChange:ln,searchQuery:k,onSearchQueryChange:fn,onSearch:Ft,onNavigateToNextMatch:Nn,onNavigateToPrevMatch:zt}},[S,j,$,K,ln,k,fn,Ft,Nn,zt]);v.useEffect(()=>{const Q=d.current;if(Q)return Q.addEventListener("keydown",un),()=>{Q.removeEventListener("keydown",un)}},[un]),v.useEffect(()=>{function Q(re){const le=d.current;if(!le)return;const ye=re.target;if(!(ye instanceof HTMLElement))return;const{key:xe,ctrlKey:Me,metaKey:Ie,shiftKey:je}=re,be=Me||Ie;if(S.current.enableSearch&&be&&!je&&xe===gC){const ke=ye.tagName==="INPUT"||ye.tagName==="TEXTAREA",Ae=le.contains(ye),ve=ye.closest('[role="search"]')!==null;if(Ae||ve||!ke){re.preventDefault(),re.stopPropagation();const Oe=!C.getState().searchOpen;ln(Oe),Oe&&!Ae&&!ve&&requestAnimationFrame(()=>{le.focus()});return}}if(le.contains(ye)&&xe==="Escape"){const ke=C.getState();(ke.selectionState.selectedCells.size>0||Object.keys(ke.rowSelection).length>0)&&(re.preventDefault(),re.stopPropagation(),ae())}}return window.addEventListener("keydown",Q,!0),()=>{window.removeEventListener("keydown",Q,!0)}},[S,ln,C,ae]),v.useEffect(()=>{const Q=C.getState(),re=S.current.autoFocus;if(re&&t.length>0&&e.length>0&&!Q.focusedCell&&H.length>0){const le=requestAnimationFrame(()=>{if(typeof re=="object"){const{rowIndex:xe,columnId:Me}=re;Me&&Pe(xe??0,Me);return}const ye=H[0];ye&&Pe(0,ye)});return()=>cancelAnimationFrame(le)}},[C,S,t,e,H,Pe]),v.useEffect(()=>{const Q=d.current;if(!Q)return;function re(le){if(E.current)return;const ye=d.current;if(!ye)return;const xe=C.getState();if(!xe.focusedCell||xe.editingCell)return;const Me=le.relatedTarget,Ie=!Me||!ye.contains(Me),je=IS(Me);if(Ie&&!je){const{rowIndex:be,columnId:Re}=xe.focusedCell,ke=tn(be,Re),Ae=x.current.get(ke);requestAnimationFrame(()=>{E.current||(Ae&&document.body.contains(Ae)?Ae.focus():ye.focus())})}}return Q.addEventListener("focusout",re),()=>{Q.removeEventListener("focusout",re)}},[C]),v.useEffect(()=>{function Q(re){if(re.button!==2&&d.current&&!d.current.contains(re.target)&&!document.elementsFromPoint(re.clientX,re.clientY).some(xe=>IS(xe))){Ve();const xe=C.getState();(xe.selectionState.selectedCells.size>0||Object.keys(xe.rowSelection).length>0)&&ae()}}return document.addEventListener("mousedown",Q),()=>{document.removeEventListener("mousedown",Q)}},[C,Ve,ae]),v.useEffect(()=>{function Q(xe){xe.preventDefault()}function re(xe){xe.preventDefault()}function le(){document.removeEventListener("selectstart",Q),document.removeEventListener("contextmenu",re),document.body.style.userSelect=""}const ye=C.subscribe(()=>{C.getState().selectionState.isSelecting?(document.addEventListener("selectstart",Q),document.addEventListener("contextmenu",re),document.body.style.userSelect="none"):le()});return()=>{le(),ye()}},[C]),KN(()=>{const Q=requestAnimationFrame(()=>{co.measure()});return()=>cancelAnimationFrame(Q)},[P,vt.getState().columnFilters,vt.getState().columnOrder,vt.getState().columnPinning,vt.getState().columnSizing,vt.getState().columnVisibility,vt.getState().expanded,vt.getState().globalFilter,vt.getState().grouping,vt.getState().rowSelection,vt.getState().sorting]);const ko=co.getTotalSize(),Tr=co.getVirtualItems(),os=co.measureElement;return v.useMemo(()=>({dataGridRef:d,headerRef:m,rowMapRef:p,footerRef:w,dir:u,table:vt,tableMeta:Kt,virtualTotalSize:ko,virtualItems:Tr,measureElement:os,columns:e,columnSizeVars:Dn,searchState:Tn,searchMatchesByRow:jn,activeSearchMatch:Ce,cellSelectionMap:F,focusedCell:R,editingCell:D,rowHeight:P,contextMenu:q,pasteDialog:A,onRowAdd:S.current.onRowAdd?uo:void 0,adjustLayout:Un}),[S,u,vt,Kt,ko,Tr,os,e,Dn,Tn,jn,Ce,F,R,D,P,q,A,uo,Un])}function hW(t){if(t.length===0)return[];const e=t[0];return!e||typeof e!="object"?[]:Object.keys(e)}function mW(t,e){const n=e?.length?e.map(l=>l.name).filter(l=>t.includes(l)):t,o=t.filter(l=>!n.includes(l)),a=[...n,...o],i=new Map(e?.map(l=>[l.name,l.type])??[]);return a.map(l=>({id:l,accessorKey:l,header:l,meta:{label:l,columnType:ru(i.get(l))||void 0,cell:{variant:"short-text"}},size:180,minSize:80,maxSize:800}))}function gW(t){const e=Ee.c(29),{data:n,columns:o,height:a,width:i,readOnly:l}=t,u=a===void 0?400:a,d=l===void 0?!0:l;let f;e[0]!==n||e[1]!==o?(f=o?.length?o.map(pW):hW(n),e[0]=n,e[1]=o,e[2]=f):f=e[2];const g=f;let m;e[3]!==g||e[4]!==o?(m=mW(g,o),e[3]=g,e[4]=o,e[5]=m):m=e[5];const p=m;let x;e[6]!==p||e[7]!==n||e[8]!==d?(x={data:n,columns:p,readOnly:d,enableSearch:!0,enableColumnSelection:!1,enableSingleCellSelection:!0,enablePaste:!1},e[6]=p,e[7]=n,e[8]=d,e[9]=x):x=e[9];const w=fW(x);if(p.length===0){let R;e[10]!==u?(R={height:u},e[10]=u,e[11]=R):R=e[11];let D;e[12]===Symbol.for("react.memo_cache_sentinel")?(D=y.jsx("p",{children:"No columns to display"}),e[12]=D):D=e[12];const T=n.length===0?"No rows in this table":"Add columns to the table schema";let k;e[13]!==T?(k=y.jsx("p",{className:"text-xs mt-1",children:T}),e[13]=T,e[14]=k):k=e[14];let j;return e[15]!==R||e[16]!==k?(j=y.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground text-sm",style:R,children:[D,k]}),e[15]=R,e[16]=k,e[17]=j):j=e[17],j}const E=i??"100%",S=i??"100%";let M;e[18]!==u||e[19]!==E||e[20]!==S?(M={height:u,width:E,maxWidth:S,boxSizing:"border-box"},e[18]=u,e[19]=E,e[20]=S,e[21]=M):M=e[21];let N;e[22]!==w||e[23]!==u||e[24]!==i?(N=y.jsx(QG,{...w,height:u,width:i}),e[22]=w,e[23]=u,e[24]=i,e[25]=N):N=e[25];let C;return e[26]!==M||e[27]!==N?(C=y.jsx("div",{className:"min-w-0 overflow-hidden",style:M,children:N}),e[26]=M,e[27]=N,e[28]=C):C=e[28],C}function pW(t){return t.name}const yW=[{id:"data",label:"Data"},{id:"definition",label:"Definition"},{id:"relationships",label:"Relationships"},{id:"rls",label:"RLS"}];function vW(t){const e=Ee.c(49),{table:n,data:o,dataLoading:a,dataError:i,rls:l,rlsLoading:u,rlsError:d}=t;let f;e[0]!==o?(f=o===void 0?[]:o,e[0]=o,e[1]=f):f=e[1];const g=f,m=a===void 0?!1:a,p=i===void 0?null:i,x=l===void 0?null:l,w=u===void 0?!1:u,E=d===void 0?null:d,[S,M]=v.useState("data"),N=v.useRef(null),[C,R]=v.useState(400),[D,T]=v.useState(void 0);let k;e[2]!==n.columns?(k=n.columns.map(EW),e[2]=n.columns,e[3]=k):k=e[3];const j=k;let $;e[4]===Symbol.for("react.memo_cache_sentinel")?($=()=>{const G=N.current;if(!G)return;const J=new ResizeObserver(W=>{const ee=W[0];if(ee){const{width:oe,height:de}=ee.contentRect;de>0&&R(de),oe>0&&T(oe)}});J.observe(G);const ae=G.getBoundingClientRect();return ae.height>0&&R(ae.height),ae.width>0&&T(ae.width),()=>J.disconnect()},e[4]=$):$=e[4];let K;e[5]!==S?(K=[S],e[5]=S,e[6]=K):K=e[6],v.useEffect($,K);let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(Kf,{className:"w-5 h-5 text-muted-foreground"}),e[7]=U):U=e[7];let Y;e[8]!==n.schema?(Y=y.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.schema,"."]}),e[8]=n.schema,e[9]=Y):Y=e[9];let Z;e[10]!==n.name?(Z=y.jsx("span",{className:"font-semibold text-card-foreground",children:n.name}),e[10]=n.name,e[11]=Z):Z=e[11];let P;e[12]!==Y||e[13]!==Z?(P=y.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[U,y.jsxs("div",{children:[Y,Z]})]}),e[12]=Y,e[13]=Z,e[14]=P):P=e[14];let q;e[15]!==S?(q=yW.map(G=>y.jsx("button",{onClick:()=>M(G.id),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${S===G.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-card-foreground"}`,children:G.label},G.id)),e[15]=S,e[16]=q):q=e[16];let A;e[17]!==q?(A=y.jsx("div",{className:"flex px-4",children:q}),e[17]=q,e[18]=A):A=e[18];let B;e[19]!==P||e[20]!==A?(B=y.jsxs("div",{className:"border-b border-border shrink-0",children:[P,A]}),e[19]=P,e[20]=A,e[21]=B):B=e[21];let L;e[22]!==S||e[23]!==g||e[24]!==p||e[25]!==m||e[26]!==j||e[27]!==C||e[28]!==D?(L=S==="data"&&y.jsx("div",{className:"p-4 flex flex-col flex-1 min-h-0 min-w-0 overflow-hidden",children:m?y.jsx("div",{className:"flex items-center justify-center flex-1 text-muted-foreground text-sm",children:y.jsx(ch,{})}):p?y.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-destructive text-sm gap-2",children:[y.jsx("p",{className:"font-medium",children:"Failed to load table data"}),y.jsx("p",{className:"text-muted-foreground",children:p})]}):y.jsx("div",{ref:N,className:"flex-1 min-h-0 min-w-0 w-full max-w-full overflow-hidden",children:y.jsx(gW,{data:g,columns:j,height:C,width:D,readOnly:!0})})}),e[22]=S,e[23]=g,e[24]=p,e[25]=m,e[26]=j,e[27]=C,e[28]=D,e[29]=L):L=e[29];let F;e[30]!==S||e[31]!==n.columns?(F=S==="definition"&&y.jsxs("div",{className:"p-4 flex-1 min-h-0 overflow-auto",children:[y.jsxs("h3",{className:"text-sm font-semibold text-card-foreground mb-4",children:["Columns (",n.columns.length,")"]}),y.jsx("div",{className:"space-y-2",children:n.columns.map(CW)})]}),e[30]=S,e[31]=n.columns,e[32]=F):F=e[32];let X;e[33]!==S||e[34]!==n.columns?(X=S==="relationships"&&y.jsxs("div",{className:"p-4 flex-1 min-h-0 overflow-auto",children:[y.jsx("h3",{className:"text-sm font-semibold text-card-foreground mb-4",children:"Foreign Keys"}),n.columns.filter(SW).length===0?y.jsx("p",{className:"text-sm text-muted-foreground",children:"No foreign key relationships"}):y.jsx("div",{className:"space-y-2",children:n.columns.filter(wW).map(bW)})]}),e[33]=S,e[34]=n.columns,e[35]=X):X=e[35];let I;e[36]!==S||e[37]!==x||e[38]!==E||e[39]!==w?(I=S==="rls"&&y.jsx("div",{className:"p-4 flex-1 min-h-0 overflow-auto",children:w?y.jsx("div",{className:"flex items-center justify-center flex-1 text-muted-foreground text-sm",children:"Loading RLS policies…"}):E?y.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-destructive text-sm gap-2",children:[y.jsx("p",{className:"font-medium",children:"Failed to load RLS info"}),y.jsx("p",{className:"text-muted-foreground",children:E})]}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex items-center gap-3 mb-6 p-3 rounded-md bg-accent/30",children:[x?.enabled?y.jsx(rI,{className:"w-5 h-5 text-emerald-500"}):y.jsx(sI,{className:"w-5 h-5 text-muted-foreground"}),y.jsxs("div",{children:[y.jsxs("div",{className:"font-medium text-card-foreground",children:["Row Level Security is"," ",x?.enabled?"enabled":"disabled"]}),x?.enabled&&x?.forced&&y.jsx("div",{className:"text-xs text-muted-foreground",children:"Force enabled (applies to table owner)"})]})]}),y.jsxs("h3",{className:"text-sm font-semibold text-card-foreground mb-4",children:["Policies (",x?.policies.length??0,")"]}),x?.policies.length?y.jsx("div",{className:"space-y-4",children:x.policies.map(xW)}):y.jsx("p",{className:"text-sm text-muted-foreground",children:x?.enabled?"No policies defined. All access is denied by default.":"No RLS policies on this table."})]})}),e[36]=S,e[37]=x,e[38]=E,e[39]=w,e[40]=I):I=e[40];let z;e[41]!==L||e[42]!==F||e[43]!==X||e[44]!==I?(z=y.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:[L,F,X,I]}),e[41]=L,e[42]=F,e[43]=X,e[44]=I,e[45]=z):z=e[45];let H;return e[46]!==B||e[47]!==z?(H=y.jsxs("div",{className:"h-full w-full min-w-0 flex flex-col",children:[B,z]}),e[46]=B,e[47]=z,e[48]=H):H=e[48],H}function xW(t){return y.jsxs("div",{className:"p-4 rounded-md border border-border bg-card",children:[y.jsxs("div",{className:"flex items-start justify-between mb-3",children:[y.jsxs("div",{children:[y.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),y.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[y.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${t.permissive==="PERMISSIVE"?"bg-emerald-500/10 text-emerald-600":"bg-amber-500/10 text-amber-600"}`,children:t.permissive}),y.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:t.command})]})]}),y.jsx("div",{className:"text-xs text-muted-foreground",children:t.roles.length===0||t.roles.includes("public")?"PUBLIC":t.roles.join(", ")})]}),t.using&&y.jsxs("div",{className:"mb-2",children:[y.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"USING"}),y.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded overflow-x-auto",children:y.jsx("code",{children:t.using})})]}),t.withCheck&&y.jsxs("div",{children:[y.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"WITH CHECK"}),y.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded overflow-x-auto",children:y.jsx("code",{children:t.withCheck})})]})]},t.name)}function bW(t){return y.jsxs("div",{className:"py-2 px-3 rounded-md bg-accent/30",children:[y.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[y.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),y.jsx("span",{className:"text-muted-foreground",children:"→"}),y.jsxs("span",{className:"text-card-foreground",children:[t.foreignKey?.toTable,".",t.foreignKey?.toColumn]})]}),y.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:t.foreignKey?.constraintName})]},t.name)}function wW(t){return t.foreignKey}function SW(t){return t.foreignKey}function CW(t){return y.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-md bg-accent/30",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),y.jsxs("div",{className:"flex items-center gap-1",children:[t.isPrimaryKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6)"},title:"Primary Key"}),t.foreignKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6)"},title:"Foreign Key"})]})]}),y.jsxs("div",{className:"text-sm text-muted-foreground",children:[ru(t.type),t.nullable&&y.jsx("span",{className:"ml-1 opacity-60",children:"(nullable)"})]})]},t.name)}function EW(t){return{name:t.name,type:t.type}}function _W(t){const e=Ee.c(17),{openTables:n,activeTable:o,onSelectTab:a,onCloseTab:i,onPinTab:l}=t;if(n.length===0)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx("button",{className:"p-2 hover:bg-accent transition-colors border-r border-border",children:y.jsx(B_,{className:"w-4 h-4 text-muted-foreground"})}),e[0]=u):u=e[0];let d;if(e[1]!==o||e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==n){let p;e[7]!==o||e[8]!==i||e[9]!==l||e[10]!==a?(p=x=>{const{table:w,isPinned:E}=x,S=`${w.schema}.${w.name}`,M=o?`${o.schema}.${o.name}`:null,N=S===M;return y.jsxs("div",{className:`group flex items-center gap-2 px-4 py-2 border-r border-border cursor-pointer transition-colors min-w-[150px] max-w-[250px] ${N?"bg-background border-t-2 border-t-primary":"hover:bg-accent/50"}`,onClick:()=>a(w),onDoubleClick:()=>l(w),children:[y.jsx(Kf,{className:"w-4 h-4 shrink-0 text-muted-foreground"}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("span",{className:`text-xs text-muted-foreground ${E?"":"italic"}`,children:[w.schema,"."]}),y.jsx("span",{className:`text-sm truncate ${N?"font-medium":""} ${E?"":"italic"}`,children:w.name})]}),y.jsx("button",{onClick:C=>{C.stopPropagation(),i(w)},className:"p-0.5 rounded hover:bg-accent opacity-0 group-hover:opacity-100 transition-opacity",children:y.jsx(ns,{className:"w-3.5 h-3.5 text-muted-foreground"})})]},S)},e[7]=o,e[8]=i,e[9]=l,e[10]=a,e[11]=p):p=e[11],d=n.map(p),e[1]=o,e[2]=i,e[3]=l,e[4]=a,e[5]=n,e[6]=d}else d=e[6];let f;e[12]!==d?(f=y.jsx("div",{className:"flex-1 flex overflow-x-auto",children:d}),e[12]=d,e[13]=f):f=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx("button",{className:"p-2 hover:bg-accent transition-colors border-l border-border",children:y.jsx(X0,{className:"w-4 h-4 text-muted-foreground"})}),e[14]=g):g=e[14];let m;return e[15]!==f?(m=y.jsxs("div",{className:"flex items-center border-b border-border bg-card shrink-0",children:[u,f,g]}),e[15]=f,e[16]=m):m=e[16],m}async function MW(t,e,n,o=1e3){const a=await fetch("/api/tables/data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,schema:e,table:n,limit:o})});if(!a.ok){let l=`HTTP error! status: ${a.status}`;try{l=(await a.json()).error||l}catch{const u=await a.text().catch(()=>"");u&&(l=u)}throw new Error(l)}const i=await a.json();if(!i.success)throw new Error(i.error||"Failed to fetch table data");return Array.isArray(i.data)?i.data:[]}async function NW(t,e,n){const o=await fetch("/api/tables/rls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,schema:e,table:n})});if(!o.ok){let i=`HTTP error! status: ${o.status}`;try{i=(await o.json()).error||i}catch{const l=await o.text().catch(()=>"");l&&(i=l)}throw new Error(i)}const a=await o.json();if(!a.success)throw new Error(a.error||"Failed to fetch RLS info");return a.data}function RW({connection:t,table:e,limit:n=1e3}){const[o,a]=v.useState([]),[i,l]=v.useState(!1),[u,d]=v.useState(null),f=v.useCallback(async()=>{if(!t?.connectionString||!e){a([]),d(null);return}l(!0),d(null);try{const g=await MW(t.connectionString,e.schema,e.name,n);a(g)}catch(g){const m=g instanceof Error?g.message:"Failed to load table data";d(m),a([])}finally{l(!1)}},[t?.connectionString,e?.schema,e?.name,n]);return v.useEffect(()=>{f()},[f]),{data:o,loading:i,error:u,refetch:f}}function DW({connection:t,table:e}){const[n,o]=v.useState(null),[a,i]=v.useState(!1),[l,u]=v.useState(null),d=v.useCallback(async()=>{if(!t?.connectionString||!e){o(null),u(null);return}i(!0),u(null);try{const f=await NW(t.connectionString,e.schema,e.name);o(f)}catch(f){const g=f instanceof Error?f.message:"Failed to load RLS info";u(g),o(null)}finally{i(!1)}},[t?.connectionString,e?.schema,e?.name]);return v.useEffect(()=>{d()},[d]),{rls:n,loading:a,error:l,refetch:d}}const TW={pinnedTables:[],selectedSchema:"all"};function kW(){const t=Ee.c(54),{selectedConnection:e}=Xf();let n;t[0]!==e?(n={connection:e},t[0]=e,t[1]=n):n=t[1];const{schemaData:o,loading:a,error:i}=FN(n),[l,u]=VN("fb-table-view",TW);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=[],t[2]=d):d=t[2];const[f,g]=v.useState(d),[m,p]=v.useState(null),[x,w]=v.useState(!1);let E;t[3]!==m||t[4]!==e?(E={connection:e,table:m},t[3]=m,t[4]=e,t[5]=E):E=t[5];const{data:S,loading:M,error:N}=RW(E);let C;t[6]!==m||t[7]!==e?(C={connection:e,table:m},t[6]=m,t[7]=e,t[8]=C):C=t[8];const{rls:R,loading:D,error:T}=DW(C),k=IW;let j;t[9]!==u?(j=W=>{u(ee=>({...ee,selectedSchema:W}))},t[9]=u,t[10]=j):j=t[10];const $=j;let K,U;t[11]!==x||t[12]!==o||t[13]!==l.pinnedTables?(K=()=>{if(!o||x||(w(!0),l.pinnedTables.length===0))return;const W=[];for(const ee of l.pinnedTables){const oe=o.tables.find(de=>de.schema===ee.schema&&de.name===ee.name);oe&&W.push({table:oe,isPinned:!0})}W.length>0&&(g(W),p(W[0].table))},U=[o,l.pinnedTables,x],t[11]=x,t[12]=o,t[13]=l.pinnedTables,t[14]=K,t[15]=U):(K=t[14],U=t[15]),v.useEffect(K,U);let Y,Z;t[16]!==x||t[17]!==f||t[18]!==u?(Y=()=>{if(!x)return;const W=f.filter(zW).map(jW);u(ee=>({...ee,pinnedTables:W}))},Z=[f,x,u],t[16]=x,t[17]=f,t[18]=u,t[19]=Y,t[20]=Z):(Y=t[19],Z=t[20]),v.useEffect(Y,Z);let P;t[21]===Symbol.for("react.memo_cache_sentinel")?(P=W=>{const ee=k(W);g(oe=>{if(oe.findIndex(ne=>k(ne.table)===ee)!==-1)return p(W),oe;const ge=oe.findIndex(AW);if(ge!==-1){const ne=[...oe];return ne[ge]={table:W,isPinned:!1},p(W),ne}return p(W),[...oe,{table:W,isPinned:!1}]})},t[21]=P):P=t[21];const q=P;let A;t[22]===Symbol.for("react.memo_cache_sentinel")?(A=W=>{const ee=k(W);g(oe=>{const de=oe.findIndex(ne=>k(ne.table)===ee);if(de!==-1){const ne=[...oe];return ne[de]={...ne[de],isPinned:!0},p(W),ne}const ge=oe.findIndex(OW);if(ge!==-1){const ne=[...oe];return ne[ge]={table:W,isPinned:!0},p(W),ne}return p(W),[...oe,{table:W,isPinned:!0}]})},t[22]=A):A=t[22];const B=A;let L;t[23]===Symbol.for("react.memo_cache_sentinel")?(L=W=>{const ee=k(W);g(oe=>oe.map(de=>k(de.table)===ee?{...de,isPinned:!0}:de))},t[23]=L):L=t[23];const F=L;let X;t[24]!==m?(X=W=>{const ee=k(W),oe=m?k(m):null;g(de=>{const ge=de.filter(ne=>k(ne.table)!==ee);if(ee===oe){const ne=de.findIndex(De=>k(De.table)===ee),_e=Math.min(ne,ge.length-1);p(ge[_e]?.table||null)}return ge})},t[24]=m,t[25]=X):X=t[25];const I=X;if(!e){let W;return t[26]===Symbol.for("react.memo_cache_sentinel")?(W=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Please select a database connection to view tables"})}),t[26]=W):W=t[26],W}if(!e.connectionString){let W;return t[27]===Symbol.for("react.memo_cache_sentinel")?(W=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Connection selected but missing connection string"})}),t[27]=W):W=t[27],W}if(a){let W;return t[28]===Symbol.for("react.memo_cache_sentinel")?(W=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx(ch,{})}),t[28]=W):W=t[28],W}if(i){let W;return t[29]!==i?(W=y.jsx("div",{className:"h-full flex items-center justify-center p-6",children:y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md",children:i})}),t[29]=i,t[30]=W):W=t[30],W}if(!o)return null;let z;t[31]!==m||t[32]!==$||t[33]!==o.tables||t[34]!==l.selectedSchema?(z=y.jsx("div",{className:"w-64 shrink-0",children:y.jsx(IF,{tables:o.tables,selectedTable:m,selectedSchema:l.selectedSchema,onSchemaChange:$,onSingleClick:q,onDoubleClick:B})}),t[31]=m,t[32]=$,t[33]=o.tables,t[34]=l.selectedSchema,t[35]=z):z=t[35];let H;t[36]!==m||t[37]!==I||t[38]!==f?(H=y.jsx(_W,{openTables:f,activeTable:m,onSelectTab:p,onCloseTab:I,onPinTab:F}),t[36]=m,t[37]=I,t[38]=f,t[39]=H):H=t[39];let G;t[40]!==m||t[41]!==T||t[42]!==D||t[43]!==S||t[44]!==N||t[45]!==M||t[46]!==R?(G=y.jsx("div",{className:"flex-1 min-h-0 min-w-0 overflow-hidden",children:m?y.jsx(vW,{table:m,data:S,dataLoading:M,dataError:N,rls:R,rlsLoading:D,rlsError:T}):y.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-muted-foreground",children:[y.jsx(Kf,{className:"w-16 h-16 mb-4 opacity-30"}),y.jsx("p",{className:"text-lg font-medium",children:"Select a table"}),y.jsx("p",{className:"text-sm",children:"Choose a table from the list to view its details"})]})}),t[40]=m,t[41]=T,t[42]=D,t[43]=S,t[44]=N,t[45]=M,t[46]=R,t[47]=G):G=t[47];let J;t[48]!==H||t[49]!==G?(J=y.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[H,G]}),t[48]=H,t[49]=G,t[50]=J):J=t[50];let ae;return t[51]!==z||t[52]!==J?(ae=y.jsxs("div",{className:"h-full flex",children:[z,J]}),t[51]=z,t[52]=J,t[53]=ae):ae=t[53],ae}function OW(t){return!t.isPinned}function AW(t){return!t.isPinned}function jW(t){return{schema:t.table.schema,name:t.table.name}}function zW(t){return t.isPinned}function IW(t){return`${t.schema}.${t.name}`}async function PW(t){const e=await fetch("/api/indexes/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t})});if(!e.ok){let o=`HTTP error! status: ${e.status}`;try{const a=await e.json();o=a.error||o,console.error("API error response:",a)}catch{const a=await e.text().catch(()=>"");console.error("Failed to parse error response. Raw response:",a)}throw new Error(o)}const n=await e.json();if(!n.success||!n.data)throw new Error(n.error||"Failed to fetch indexes data");return n.data}function LW(t){if(t===0)return"0 B";const e=1024,n=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,o)).toFixed(1))+" "+n[o]}function $W(t){return t.toLocaleString()}function HW(t){const e=t.isUnique?"UNIQUE ":"",n=`${t.schema}.${t.table}`,o=t.columns.length>0?t.columns.join(", "):"";return`CREATE ${e}INDEX ${t.indexName} ON ${n} USING btree (${o})`}function BW(t){const e=Ee.c(22),{index:n,open:o,onOpenChange:a}=t,[i,l]=v.useState(!1);let u;e[0]!==n?(u=n?HW(n):"",e[0]=n,e[1]=u):u=e[1];const d=u;let f;e[2]!==d?(f=async()=>{if(d)try{await navigator.clipboard.writeText(d),l(!0),setTimeout(()=>l(!1),2e3)}catch{l(!1)}},e[2]=d,e[3]=f):f=e[3];const g=f,m=n?n.indexName:"Index definition";let p;e[4]!==m?(p=y.jsx(K_,{className:"border-b border-border",children:y.jsx(X_,{children:m})}),e[4]=m,e[5]=p):p=e[5];let x;e[6]!==i||e[7]!==g||e[8]!==n?(x=n&&y.jsxs("div",{className:"flex flex-col gap-4",children:[y.jsx("pre",{className:"text-sm font-mono leading-relaxed whitespace-pre-wrap break-words rounded-md selection:bg-primary/20 selection:text-foreground",children:y.jsxs("code",{className:"text-foreground/95",children:[y.jsx("span",{className:"text-primary",children:"CREATE "}),n.isUnique&&y.jsx("span",{className:"text-primary",children:"UNIQUE "}),y.jsx("span",{className:"text-primary",children:"INDEX "}),y.jsxs("span",{className:"text-foreground",children:[n.indexName," "]}),y.jsx("span",{className:"text-primary",children:"ON "}),y.jsx("span",{className:"text-foreground",children:`${n.schema}.${n.table} `}),y.jsx("span",{className:"text-primary",children:"USING btree "}),y.jsxs("span",{className:"text-foreground",children:["(",n.columns.join(", "),")"]})]})}),y.jsx(vn,{variant:"outline",size:"icon-sm",onClick:g,title:"Copy SQL","aria-label":"Copy SQL",children:i?y.jsx(Vs,{className:"size-4"}):y.jsx(V_,{className:"size-4"})})]}),e[6]=i,e[7]=g,e[8]=n,e[9]=x):x=e[9];let w;e[10]!==x?(w=y.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-y-auto px-4",children:x}),e[10]=x,e[11]=w):w=e[11];let E;e[12]!==a?(E=y.jsx(NI,{className:"border-t border-border flex-row justify-end",children:y.jsx(vn,{variant:"outline",onClick:()=>a(!1),children:"Close"})}),e[12]=a,e[13]=E):E=e[13];let S;e[14]!==p||e[15]!==w||e[16]!==E?(S=y.jsxs(W_,{side:"right",className:"flex flex-col w-full sm:max-w-xl border-l border-border",showCloseButton:!0,children:[p,w,E]}),e[14]=p,e[15]=w,e[16]=E,e[17]=S):S=e[17];let M;return e[18]!==a||e[19]!==o||e[20]!==S?(M=y.jsx(q_,{open:o,onOpenChange:a,children:S}),e[18]=a,e[19]=o,e[20]=S,e[21]=M):M=e[21],M}const FW=[{value:"size-desc",label:"Largest size"},{value:"scans-desc",label:"Most scans"},{value:"scans-asc",label:"Least scans"},{value:"name-asc",label:"Index name (A–Z)"},{value:"table-asc",label:"Table (A–Z)"}];function VW(){const{selectedConnection:t}=Xf(),[e,n]=v.useState(null),[o,a]=v.useState(!1),[i,l]=v.useState(null),[u,d]=v.useState("all"),[f,g]=v.useState(""),[m,p]=v.useState("size-desc"),[x,w]=v.useState(null),[E,S]=v.useState(!1),M=v.useCallback(async()=>{if(!t?.connectionString){n(null),l(null);return}a(!0),l(null);try{const C=await PW(t.connectionString);n(C)}catch(C){const R=C instanceof Error?C.message:"Failed to load indexes";l(R),n(null)}finally{a(!1)}},[t?.connectionString]);v.useEffect(()=>{t?.connectionString&&M()},[t?.connectionString,M]);const N=v.useMemo(()=>{if(!e?.indexes)return[];let C=e.indexes;if(u!=="all"&&(C=C.filter(D=>D.schema===u)),f.trim()){const D=f.toLowerCase();C=C.filter(T=>T.indexName.toLowerCase().includes(D)||T.table.toLowerCase().includes(D)||T.columns.some(k=>k.toLowerCase().includes(D)))}const R=[...C];switch(m){case"size-desc":R.sort((D,T)=>T.sizeBytes-D.sizeBytes);break;case"scans-desc":R.sort((D,T)=>T.indexScans-D.indexScans);break;case"scans-asc":R.sort((D,T)=>D.indexScans-T.indexScans);break;case"name-asc":R.sort((D,T)=>D.indexName.localeCompare(T.indexName));break;case"table-asc":R.sort((D,T)=>D.table.localeCompare(T.table)||D.indexName.localeCompare(T.indexName));break}return R},[e?.indexes,u,f,m]);return t?o&&!e?y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx(ch,{})}):i?y.jsx("div",{className:"h-full flex items-center justify-center p-6",children:y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md max-w-lg",children:i})}):y.jsxs("div",{className:"py-6 h-full flex flex-col overflow-hidden pb-6",children:[y.jsxs("div",{className:"w-full max-w-7xl mx-auto flex flex-col min-h-0 flex-1",children:[y.jsxs("div",{className:"flex flex-col gap-2 shrink-0",children:[y.jsx("h1",{className:"text-2xl font-bold",children:"Indexes"}),y.jsx("p",{className:"text-muted-foreground",children:"View and manage indexes for your database"})]}),y.jsx("div",{className:"shrink-0 py-6 border-b bg-background",children:y.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs(Ps,{value:u,onValueChange:d,children:[y.jsxs(Ls,{className:"w-[180px]",children:[y.jsx("span",{className:"text-muted-foreground mr-1",children:"schema"}),y.jsx(Ka,{placeholder:"All schemas"})]}),y.jsxs($s,{children:[y.jsx(io,{value:"all",children:"All schemas"}),e?.schemas.map(C=>y.jsx(io,{value:C,children:C},C))]})]}),y.jsxs("div",{className:"relative min-w-[240px]",children:[y.jsx(Wf,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),y.jsx(Ui,{placeholder:"Search for an index",value:f,onChange:C=>g(C.target.value),className:"pl-9"})]})]}),y.jsx("div",{className:"flex items-center gap-2",children:y.jsxs(Ps,{value:m,onValueChange:C=>p(C),children:[y.jsx(Ls,{className:"w-[180px]",children:y.jsx(Ka,{placeholder:"Sort by"})}),y.jsx($s,{children:FW.map(C=>y.jsx(io,{value:C.value,children:C.label},C.value))})]})})]})}),y.jsx("div",{className:"min-h-0 max-h-[calc(100vh-12rem)] overflow-y-auto border border-border rounded-md",children:N.length===0?y.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] text-muted-foreground py-12",children:[y.jsx(Y_,{className:"size-12 mb-4 opacity-30"}),y.jsx("p",{className:"text-lg font-medium",children:e?.indexes.length===0?"No indexes found":"No matching indexes"}),y.jsx("p",{className:"text-sm",children:e?.indexes.length===0?"This database has no user-created indexes.":"Try adjusting your filters or search query."})]}):y.jsxs("table",{className:"w-full text-sm",children:[y.jsx("thead",{className:"bg-background sticky top-0 z-10",children:y.jsxs("tr",{children:[y.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Table"}),y.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Columns"}),y.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Name"}),y.jsx("th",{className:"text-right p-4 font-medium uppercase text-xs text-muted-foreground",children:"Size"}),y.jsx("th",{className:"text-right p-4 font-medium uppercase text-xs text-muted-foreground",children:"Scans"})]})}),y.jsx("tbody",{children:N.map(C=>y.jsx(UW,{index:C,onSelect:()=>{w(C),S(!0)}},`${C.schema}.${C.indexName}`))})]})})]}),y.jsx(BW,{index:x,open:E,onOpenChange:S})]}):y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Please select a database connection to view indexes"})})}function UW(t){const e=Ee.c(35),{index:n,onSelect:o}=t;let a;e[0]!==o?(a=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),o?.())},e[0]=o,e[1]=a):a=e[1];let i;e[2]!==n.table?(i=y.jsx("td",{className:"p-4 font-medium",children:n.table}),e[2]=n.table,e[3]=i):i=e[3];let l;e[4]!==n.columns?(l=n.columns.length>0?n.columns.join(", "):"—",e[4]=n.columns,e[5]=l):l=e[5];let u;e[6]!==l?(u=y.jsx("td",{className:"p-4",children:y.jsx("span",{className:"text-muted-foreground line-clamp-1",children:l})}),e[6]=l,e[7]=u):u=e[7];let d;e[8]!==n.indexName?(d=y.jsx("span",{className:"font-mono text-sm",children:n.indexName}),e[8]=n.indexName,e[9]=d):d=e[9];let f;e[10]!==n.isPrimary?(f=n.isPrimary&&y.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded",children:"PK"}),e[10]=n.isPrimary,e[11]=f):f=e[11];let g;e[12]!==n.isPrimary||e[13]!==n.isUnique?(g=n.isUnique&&!n.isPrimary&&y.jsx("span",{className:"text-xs bg-amber-500/10 text-amber-600 px-1.5 py-0.5 rounded",children:"Unique"}),e[12]=n.isPrimary,e[13]=n.isUnique,e[14]=g):g=e[14];let m;e[15]!==d||e[16]!==f||e[17]!==g?(m=y.jsx("td",{className:"p-4",children:y.jsxs("div",{className:"flex items-center gap-2",children:[d,f,g]})}),e[15]=d,e[16]=f,e[17]=g,e[18]=m):m=e[18];let p;e[19]!==n.sizeBytes?(p=LW(n.sizeBytes),e[19]=n.sizeBytes,e[20]=p):p=e[20];let x;e[21]!==p?(x=y.jsx("td",{className:"p-4 text-right font-mono text-muted-foreground",children:p}),e[21]=p,e[22]=x):x=e[22];let w;e[23]!==n.indexScans?(w=$W(n.indexScans),e[23]=n.indexScans,e[24]=w):w=e[24];let E;e[25]!==w?(E=y.jsx("td",{className:"p-4 text-right font-mono text-muted-foreground",children:w}),e[25]=w,e[26]=E):E=e[26];let S;return e[27]!==o||e[28]!==a||e[29]!==x||e[30]!==E||e[31]!==i||e[32]!==u||e[33]!==m?(S=y.jsxs("tr",{className:"border-b hover:bg-muted/30 transition-colors cursor-pointer",onClick:o,role:"button",tabIndex:0,onKeyDown:a,children:[i,u,m,x,E]}),e[27]=o,e[28]=a,e[29]=x,e[30]=E,e[31]=i,e[32]=u,e[33]=m,e[34]=S):S=e[34],S}function YW(){const t=Ee.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx(fc,{path:"/",element:y.jsx(ok,{to:"/schema",replace:!0})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(fc,{path:"/schema",element:y.jsx(jF,{})}),t[1]=n):n=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx(fc,{path:"/tables",element:y.jsx(kW,{})}),t[2]=o):o=t[2];let a;return t[3]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(f7,{children:y.jsxs(ak,{children:[e,n,o,y.jsx(fc,{path:"/indexes",element:y.jsx(VW,{})})]})}),t[3]=a):a=t[3],a}iT.createRoot(document.getElementById("root")).render(y.jsx(v.StrictMode,{children:y.jsx(Dk,{children:y.jsx(YW,{})})}));
|