db-studio 0.0.1 → 0.0.2

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.
@@ -0,0 +1,81 @@
1
+ function NM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function h1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mm={exports:{}},Il={};var Qx;function RM(){if(Qx)return Il;Qx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:l}}return Il.Fragment=t,Il.jsx=n,Il.jsxs=n,Il}var Xx;function MM(){return Xx||(Xx=1,Mm.exports=RM()),Mm.exports}var h=MM(),Om={exports:{}},Ue={};var Jx;function OM(){if(Jx)return Ue;Jx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),x=Symbol.iterator;function S(z){return z===null||typeof z!="object"?null:(z=x&&z[x]||z["@@iterator"],typeof z=="function"?z:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function T(z,P,U){this.props=z,this.context=P,this.refs=C,this.updater=U||_}T.prototype.isReactComponent={},T.prototype.setState=function(z,P){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,P,"setState")},T.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function N(){}N.prototype=T.prototype;function M(z,P,U){this.props=z,this.context=P,this.refs=C,this.updater=U||_}var R=M.prototype=new N;R.constructor=M,w(R,T.prototype),R.isPureReactComponent=!0;var j=Array.isArray;function A(){}var D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function B(z,P,U){var W=U.ref;return{$$typeof:e,type:z,key:P,ref:W!==void 0?W:null,props:U}}function ne(z,P){return B(z.type,P,z.props)}function J(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function ie(z){var P={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(U){return P[U]})}var ue=/\/+/g;function ae(z,P){return typeof z=="object"&&z!==null&&z.key!=null?ie(""+z.key):P.toString(36)}function pe(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(A,A):(z.status="pending",z.then(function(P){z.status==="pending"&&(z.status="fulfilled",z.value=P)},function(P){z.status==="pending"&&(z.status="rejected",z.reason=P)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function k(z,P,U,W,oe){var he=typeof z;(he==="undefined"||he==="boolean")&&(z=null);var X=!1;if(z===null)X=!0;else switch(he){case"bigint":case"string":case"number":X=!0;break;case"object":switch(z.$$typeof){case e:case t:X=!0;break;case v:return X=z._init,k(X(z._payload),P,U,W,oe)}}if(X)return oe=oe(z),X=W===""?"."+ae(z,0):W,j(oe)?(U="",X!=null&&(U=X.replace(ue,"$&/")+"/"),k(oe,P,U,"",function(De){return De})):oe!=null&&(J(oe)&&(oe=ne(oe,U+(oe.key==null||z&&z.key===oe.key?"":(""+oe.key).replace(ue,"$&/")+"/")+X)),P.push(oe)),1;X=0;var ye=W===""?".":W+":";if(j(z))for(var _e=0;_e<z.length;_e++)W=z[_e],he=ye+ae(W,_e),X+=k(W,P,U,he,oe);else if(_e=S(z),typeof _e=="function")for(z=_e.call(z),_e=0;!(W=z.next()).done;)W=W.value,he=ye+ae(W,_e++),X+=k(W,P,U,he,oe);else if(he==="object"){if(typeof z.then=="function")return k(pe(z),P,U,W,oe);throw P=String(z),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return X}function Y(z,P,U){if(z==null)return z;var W=[],oe=0;return k(z,W,"","",function(he){return P.call(U,he,oe++)}),W}function H(z){if(z._status===-1){var P=z._result;P=P(),P.then(function(U){(z._status===0||z._status===-1)&&(z._status=1,z._result=U)},function(U){(z._status===0||z._status===-1)&&(z._status=2,z._result=U)}),z._status===-1&&(z._status=0,z._result=P)}if(z._status===1)return z._result.default;throw z._result}var ee=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},ve={map:Y,forEach:function(z,P,U){Y(z,function(){P.apply(this,arguments)},U)},count:function(z){var P=0;return Y(z,function(){P++}),P},toArray:function(z){return Y(z,function(P){return P})||[]},only:function(z){if(!J(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return Ue.Activity=p,Ue.Children=ve,Ue.Component=T,Ue.Fragment=n,Ue.Profiler=s,Ue.PureComponent=M,Ue.StrictMode=r,Ue.Suspense=f,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(z){return D.H.useMemoCache(z)}},Ue.cache=function(z){return function(){return z.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(z,P,U){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var W=w({},z.props),oe=z.key;if(P!=null)for(he in P.key!==void 0&&(oe=""+P.key),P)!L.call(P,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&P.ref===void 0||(W[he]=P[he]);var he=arguments.length-2;if(he===1)W.children=U;else if(1<he){for(var X=Array(he),ye=0;ye<he;ye++)X[ye]=arguments[ye+2];W.children=X}return B(z.type,oe,W)},Ue.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:l,_context:z},z},Ue.createElement=function(z,P,U){var W,oe={},he=null;if(P!=null)for(W in P.key!==void 0&&(he=""+P.key),P)L.call(P,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(oe[W]=P[W]);var X=arguments.length-2;if(X===1)oe.children=U;else if(1<X){for(var ye=Array(X),_e=0;_e<X;_e++)ye[_e]=arguments[_e+2];oe.children=ye}if(z&&z.defaultProps)for(W in X=z.defaultProps,X)oe[W]===void 0&&(oe[W]=X[W]);return B(z,he,oe)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(z){return{$$typeof:d,render:z}},Ue.isValidElement=J,Ue.lazy=function(z){return{$$typeof:v,_payload:{_status:-1,_result:z},_init:H}},Ue.memo=function(z,P){return{$$typeof:m,type:z,compare:P===void 0?null:P}},Ue.startTransition=function(z){var P=D.T,U={};D.T=U;try{var W=z(),oe=D.S;oe!==null&&oe(U,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(A,ee)}catch(he){ee(he)}finally{P!==null&&U.types!==null&&(P.types=U.types),D.T=P}},Ue.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ue.use=function(z){return D.H.use(z)},Ue.useActionState=function(z,P,U){return D.H.useActionState(z,P,U)},Ue.useCallback=function(z,P){return D.H.useCallback(z,P)},Ue.useContext=function(z){return D.H.useContext(z)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(z,P){return D.H.useDeferredValue(z,P)},Ue.useEffect=function(z,P){return D.H.useEffect(z,P)},Ue.useEffectEvent=function(z){return D.H.useEffectEvent(z)},Ue.useId=function(){return D.H.useId()},Ue.useImperativeHandle=function(z,P,U){return D.H.useImperativeHandle(z,P,U)},Ue.useInsertionEffect=function(z,P){return D.H.useInsertionEffect(z,P)},Ue.useLayoutEffect=function(z,P){return D.H.useLayoutEffect(z,P)},Ue.useMemo=function(z,P){return D.H.useMemo(z,P)},Ue.useOptimistic=function(z,P){return D.H.useOptimistic(z,P)},Ue.useReducer=function(z,P,U){return D.H.useReducer(z,P,U)},Ue.useRef=function(z){return D.H.useRef(z)},Ue.useState=function(z){return D.H.useState(z)},Ue.useSyncExternalStore=function(z,P,U){return D.H.useSyncExternalStore(z,P,U)},Ue.useTransition=function(){return D.H.useTransition()},Ue.version="19.2.3",Ue}var eS;function Eg(){return eS||(eS=1,Om.exports=OM()),Om.exports}var b=Eg();const I=h1(b),m1=NM({__proto__:null,default:I},[b]),Tg=DM();function At(e,...t){if(!Tg)return;const n=jM(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function AM(e,...t){Tg&&console.warn(e,...t)}function jM(e,...t){return e.replace(/%[sfdO]/g,n=>{const r=t.shift();return n==="%O"&&r?JSON.stringify(r).replace(/"([^"]+)":/g,"$1:"):String(r)})}function DM(){try{const e="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(e,e);const t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const kM={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function fc(e){return`[nuqs] ${kM[e]}
2
+ See https://nuqs.dev/NUQS-${e}`}function zM(e){if(e.size===0)return"";const t=[];for(const[r,s]of e.entries()){const l=r.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${l}=${PM(s)}`)}return"?"+t.join("&")}function PM(e){return e.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,t=>encodeURIComponent(t))}const ls=b.createContext({useAdapter(){throw new Error(fc(404))}});ls.displayName="NuqsAdapterContext";Tg&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==ls&&console.error(fc(303)),window.__NuqsAdapterContext=ls);function LM(e){return({children:t,defaultOptions:n,processUrlSearchParams:r,...s})=>b.createElement(ls.Provider,{...s,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:r}},t)}function FM(e){const t=b.useContext(ls);if(!("useAdapter"in t))throw new Error(fc(404));return t.useAdapter(e)}const IM=()=>b.useContext(ls).defaultOptions,VM=()=>b.useContext(ls).processUrlSearchParams;function $M(){if(typeof window>"u"||!window.GestureEvent)return 50;try{const e=navigator.userAgent?.match(/version\/([\d\.]+) safari/i);return parseFloat(e[1])>=17?120:320}catch{return 320}}function UM(e){return{method:"throttle",timeMs:e}}const Xl=UM($M());function BM(e){return e===null||Array.isArray(e)&&e.length===0}function HM(e,t,n){if(typeof e=="string")n.set(t,e);else{n.delete(t);for(const r of e)n.append(t,r);n.has(t)||n.set(t,"")}return n}function Ng(){const e=new Map;return{on(t,n){const r=e.get(t)||[];return r.push(n),e.set(t,r),()=>this.off(t,n)},off(t,n){const r=e.get(t);r&&e.set(t,r.filter(s=>s!==n))},emit(t,n){e.get(t)?.forEach(r=>r(n))}}}function Rp(e,t,n){function r(){e(),n.removeEventListener("abort",l)}const s=setTimeout(r,t);function l(){clearTimeout(s),n.removeEventListener("abort",l)}n.addEventListener("abort",l)}function Mp(){const e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((r,s)=>{t=r,n=s}),resolve:t,reject:n}}function qM(e,t){let n=t;for(let r=e.length-1;r>=0;r--){const s=e[r];if(!s)continue;const l=n;n=()=>s(l)}n()}function Op(){return new URLSearchParams(location.search)}var p1=class{updateMap=new Map;options={history:"replace",scroll:!1,shallow:!0};timeMs=Xl.timeMs;transitions=new Set;resolvers=null;controller=null;lastFlushedAt=0;resetQueueOnNextPush=!1;push({key:e,query:t,options:n},r=Xl.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),At("[nuqs gtq] Enqueueing %s=%s %O",e,t,n),this.updateMap.set(e,t),n.history==="push"&&(this.options.history="push"),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||r>this.timeMs)&&(this.timeMs=r)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=Op}){return this.resolvers?.promise??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=Op,rateLimitFactor:t=1,...n},r){if(this.controller??=new AbortController,!Number.isFinite(this.timeMs))return At("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=Mp();const s=()=>{this.lastFlushedAt=performance.now();const[c,d]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},r);d===null?(this.resolvers.resolve(c),this.resetQueueOnNextPush=!0):this.resolvers.reject(c),this.resolvers=null};return Rp(()=>{const c=performance.now()-this.lastFlushedAt,d=this.timeMs,f=t*Math.max(0,d-c);At("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",f,d,t),f===0?s():Rp(s,f,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){return this.controller?.abort(),this.controller=new AbortController,this.resolvers?.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const e=Array.from(this.updateMap.keys());return At("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=Xl.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:r}=e;let s=r();if(At("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,s.toString()),this.updateMap.size===0)return[s,null];const l=Array.from(this.updateMap.entries()),c={...this.options},d=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),At("[nuqs gtq] Flushing queue %O with options %O",l,c);for(const[f,m]of l)m===null?s.delete(f):s=HM(m,f,s);t&&(s=t(s));try{return qM(d,()=>{n(s,c)}),[s,null]}catch(f){return console.error(fc(429),l.map(([m])=>m).join(),f),[s,f]}}};const ad=new p1;function YM(e,t,n){const r=b.useCallback(()=>{const l=Object.fromEntries(e.map(c=>[c,n(c)]));return[JSON.stringify(l),l]},[e.join(","),n]),s=b.useRef(null);return s.current===null&&(s.current=r()),b.useSyncExternalStore(b.useCallback(l=>{const c=e.map(d=>t(d,l));return()=>c.forEach(d=>d())},[e.join(","),t]),()=>{const[l,c]=r();return s.current[0]===l?s.current[1]:(s.current=[l,c],c)},()=>s.current[1])}var GM=class{callback;resolvers=Mp();controller=new AbortController;queuedValue=void 0;constructor(e){this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,Rp(()=>{const n=this.resolvers;try{At("[nuqs dq] Flushing debounce queue",e);const r=this.callback(e);At("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=Mp(),r.then(s=>n.resolve(s)).catch(s=>n.reject(s))}catch(r){this.queuedValue=void 0,n.reject(r)}},t,this.controller.signal),this.resolvers.promise}},KM=class{throttleQueue;queues=new Map;queuedQuerySync=Ng();constructor(e=new p1){this.throttleQueue=e}useQueuedQueries(e){return YM(e,(t,n)=>this.queuedQuerySync.on(t,n),t=>this.getQueuedQuery(t))}push(e,t,n,r){if(!Number.isFinite(t)){const c=n.getSearchParamsSnapshot??Op;return Promise.resolve(c())}const s=e.key;if(!this.queues.has(s)){At("[nuqs dqc] Creating debounce queue for `%s`",s);const c=new GM(d=>(this.throttleQueue.push(d),this.throttleQueue.flush(n,r).finally(()=>{this.queues.get(d.key)?.queuedValue===void 0&&(At("[nuqs dqc] Cleaning up empty queue for `%s`",d.key),this.queues.delete(d.key)),this.queuedQuerySync.emit(d.key)})));this.queues.set(s,c)}At("[nuqs dqc] Enqueueing debounce update %O",e);const l=this.queues.get(s).push(e,t);return this.queuedQuerySync.emit(s),l}abort(e){const t=this.queues.get(e);return t?(At("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),n=>(n.then(t.resolvers.resolve,t.resolvers.reject),n)):n=>n}abortAll(){for(const[e,t]of this.queues.entries())At("[nuqs dqc] Aborting debounce queue %s=%s",e,t.queuedValue?.query),t.abort(),t.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(e);this.queues.clear()}getQueuedQuery(e){const t=this.queues.get(e)?.queuedValue?.query;return t!==void 0?t:this.throttleQueue.getQueuedQuery(e)}};const Am=new KM(ad);function g1(e,t){return e===t?!0:e===null||t===null||typeof e=="string"||typeof t=="string"||e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function tS(e,t,n){return r=>{if(!(t.length===0||t.some(l=>!g1(r.getAll(l),e.getAll(l)))))return At("[nuqs `%s`] no change, returning previous",t.join(","),r),r;const s=v1(e,t,n);return At("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),r,s),s}}function v1(e,t,n){if(t.length===0)return e;const r=n?new URLSearchParams(e):e;for(const s of e.keys())t.includes(s)||r.delete(s);return r}const ZM="__nuqs__",Ap=Ng();function WM(e){return function(n,r){const s=new URL(location.href);s.search=zM(n),At("[nuqs react] Updating url: %s",s),e&&r.shallow===!1?(r.history==="push"?location.assign:location.replace).call(location,s):(r.history==="push"?history.pushState:history.replaceState).call(history,history.state,ZM,s),Ap.emit("update",n),r.scroll===!0&&window.scrollTo({top:0})}}const y1=b.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function QM(e){const{fullPageNavigationOnShallowFalseUpdates:t}=b.useContext(y1),[n,r]=b.useState(()=>typeof location>"u"?new URLSearchParams:v1(new URLSearchParams(location.search),e,!1));return b.useEffect(()=>{const s=()=>{r(tS(new URLSearchParams(location.search),e,!1))},l=c=>{r(tS(c,e,!0))};return Ap.on("update",l),window.addEventListener("popstate",s),()=>{Ap.off("update",l),window.removeEventListener("popstate",s)}},[e.join("&")]),{searchParams:n,updateUrl:b.useMemo(()=>WM(t),[t])}}const XM=LM(QM);function JM({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return b.createElement(y1.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},b.createElement(XM,{...n,children:e}))}var jm={exports:{}},Vl={},Dm={exports:{}},km={};var nS;function eO(){return nS||(nS=1,(function(e){function t(k,Y){var H=k.length;k.push(Y);e:for(;0<H;){var ee=H-1>>>1,ve=k[ee];if(0<s(ve,Y))k[ee]=Y,k[H]=ve,H=ee;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var Y=k[0],H=k.pop();if(H!==Y){k[0]=H;e:for(var ee=0,ve=k.length,z=ve>>>1;ee<z;){var P=2*(ee+1)-1,U=k[P],W=P+1,oe=k[W];if(0>s(U,H))W<ve&&0>s(oe,U)?(k[ee]=oe,k[W]=H,ee=W):(k[ee]=U,k[P]=H,ee=P);else if(W<ve&&0>s(oe,H))k[ee]=oe,k[W]=H,ee=W;else break e}}return Y}function s(k,Y){var H=k.sortIndex-Y.sortIndex;return H!==0?H:k.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],m=[],v=1,p=null,x=3,S=!1,_=!1,w=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function R(k){for(var Y=n(m);Y!==null;){if(Y.callback===null)r(m);else if(Y.startTime<=k)r(m),Y.sortIndex=Y.expirationTime,t(f,Y);else break;Y=n(m)}}function j(k){if(w=!1,R(k),!_)if(n(f)!==null)_=!0,A||(A=!0,ie());else{var Y=n(m);Y!==null&&pe(j,Y.startTime-k)}}var A=!1,D=-1,L=5,B=-1;function ne(){return C?!0:!(e.unstable_now()-B<L)}function J(){if(C=!1,A){var k=e.unstable_now();B=k;var Y=!0;try{e:{_=!1,w&&(w=!1,N(D),D=-1),S=!0;var H=x;try{t:{for(R(k),p=n(f);p!==null&&!(p.expirationTime>k&&ne());){var ee=p.callback;if(typeof ee=="function"){p.callback=null,x=p.priorityLevel;var ve=ee(p.expirationTime<=k);if(k=e.unstable_now(),typeof ve=="function"){p.callback=ve,R(k),Y=!0;break t}p===n(f)&&r(f),R(k)}else r(f);p=n(f)}if(p!==null)Y=!0;else{var z=n(m);z!==null&&pe(j,z.startTime-k),Y=!1}}break e}finally{p=null,x=H,S=!1}Y=void 0}}finally{Y?ie():A=!1}}}var ie;if(typeof M=="function")ie=function(){M(J)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,ae=ue.port2;ue.port1.onmessage=J,ie=function(){ae.postMessage(null)}}else ie=function(){T(J,0)};function pe(k,Y){D=T(function(){k(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(k){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var H=x;x=Y;try{return k()}finally{x=H}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(k,Y){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var H=x;x=k;try{return Y()}finally{x=H}},e.unstable_scheduleCallback=function(k,Y,H){var ee=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?ee+H:ee):H=ee,k){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=H+ve,k={id:v++,callback:Y,priorityLevel:k,startTime:H,expirationTime:ve,sortIndex:-1},H>ee?(k.sortIndex=H,t(m,k),n(f)===null&&k===n(m)&&(w?(N(D),D=-1):w=!0,pe(j,H-ee))):(k.sortIndex=ve,t(f,k),_||S||(_=!0,A||(A=!0,ie()))),k},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(k){var Y=x;return function(){var H=x;x=Y;try{return k.apply(this,arguments)}finally{x=H}}}})(km)),km}var rS;function tO(){return rS||(rS=1,Dm.exports=eO()),Dm.exports}var zm={exports:{}},bn={};var oS;function nO(){if(oS)return bn;oS=1;var e=Eg();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+f+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(f,m,v){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:f,containerInfo:m,implementation:v}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,m){if(f==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,bn.createPortal=function(f,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(f,m,null,v)},bn.flushSync=function(f){var m=c.T,v=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=v,r.d.f()}},bn.preconnect=function(f,m){typeof f=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(f,m))},bn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},bn.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var v=m.as,p=d(v,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:p,integrity:x,fetchPriority:S}):v==="script"&&r.d.X(f,{crossOrigin:p,integrity:x,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},bn.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=d(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(f)},bn.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,p=d(v,m.crossOrigin);r.d.L(f,v,{crossOrigin:p,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},bn.preloadModule=function(f,m){if(typeof f=="string")if(m){var v=d(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},bn.requestFormReset=function(f){r.d.r(f)},bn.unstable_batchedUpdates=function(f,m){return f(m)},bn.useFormState=function(f,m,v){return c.H.useFormState(f,m,v)},bn.useFormStatus=function(){return c.H.useHostTransitionStatus()},bn.version="19.2.3",bn}var aS;function b1(){if(aS)return zm.exports;aS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zm.exports=nO(),zm.exports}var sS;function rO(){if(sS)return Vl;sS=1;var e=tO(),t=Eg(),n=b1();function r(o){var a="https://react.dev/errors/"+o;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+o+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function l(o){var a=o,i=o;if(o.alternate)for(;a.return;)a=a.return;else{o=a;do a=o,(a.flags&4098)!==0&&(i=a.return),o=a.return;while(o)}return a.tag===3?i:null}function c(o){if(o.tag===13){var a=o.memoizedState;if(a===null&&(o=o.alternate,o!==null&&(a=o.memoizedState)),a!==null)return a.dehydrated}return null}function d(o){if(o.tag===31){var a=o.memoizedState;if(a===null&&(o=o.alternate,o!==null&&(a=o.memoizedState)),a!==null)return a.dehydrated}return null}function f(o){if(l(o)!==o)throw Error(r(188))}function m(o){var a=o.alternate;if(!a){if(a=l(o),a===null)throw Error(r(188));return a!==o?null:o}for(var i=o,u=a;;){var g=i.return;if(g===null)break;var y=g.alternate;if(y===null){if(u=g.return,u!==null){i=u;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===i)return f(g),o;if(y===u)return f(g),a;y=y.sibling}throw Error(r(188))}if(i.return!==u.return)i=g,u=y;else{for(var E=!1,O=g.child;O;){if(O===i){E=!0,i=g,u=y;break}if(O===u){E=!0,u=g,i=y;break}O=O.sibling}if(!E){for(O=y.child;O;){if(O===i){E=!0,i=y,u=g;break}if(O===u){E=!0,u=y,i=g;break}O=O.sibling}if(!E)throw Error(r(189))}}if(i.alternate!==u)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?o:a}function v(o){var a=o.tag;if(a===5||a===26||a===27||a===6)return o;for(o=o.child;o!==null;){if(a=v(o),a!==null)return a;o=o.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),M=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function ie(o){return o===null||typeof o!="object"?null:(o=J&&o[J]||o["@@iterator"],typeof o=="function"?o:null)}var ue=Symbol.for("react.client.reference");function ae(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===ue?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case w:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case j:return"Suspense";case A:return"SuspenseList";case B:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case _:return"Portal";case M:return o.displayName||"Context";case N:return(o._context.displayName||"Context")+".Consumer";case R:var a=o.render;return o=o.displayName,o||(o=a.displayName||a.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case D:return a=o.displayName||null,a!==null?a:ae(o.type)||"Memo";case L:a=o._payload,o=o._init;try{return ae(o(a))}catch{}}return null}var pe=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},ee=[],ve=-1;function z(o){return{current:o}}function P(o){0>ve||(o.current=ee[ve],ee[ve]=null,ve--)}function U(o,a){ve++,ee[ve]=o.current,o.current=a}var W=z(null),oe=z(null),he=z(null),X=z(null);function ye(o,a){switch(U(he,a),U(oe,o),U(W,null),a.nodeType){case 9:case 11:o=(o=a.documentElement)&&(o=o.namespaceURI)?xx(o):0;break;default:if(o=a.tagName,a=a.namespaceURI)a=xx(a),o=Sx(a,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}P(W),U(W,o)}function _e(){P(W),P(oe),P(he)}function De(o){o.memoizedState!==null&&U(X,o);var a=W.current,i=Sx(a,o.type);a!==i&&(U(oe,o),U(W,i))}function qe(o){oe.current===o&&(P(W),P(oe)),X.current===o&&(P(X),zl._currentValue=H)}var Ge,Lt;function Rt(o){if(Ge===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);Ge=a&&a[1]||"",Lt=-1<i.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+Ge+o+Lt}var En=!1;function Fn(o,a){if(!o||En)return"";En=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(re){var Q=re}Reflect.construct(o,[],ce)}else{try{ce.call()}catch(re){Q=re}o.call(ce.prototype)}}else{try{throw Error()}catch(re){Q=re}(ce=o())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(re){if(re&&Q&&typeof re.stack=="string")return[re.stack,Q.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),E=y[0],O=y[1];if(E&&O){var F=E.split(`
5
+ `),Z=O.split(`
6
+ `);for(g=u=0;u<F.length&&!F[u].includes("DetermineComponentFrameRoot");)u++;for(;g<Z.length&&!Z[g].includes("DetermineComponentFrameRoot");)g++;if(u===F.length||g===Z.length)for(u=F.length-1,g=Z.length-1;1<=u&&0<=g&&F[u]!==Z[g];)g--;for(;1<=u&&0<=g;u--,g--)if(F[u]!==Z[g]){if(u!==1||g!==1)do if(u--,g--,0>g||F[u]!==Z[g]){var se=`
7
+ `+F[u].replace(" at new "," at ");return o.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",o.displayName)),se}while(1<=u&&0<=g);break}}}finally{En=!1,Error.prepareStackTrace=i}return(i=o?o.displayName||o.name:"")?Rt(i):""}function Tn(o,a){switch(o.tag){case 26:case 27:case 5:return Rt(o.type);case 16:return Rt("Lazy");case 13:return o.child!==a&&a!==null?Rt("Suspense Fallback"):Rt("Suspense");case 19:return Rt("SuspenseList");case 0:case 15:return Fn(o.type,!1);case 11:return Fn(o.type.render,!1);case 1:return Fn(o.type,!0);case 31:return Rt("Activity");default:return""}}function Ho(o){try{var a="",i=null;do a+=Tn(o,i),i=o,o=o.return;while(o);return a}catch(u){return`
8
+ Error generating stack: `+u.message+`
9
+ `+u.stack}}var on=Object.prototype.hasOwnProperty,V=e.unstable_scheduleCallback,G=e.unstable_cancelCallback,te=e.unstable_shouldYield,xe=e.unstable_requestPaint,me=e.unstable_now,ge=e.unstable_getCurrentPriorityLevel,Te=e.unstable_ImmediatePriority,tt=e.unstable_UserBlockingPriority,nt=e.unstable_NormalPriority,Ht=e.unstable_LowPriority,yn=e.unstable_IdlePriority,Nn=e.log,hr=e.unstable_setDisableYieldValue,Xn=null,Ft=null;function Rn(o){if(typeof Nn=="function"&&hr(o),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(Xn,o)}catch{}}var It=Math.clz32?Math.clz32:Le,qo=Math.log,Qr=Math.LN2;function Le(o){return o>>>=0,o===0?32:31-(qo(o)/Qr|0)|0}var Xe=256,Pe=262144,We=4194304;function Mt(o){var a=o&42;if(a!==0)return a;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Se(o,a,i){var u=o.pendingLanes;if(u===0)return 0;var g=0,y=o.suspendedLanes,E=o.pingedLanes;o=o.warmLanes;var O=u&134217727;return O!==0?(u=O&~y,u!==0?g=Mt(u):(E&=O,E!==0?g=Mt(E):i||(i=O&~o,i!==0&&(g=Mt(i))))):(O=u&~y,O!==0?g=Mt(O):E!==0?g=Mt(E):i||(i=u&~o,i!==0&&(g=Mt(i)))),g===0?0:a!==0&&a!==g&&(a&y)===0&&(y=g&-g,i=a&-a,y>=i||y===32&&(i&4194048)!==0)?a:g}function wt(o,a){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&a)===0}function qt(o,a){switch(o){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 an(){var o=We;return We<<=1,(We&62914560)===0&&(We=4194304),o}function mr(o){for(var a=[],i=0;31>i;i++)a.push(o);return a}function xt(o,a){o.pendingLanes|=a,a!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function In(o,a,i,u,g,y){var E=o.pendingLanes;o.pendingLanes=i,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=i,o.entangledLanes&=i,o.errorRecoveryDisabledLanes&=i,o.shellSuspendCounter=0;var O=o.entanglements,F=o.expirationTimes,Z=o.hiddenUpdates;for(i=E&~i;0<i;){var se=31-It(i),ce=1<<se;O[se]=0,F[se]=-1;var Q=Z[se];if(Q!==null)for(Z[se]=null,se=0;se<Q.length;se++){var re=Q[se];re!==null&&(re.lane&=-536870913)}i&=~ce}u!==0&&La(o,u,0),y!==0&&g===0&&o.tag!==0&&(o.suspendedLanes|=y&~(E&~a))}function La(o,a,i){o.pendingLanes|=a,o.suspendedLanes&=~a;var u=31-It(a);o.entangledLanes|=a,o.entanglements[u]=o.entanglements[u]|1073741824|i&261930}function Vn(o,a){var i=o.entangledLanes|=a;for(o=o.entanglements;i;){var u=31-It(i),g=1<<u;g&a|o[u]&a&&(o[u]|=a),i&=~g}}function $n(o,a){var i=a&-a;return i=(i&42)!==0?1:_s(i),(i&(o.suspendedLanes|a))!==0?0:i}function _s(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function kr(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function bf(){var o=Y.p;return o!==0?o:(o=window.event,o===void 0?32:Hx(o.type))}function sy(o,a){var i=Y.p;try{return Y.p=o,a()}finally{Y.p=i}}var Yo=Math.random().toString(36).slice(2),un="__reactFiber$"+Yo,Un="__reactProps$"+Yo,Es="__reactContainer$"+Yo,xf="__reactEvents$"+Yo,gN="__reactListeners$"+Yo,vN="__reactHandles$"+Yo,iy="__reactResources$"+Yo,Wi="__reactMarker$"+Yo;function Sf(o){delete o[un],delete o[Un],delete o[xf],delete o[gN],delete o[vN]}function Ts(o){var a=o[un];if(a)return a;for(var i=o.parentNode;i;){if(a=i[Es]||i[un]){if(i=a.alternate,a.child!==null||i!==null&&i.child!==null)for(o=Rx(o);o!==null;){if(i=o[un])return i;o=Rx(o)}return a}o=i,i=o.parentNode}return null}function Ns(o){if(o=o[un]||o[Es]){var a=o.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return o}return null}function Qi(o){var a=o.tag;if(a===5||a===26||a===27||a===6)return o.stateNode;throw Error(r(33))}function Rs(o){var a=o[iy];return a||(a=o[iy]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function sn(o){o[Wi]=!0}var ly=new Set,cy={};function Fa(o,a){Ms(o,a),Ms(o+"Capture",a)}function Ms(o,a){for(cy[o]=a,o=0;o<a.length;o++)ly.add(a[o])}var yN=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]*$"),uy={},dy={};function bN(o){return on.call(dy,o)?!0:on.call(uy,o)?!1:yN.test(o)?dy[o]=!0:(uy[o]=!0,!1)}function Mc(o,a,i){if(bN(a))if(i===null)o.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":o.removeAttribute(a);return;case"boolean":var u=a.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){o.removeAttribute(a);return}}o.setAttribute(a,""+i)}}function Oc(o,a,i){if(i===null)o.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(a);return}o.setAttribute(a,""+i)}}function vo(o,a,i,u){if(u===null)o.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(i);return}o.setAttributeNS(a,i,""+u)}}function pr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function fy(o){var a=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function xN(o,a,i){var u=Object.getOwnPropertyDescriptor(o.constructor.prototype,a);if(!o.hasOwnProperty(a)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var g=u.get,y=u.set;return Object.defineProperty(o,a,{configurable:!0,get:function(){return g.call(this)},set:function(E){i=""+E,y.call(this,E)}}),Object.defineProperty(o,a,{enumerable:u.enumerable}),{getValue:function(){return i},setValue:function(E){i=""+E},stopTracking:function(){o._valueTracker=null,delete o[a]}}}}function wf(o){if(!o._valueTracker){var a=fy(o)?"checked":"value";o._valueTracker=xN(o,a,""+o[a])}}function hy(o){if(!o)return!1;var a=o._valueTracker;if(!a)return!0;var i=a.getValue(),u="";return o&&(u=fy(o)?o.checked?"true":"false":o.value),o=u,o!==i?(a.setValue(o),!0):!1}function Ac(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var SN=/[\n"\\]/g;function gr(o){return o.replace(SN,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Cf(o,a,i,u,g,y,E,O){o.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?o.type=E:o.removeAttribute("type"),a!=null?E==="number"?(a===0&&o.value===""||o.value!=a)&&(o.value=""+pr(a)):o.value!==""+pr(a)&&(o.value=""+pr(a)):E!=="submit"&&E!=="reset"||o.removeAttribute("value"),a!=null?_f(o,E,pr(a)):i!=null?_f(o,E,pr(i)):u!=null&&o.removeAttribute("value"),g==null&&y!=null&&(o.defaultChecked=!!y),g!=null&&(o.checked=g&&typeof g!="function"&&typeof g!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?o.name=""+pr(O):o.removeAttribute("name")}function my(o,a,i,u,g,y,E,O){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(o.type=y),a!=null||i!=null){if(!(y!=="submit"&&y!=="reset"||a!=null)){wf(o);return}i=i!=null?""+pr(i):"",a=a!=null?""+pr(a):i,O||a===o.value||(o.value=a),o.defaultValue=a}u=u??g,u=typeof u!="function"&&typeof u!="symbol"&&!!u,o.checked=O?o.checked:!!u,o.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.name=E),wf(o)}function _f(o,a,i){a==="number"&&Ac(o.ownerDocument)===o||o.defaultValue===""+i||(o.defaultValue=""+i)}function Os(o,a,i,u){if(o=o.options,a){a={};for(var g=0;g<i.length;g++)a["$"+i[g]]=!0;for(i=0;i<o.length;i++)g=a.hasOwnProperty("$"+o[i].value),o[i].selected!==g&&(o[i].selected=g),g&&u&&(o[i].defaultSelected=!0)}else{for(i=""+pr(i),a=null,g=0;g<o.length;g++){if(o[g].value===i){o[g].selected=!0,u&&(o[g].defaultSelected=!0);return}a!==null||o[g].disabled||(a=o[g])}a!==null&&(a.selected=!0)}}function py(o,a,i){if(a!=null&&(a=""+pr(a),a!==o.value&&(o.value=a),i==null)){o.defaultValue!==a&&(o.defaultValue=a);return}o.defaultValue=i!=null?""+pr(i):""}function gy(o,a,i,u){if(a==null){if(u!=null){if(i!=null)throw Error(r(92));if(pe(u)){if(1<u.length)throw Error(r(93));u=u[0]}i=u}i==null&&(i=""),a=i}i=pr(a),o.defaultValue=i,u=o.textContent,u===i&&u!==""&&u!==null&&(o.value=u),wf(o)}function As(o,a){if(a){var i=o.firstChild;if(i&&i===o.lastChild&&i.nodeType===3){i.nodeValue=a;return}}o.textContent=a}var wN=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 vy(o,a,i){var u=a.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?u?o.setProperty(a,""):a==="float"?o.cssFloat="":o[a]="":u?o.setProperty(a,i):typeof i!="number"||i===0||wN.has(a)?a==="float"?o.cssFloat=i:o[a]=(""+i).trim():o[a]=i+"px"}function yy(o,a,i){if(a!=null&&typeof a!="object")throw Error(r(62));if(o=o.style,i!=null){for(var u in i)!i.hasOwnProperty(u)||a!=null&&a.hasOwnProperty(u)||(u.indexOf("--")===0?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="");for(var g in a)u=a[g],a.hasOwnProperty(g)&&i[g]!==u&&vy(o,g,u)}else for(var y in a)a.hasOwnProperty(y)&&vy(o,y,a[y])}function Ef(o){if(o.indexOf("-")===-1)return!1;switch(o){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 CN=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"]]),_N=/^[\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 jc(o){return _N.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function yo(){}var Tf=null;function Nf(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var js=null,Ds=null;function by(o){var a=Ns(o);if(a&&(o=a.stateNode)){var i=o[Un]||null;e:switch(o=a.stateNode,a.type){case"input":if(Cf(o,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),a=i.name,i.type==="radio"&&a!=null){for(i=o;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+gr(""+a)+'"][type="radio"]'),a=0;a<i.length;a++){var u=i[a];if(u!==o&&u.form===o.form){var g=u[Un]||null;if(!g)throw Error(r(90));Cf(u,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(a=0;a<i.length;a++)u=i[a],u.form===o.form&&hy(u)}break e;case"textarea":py(o,i.value,i.defaultValue);break e;case"select":a=i.value,a!=null&&Os(o,!!i.multiple,a,!1)}}}var Rf=!1;function xy(o,a,i){if(Rf)return o(a,i);Rf=!0;try{var u=o(a);return u}finally{if(Rf=!1,(js!==null||Ds!==null)&&(bu(),js&&(a=js,o=Ds,Ds=js=null,by(a),o)))for(a=0;a<o.length;a++)by(o[a])}}function Xi(o,a){var i=o.stateNode;if(i===null)return null;var u=i[Un]||null;if(u===null)return null;i=u[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(o=o.type,u=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!u;break e;default:o=!1}if(o)return null;if(i&&typeof i!="function")throw Error(r(231,a,typeof i));return i}var bo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mf=!1;if(bo)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){Mf=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{Mf=!1}var Go=null,Of=null,Dc=null;function Sy(){if(Dc)return Dc;var o,a=Of,i=a.length,u,g="value"in Go?Go.value:Go.textContent,y=g.length;for(o=0;o<i&&a[o]===g[o];o++);var E=i-o;for(u=1;u<=E&&a[i-u]===g[y-u];u++);return Dc=g.slice(o,1<u?1-u:void 0)}function kc(o){var a=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&a===13&&(o=13)):o=a,o===10&&(o=13),32<=o||o===13?o:0}function zc(){return!0}function wy(){return!1}function Bn(o){function a(i,u,g,y,E){this._reactName=i,this._targetInst=g,this.type=u,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var O in o)o.hasOwnProperty(O)&&(i=o[O],this[O]=i?i(y):y[O]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?zc:wy,this.isPropagationStopped=wy,this}return p(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=zc)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=zc)},persist:function(){},isPersistent:zc}),a}var Ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pc=Bn(Ia),el=p({},Ia,{view:0,detail:0}),EN=Bn(el),Af,jf,tl,Lc=p({},el,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kf,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==tl&&(tl&&o.type==="mousemove"?(Af=o.screenX-tl.screenX,jf=o.screenY-tl.screenY):jf=Af=0,tl=o),Af)},movementY:function(o){return"movementY"in o?o.movementY:jf}}),Cy=Bn(Lc),TN=p({},Lc,{dataTransfer:0}),NN=Bn(TN),RN=p({},el,{relatedTarget:0}),Df=Bn(RN),MN=p({},Ia,{animationName:0,elapsedTime:0,pseudoElement:0}),ON=Bn(MN),AN=p({},Ia,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),jN=Bn(AN),DN=p({},Ia,{data:0}),_y=Bn(DN),kN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zN={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"},PN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LN(o){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(o):(o=PN[o])?!!a[o]:!1}function kf(){return LN}var FN=p({},el,{key:function(o){if(o.key){var a=kN[o.key]||o.key;if(a!=="Unidentified")return a}return o.type==="keypress"?(o=kc(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?zN[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kf,charCode:function(o){return o.type==="keypress"?kc(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?kc(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),IN=Bn(FN),VN=p({},Lc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ey=Bn(VN),$N=p({},el,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kf}),UN=Bn($N),BN=p({},Ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),HN=Bn(BN),qN=p({},Lc,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),YN=Bn(qN),GN=p({},Ia,{newState:0,oldState:0}),KN=Bn(GN),ZN=[9,13,27,32],zf=bo&&"CompositionEvent"in window,nl=null;bo&&"documentMode"in document&&(nl=document.documentMode);var WN=bo&&"TextEvent"in window&&!nl,Ty=bo&&(!zf||nl&&8<nl&&11>=nl),Ny=" ",Ry=!1;function My(o,a){switch(o){case"keyup":return ZN.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Oy(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ks=!1;function QN(o,a){switch(o){case"compositionend":return Oy(a);case"keypress":return a.which!==32?null:(Ry=!0,Ny);case"textInput":return o=a.data,o===Ny&&Ry?null:o;default:return null}}function XN(o,a){if(ks)return o==="compositionend"||!zf&&My(o,a)?(o=Sy(),Dc=Of=Go=null,ks=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return Ty&&a.locale!=="ko"?null:a.data;default:return null}}var JN={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 Ay(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a==="input"?!!JN[o.type]:a==="textarea"}function jy(o,a,i,u){js?Ds?Ds.push(u):Ds=[u]:js=u,a=Tu(a,"onChange"),0<a.length&&(i=new Pc("onChange","change",null,i,u),o.push({event:i,listeners:a}))}var rl=null,ol=null;function eR(o){mx(o,0)}function Fc(o){var a=Qi(o);if(hy(a))return o}function Dy(o,a){if(o==="change")return a}var ky=!1;if(bo){var Pf;if(bo){var Lf="oninput"in document;if(!Lf){var zy=document.createElement("div");zy.setAttribute("oninput","return;"),Lf=typeof zy.oninput=="function"}Pf=Lf}else Pf=!1;ky=Pf&&(!document.documentMode||9<document.documentMode)}function Py(){rl&&(rl.detachEvent("onpropertychange",Ly),ol=rl=null)}function Ly(o){if(o.propertyName==="value"&&Fc(ol)){var a=[];jy(a,ol,o,Nf(o)),xy(eR,a)}}function tR(o,a,i){o==="focusin"?(Py(),rl=a,ol=i,rl.attachEvent("onpropertychange",Ly)):o==="focusout"&&Py()}function nR(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Fc(ol)}function rR(o,a){if(o==="click")return Fc(a)}function oR(o,a){if(o==="input"||o==="change")return Fc(a)}function aR(o,a){return o===a&&(o!==0||1/o===1/a)||o!==o&&a!==a}var Jn=typeof Object.is=="function"?Object.is:aR;function al(o,a){if(Jn(o,a))return!0;if(typeof o!="object"||o===null||typeof a!="object"||a===null)return!1;var i=Object.keys(o),u=Object.keys(a);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var g=i[u];if(!on.call(a,g)||!Jn(o[g],a[g]))return!1}return!0}function Fy(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Iy(o,a){var i=Fy(o);o=0;for(var u;i;){if(i.nodeType===3){if(u=o+i.textContent.length,o<=a&&u>=a)return{node:i,offset:a-o};o=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Fy(i)}}function Vy(o,a){return o&&a?o===a?!0:o&&o.nodeType===3?!1:a&&a.nodeType===3?Vy(o,a.parentNode):"contains"in o?o.contains(a):o.compareDocumentPosition?!!(o.compareDocumentPosition(a)&16):!1:!1}function $y(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var a=Ac(o.document);a instanceof o.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)o=a.contentWindow;else break;a=Ac(o.document)}return a}function Ff(o){var a=o&&o.nodeName&&o.nodeName.toLowerCase();return a&&(a==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||a==="textarea"||o.contentEditable==="true")}var sR=bo&&"documentMode"in document&&11>=document.documentMode,zs=null,If=null,sl=null,Vf=!1;function Uy(o,a,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Vf||zs==null||zs!==Ac(u)||(u=zs,"selectionStart"in u&&Ff(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),sl&&al(sl,u)||(sl=u,u=Tu(If,"onSelect"),0<u.length&&(a=new Pc("onSelect","select",null,a,i),o.push({event:a,listeners:u}),a.target=zs)))}function Va(o,a){var i={};return i[o.toLowerCase()]=a.toLowerCase(),i["Webkit"+o]="webkit"+a,i["Moz"+o]="moz"+a,i}var Ps={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionrun:Va("Transition","TransitionRun"),transitionstart:Va("Transition","TransitionStart"),transitioncancel:Va("Transition","TransitionCancel"),transitionend:Va("Transition","TransitionEnd")},$f={},By={};bo&&(By=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function $a(o){if($f[o])return $f[o];if(!Ps[o])return o;var a=Ps[o],i;for(i in a)if(a.hasOwnProperty(i)&&i in By)return $f[o]=a[i];return o}var Hy=$a("animationend"),qy=$a("animationiteration"),Yy=$a("animationstart"),iR=$a("transitionrun"),lR=$a("transitionstart"),cR=$a("transitioncancel"),Gy=$a("transitionend"),Ky=new Map,Uf="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(" ");Uf.push("scrollEnd");function zr(o,a){Ky.set(o,a),Fa(a,[o])}var Ic=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},vr=[],Ls=0,Bf=0;function Vc(){for(var o=Ls,a=Bf=Ls=0;a<o;){var i=vr[a];vr[a++]=null;var u=vr[a];vr[a++]=null;var g=vr[a];vr[a++]=null;var y=vr[a];if(vr[a++]=null,u!==null&&g!==null){var E=u.pending;E===null?g.next=g:(g.next=E.next,E.next=g),u.pending=g}y!==0&&Zy(i,g,y)}}function $c(o,a,i,u){vr[Ls++]=o,vr[Ls++]=a,vr[Ls++]=i,vr[Ls++]=u,Bf|=u,o.lanes|=u,o=o.alternate,o!==null&&(o.lanes|=u)}function Hf(o,a,i,u){return $c(o,a,i,u),Uc(o)}function Ua(o,a){return $c(o,null,null,a),Uc(o)}function Zy(o,a,i){o.lanes|=i;var u=o.alternate;u!==null&&(u.lanes|=i);for(var g=!1,y=o.return;y!==null;)y.childLanes|=i,u=y.alternate,u!==null&&(u.childLanes|=i),y.tag===22&&(o=y.stateNode,o===null||o._visibility&1||(g=!0)),o=y,y=y.return;return o.tag===3?(y=o.stateNode,g&&a!==null&&(g=31-It(i),o=y.hiddenUpdates,u=o[g],u===null?o[g]=[a]:u.push(a),a.lane=i|536870912),y):null}function Uc(o){if(50<Rl)throw Rl=0,Jh=null,Error(r(185));for(var a=o.return;a!==null;)o=a,a=o.return;return o.tag===3?o.stateNode:null}var Fs={};function uR(o,a,i,u){this.tag=o,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function er(o,a,i,u){return new uR(o,a,i,u)}function qf(o){return o=o.prototype,!(!o||!o.isReactComponent)}function xo(o,a){var i=o.alternate;return i===null?(i=er(o.tag,a,o.key,o.mode),i.elementType=o.elementType,i.type=o.type,i.stateNode=o.stateNode,i.alternate=o,o.alternate=i):(i.pendingProps=a,i.type=o.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=o.flags&65011712,i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,a=o.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=o.sibling,i.index=o.index,i.ref=o.ref,i.refCleanup=o.refCleanup,i}function Wy(o,a){o.flags&=65011714;var i=o.alternate;return i===null?(o.childLanes=0,o.lanes=a,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,a=i.dependencies,o.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),o}function Bc(o,a,i,u,g,y){var E=0;if(u=o,typeof o=="function")qf(o)&&(E=1);else if(typeof o=="string")E=pM(o,i,W.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case B:return o=er(31,i,a,g),o.elementType=B,o.lanes=y,o;case w:return Ba(i.children,g,y,a);case C:E=8,g|=24;break;case T:return o=er(12,i,a,g|2),o.elementType=T,o.lanes=y,o;case j:return o=er(13,i,a,g),o.elementType=j,o.lanes=y,o;case A:return o=er(19,i,a,g),o.elementType=A,o.lanes=y,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:E=10;break e;case N:E=9;break e;case R:E=11;break e;case D:E=14;break e;case L:E=16,u=null;break e}E=29,i=Error(r(130,o===null?"null":typeof o,"")),u=null}return a=er(E,i,a,g),a.elementType=o,a.type=u,a.lanes=y,a}function Ba(o,a,i,u){return o=er(7,o,u,a),o.lanes=i,o}function Yf(o,a,i){return o=er(6,o,null,a),o.lanes=i,o}function Qy(o){var a=er(18,null,null,0);return a.stateNode=o,a}function Gf(o,a,i){return a=er(4,o.children!==null?o.children:[],o.key,a),a.lanes=i,a.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},a}var Xy=new WeakMap;function yr(o,a){if(typeof o=="object"&&o!==null){var i=Xy.get(o);return i!==void 0?i:(a={value:o,source:a,stack:Ho(a)},Xy.set(o,a),a)}return{value:o,source:a,stack:Ho(a)}}var Is=[],Vs=0,Hc=null,il=0,br=[],xr=0,Ko=null,Xr=1,Jr="";function So(o,a){Is[Vs++]=il,Is[Vs++]=Hc,Hc=o,il=a}function Jy(o,a,i){br[xr++]=Xr,br[xr++]=Jr,br[xr++]=Ko,Ko=o;var u=Xr;o=Jr;var g=32-It(u)-1;u&=~(1<<g),i+=1;var y=32-It(a)+g;if(30<y){var E=g-g%5;y=(u&(1<<E)-1).toString(32),u>>=E,g-=E,Xr=1<<32-It(a)+g|i<<g|u,Jr=y+o}else Xr=1<<y|i<<g|u,Jr=o}function Kf(o){o.return!==null&&(So(o,1),Jy(o,1,0))}function Zf(o){for(;o===Hc;)Hc=Is[--Vs],Is[Vs]=null,il=Is[--Vs],Is[Vs]=null;for(;o===Ko;)Ko=br[--xr],br[xr]=null,Jr=br[--xr],br[xr]=null,Xr=br[--xr],br[xr]=null}function eb(o,a){br[xr++]=Xr,br[xr++]=Jr,br[xr++]=Ko,Xr=a.id,Jr=a.overflow,Ko=o}var dn=null,Et=null,st=!1,Zo=null,Sr=!1,Wf=Error(r(519));function Wo(o){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ll(yr(a,o)),Wf}function tb(o){var a=o.stateNode,i=o.type,u=o.memoizedProps;switch(a[un]=o,a[Un]=u,i){case"dialog":et("cancel",a),et("close",a);break;case"iframe":case"object":case"embed":et("load",a);break;case"video":case"audio":for(i=0;i<Ol.length;i++)et(Ol[i],a);break;case"source":et("error",a);break;case"img":case"image":case"link":et("error",a),et("load",a);break;case"details":et("toggle",a);break;case"input":et("invalid",a),my(a,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":et("invalid",a);break;case"textarea":et("invalid",a),gy(a,u.value,u.defaultValue,u.children)}i=u.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||a.textContent===""+i||u.suppressHydrationWarning===!0||yx(a.textContent,i)?(u.popover!=null&&(et("beforetoggle",a),et("toggle",a)),u.onScroll!=null&&et("scroll",a),u.onScrollEnd!=null&&et("scrollend",a),u.onClick!=null&&(a.onclick=yo),a=!0):a=!1,a||Wo(o,!0)}function nb(o){for(dn=o.return;dn;)switch(dn.tag){case 5:case 31:case 13:Sr=!1;return;case 27:case 3:Sr=!0;return;default:dn=dn.return}}function $s(o){if(o!==dn)return!1;if(!st)return nb(o),st=!0,!1;var a=o.tag,i;if((i=a!==3&&a!==27)&&((i=a===5)&&(i=o.type,i=!(i!=="form"&&i!=="button")||mm(o.type,o.memoizedProps)),i=!i),i&&Et&&Wo(o),nb(o),a===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Et=Nx(o)}else if(a===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Et=Nx(o)}else a===27?(a=Et,ua(o.type)?(o=bm,bm=null,Et=o):Et=a):Et=dn?Cr(o.stateNode.nextSibling):null;return!0}function Ha(){Et=dn=null,st=!1}function Qf(){var o=Zo;return o!==null&&(Gn===null?Gn=o:Gn.push.apply(Gn,o),Zo=null),o}function ll(o){Zo===null?Zo=[o]:Zo.push(o)}var Xf=z(null),qa=null,wo=null;function Qo(o,a,i){U(Xf,a._currentValue),a._currentValue=i}function Co(o){o._currentValue=Xf.current,P(Xf)}function Jf(o,a,i){for(;o!==null;){var u=o.alternate;if((o.childLanes&a)!==a?(o.childLanes|=a,u!==null&&(u.childLanes|=a)):u!==null&&(u.childLanes&a)!==a&&(u.childLanes|=a),o===i)break;o=o.return}}function eh(o,a,i,u){var g=o.child;for(g!==null&&(g.return=o);g!==null;){var y=g.dependencies;if(y!==null){var E=g.child;y=y.firstContext;e:for(;y!==null;){var O=y;y=g;for(var F=0;F<a.length;F++)if(O.context===a[F]){y.lanes|=i,O=y.alternate,O!==null&&(O.lanes|=i),Jf(y.return,i,o),u||(E=null);break e}y=O.next}}else if(g.tag===18){if(E=g.return,E===null)throw Error(r(341));E.lanes|=i,y=E.alternate,y!==null&&(y.lanes|=i),Jf(E,i,o),E=null}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===o){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}}function Us(o,a,i,u){o=null;for(var g=a,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var E=g.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var O=g.type;Jn(g.pendingProps.value,E.value)||(o!==null?o.push(O):o=[O])}}else if(g===X.current){if(E=g.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(o!==null?o.push(zl):o=[zl])}g=g.return}o!==null&&eh(a,o,i,u),a.flags|=262144}function qc(o){for(o=o.firstContext;o!==null;){if(!Jn(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Ya(o){qa=o,wo=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function fn(o){return rb(qa,o)}function Yc(o,a){return qa===null&&Ya(o),rb(o,a)}function rb(o,a){var i=a._currentValue;if(a={context:a,memoizedValue:i,next:null},wo===null){if(o===null)throw Error(r(308));wo=a,o.dependencies={lanes:0,firstContext:a},o.flags|=524288}else wo=wo.next=a;return i}var dR=typeof AbortController<"u"?AbortController:function(){var o=[],a=this.signal={aborted:!1,addEventListener:function(i,u){o.push(u)}};this.abort=function(){a.aborted=!0,o.forEach(function(i){return i()})}},fR=e.unstable_scheduleCallback,hR=e.unstable_NormalPriority,Yt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function th(){return{controller:new dR,data:new Map,refCount:0}}function cl(o){o.refCount--,o.refCount===0&&fR(hR,function(){o.controller.abort()})}var ul=null,nh=0,Bs=0,Hs=null;function mR(o,a){if(ul===null){var i=ul=[];nh=0,Bs=am(),Hs={status:"pending",value:void 0,then:function(u){i.push(u)}}}return nh++,a.then(ob,ob),a}function ob(){if(--nh===0&&ul!==null){Hs!==null&&(Hs.status="fulfilled");var o=ul;ul=null,Bs=0,Hs=null;for(var a=0;a<o.length;a++)(0,o[a])()}}function pR(o,a){var i=[],u={status:"pending",value:null,reason:null,then:function(g){i.push(g)}};return o.then(function(){u.status="fulfilled",u.value=a;for(var g=0;g<i.length;g++)(0,i[g])(a)},function(g){for(u.status="rejected",u.reason=g,g=0;g<i.length;g++)(0,i[g])(void 0)}),u}var ab=k.S;k.S=function(o,a){U0=me(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&mR(o,a),ab!==null&&ab(o,a)};var Ga=z(null);function rh(){var o=Ga.current;return o!==null?o:St.pooledCache}function Gc(o,a){a===null?U(Ga,Ga.current):U(Ga,a.pool)}function sb(){var o=rh();return o===null?null:{parent:Yt._currentValue,pool:o}}var qs=Error(r(460)),oh=Error(r(474)),Kc=Error(r(542)),Zc={then:function(){}};function ib(o){return o=o.status,o==="fulfilled"||o==="rejected"}function lb(o,a,i){switch(i=o[i],i===void 0?o.push(a):i!==a&&(a.then(yo,yo),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw o=a.reason,ub(o),o;default:if(typeof a.status=="string")a.then(yo,yo);else{if(o=St,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=a,o.status="pending",o.then(function(u){if(a.status==="pending"){var g=a;g.status="fulfilled",g.value=u}},function(u){if(a.status==="pending"){var g=a;g.status="rejected",g.reason=u}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw o=a.reason,ub(o),o}throw Za=a,qs}}function Ka(o){try{var a=o._init;return a(o._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Za=i,qs):i}}var Za=null;function cb(){if(Za===null)throw Error(r(459));var o=Za;return Za=null,o}function ub(o){if(o===qs||o===Kc)throw Error(r(483))}var Ys=null,dl=0;function Wc(o){var a=dl;return dl+=1,Ys===null&&(Ys=[]),lb(Ys,o,a)}function fl(o,a){a=a.props.ref,o.ref=a!==void 0?a:null}function Qc(o,a){throw a.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(a),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":o)))}function db(o){function a(q,$){if(o){var K=q.deletions;K===null?(q.deletions=[$],q.flags|=16):K.push($)}}function i(q,$){if(!o)return null;for(;$!==null;)a(q,$),$=$.sibling;return null}function u(q){for(var $=new Map;q!==null;)q.key!==null?$.set(q.key,q):$.set(q.index,q),q=q.sibling;return $}function g(q,$){return q=xo(q,$),q.index=0,q.sibling=null,q}function y(q,$,K){return q.index=K,o?(K=q.alternate,K!==null?(K=K.index,K<$?(q.flags|=67108866,$):K):(q.flags|=67108866,$)):(q.flags|=1048576,$)}function E(q){return o&&q.alternate===null&&(q.flags|=67108866),q}function O(q,$,K,le){return $===null||$.tag!==6?($=Yf(K,q.mode,le),$.return=q,$):($=g($,K),$.return=q,$)}function F(q,$,K,le){var ke=K.type;return ke===w?se(q,$,K.props.children,le,K.key):$!==null&&($.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===L&&Ka(ke)===$.type)?($=g($,K.props),fl($,K),$.return=q,$):($=Bc(K.type,K.key,K.props,null,q.mode,le),fl($,K),$.return=q,$)}function Z(q,$,K,le){return $===null||$.tag!==4||$.stateNode.containerInfo!==K.containerInfo||$.stateNode.implementation!==K.implementation?($=Gf(K,q.mode,le),$.return=q,$):($=g($,K.children||[]),$.return=q,$)}function se(q,$,K,le,ke){return $===null||$.tag!==7?($=Ba(K,q.mode,le,ke),$.return=q,$):($=g($,K),$.return=q,$)}function ce(q,$,K){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Yf(""+$,q.mode,K),$.return=q,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case S:return K=Bc($.type,$.key,$.props,null,q.mode,K),fl(K,$),K.return=q,K;case _:return $=Gf($,q.mode,K),$.return=q,$;case L:return $=Ka($),ce(q,$,K)}if(pe($)||ie($))return $=Ba($,q.mode,K,null),$.return=q,$;if(typeof $.then=="function")return ce(q,Wc($),K);if($.$$typeof===M)return ce(q,Yc(q,$),K);Qc(q,$)}return null}function Q(q,$,K,le){var ke=$!==null?$.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return ke!==null?null:O(q,$,""+K,le);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return K.key===ke?F(q,$,K,le):null;case _:return K.key===ke?Z(q,$,K,le):null;case L:return K=Ka(K),Q(q,$,K,le)}if(pe(K)||ie(K))return ke!==null?null:se(q,$,K,le,null);if(typeof K.then=="function")return Q(q,$,Wc(K),le);if(K.$$typeof===M)return Q(q,$,Yc(q,K),le);Qc(q,K)}return null}function re(q,$,K,le,ke){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return q=q.get(K)||null,O($,q,""+le,ke);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case S:return q=q.get(le.key===null?K:le.key)||null,F($,q,le,ke);case _:return q=q.get(le.key===null?K:le.key)||null,Z($,q,le,ke);case L:return le=Ka(le),re(q,$,K,le,ke)}if(pe(le)||ie(le))return q=q.get(K)||null,se($,q,le,ke,null);if(typeof le.then=="function")return re(q,$,K,Wc(le),ke);if(le.$$typeof===M)return re(q,$,K,Yc($,le),ke);Qc($,le)}return null}function Ee(q,$,K,le){for(var ke=null,ct=null,Me=$,Ke=$=0,ot=null;Me!==null&&Ke<K.length;Ke++){Me.index>Ke?(ot=Me,Me=null):ot=Me.sibling;var ut=Q(q,Me,K[Ke],le);if(ut===null){Me===null&&(Me=ot);break}o&&Me&&ut.alternate===null&&a(q,Me),$=y(ut,$,Ke),ct===null?ke=ut:ct.sibling=ut,ct=ut,Me=ot}if(Ke===K.length)return i(q,Me),st&&So(q,Ke),ke;if(Me===null){for(;Ke<K.length;Ke++)Me=ce(q,K[Ke],le),Me!==null&&($=y(Me,$,Ke),ct===null?ke=Me:ct.sibling=Me,ct=Me);return st&&So(q,Ke),ke}for(Me=u(Me);Ke<K.length;Ke++)ot=re(Me,q,Ke,K[Ke],le),ot!==null&&(o&&ot.alternate!==null&&Me.delete(ot.key===null?Ke:ot.key),$=y(ot,$,Ke),ct===null?ke=ot:ct.sibling=ot,ct=ot);return o&&Me.forEach(function(pa){return a(q,pa)}),st&&So(q,Ke),ke}function Fe(q,$,K,le){if(K==null)throw Error(r(151));for(var ke=null,ct=null,Me=$,Ke=$=0,ot=null,ut=K.next();Me!==null&&!ut.done;Ke++,ut=K.next()){Me.index>Ke?(ot=Me,Me=null):ot=Me.sibling;var pa=Q(q,Me,ut.value,le);if(pa===null){Me===null&&(Me=ot);break}o&&Me&&pa.alternate===null&&a(q,Me),$=y(pa,$,Ke),ct===null?ke=pa:ct.sibling=pa,ct=pa,Me=ot}if(ut.done)return i(q,Me),st&&So(q,Ke),ke;if(Me===null){for(;!ut.done;Ke++,ut=K.next())ut=ce(q,ut.value,le),ut!==null&&($=y(ut,$,Ke),ct===null?ke=ut:ct.sibling=ut,ct=ut);return st&&So(q,Ke),ke}for(Me=u(Me);!ut.done;Ke++,ut=K.next())ut=re(Me,q,Ke,ut.value,le),ut!==null&&(o&&ut.alternate!==null&&Me.delete(ut.key===null?Ke:ut.key),$=y(ut,$,Ke),ct===null?ke=ut:ct.sibling=ut,ct=ut);return o&&Me.forEach(function(TM){return a(q,TM)}),st&&So(q,Ke),ke}function yt(q,$,K,le){if(typeof K=="object"&&K!==null&&K.type===w&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case S:e:{for(var ke=K.key;$!==null;){if($.key===ke){if(ke=K.type,ke===w){if($.tag===7){i(q,$.sibling),le=g($,K.props.children),le.return=q,q=le;break e}}else if($.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===L&&Ka(ke)===$.type){i(q,$.sibling),le=g($,K.props),fl(le,K),le.return=q,q=le;break e}i(q,$);break}else a(q,$);$=$.sibling}K.type===w?(le=Ba(K.props.children,q.mode,le,K.key),le.return=q,q=le):(le=Bc(K.type,K.key,K.props,null,q.mode,le),fl(le,K),le.return=q,q=le)}return E(q);case _:e:{for(ke=K.key;$!==null;){if($.key===ke)if($.tag===4&&$.stateNode.containerInfo===K.containerInfo&&$.stateNode.implementation===K.implementation){i(q,$.sibling),le=g($,K.children||[]),le.return=q,q=le;break e}else{i(q,$);break}else a(q,$);$=$.sibling}le=Gf(K,q.mode,le),le.return=q,q=le}return E(q);case L:return K=Ka(K),yt(q,$,K,le)}if(pe(K))return Ee(q,$,K,le);if(ie(K)){if(ke=ie(K),typeof ke!="function")throw Error(r(150));return K=ke.call(K),Fe(q,$,K,le)}if(typeof K.then=="function")return yt(q,$,Wc(K),le);if(K.$$typeof===M)return yt(q,$,Yc(q,K),le);Qc(q,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,$!==null&&$.tag===6?(i(q,$.sibling),le=g($,K),le.return=q,q=le):(i(q,$),le=Yf(K,q.mode,le),le.return=q,q=le),E(q)):i(q,$)}return function(q,$,K,le){try{dl=0;var ke=yt(q,$,K,le);return Ys=null,ke}catch(Me){if(Me===qs||Me===Kc)throw Me;var ct=er(29,Me,null,q.mode);return ct.lanes=le,ct.return=q,ct}finally{}}}var Wa=db(!0),fb=db(!1),Xo=!1;function ah(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sh(o,a){o=o.updateQueue,a.updateQueue===o&&(a.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Jo(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function ea(o,a,i){var u=o.updateQueue;if(u===null)return null;if(u=u.shared,(dt&2)!==0){var g=u.pending;return g===null?a.next=a:(a.next=g.next,g.next=a),u.pending=a,a=Uc(o),Zy(o,null,i),a}return $c(o,u,a,i),Uc(o)}function hl(o,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var u=a.lanes;u&=o.pendingLanes,i|=u,a.lanes=i,Vn(o,i)}}function ih(o,a){var i=o.updateQueue,u=o.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var g=null,y=null;if(i=i.firstBaseUpdate,i!==null){do{var E={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};y===null?g=y=E:y=y.next=E,i=i.next}while(i!==null);y===null?g=y=a:y=y.next=a}else g=y=a;i={baseState:u.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:u.shared,callbacks:u.callbacks},o.updateQueue=i;return}o=i.lastBaseUpdate,o===null?i.firstBaseUpdate=a:o.next=a,i.lastBaseUpdate=a}var lh=!1;function ml(){if(lh){var o=Hs;if(o!==null)throw o}}function pl(o,a,i,u){lh=!1;var g=o.updateQueue;Xo=!1;var y=g.firstBaseUpdate,E=g.lastBaseUpdate,O=g.shared.pending;if(O!==null){g.shared.pending=null;var F=O,Z=F.next;F.next=null,E===null?y=Z:E.next=Z,E=F;var se=o.alternate;se!==null&&(se=se.updateQueue,O=se.lastBaseUpdate,O!==E&&(O===null?se.firstBaseUpdate=Z:O.next=Z,se.lastBaseUpdate=F))}if(y!==null){var ce=g.baseState;E=0,se=Z=F=null,O=y;do{var Q=O.lane&-536870913,re=Q!==O.lane;if(re?(rt&Q)===Q:(u&Q)===Q){Q!==0&&Q===Bs&&(lh=!0),se!==null&&(se=se.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Ee=o,Fe=O;Q=a;var yt=i;switch(Fe.tag){case 1:if(Ee=Fe.payload,typeof Ee=="function"){ce=Ee.call(yt,ce,Q);break e}ce=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Fe.payload,Q=typeof Ee=="function"?Ee.call(yt,ce,Q):Ee,Q==null)break e;ce=p({},ce,Q);break e;case 2:Xo=!0}}Q=O.callback,Q!==null&&(o.flags|=64,re&&(o.flags|=8192),re=g.callbacks,re===null?g.callbacks=[Q]:re.push(Q))}else re={lane:Q,tag:O.tag,payload:O.payload,callback:O.callback,next:null},se===null?(Z=se=re,F=ce):se=se.next=re,E|=Q;if(O=O.next,O===null){if(O=g.shared.pending,O===null)break;re=O,O=re.next,re.next=null,g.lastBaseUpdate=re,g.shared.pending=null}}while(!0);se===null&&(F=ce),g.baseState=F,g.firstBaseUpdate=Z,g.lastBaseUpdate=se,y===null&&(g.shared.lanes=0),aa|=E,o.lanes=E,o.memoizedState=ce}}function hb(o,a){if(typeof o!="function")throw Error(r(191,o));o.call(a)}function mb(o,a){var i=o.callbacks;if(i!==null)for(o.callbacks=null,o=0;o<i.length;o++)hb(i[o],a)}var Gs=z(null),Xc=z(0);function pb(o,a){o=jo,U(Xc,o),U(Gs,a),jo=o|a.baseLanes}function ch(){U(Xc,jo),U(Gs,Gs.current)}function uh(){jo=Xc.current,P(Gs),P(Xc)}var tr=z(null),wr=null;function ta(o){var a=o.alternate;U(Vt,Vt.current&1),U(tr,o),wr===null&&(a===null||Gs.current!==null||a.memoizedState!==null)&&(wr=o)}function dh(o){U(Vt,Vt.current),U(tr,o),wr===null&&(wr=o)}function gb(o){o.tag===22?(U(Vt,Vt.current),U(tr,o),wr===null&&(wr=o)):na()}function na(){U(Vt,Vt.current),U(tr,tr.current)}function nr(o){P(tr),wr===o&&(wr=null),P(Vt)}var Vt=z(0);function Jc(o){for(var a=o;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||vm(i)||ym(i)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var _o=0,Ye=null,gt=null,Gt=null,eu=!1,Ks=!1,Qa=!1,tu=0,gl=0,Zs=null,gR=0;function zt(){throw Error(r(321))}function fh(o,a){if(a===null)return!1;for(var i=0;i<a.length&&i<o.length;i++)if(!Jn(o[i],a[i]))return!1;return!0}function hh(o,a,i,u,g,y){return _o=y,Ye=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,k.H=o===null||o.memoizedState===null?Jb:Rh,Qa=!1,y=i(u,g),Qa=!1,Ks&&(y=yb(a,i,u,g)),vb(o),y}function vb(o){k.H=bl;var a=gt!==null&&gt.next!==null;if(_o=0,Gt=gt=Ye=null,eu=!1,gl=0,Zs=null,a)throw Error(r(300));o===null||Kt||(o=o.dependencies,o!==null&&qc(o)&&(Kt=!0))}function yb(o,a,i,u){Ye=o;var g=0;do{if(Ks&&(Zs=null),gl=0,Ks=!1,25<=g)throw Error(r(301));if(g+=1,Gt=gt=null,o.updateQueue!=null){var y=o.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}k.H=e0,y=a(i,u)}while(Ks);return y}function vR(){var o=k.H,a=o.useState()[0];return a=typeof a.then=="function"?vl(a):a,o=o.useState()[0],(gt!==null?gt.memoizedState:null)!==o&&(Ye.flags|=1024),a}function mh(){var o=tu!==0;return tu=0,o}function ph(o,a,i){a.updateQueue=o.updateQueue,a.flags&=-2053,o.lanes&=~i}function gh(o){if(eu){for(o=o.memoizedState;o!==null;){var a=o.queue;a!==null&&(a.pending=null),o=o.next}eu=!1}_o=0,Gt=gt=Ye=null,Ks=!1,gl=tu=0,Zs=null}function Mn(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gt===null?Ye.memoizedState=Gt=o:Gt=Gt.next=o,Gt}function $t(){if(gt===null){var o=Ye.alternate;o=o!==null?o.memoizedState:null}else o=gt.next;var a=Gt===null?Ye.memoizedState:Gt.next;if(a!==null)Gt=a,gt=o;else{if(o===null)throw Ye.alternate===null?Error(r(467)):Error(r(310));gt=o,o={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Gt===null?Ye.memoizedState=Gt=o:Gt=Gt.next=o}return Gt}function nu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vl(o){var a=gl;return gl+=1,Zs===null&&(Zs=[]),o=lb(Zs,o,a),a=Ye,(Gt===null?a.memoizedState:Gt.next)===null&&(a=a.alternate,k.H=a===null||a.memoizedState===null?Jb:Rh),o}function ru(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return vl(o);if(o.$$typeof===M)return fn(o)}throw Error(r(438,String(o)))}function vh(o){var a=null,i=Ye.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var u=Ye.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(a={data:u.data.map(function(g){return g.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=nu(),Ye.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(o),u=0;u<o;u++)i[u]=ne;return a.index++,i}function Eo(o,a){return typeof a=="function"?a(o):a}function ou(o){var a=$t();return yh(a,gt,o)}function yh(o,a,i){var u=o.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var g=o.baseQueue,y=u.pending;if(y!==null){if(g!==null){var E=g.next;g.next=y.next,y.next=E}a.baseQueue=g=y,u.pending=null}if(y=o.baseState,g===null)o.memoizedState=y;else{a=g.next;var O=E=null,F=null,Z=a,se=!1;do{var ce=Z.lane&-536870913;if(ce!==Z.lane?(rt&ce)===ce:(_o&ce)===ce){var Q=Z.revertLane;if(Q===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),ce===Bs&&(se=!0);else if((_o&Q)===Q){Z=Z.next,Q===Bs&&(se=!0);continue}else ce={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},F===null?(O=F=ce,E=y):F=F.next=ce,Ye.lanes|=Q,aa|=Q;ce=Z.action,Qa&&i(y,ce),y=Z.hasEagerState?Z.eagerState:i(y,ce)}else Q={lane:ce,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},F===null?(O=F=Q,E=y):F=F.next=Q,Ye.lanes|=ce,aa|=ce;Z=Z.next}while(Z!==null&&Z!==a);if(F===null?E=y:F.next=O,!Jn(y,o.memoizedState)&&(Kt=!0,se&&(i=Hs,i!==null)))throw i;o.memoizedState=y,o.baseState=E,o.baseQueue=F,u.lastRenderedState=y}return g===null&&(u.lanes=0),[o.memoizedState,u.dispatch]}function bh(o){var a=$t(),i=a.queue;if(i===null)throw Error(r(311));i.lastRenderedReducer=o;var u=i.dispatch,g=i.pending,y=a.memoizedState;if(g!==null){i.pending=null;var E=g=g.next;do y=o(y,E.action),E=E.next;while(E!==g);Jn(y,a.memoizedState)||(Kt=!0),a.memoizedState=y,a.baseQueue===null&&(a.baseState=y),i.lastRenderedState=y}return[y,u]}function bb(o,a,i){var u=Ye,g=$t(),y=st;if(y){if(i===void 0)throw Error(r(407));i=i()}else i=a();var E=!Jn((gt||g).memoizedState,i);if(E&&(g.memoizedState=i,Kt=!0),g=g.queue,wh(wb.bind(null,u,g,o),[o]),g.getSnapshot!==a||E||Gt!==null&&Gt.memoizedState.tag&1){if(u.flags|=2048,Ws(9,{destroy:void 0},Sb.bind(null,u,g,i,a),null),St===null)throw Error(r(349));y||(_o&127)!==0||xb(u,a,i)}return i}function xb(o,a,i){o.flags|=16384,o={getSnapshot:a,value:i},a=Ye.updateQueue,a===null?(a=nu(),Ye.updateQueue=a,a.stores=[o]):(i=a.stores,i===null?a.stores=[o]:i.push(o))}function Sb(o,a,i,u){a.value=i,a.getSnapshot=u,Cb(a)&&_b(o)}function wb(o,a,i){return i(function(){Cb(a)&&_b(o)})}function Cb(o){var a=o.getSnapshot;o=o.value;try{var i=a();return!Jn(o,i)}catch{return!0}}function _b(o){var a=Ua(o,2);a!==null&&Kn(a,o,2)}function xh(o){var a=Mn();if(typeof o=="function"){var i=o;if(o=i(),Qa){Rn(!0);try{i()}finally{Rn(!1)}}}return a.memoizedState=a.baseState=o,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:o},a}function Eb(o,a,i,u){return o.baseState=i,yh(o,gt,typeof u=="function"?u:Eo)}function yR(o,a,i,u,g){if(iu(o))throw Error(r(485));if(o=a.action,o!==null){var y={payload:g,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){y.listeners.push(E)}};k.T!==null?i(!0):y.isTransition=!1,u(y),i=a.pending,i===null?(y.next=a.pending=y,Tb(a,y)):(y.next=i.next,a.pending=i.next=y)}}function Tb(o,a){var i=a.action,u=a.payload,g=o.state;if(a.isTransition){var y=k.T,E={};k.T=E;try{var O=i(g,u),F=k.S;F!==null&&F(E,O),Nb(o,a,O)}catch(Z){Sh(o,a,Z)}finally{y!==null&&E.types!==null&&(y.types=E.types),k.T=y}}else try{y=i(g,u),Nb(o,a,y)}catch(Z){Sh(o,a,Z)}}function Nb(o,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(u){Rb(o,a,u)},function(u){return Sh(o,a,u)}):Rb(o,a,i)}function Rb(o,a,i){a.status="fulfilled",a.value=i,Mb(a),o.state=i,a=o.pending,a!==null&&(i=a.next,i===a?o.pending=null:(i=i.next,a.next=i,Tb(o,i)))}function Sh(o,a,i){var u=o.pending;if(o.pending=null,u!==null){u=u.next;do a.status="rejected",a.reason=i,Mb(a),a=a.next;while(a!==u)}o.action=null}function Mb(o){o=o.listeners;for(var a=0;a<o.length;a++)(0,o[a])()}function Ob(o,a){return a}function Ab(o,a){if(st){var i=St.formState;if(i!==null){e:{var u=Ye;if(st){if(Et){t:{for(var g=Et,y=Sr;g.nodeType!==8;){if(!y){g=null;break t}if(g=Cr(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){Et=Cr(g.nextSibling),u=g.data==="F!";break e}}Wo(u)}u=!1}u&&(a=i[0])}}return i=Mn(),i.memoizedState=i.baseState=a,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ob,lastRenderedState:a},i.queue=u,i=Wb.bind(null,Ye,u),u.dispatch=i,u=xh(!1),y=Nh.bind(null,Ye,!1,u.queue),u=Mn(),g={state:a,dispatch:null,action:o,pending:null},u.queue=g,i=yR.bind(null,Ye,g,y,i),g.dispatch=i,u.memoizedState=o,[a,i,!1]}function jb(o){var a=$t();return Db(a,gt,o)}function Db(o,a,i){if(a=yh(o,a,Ob)[0],o=ou(Eo)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var u=vl(a)}catch(E){throw E===qs?Kc:E}else u=a;a=$t();var g=a.queue,y=g.dispatch;return i!==a.memoizedState&&(Ye.flags|=2048,Ws(9,{destroy:void 0},bR.bind(null,g,i),null)),[u,y,o]}function bR(o,a){o.action=a}function kb(o){var a=$t(),i=gt;if(i!==null)return Db(a,i,o);$t(),a=a.memoizedState,i=$t();var u=i.queue.dispatch;return i.memoizedState=o,[a,u,!1]}function Ws(o,a,i,u){return o={tag:o,create:i,deps:u,inst:a,next:null},a=Ye.updateQueue,a===null&&(a=nu(),Ye.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=o.next=o:(u=i.next,i.next=o,o.next=u,a.lastEffect=o),o}function zb(){return $t().memoizedState}function au(o,a,i,u){var g=Mn();Ye.flags|=o,g.memoizedState=Ws(1|a,{destroy:void 0},i,u===void 0?null:u)}function su(o,a,i,u){var g=$t();u=u===void 0?null:u;var y=g.memoizedState.inst;gt!==null&&u!==null&&fh(u,gt.memoizedState.deps)?g.memoizedState=Ws(a,y,i,u):(Ye.flags|=o,g.memoizedState=Ws(1|a,y,i,u))}function Pb(o,a){au(8390656,8,o,a)}function wh(o,a){su(2048,8,o,a)}function xR(o){Ye.flags|=4;var a=Ye.updateQueue;if(a===null)a=nu(),Ye.updateQueue=a,a.events=[o];else{var i=a.events;i===null?a.events=[o]:i.push(o)}}function Lb(o){var a=$t().memoizedState;return xR({ref:a,nextImpl:o}),function(){if((dt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function Fb(o,a){return su(4,2,o,a)}function Ib(o,a){return su(4,4,o,a)}function Vb(o,a){if(typeof a=="function"){o=o();var i=a(o);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return o=o(),a.current=o,function(){a.current=null}}function $b(o,a,i){i=i!=null?i.concat([o]):null,su(4,4,Vb.bind(null,a,o),i)}function Ch(){}function Ub(o,a){var i=$t();a=a===void 0?null:a;var u=i.memoizedState;return a!==null&&fh(a,u[1])?u[0]:(i.memoizedState=[o,a],o)}function Bb(o,a){var i=$t();a=a===void 0?null:a;var u=i.memoizedState;if(a!==null&&fh(a,u[1]))return u[0];if(u=o(),Qa){Rn(!0);try{o()}finally{Rn(!1)}}return i.memoizedState=[u,a],u}function _h(o,a,i){return i===void 0||(_o&1073741824)!==0&&(rt&261930)===0?o.memoizedState=a:(o.memoizedState=i,o=H0(),Ye.lanes|=o,aa|=o,i)}function Hb(o,a,i,u){return Jn(i,a)?i:Gs.current!==null?(o=_h(o,i,u),Jn(o,a)||(Kt=!0),o):(_o&42)===0||(_o&1073741824)!==0&&(rt&261930)===0?(Kt=!0,o.memoizedState=i):(o=H0(),Ye.lanes|=o,aa|=o,a)}function qb(o,a,i,u,g){var y=Y.p;Y.p=y!==0&&8>y?y:8;var E=k.T,O={};k.T=O,Nh(o,!1,a,i);try{var F=g(),Z=k.S;if(Z!==null&&Z(O,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var se=pR(F,u);yl(o,a,se,ar(o))}else yl(o,a,u,ar(o))}catch(ce){yl(o,a,{then:function(){},status:"rejected",reason:ce},ar())}finally{Y.p=y,E!==null&&O.types!==null&&(E.types=O.types),k.T=E}}function SR(){}function Eh(o,a,i,u){if(o.tag!==5)throw Error(r(476));var g=Yb(o).queue;qb(o,g,a,H,i===null?SR:function(){return Gb(o),i(u)})}function Yb(o){var a=o.memoizedState;if(a!==null)return a;a={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:H},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:i},next:null},o.memoizedState=a,o=o.alternate,o!==null&&(o.memoizedState=a),a}function Gb(o){var a=Yb(o);a.next===null&&(a=o.alternate.memoizedState),yl(o,a.next.queue,{},ar())}function Th(){return fn(zl)}function Kb(){return $t().memoizedState}function Zb(){return $t().memoizedState}function wR(o){for(var a=o.return;a!==null;){switch(a.tag){case 24:case 3:var i=ar();o=Jo(i);var u=ea(a,o,i);u!==null&&(Kn(u,a,i),hl(u,a,i)),a={cache:th()},o.payload=a;return}a=a.return}}function CR(o,a,i){var u=ar();i={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},iu(o)?Qb(a,i):(i=Hf(o,a,i,u),i!==null&&(Kn(i,o,u),Xb(i,a,u)))}function Wb(o,a,i){var u=ar();yl(o,a,i,u)}function yl(o,a,i,u){var g={lane:u,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(iu(o))Qb(a,g);else{var y=o.alternate;if(o.lanes===0&&(y===null||y.lanes===0)&&(y=a.lastRenderedReducer,y!==null))try{var E=a.lastRenderedState,O=y(E,i);if(g.hasEagerState=!0,g.eagerState=O,Jn(O,E))return $c(o,a,g,0),St===null&&Vc(),!1}catch{}finally{}if(i=Hf(o,a,g,u),i!==null)return Kn(i,o,u),Xb(i,a,u),!0}return!1}function Nh(o,a,i,u){if(u={lane:2,revertLane:am(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},iu(o)){if(a)throw Error(r(479))}else a=Hf(o,i,u,2),a!==null&&Kn(a,o,2)}function iu(o){var a=o.alternate;return o===Ye||a!==null&&a===Ye}function Qb(o,a){Ks=eu=!0;var i=o.pending;i===null?a.next=a:(a.next=i.next,i.next=a),o.pending=a}function Xb(o,a,i){if((i&4194048)!==0){var u=a.lanes;u&=o.pendingLanes,i|=u,a.lanes=i,Vn(o,i)}}var bl={readContext:fn,use:ru,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};bl.useEffectEvent=zt;var Jb={readContext:fn,use:ru,useCallback:function(o,a){return Mn().memoizedState=[o,a===void 0?null:a],o},useContext:fn,useEffect:Pb,useImperativeHandle:function(o,a,i){i=i!=null?i.concat([o]):null,au(4194308,4,Vb.bind(null,a,o),i)},useLayoutEffect:function(o,a){return au(4194308,4,o,a)},useInsertionEffect:function(o,a){au(4,2,o,a)},useMemo:function(o,a){var i=Mn();a=a===void 0?null:a;var u=o();if(Qa){Rn(!0);try{o()}finally{Rn(!1)}}return i.memoizedState=[u,a],u},useReducer:function(o,a,i){var u=Mn();if(i!==void 0){var g=i(a);if(Qa){Rn(!0);try{i(a)}finally{Rn(!1)}}}else g=a;return u.memoizedState=u.baseState=g,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:g},u.queue=o,o=o.dispatch=CR.bind(null,Ye,o),[u.memoizedState,o]},useRef:function(o){var a=Mn();return o={current:o},a.memoizedState=o},useState:function(o){o=xh(o);var a=o.queue,i=Wb.bind(null,Ye,a);return a.dispatch=i,[o.memoizedState,i]},useDebugValue:Ch,useDeferredValue:function(o,a){var i=Mn();return _h(i,o,a)},useTransition:function(){var o=xh(!1);return o=qb.bind(null,Ye,o.queue,!0,!1),Mn().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,a,i){var u=Ye,g=Mn();if(st){if(i===void 0)throw Error(r(407));i=i()}else{if(i=a(),St===null)throw Error(r(349));(rt&127)!==0||xb(u,a,i)}g.memoizedState=i;var y={value:i,getSnapshot:a};return g.queue=y,Pb(wb.bind(null,u,y,o),[o]),u.flags|=2048,Ws(9,{destroy:void 0},Sb.bind(null,u,y,i,a),null),i},useId:function(){var o=Mn(),a=St.identifierPrefix;if(st){var i=Jr,u=Xr;i=(u&~(1<<32-It(u)-1)).toString(32)+i,a="_"+a+"R_"+i,i=tu++,0<i&&(a+="H"+i.toString(32)),a+="_"}else i=gR++,a="_"+a+"r_"+i.toString(32)+"_";return o.memoizedState=a},useHostTransitionStatus:Th,useFormState:Ab,useActionState:Ab,useOptimistic:function(o){var a=Mn();a.memoizedState=a.baseState=o;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Nh.bind(null,Ye,!0,i),i.dispatch=a,[o,a]},useMemoCache:vh,useCacheRefresh:function(){return Mn().memoizedState=wR.bind(null,Ye)},useEffectEvent:function(o){var a=Mn(),i={impl:o};return a.memoizedState=i,function(){if((dt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}},Rh={readContext:fn,use:ru,useCallback:Ub,useContext:fn,useEffect:wh,useImperativeHandle:$b,useInsertionEffect:Fb,useLayoutEffect:Ib,useMemo:Bb,useReducer:ou,useRef:zb,useState:function(){return ou(Eo)},useDebugValue:Ch,useDeferredValue:function(o,a){var i=$t();return Hb(i,gt.memoizedState,o,a)},useTransition:function(){var o=ou(Eo)[0],a=$t().memoizedState;return[typeof o=="boolean"?o:vl(o),a]},useSyncExternalStore:bb,useId:Kb,useHostTransitionStatus:Th,useFormState:jb,useActionState:jb,useOptimistic:function(o,a){var i=$t();return Eb(i,gt,o,a)},useMemoCache:vh,useCacheRefresh:Zb};Rh.useEffectEvent=Lb;var e0={readContext:fn,use:ru,useCallback:Ub,useContext:fn,useEffect:wh,useImperativeHandle:$b,useInsertionEffect:Fb,useLayoutEffect:Ib,useMemo:Bb,useReducer:bh,useRef:zb,useState:function(){return bh(Eo)},useDebugValue:Ch,useDeferredValue:function(o,a){var i=$t();return gt===null?_h(i,o,a):Hb(i,gt.memoizedState,o,a)},useTransition:function(){var o=bh(Eo)[0],a=$t().memoizedState;return[typeof o=="boolean"?o:vl(o),a]},useSyncExternalStore:bb,useId:Kb,useHostTransitionStatus:Th,useFormState:kb,useActionState:kb,useOptimistic:function(o,a){var i=$t();return gt!==null?Eb(i,gt,o,a):(i.baseState=o,[o,i.queue.dispatch])},useMemoCache:vh,useCacheRefresh:Zb};e0.useEffectEvent=Lb;function Mh(o,a,i,u){a=o.memoizedState,i=i(u,a),i=i==null?a:p({},a,i),o.memoizedState=i,o.lanes===0&&(o.updateQueue.baseState=i)}var Oh={enqueueSetState:function(o,a,i){o=o._reactInternals;var u=ar(),g=Jo(u);g.payload=a,i!=null&&(g.callback=i),a=ea(o,g,u),a!==null&&(Kn(a,o,u),hl(a,o,u))},enqueueReplaceState:function(o,a,i){o=o._reactInternals;var u=ar(),g=Jo(u);g.tag=1,g.payload=a,i!=null&&(g.callback=i),a=ea(o,g,u),a!==null&&(Kn(a,o,u),hl(a,o,u))},enqueueForceUpdate:function(o,a){o=o._reactInternals;var i=ar(),u=Jo(i);u.tag=2,a!=null&&(u.callback=a),a=ea(o,u,i),a!==null&&(Kn(a,o,i),hl(a,o,i))}};function t0(o,a,i,u,g,y,E){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(u,y,E):a.prototype&&a.prototype.isPureReactComponent?!al(i,u)||!al(g,y):!0}function n0(o,a,i,u){o=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,u),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,u),a.state!==o&&Oh.enqueueReplaceState(a,a.state,null)}function Xa(o,a){var i=a;if("ref"in a){i={};for(var u in a)u!=="ref"&&(i[u]=a[u])}if(o=o.defaultProps){i===a&&(i=p({},i));for(var g in o)i[g]===void 0&&(i[g]=o[g])}return i}function r0(o){Ic(o)}function o0(o){console.error(o)}function a0(o){Ic(o)}function lu(o,a){try{var i=o.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(u){setTimeout(function(){throw u})}}function s0(o,a,i){try{var u=o.onCaughtError;u(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Ah(o,a,i){return i=Jo(i),i.tag=3,i.payload={element:null},i.callback=function(){lu(o,a)},i}function i0(o){return o=Jo(o),o.tag=3,o}function l0(o,a,i,u){var g=i.type.getDerivedStateFromError;if(typeof g=="function"){var y=u.value;o.payload=function(){return g(y)},o.callback=function(){s0(a,i,u)}}var E=i.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(o.callback=function(){s0(a,i,u),typeof g!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var O=u.stack;this.componentDidCatch(u.value,{componentStack:O!==null?O:""})})}function _R(o,a,i,u,g){if(i.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(a=i.alternate,a!==null&&Us(a,i,g,!0),i=tr.current,i!==null){switch(i.tag){case 31:case 13:return wr===null?xu():i.alternate===null&&Pt===0&&(Pt=3),i.flags&=-257,i.flags|=65536,i.lanes=g,u===Zc?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([u]):a.add(u),nm(o,u,g)),!1;case 22:return i.flags|=65536,u===Zc?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([u])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([u]):i.add(u)),nm(o,u,g)),!1}throw Error(r(435,i.tag))}return nm(o,u,g),xu(),!1}if(st)return a=tr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=g,u!==Wf&&(o=Error(r(422),{cause:u}),ll(yr(o,i)))):(u!==Wf&&(a=Error(r(423),{cause:u}),ll(yr(a,i))),o=o.current.alternate,o.flags|=65536,g&=-g,o.lanes|=g,u=yr(u,i),g=Ah(o.stateNode,u,g),ih(o,g),Pt!==4&&(Pt=2)),!1;var y=Error(r(520),{cause:u});if(y=yr(y,i),Nl===null?Nl=[y]:Nl.push(y),Pt!==4&&(Pt=2),a===null)return!0;u=yr(u,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,o=g&-g,i.lanes|=o,o=Ah(i.stateNode,u,o),ih(i,o),!1;case 1:if(a=i.type,y=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(sa===null||!sa.has(y))))return i.flags|=65536,g&=-g,i.lanes|=g,g=i0(g),l0(g,o,i,u),ih(i,g),!1}i=i.return}while(i!==null);return!1}var jh=Error(r(461)),Kt=!1;function hn(o,a,i,u){a.child=o===null?fb(a,null,i,u):Wa(a,o.child,i,u)}function c0(o,a,i,u,g){i=i.render;var y=a.ref;if("ref"in u){var E={};for(var O in u)O!=="ref"&&(E[O]=u[O])}else E=u;return Ya(a),u=hh(o,a,i,E,y,g),O=mh(),o!==null&&!Kt?(ph(o,a,g),To(o,a,g)):(st&&O&&Kf(a),a.flags|=1,hn(o,a,u,g),a.child)}function u0(o,a,i,u,g){if(o===null){var y=i.type;return typeof y=="function"&&!qf(y)&&y.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=y,d0(o,a,y,u,g)):(o=Bc(i.type,null,u,a,a.mode,g),o.ref=a.ref,o.return=a,a.child=o)}if(y=o.child,!Vh(o,g)){var E=y.memoizedProps;if(i=i.compare,i=i!==null?i:al,i(E,u)&&o.ref===a.ref)return To(o,a,g)}return a.flags|=1,o=xo(y,u),o.ref=a.ref,o.return=a,a.child=o}function d0(o,a,i,u,g){if(o!==null){var y=o.memoizedProps;if(al(y,u)&&o.ref===a.ref)if(Kt=!1,a.pendingProps=u=y,Vh(o,g))(o.flags&131072)!==0&&(Kt=!0);else return a.lanes=o.lanes,To(o,a,g)}return Dh(o,a,i,u,g)}function f0(o,a,i,u){var g=u.children,y=o!==null?o.memoizedState:null;if(o===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((a.flags&128)!==0){if(y=y!==null?y.baseLanes|i:i,o!==null){for(u=a.child=o.child,g=0;u!==null;)g=g|u.lanes|u.childLanes,u=u.sibling;u=g&~y}else u=0,a.child=null;return h0(o,a,y,i,u)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},o!==null&&Gc(a,y!==null?y.cachePool:null),y!==null?pb(a,y):ch(),gb(a);else return u=a.lanes=536870912,h0(o,a,y!==null?y.baseLanes|i:i,i,u)}else y!==null?(Gc(a,y.cachePool),pb(a,y),na(),a.memoizedState=null):(o!==null&&Gc(a,null),ch(),na());return hn(o,a,g,i),a.child}function xl(o,a){return o!==null&&o.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function h0(o,a,i,u,g){var y=rh();return y=y===null?null:{parent:Yt._currentValue,pool:y},a.memoizedState={baseLanes:i,cachePool:y},o!==null&&Gc(a,null),ch(),gb(a),o!==null&&Us(o,a,u,!0),a.childLanes=g,null}function cu(o,a){return a=du({mode:a.mode,children:a.children},o.mode),a.ref=o.ref,o.child=a,a.return=o,a}function m0(o,a,i){return Wa(a,o.child,null,i),o=cu(a,a.pendingProps),o.flags|=2,nr(a),a.memoizedState=null,o}function ER(o,a,i){var u=a.pendingProps,g=(a.flags&128)!==0;if(a.flags&=-129,o===null){if(st){if(u.mode==="hidden")return o=cu(a,u),a.lanes=536870912,xl(null,o);if(dh(a),(o=Et)?(o=Tx(o,Sr),o=o!==null&&o.data==="&"?o:null,o!==null&&(a.memoizedState={dehydrated:o,treeContext:Ko!==null?{id:Xr,overflow:Jr}:null,retryLane:536870912,hydrationErrors:null},i=Qy(o),i.return=a,a.child=i,dn=a,Et=null)):o=null,o===null)throw Wo(a);return a.lanes=536870912,null}return cu(a,u)}var y=o.memoizedState;if(y!==null){var E=y.dehydrated;if(dh(a),g)if(a.flags&256)a.flags&=-257,a=m0(o,a,i);else if(a.memoizedState!==null)a.child=o.child,a.flags|=128,a=null;else throw Error(r(558));else if(Kt||Us(o,a,i,!1),g=(i&o.childLanes)!==0,Kt||g){if(u=St,u!==null&&(E=$n(u,i),E!==0&&E!==y.retryLane))throw y.retryLane=E,Ua(o,E),Kn(u,o,E),jh;xu(),a=m0(o,a,i)}else o=y.treeContext,Et=Cr(E.nextSibling),dn=a,st=!0,Zo=null,Sr=!1,o!==null&&eb(a,o),a=cu(a,u),a.flags|=4096;return a}return o=xo(o.child,{mode:u.mode,children:u.children}),o.ref=a.ref,a.child=o,o.return=a,o}function uu(o,a){var i=a.ref;if(i===null)o!==null&&o.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(r(284));(o===null||o.ref!==i)&&(a.flags|=4194816)}}function Dh(o,a,i,u,g){return Ya(a),i=hh(o,a,i,u,void 0,g),u=mh(),o!==null&&!Kt?(ph(o,a,g),To(o,a,g)):(st&&u&&Kf(a),a.flags|=1,hn(o,a,i,g),a.child)}function p0(o,a,i,u,g,y){return Ya(a),a.updateQueue=null,i=yb(a,u,i,g),vb(o),u=mh(),o!==null&&!Kt?(ph(o,a,y),To(o,a,y)):(st&&u&&Kf(a),a.flags|=1,hn(o,a,i,y),a.child)}function g0(o,a,i,u,g){if(Ya(a),a.stateNode===null){var y=Fs,E=i.contextType;typeof E=="object"&&E!==null&&(y=fn(E)),y=new i(u,y),a.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Oh,a.stateNode=y,y._reactInternals=a,y=a.stateNode,y.props=u,y.state=a.memoizedState,y.refs={},ah(a),E=i.contextType,y.context=typeof E=="object"&&E!==null?fn(E):Fs,y.state=a.memoizedState,E=i.getDerivedStateFromProps,typeof E=="function"&&(Mh(a,i,E,u),y.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(E=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),E!==y.state&&Oh.enqueueReplaceState(y,y.state,null),pl(a,u,y,g),ml(),y.state=a.memoizedState),typeof y.componentDidMount=="function"&&(a.flags|=4194308),u=!0}else if(o===null){y=a.stateNode;var O=a.memoizedProps,F=Xa(i,O);y.props=F;var Z=y.context,se=i.contextType;E=Fs,typeof se=="object"&&se!==null&&(E=fn(se));var ce=i.getDerivedStateFromProps;se=typeof ce=="function"||typeof y.getSnapshotBeforeUpdate=="function",O=a.pendingProps!==O,se||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(O||Z!==E)&&n0(a,y,u,E),Xo=!1;var Q=a.memoizedState;y.state=Q,pl(a,u,y,g),ml(),Z=a.memoizedState,O||Q!==Z||Xo?(typeof ce=="function"&&(Mh(a,i,ce,u),Z=a.memoizedState),(F=Xo||t0(a,i,F,u,Q,Z,E))?(se||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(a.flags|=4194308)):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=u,a.memoizedState=Z),y.props=u,y.state=Z,y.context=E,u=F):(typeof y.componentDidMount=="function"&&(a.flags|=4194308),u=!1)}else{y=a.stateNode,sh(o,a),E=a.memoizedProps,se=Xa(i,E),y.props=se,ce=a.pendingProps,Q=y.context,Z=i.contextType,F=Fs,typeof Z=="object"&&Z!==null&&(F=fn(Z)),O=i.getDerivedStateFromProps,(Z=typeof O=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(E!==ce||Q!==F)&&n0(a,y,u,F),Xo=!1,Q=a.memoizedState,y.state=Q,pl(a,u,y,g),ml();var re=a.memoizedState;E!==ce||Q!==re||Xo||o!==null&&o.dependencies!==null&&qc(o.dependencies)?(typeof O=="function"&&(Mh(a,i,O,u),re=a.memoizedState),(se=Xo||t0(a,i,se,u,Q,re,F)||o!==null&&o.dependencies!==null&&qc(o.dependencies))?(Z||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(u,re,F),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(u,re,F)),typeof y.componentDidUpdate=="function"&&(a.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof y.componentDidUpdate!="function"||E===o.memoizedProps&&Q===o.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&Q===o.memoizedState||(a.flags|=1024),a.memoizedProps=u,a.memoizedState=re),y.props=u,y.state=re,y.context=F,u=se):(typeof y.componentDidUpdate!="function"||E===o.memoizedProps&&Q===o.memoizedState||(a.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===o.memoizedProps&&Q===o.memoizedState||(a.flags|=1024),u=!1)}return y=u,uu(o,a),u=(a.flags&128)!==0,y||u?(y=a.stateNode,i=u&&typeof i.getDerivedStateFromError!="function"?null:y.render(),a.flags|=1,o!==null&&u?(a.child=Wa(a,o.child,null,g),a.child=Wa(a,null,i,g)):hn(o,a,i,g),a.memoizedState=y.state,o=a.child):o=To(o,a,g),o}function v0(o,a,i,u){return Ha(),a.flags|=256,hn(o,a,i,u),a.child}var kh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zh(o){return{baseLanes:o,cachePool:sb()}}function Ph(o,a,i){return o=o!==null?o.childLanes&~i:0,a&&(o|=or),o}function y0(o,a,i){var u=a.pendingProps,g=!1,y=(a.flags&128)!==0,E;if((E=y)||(E=o!==null&&o.memoizedState===null?!1:(Vt.current&2)!==0),E&&(g=!0,a.flags&=-129),E=(a.flags&32)!==0,a.flags&=-33,o===null){if(st){if(g?ta(a):na(),(o=Et)?(o=Tx(o,Sr),o=o!==null&&o.data!=="&"?o:null,o!==null&&(a.memoizedState={dehydrated:o,treeContext:Ko!==null?{id:Xr,overflow:Jr}:null,retryLane:536870912,hydrationErrors:null},i=Qy(o),i.return=a,a.child=i,dn=a,Et=null)):o=null,o===null)throw Wo(a);return ym(o)?a.lanes=32:a.lanes=536870912,null}var O=u.children;return u=u.fallback,g?(na(),g=a.mode,O=du({mode:"hidden",children:O},g),u=Ba(u,g,i,null),O.return=a,u.return=a,O.sibling=u,a.child=O,u=a.child,u.memoizedState=zh(i),u.childLanes=Ph(o,E,i),a.memoizedState=kh,xl(null,u)):(ta(a),Lh(a,O))}var F=o.memoizedState;if(F!==null&&(O=F.dehydrated,O!==null)){if(y)a.flags&256?(ta(a),a.flags&=-257,a=Fh(o,a,i)):a.memoizedState!==null?(na(),a.child=o.child,a.flags|=128,a=null):(na(),O=u.fallback,g=a.mode,u=du({mode:"visible",children:u.children},g),O=Ba(O,g,i,null),O.flags|=2,u.return=a,O.return=a,u.sibling=O,a.child=u,Wa(a,o.child,null,i),u=a.child,u.memoizedState=zh(i),u.childLanes=Ph(o,E,i),a.memoizedState=kh,a=xl(null,u));else if(ta(a),ym(O)){if(E=O.nextSibling&&O.nextSibling.dataset,E)var Z=E.dgst;E=Z,u=Error(r(419)),u.stack="",u.digest=E,ll({value:u,source:null,stack:null}),a=Fh(o,a,i)}else if(Kt||Us(o,a,i,!1),E=(i&o.childLanes)!==0,Kt||E){if(E=St,E!==null&&(u=$n(E,i),u!==0&&u!==F.retryLane))throw F.retryLane=u,Ua(o,u),Kn(E,o,u),jh;vm(O)||xu(),a=Fh(o,a,i)}else vm(O)?(a.flags|=192,a.child=o.child,a=null):(o=F.treeContext,Et=Cr(O.nextSibling),dn=a,st=!0,Zo=null,Sr=!1,o!==null&&eb(a,o),a=Lh(a,u.children),a.flags|=4096);return a}return g?(na(),O=u.fallback,g=a.mode,F=o.child,Z=F.sibling,u=xo(F,{mode:"hidden",children:u.children}),u.subtreeFlags=F.subtreeFlags&65011712,Z!==null?O=xo(Z,O):(O=Ba(O,g,i,null),O.flags|=2),O.return=a,u.return=a,u.sibling=O,a.child=u,xl(null,u),u=a.child,O=o.child.memoizedState,O===null?O=zh(i):(g=O.cachePool,g!==null?(F=Yt._currentValue,g=g.parent!==F?{parent:F,pool:F}:g):g=sb(),O={baseLanes:O.baseLanes|i,cachePool:g}),u.memoizedState=O,u.childLanes=Ph(o,E,i),a.memoizedState=kh,xl(o.child,u)):(ta(a),i=o.child,o=i.sibling,i=xo(i,{mode:"visible",children:u.children}),i.return=a,i.sibling=null,o!==null&&(E=a.deletions,E===null?(a.deletions=[o],a.flags|=16):E.push(o)),a.child=i,a.memoizedState=null,i)}function Lh(o,a){return a=du({mode:"visible",children:a},o.mode),a.return=o,o.child=a}function du(o,a){return o=er(22,o,null,a),o.lanes=0,o}function Fh(o,a,i){return Wa(a,o.child,null,i),o=Lh(a,a.pendingProps.children),o.flags|=2,a.memoizedState=null,o}function b0(o,a,i){o.lanes|=a;var u=o.alternate;u!==null&&(u.lanes|=a),Jf(o.return,a,i)}function Ih(o,a,i,u,g,y){var E=o.memoizedState;E===null?o.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:g,treeForkCount:y}:(E.isBackwards=a,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=i,E.tailMode=g,E.treeForkCount=y)}function x0(o,a,i){var u=a.pendingProps,g=u.revealOrder,y=u.tail;u=u.children;var E=Vt.current,O=(E&2)!==0;if(O?(E=E&1|2,a.flags|=128):E&=1,U(Vt,E),hn(o,a,u,i),u=st?il:0,!O&&o!==null&&(o.flags&128)!==0)e:for(o=a.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&b0(o,i,a);else if(o.tag===19)b0(o,i,a);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===a)break e;for(;o.sibling===null;){if(o.return===null||o.return===a)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(g){case"forwards":for(i=a.child,g=null;i!==null;)o=i.alternate,o!==null&&Jc(o)===null&&(g=i),i=i.sibling;i=g,i===null?(g=a.child,a.child=null):(g=i.sibling,i.sibling=null),Ih(a,!1,g,i,y,u);break;case"backwards":case"unstable_legacy-backwards":for(i=null,g=a.child,a.child=null;g!==null;){if(o=g.alternate,o!==null&&Jc(o)===null){a.child=g;break}o=g.sibling,g.sibling=i,i=g,g=o}Ih(a,!0,i,null,y,u);break;case"together":Ih(a,!1,null,null,void 0,u);break;default:a.memoizedState=null}return a.child}function To(o,a,i){if(o!==null&&(a.dependencies=o.dependencies),aa|=a.lanes,(i&a.childLanes)===0)if(o!==null){if(Us(o,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(o!==null&&a.child!==o.child)throw Error(r(153));if(a.child!==null){for(o=a.child,i=xo(o,o.pendingProps),a.child=i,i.return=a;o.sibling!==null;)o=o.sibling,i=i.sibling=xo(o,o.pendingProps),i.return=a;i.sibling=null}return a.child}function Vh(o,a){return(o.lanes&a)!==0?!0:(o=o.dependencies,!!(o!==null&&qc(o)))}function TR(o,a,i){switch(a.tag){case 3:ye(a,a.stateNode.containerInfo),Qo(a,Yt,o.memoizedState.cache),Ha();break;case 27:case 5:De(a);break;case 4:ye(a,a.stateNode.containerInfo);break;case 10:Qo(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,dh(a),null;break;case 13:var u=a.memoizedState;if(u!==null)return u.dehydrated!==null?(ta(a),a.flags|=128,null):(i&a.child.childLanes)!==0?y0(o,a,i):(ta(a),o=To(o,a,i),o!==null?o.sibling:null);ta(a);break;case 19:var g=(o.flags&128)!==0;if(u=(i&a.childLanes)!==0,u||(Us(o,a,i,!1),u=(i&a.childLanes)!==0),g){if(u)return x0(o,a,i);a.flags|=128}if(g=a.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),U(Vt,Vt.current),u)break;return null;case 22:return a.lanes=0,f0(o,a,i,a.pendingProps);case 24:Qo(a,Yt,o.memoizedState.cache)}return To(o,a,i)}function S0(o,a,i){if(o!==null)if(o.memoizedProps!==a.pendingProps)Kt=!0;else{if(!Vh(o,i)&&(a.flags&128)===0)return Kt=!1,TR(o,a,i);Kt=(o.flags&131072)!==0}else Kt=!1,st&&(a.flags&1048576)!==0&&Jy(a,il,a.index);switch(a.lanes=0,a.tag){case 16:e:{var u=a.pendingProps;if(o=Ka(a.elementType),a.type=o,typeof o=="function")qf(o)?(u=Xa(o,u),a.tag=1,a=g0(null,a,o,u,i)):(a.tag=0,a=Dh(null,a,o,u,i));else{if(o!=null){var g=o.$$typeof;if(g===R){a.tag=11,a=c0(null,a,o,u,i);break e}else if(g===D){a.tag=14,a=u0(null,a,o,u,i);break e}}throw a=ae(o)||o,Error(r(306,a,""))}}return a;case 0:return Dh(o,a,a.type,a.pendingProps,i);case 1:return u=a.type,g=Xa(u,a.pendingProps),g0(o,a,u,g,i);case 3:e:{if(ye(a,a.stateNode.containerInfo),o===null)throw Error(r(387));u=a.pendingProps;var y=a.memoizedState;g=y.element,sh(o,a),pl(a,u,null,i);var E=a.memoizedState;if(u=E.cache,Qo(a,Yt,u),u!==y.cache&&eh(a,[Yt],i,!0),ml(),u=E.element,y.isDehydrated)if(y={element:u,isDehydrated:!1,cache:E.cache},a.updateQueue.baseState=y,a.memoizedState=y,a.flags&256){a=v0(o,a,u,i);break e}else if(u!==g){g=yr(Error(r(424)),a),ll(g),a=v0(o,a,u,i);break e}else{switch(o=a.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Et=Cr(o.firstChild),dn=a,st=!0,Zo=null,Sr=!0,i=fb(a,null,u,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Ha(),u===g){a=To(o,a,i);break e}hn(o,a,u,i)}a=a.child}return a;case 26:return uu(o,a),o===null?(i=jx(a.type,null,a.pendingProps,null))?a.memoizedState=i:st||(i=a.type,o=a.pendingProps,u=Nu(he.current).createElement(i),u[un]=a,u[Un]=o,mn(u,i,o),sn(u),a.stateNode=u):a.memoizedState=jx(a.type,o.memoizedProps,a.pendingProps,o.memoizedState),null;case 27:return De(a),o===null&&st&&(u=a.stateNode=Mx(a.type,a.pendingProps,he.current),dn=a,Sr=!0,g=Et,ua(a.type)?(bm=g,Et=Cr(u.firstChild)):Et=g),hn(o,a,a.pendingProps.children,i),uu(o,a),o===null&&(a.flags|=4194304),a.child;case 5:return o===null&&st&&((g=u=Et)&&(u=nM(u,a.type,a.pendingProps,Sr),u!==null?(a.stateNode=u,dn=a,Et=Cr(u.firstChild),Sr=!1,g=!0):g=!1),g||Wo(a)),De(a),g=a.type,y=a.pendingProps,E=o!==null?o.memoizedProps:null,u=y.children,mm(g,y)?u=null:E!==null&&mm(g,E)&&(a.flags|=32),a.memoizedState!==null&&(g=hh(o,a,vR,null,null,i),zl._currentValue=g),uu(o,a),hn(o,a,u,i),a.child;case 6:return o===null&&st&&((o=i=Et)&&(i=rM(i,a.pendingProps,Sr),i!==null?(a.stateNode=i,dn=a,Et=null,o=!0):o=!1),o||Wo(a)),null;case 13:return y0(o,a,i);case 4:return ye(a,a.stateNode.containerInfo),u=a.pendingProps,o===null?a.child=Wa(a,null,u,i):hn(o,a,u,i),a.child;case 11:return c0(o,a,a.type,a.pendingProps,i);case 7:return hn(o,a,a.pendingProps,i),a.child;case 8:return hn(o,a,a.pendingProps.children,i),a.child;case 12:return hn(o,a,a.pendingProps.children,i),a.child;case 10:return u=a.pendingProps,Qo(a,a.type,u.value),hn(o,a,u.children,i),a.child;case 9:return g=a.type._context,u=a.pendingProps.children,Ya(a),g=fn(g),u=u(g),a.flags|=1,hn(o,a,u,i),a.child;case 14:return u0(o,a,a.type,a.pendingProps,i);case 15:return d0(o,a,a.type,a.pendingProps,i);case 19:return x0(o,a,i);case 31:return ER(o,a,i);case 22:return f0(o,a,i,a.pendingProps);case 24:return Ya(a),u=fn(Yt),o===null?(g=rh(),g===null&&(g=St,y=th(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=i),g=y),a.memoizedState={parent:u,cache:g},ah(a),Qo(a,Yt,g)):((o.lanes&i)!==0&&(sh(o,a),pl(a,null,null,i),ml()),g=o.memoizedState,y=a.memoizedState,g.parent!==u?(g={parent:u,cache:u},a.memoizedState=g,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=g),Qo(a,Yt,u)):(u=y.cache,Qo(a,Yt,u),u!==g.cache&&eh(a,[Yt],i,!0))),hn(o,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function No(o){o.flags|=4}function $h(o,a,i,u,g){if((a=(o.mode&32)!==0)&&(a=!1),a){if(o.flags|=16777216,(g&335544128)===g)if(o.stateNode.complete)o.flags|=8192;else if(K0())o.flags|=8192;else throw Za=Zc,oh}else o.flags&=-16777217}function w0(o,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Lx(a))if(K0())o.flags|=8192;else throw Za=Zc,oh}function fu(o,a){a!==null&&(o.flags|=4),o.flags&16384&&(a=o.tag!==22?an():536870912,o.lanes|=a,ei|=a)}function Sl(o,a){if(!st)switch(o.tailMode){case"hidden":a=o.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?o.tail=null:i.sibling=null;break;case"collapsed":i=o.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a||o.tail===null?o.tail=null:o.tail.sibling=null:u.sibling=null}}function Tt(o){var a=o.alternate!==null&&o.alternate.child===o.child,i=0,u=0;if(a)for(var g=o.child;g!==null;)i|=g.lanes|g.childLanes,u|=g.subtreeFlags&65011712,u|=g.flags&65011712,g.return=o,g=g.sibling;else for(g=o.child;g!==null;)i|=g.lanes|g.childLanes,u|=g.subtreeFlags,u|=g.flags,g.return=o,g=g.sibling;return o.subtreeFlags|=u,o.childLanes=i,a}function NR(o,a,i){var u=a.pendingProps;switch(Zf(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(a),null;case 1:return Tt(a),null;case 3:return i=a.stateNode,u=null,o!==null&&(u=o.memoizedState.cache),a.memoizedState.cache!==u&&(a.flags|=2048),Co(Yt),_e(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(o===null||o.child===null)&&($s(a)?No(a):o===null||o.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Qf())),Tt(a),null;case 26:var g=a.type,y=a.memoizedState;return o===null?(No(a),y!==null?(Tt(a),w0(a,y)):(Tt(a),$h(a,g,null,u,i))):y?y!==o.memoizedState?(No(a),Tt(a),w0(a,y)):(Tt(a),a.flags&=-16777217):(o=o.memoizedProps,o!==u&&No(a),Tt(a),$h(a,g,o,u,i)),null;case 27:if(qe(a),i=he.current,g=a.type,o!==null&&a.stateNode!=null)o.memoizedProps!==u&&No(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Tt(a),null}o=W.current,$s(a)?tb(a):(o=Mx(g,u,i),a.stateNode=o,No(a))}return Tt(a),null;case 5:if(qe(a),g=a.type,o!==null&&a.stateNode!=null)o.memoizedProps!==u&&No(a);else{if(!u){if(a.stateNode===null)throw Error(r(166));return Tt(a),null}if(y=W.current,$s(a))tb(a);else{var E=Nu(he.current);switch(y){case 1:y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=E.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?y.multiple=!0:u.size&&(y.size=u.size);break;default:y=typeof u.is=="string"?E.createElement(g,{is:u.is}):E.createElement(g)}}y[un]=a,y[Un]=u;e:for(E=a.child;E!==null;){if(E.tag===5||E.tag===6)y.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===a)break e;for(;E.sibling===null;){if(E.return===null||E.return===a)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}a.stateNode=y;e:switch(mn(y,g,u),g){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&No(a)}}return Tt(a),$h(a,a.type,o===null?null:o.memoizedProps,a.pendingProps,i),null;case 6:if(o&&a.stateNode!=null)o.memoizedProps!==u&&No(a);else{if(typeof u!="string"&&a.stateNode===null)throw Error(r(166));if(o=he.current,$s(a)){if(o=a.stateNode,i=a.memoizedProps,u=null,g=dn,g!==null)switch(g.tag){case 27:case 5:u=g.memoizedProps}o[un]=a,o=!!(o.nodeValue===i||u!==null&&u.suppressHydrationWarning===!0||yx(o.nodeValue,i)),o||Wo(a,!0)}else o=Nu(o).createTextNode(u),o[un]=a,a.stateNode=o}return Tt(a),null;case 31:if(i=a.memoizedState,o===null||o.memoizedState!==null){if(u=$s(a),i!==null){if(o===null){if(!u)throw Error(r(318));if(o=a.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[un]=a}else Ha(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Tt(a),o=!1}else i=Qf(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=i),o=!0;if(!o)return a.flags&256?(nr(a),a):(nr(a),null);if((a.flags&128)!==0)throw Error(r(558))}return Tt(a),null;case 13:if(u=a.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(g=$s(a),u!==null&&u.dehydrated!==null){if(o===null){if(!g)throw Error(r(318));if(g=a.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[un]=a}else Ha(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;Tt(a),g=!1}else g=Qf(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=g),g=!0;if(!g)return a.flags&256?(nr(a),a):(nr(a),null)}return nr(a),(a.flags&128)!==0?(a.lanes=i,a):(i=u!==null,o=o!==null&&o.memoizedState!==null,i&&(u=a.child,g=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(g=u.alternate.memoizedState.cachePool.pool),y=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(y=u.memoizedState.cachePool.pool),y!==g&&(u.flags|=2048)),i!==o&&i&&(a.child.flags|=8192),fu(a,a.updateQueue),Tt(a),null);case 4:return _e(),o===null&&cm(a.stateNode.containerInfo),Tt(a),null;case 10:return Co(a.type),Tt(a),null;case 19:if(P(Vt),u=a.memoizedState,u===null)return Tt(a),null;if(g=(a.flags&128)!==0,y=u.rendering,y===null)if(g)Sl(u,!1);else{if(Pt!==0||o!==null&&(o.flags&128)!==0)for(o=a.child;o!==null;){if(y=Jc(o),y!==null){for(a.flags|=128,Sl(u,!1),o=y.updateQueue,a.updateQueue=o,fu(a,o),a.subtreeFlags=0,o=i,i=a.child;i!==null;)Wy(i,o),i=i.sibling;return U(Vt,Vt.current&1|2),st&&So(a,u.treeForkCount),a.child}o=o.sibling}u.tail!==null&&me()>vu&&(a.flags|=128,g=!0,Sl(u,!1),a.lanes=4194304)}else{if(!g)if(o=Jc(y),o!==null){if(a.flags|=128,g=!0,o=o.updateQueue,a.updateQueue=o,fu(a,o),Sl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!y.alternate&&!st)return Tt(a),null}else 2*me()-u.renderingStartTime>vu&&i!==536870912&&(a.flags|=128,g=!0,Sl(u,!1),a.lanes=4194304);u.isBackwards?(y.sibling=a.child,a.child=y):(o=u.last,o!==null?o.sibling=y:a.child=y,u.last=y)}return u.tail!==null?(o=u.tail,u.rendering=o,u.tail=o.sibling,u.renderingStartTime=me(),o.sibling=null,i=Vt.current,U(Vt,g?i&1|2:i&1),st&&So(a,u.treeForkCount),o):(Tt(a),null);case 22:case 23:return nr(a),uh(),u=a.memoizedState!==null,o!==null?o.memoizedState!==null!==u&&(a.flags|=8192):u&&(a.flags|=8192),u?(i&536870912)!==0&&(a.flags&128)===0&&(Tt(a),a.subtreeFlags&6&&(a.flags|=8192)):Tt(a),i=a.updateQueue,i!==null&&fu(a,i.retryQueue),i=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==i&&(a.flags|=2048),o!==null&&P(Ga),null;case 24:return i=null,o!==null&&(i=o.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Co(Yt),Tt(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function RR(o,a){switch(Zf(a),a.tag){case 1:return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 3:return Co(Yt),_e(),o=a.flags,(o&65536)!==0&&(o&128)===0?(a.flags=o&-65537|128,a):null;case 26:case 27:case 5:return qe(a),null;case 31:if(a.memoizedState!==null){if(nr(a),a.alternate===null)throw Error(r(340));Ha()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 13:if(nr(a),o=a.memoizedState,o!==null&&o.dehydrated!==null){if(a.alternate===null)throw Error(r(340));Ha()}return o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 19:return P(Vt),null;case 4:return _e(),null;case 10:return Co(a.type),null;case 22:case 23:return nr(a),uh(),o!==null&&P(Ga),o=a.flags,o&65536?(a.flags=o&-65537|128,a):null;case 24:return Co(Yt),null;case 25:return null;default:return null}}function C0(o,a){switch(Zf(a),a.tag){case 3:Co(Yt),_e();break;case 26:case 27:case 5:qe(a);break;case 4:_e();break;case 31:a.memoizedState!==null&&nr(a);break;case 13:nr(a);break;case 19:P(Vt);break;case 10:Co(a.type);break;case 22:case 23:nr(a),uh(),o!==null&&P(Ga);break;case 24:Co(Yt)}}function wl(o,a){try{var i=a.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var g=u.next;i=g;do{if((i.tag&o)===o){u=void 0;var y=i.create,E=i.inst;u=y(),E.destroy=u}i=i.next}while(i!==g)}}catch(O){mt(a,a.return,O)}}function ra(o,a,i){try{var u=a.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var y=g.next;u=y;do{if((u.tag&o)===o){var E=u.inst,O=E.destroy;if(O!==void 0){E.destroy=void 0,g=a;var F=i,Z=O;try{Z()}catch(se){mt(g,F,se)}}}u=u.next}while(u!==y)}}catch(se){mt(a,a.return,se)}}function _0(o){var a=o.updateQueue;if(a!==null){var i=o.stateNode;try{mb(a,i)}catch(u){mt(o,o.return,u)}}}function E0(o,a,i){i.props=Xa(o.type,o.memoizedProps),i.state=o.memoizedState;try{i.componentWillUnmount()}catch(u){mt(o,a,u)}}function Cl(o,a){try{var i=o.ref;if(i!==null){switch(o.tag){case 26:case 27:case 5:var u=o.stateNode;break;case 30:u=o.stateNode;break;default:u=o.stateNode}typeof i=="function"?o.refCleanup=i(u):i.current=u}}catch(g){mt(o,a,g)}}function eo(o,a){var i=o.ref,u=o.refCleanup;if(i!==null)if(typeof u=="function")try{u()}catch(g){mt(o,a,g)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(g){mt(o,a,g)}else i.current=null}function T0(o){var a=o.type,i=o.memoizedProps,u=o.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&u.focus();break e;case"img":i.src?u.src=i.src:i.srcSet&&(u.srcset=i.srcSet)}}catch(g){mt(o,o.return,g)}}function Uh(o,a,i){try{var u=o.stateNode;WR(u,o.type,i,a),u[Un]=a}catch(g){mt(o,o.return,g)}}function N0(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&ua(o.type)||o.tag===4}function Bh(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||N0(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&ua(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Hh(o,a,i){var u=o.tag;if(u===5||u===6)o=o.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(o,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(o),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=yo));else if(u!==4&&(u===27&&ua(o.type)&&(i=o.stateNode,a=null),o=o.child,o!==null))for(Hh(o,a,i),o=o.sibling;o!==null;)Hh(o,a,i),o=o.sibling}function hu(o,a,i){var u=o.tag;if(u===5||u===6)o=o.stateNode,a?i.insertBefore(o,a):i.appendChild(o);else if(u!==4&&(u===27&&ua(o.type)&&(i=o.stateNode),o=o.child,o!==null))for(hu(o,a,i),o=o.sibling;o!==null;)hu(o,a,i),o=o.sibling}function R0(o){var a=o.stateNode,i=o.memoizedProps;try{for(var u=o.type,g=a.attributes;g.length;)a.removeAttributeNode(g[0]);mn(a,u,i),a[un]=o,a[Un]=i}catch(y){mt(o,o.return,y)}}var Ro=!1,Zt=!1,qh=!1,M0=typeof WeakSet=="function"?WeakSet:Set,ln=null;function MR(o,a){if(o=o.containerInfo,fm=ku,o=$y(o),Ff(o)){if("selectionStart"in o)var i={start:o.selectionStart,end:o.selectionEnd};else e:{i=(i=o.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var g=u.anchorOffset,y=u.focusNode;u=u.focusOffset;try{i.nodeType,y.nodeType}catch{i=null;break e}var E=0,O=-1,F=-1,Z=0,se=0,ce=o,Q=null;t:for(;;){for(var re;ce!==i||g!==0&&ce.nodeType!==3||(O=E+g),ce!==y||u!==0&&ce.nodeType!==3||(F=E+u),ce.nodeType===3&&(E+=ce.nodeValue.length),(re=ce.firstChild)!==null;)Q=ce,ce=re;for(;;){if(ce===o)break t;if(Q===i&&++Z===g&&(O=E),Q===y&&++se===u&&(F=E),(re=ce.nextSibling)!==null)break;ce=Q,Q=ce.parentNode}ce=re}i=O===-1||F===-1?null:{start:O,end:F}}else i=null}i=i||{start:0,end:0}}else i=null;for(hm={focusedElem:o,selectionRange:i},ku=!1,ln=a;ln!==null;)if(a=ln,o=a.child,(a.subtreeFlags&1028)!==0&&o!==null)o.return=a,ln=o;else for(;ln!==null;){switch(a=ln,y=a.alternate,o=a.flags,a.tag){case 0:if((o&4)!==0&&(o=a.updateQueue,o=o!==null?o.events:null,o!==null))for(i=0;i<o.length;i++)g=o[i],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&y!==null){o=void 0,i=a,g=y.memoizedProps,y=y.memoizedState,u=i.stateNode;try{var Ee=Xa(i.type,g);o=u.getSnapshotBeforeUpdate(Ee,y),u.__reactInternalSnapshotBeforeUpdate=o}catch(Fe){mt(i,i.return,Fe)}}break;case 3:if((o&1024)!==0){if(o=a.stateNode.containerInfo,i=o.nodeType,i===9)gm(o);else if(i===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":gm(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=a.sibling,o!==null){o.return=a.return,ln=o;break}ln=a.return}}function O0(o,a,i){var u=i.flags;switch(i.tag){case 0:case 11:case 15:Oo(o,i),u&4&&wl(5,i);break;case 1:if(Oo(o,i),u&4)if(o=i.stateNode,a===null)try{o.componentDidMount()}catch(E){mt(i,i.return,E)}else{var g=Xa(i.type,a.memoizedProps);a=a.memoizedState;try{o.componentDidUpdate(g,a,o.__reactInternalSnapshotBeforeUpdate)}catch(E){mt(i,i.return,E)}}u&64&&_0(i),u&512&&Cl(i,i.return);break;case 3:if(Oo(o,i),u&64&&(o=i.updateQueue,o!==null)){if(a=null,i.child!==null)switch(i.child.tag){case 27:case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}try{mb(o,a)}catch(E){mt(i,i.return,E)}}break;case 27:a===null&&u&4&&R0(i);case 26:case 5:Oo(o,i),a===null&&u&4&&T0(i),u&512&&Cl(i,i.return);break;case 12:Oo(o,i);break;case 31:Oo(o,i),u&4&&D0(o,i);break;case 13:Oo(o,i),u&4&&k0(o,i),u&64&&(o=i.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(i=FR.bind(null,i),oM(o,i))));break;case 22:if(u=i.memoizedState!==null||Ro,!u){a=a!==null&&a.memoizedState!==null||Zt,g=Ro;var y=Zt;Ro=u,(Zt=a)&&!y?Ao(o,i,(i.subtreeFlags&8772)!==0):Oo(o,i),Ro=g,Zt=y}break;case 30:break;default:Oo(o,i)}}function A0(o){var a=o.alternate;a!==null&&(o.alternate=null,A0(a)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(a=o.stateNode,a!==null&&Sf(a)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Ot=null,Hn=!1;function Mo(o,a,i){for(i=i.child;i!==null;)j0(o,a,i),i=i.sibling}function j0(o,a,i){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(Xn,i)}catch{}switch(i.tag){case 26:Zt||eo(i,a),Mo(o,a,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Zt||eo(i,a);var u=Ot,g=Hn;ua(i.type)&&(Ot=i.stateNode,Hn=!1),Mo(o,a,i),jl(i.stateNode),Ot=u,Hn=g;break;case 5:Zt||eo(i,a);case 6:if(u=Ot,g=Hn,Ot=null,Mo(o,a,i),Ot=u,Hn=g,Ot!==null)if(Hn)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(i.stateNode)}catch(y){mt(i,a,y)}else try{Ot.removeChild(i.stateNode)}catch(y){mt(i,a,y)}break;case 18:Ot!==null&&(Hn?(o=Ot,_x(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.stateNode),li(o)):_x(Ot,i.stateNode));break;case 4:u=Ot,g=Hn,Ot=i.stateNode.containerInfo,Hn=!0,Mo(o,a,i),Ot=u,Hn=g;break;case 0:case 11:case 14:case 15:ra(2,i,a),Zt||ra(4,i,a),Mo(o,a,i);break;case 1:Zt||(eo(i,a),u=i.stateNode,typeof u.componentWillUnmount=="function"&&E0(i,a,u)),Mo(o,a,i);break;case 21:Mo(o,a,i);break;case 22:Zt=(u=Zt)||i.memoizedState!==null,Mo(o,a,i),Zt=u;break;default:Mo(o,a,i)}}function D0(o,a){if(a.memoizedState===null&&(o=a.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{li(o)}catch(i){mt(a,a.return,i)}}}function k0(o,a){if(a.memoizedState===null&&(o=a.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{li(o)}catch(i){mt(a,a.return,i)}}function OR(o){switch(o.tag){case 31:case 13:case 19:var a=o.stateNode;return a===null&&(a=o.stateNode=new M0),a;case 22:return o=o.stateNode,a=o._retryCache,a===null&&(a=o._retryCache=new M0),a;default:throw Error(r(435,o.tag))}}function mu(o,a){var i=OR(o);a.forEach(function(u){if(!i.has(u)){i.add(u);var g=IR.bind(null,o,u);u.then(g,g)}})}function qn(o,a){var i=a.deletions;if(i!==null)for(var u=0;u<i.length;u++){var g=i[u],y=o,E=a,O=E;e:for(;O!==null;){switch(O.tag){case 27:if(ua(O.type)){Ot=O.stateNode,Hn=!1;break e}break;case 5:Ot=O.stateNode,Hn=!1;break e;case 3:case 4:Ot=O.stateNode.containerInfo,Hn=!0;break e}O=O.return}if(Ot===null)throw Error(r(160));j0(y,E,g),Ot=null,Hn=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)z0(a,o),a=a.sibling}var Pr=null;function z0(o,a){var i=o.alternate,u=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:qn(a,o),Yn(o),u&4&&(ra(3,o,o.return),wl(3,o),ra(5,o,o.return));break;case 1:qn(a,o),Yn(o),u&512&&(Zt||i===null||eo(i,i.return)),u&64&&Ro&&(o=o.updateQueue,o!==null&&(u=o.callbacks,u!==null&&(i=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=i===null?u:i.concat(u))));break;case 26:var g=Pr;if(qn(a,o),Yn(o),u&512&&(Zt||i===null||eo(i,i.return)),u&4){var y=i!==null?i.memoizedState:null;if(u=o.memoizedState,i===null)if(u===null)if(o.stateNode===null){e:{u=o.type,i=o.memoizedProps,g=g.ownerDocument||g;t:switch(u){case"title":y=g.getElementsByTagName("title")[0],(!y||y[Wi]||y[un]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(u),g.head.insertBefore(y,g.querySelector("head > title"))),mn(y,u,i),y[un]=o,sn(y),u=y;break e;case"link":var E=zx("link","href",g).get(u+(i.href||""));if(E){for(var O=0;O<E.length;O++)if(y=E[O],y.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&y.getAttribute("rel")===(i.rel==null?null:i.rel)&&y.getAttribute("title")===(i.title==null?null:i.title)&&y.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){E.splice(O,1);break t}}y=g.createElement(u),mn(y,u,i),g.head.appendChild(y);break;case"meta":if(E=zx("meta","content",g).get(u+(i.content||""))){for(O=0;O<E.length;O++)if(y=E[O],y.getAttribute("content")===(i.content==null?null:""+i.content)&&y.getAttribute("name")===(i.name==null?null:i.name)&&y.getAttribute("property")===(i.property==null?null:i.property)&&y.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&y.getAttribute("charset")===(i.charSet==null?null:i.charSet)){E.splice(O,1);break t}}y=g.createElement(u),mn(y,u,i),g.head.appendChild(y);break;default:throw Error(r(468,u))}y[un]=o,sn(y),u=y}o.stateNode=u}else Px(g,o.type,o.stateNode);else o.stateNode=kx(g,u,o.memoizedProps);else y!==u?(y===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):y.count--,u===null?Px(g,o.type,o.stateNode):kx(g,u,o.memoizedProps)):u===null&&o.stateNode!==null&&Uh(o,o.memoizedProps,i.memoizedProps)}break;case 27:qn(a,o),Yn(o),u&512&&(Zt||i===null||eo(i,i.return)),i!==null&&u&4&&Uh(o,o.memoizedProps,i.memoizedProps);break;case 5:if(qn(a,o),Yn(o),u&512&&(Zt||i===null||eo(i,i.return)),o.flags&32){g=o.stateNode;try{As(g,"")}catch(Ee){mt(o,o.return,Ee)}}u&4&&o.stateNode!=null&&(g=o.memoizedProps,Uh(o,g,i!==null?i.memoizedProps:g)),u&1024&&(qh=!0);break;case 6:if(qn(a,o),Yn(o),u&4){if(o.stateNode===null)throw Error(r(162));u=o.memoizedProps,i=o.stateNode;try{i.nodeValue=u}catch(Ee){mt(o,o.return,Ee)}}break;case 3:if(Ou=null,g=Pr,Pr=Ru(a.containerInfo),qn(a,o),Pr=g,Yn(o),u&4&&i!==null&&i.memoizedState.isDehydrated)try{li(a.containerInfo)}catch(Ee){mt(o,o.return,Ee)}qh&&(qh=!1,P0(o));break;case 4:u=Pr,Pr=Ru(o.stateNode.containerInfo),qn(a,o),Yn(o),Pr=u;break;case 12:qn(a,o),Yn(o);break;case 31:qn(a,o),Yn(o),u&4&&(u=o.updateQueue,u!==null&&(o.updateQueue=null,mu(o,u)));break;case 13:qn(a,o),Yn(o),o.child.flags&8192&&o.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(gu=me()),u&4&&(u=o.updateQueue,u!==null&&(o.updateQueue=null,mu(o,u)));break;case 22:g=o.memoizedState!==null;var F=i!==null&&i.memoizedState!==null,Z=Ro,se=Zt;if(Ro=Z||g,Zt=se||F,qn(a,o),Zt=se,Ro=Z,Yn(o),u&8192)e:for(a=o.stateNode,a._visibility=g?a._visibility&-2:a._visibility|1,g&&(i===null||F||Ro||Zt||Ja(o)),i=null,a=o;;){if(a.tag===5||a.tag===26){if(i===null){F=i=a;try{if(y=F.stateNode,g)E=y.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{O=F.stateNode;var ce=F.memoizedProps.style,Q=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;O.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Ee){mt(F,F.return,Ee)}}}else if(a.tag===6){if(i===null){F=a;try{F.stateNode.nodeValue=g?"":F.memoizedProps}catch(Ee){mt(F,F.return,Ee)}}}else if(a.tag===18){if(i===null){F=a;try{var re=F.stateNode;g?Ex(re,!0):Ex(F.stateNode,!1)}catch(Ee){mt(F,F.return,Ee)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===o)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===o)break e;for(;a.sibling===null;){if(a.return===null||a.return===o)break e;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}u&4&&(u=o.updateQueue,u!==null&&(i=u.retryQueue,i!==null&&(u.retryQueue=null,mu(o,i))));break;case 19:qn(a,o),Yn(o),u&4&&(u=o.updateQueue,u!==null&&(o.updateQueue=null,mu(o,u)));break;case 30:break;case 21:break;default:qn(a,o),Yn(o)}}function Yn(o){var a=o.flags;if(a&2){try{for(var i,u=o.return;u!==null;){if(N0(u)){i=u;break}u=u.return}if(i==null)throw Error(r(160));switch(i.tag){case 27:var g=i.stateNode,y=Bh(o);hu(o,y,g);break;case 5:var E=i.stateNode;i.flags&32&&(As(E,""),i.flags&=-33);var O=Bh(o);hu(o,O,E);break;case 3:case 4:var F=i.stateNode.containerInfo,Z=Bh(o);Hh(o,Z,F);break;default:throw Error(r(161))}}catch(se){mt(o,o.return,se)}o.flags&=-3}a&4096&&(o.flags&=-4097)}function P0(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var a=o;P0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),o=o.sibling}}function Oo(o,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)O0(o,a.alternate,a),a=a.sibling}function Ja(o){for(o=o.child;o!==null;){var a=o;switch(a.tag){case 0:case 11:case 14:case 15:ra(4,a,a.return),Ja(a);break;case 1:eo(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&E0(a,a.return,i),Ja(a);break;case 27:jl(a.stateNode);case 26:case 5:eo(a,a.return),Ja(a);break;case 22:a.memoizedState===null&&Ja(a);break;case 30:Ja(a);break;default:Ja(a)}o=o.sibling}}function Ao(o,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var u=a.alternate,g=o,y=a,E=y.flags;switch(y.tag){case 0:case 11:case 15:Ao(g,y,i),wl(4,y);break;case 1:if(Ao(g,y,i),u=y,g=u.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(Z){mt(u,u.return,Z)}if(u=y,g=u.updateQueue,g!==null){var O=u.stateNode;try{var F=g.shared.hiddenCallbacks;if(F!==null)for(g.shared.hiddenCallbacks=null,g=0;g<F.length;g++)hb(F[g],O)}catch(Z){mt(u,u.return,Z)}}i&&E&64&&_0(y),Cl(y,y.return);break;case 27:R0(y);case 26:case 5:Ao(g,y,i),i&&u===null&&E&4&&T0(y),Cl(y,y.return);break;case 12:Ao(g,y,i);break;case 31:Ao(g,y,i),i&&E&4&&D0(g,y);break;case 13:Ao(g,y,i),i&&E&4&&k0(g,y);break;case 22:y.memoizedState===null&&Ao(g,y,i),Cl(y,y.return);break;case 30:break;default:Ao(g,y,i)}a=a.sibling}}function Yh(o,a){var i=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==i&&(o!=null&&o.refCount++,i!=null&&cl(i))}function Gh(o,a){o=null,a.alternate!==null&&(o=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==o&&(a.refCount++,o!=null&&cl(o))}function Lr(o,a,i,u){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)L0(o,a,i,u),a=a.sibling}function L0(o,a,i,u){var g=a.flags;switch(a.tag){case 0:case 11:case 15:Lr(o,a,i,u),g&2048&&wl(9,a);break;case 1:Lr(o,a,i,u);break;case 3:Lr(o,a,i,u),g&2048&&(o=null,a.alternate!==null&&(o=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==o&&(a.refCount++,o!=null&&cl(o)));break;case 12:if(g&2048){Lr(o,a,i,u),o=a.stateNode;try{var y=a.memoizedProps,E=y.id,O=y.onPostCommit;typeof O=="function"&&O(E,a.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(F){mt(a,a.return,F)}}else Lr(o,a,i,u);break;case 31:Lr(o,a,i,u);break;case 13:Lr(o,a,i,u);break;case 23:break;case 22:y=a.stateNode,E=a.alternate,a.memoizedState!==null?y._visibility&2?Lr(o,a,i,u):_l(o,a):y._visibility&2?Lr(o,a,i,u):(y._visibility|=2,Qs(o,a,i,u,(a.subtreeFlags&10256)!==0||!1)),g&2048&&Yh(E,a);break;case 24:Lr(o,a,i,u),g&2048&&Gh(a.alternate,a);break;default:Lr(o,a,i,u)}}function Qs(o,a,i,u,g){for(g=g&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var y=o,E=a,O=i,F=u,Z=E.flags;switch(E.tag){case 0:case 11:case 15:Qs(y,E,O,F,g),wl(8,E);break;case 23:break;case 22:var se=E.stateNode;E.memoizedState!==null?se._visibility&2?Qs(y,E,O,F,g):_l(y,E):(se._visibility|=2,Qs(y,E,O,F,g)),g&&Z&2048&&Yh(E.alternate,E);break;case 24:Qs(y,E,O,F,g),g&&Z&2048&&Gh(E.alternate,E);break;default:Qs(y,E,O,F,g)}a=a.sibling}}function _l(o,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=o,u=a,g=u.flags;switch(u.tag){case 22:_l(i,u),g&2048&&Yh(u.alternate,u);break;case 24:_l(i,u),g&2048&&Gh(u.alternate,u);break;default:_l(i,u)}a=a.sibling}}var El=8192;function Xs(o,a,i){if(o.subtreeFlags&El)for(o=o.child;o!==null;)F0(o,a,i),o=o.sibling}function F0(o,a,i){switch(o.tag){case 26:Xs(o,a,i),o.flags&El&&o.memoizedState!==null&&gM(i,Pr,o.memoizedState,o.memoizedProps);break;case 5:Xs(o,a,i);break;case 3:case 4:var u=Pr;Pr=Ru(o.stateNode.containerInfo),Xs(o,a,i),Pr=u;break;case 22:o.memoizedState===null&&(u=o.alternate,u!==null&&u.memoizedState!==null?(u=El,El=16777216,Xs(o,a,i),El=u):Xs(o,a,i));break;default:Xs(o,a,i)}}function I0(o){var a=o.alternate;if(a!==null&&(o=a.child,o!==null)){a.child=null;do a=o.sibling,o.sibling=null,o=a;while(o!==null)}}function Tl(o){var a=o.deletions;if((o.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var u=a[i];ln=u,$0(u,o)}I0(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)V0(o),o=o.sibling}function V0(o){switch(o.tag){case 0:case 11:case 15:Tl(o),o.flags&2048&&ra(9,o,o.return);break;case 3:Tl(o);break;case 12:Tl(o);break;case 22:var a=o.stateNode;o.memoizedState!==null&&a._visibility&2&&(o.return===null||o.return.tag!==13)?(a._visibility&=-3,pu(o)):Tl(o);break;default:Tl(o)}}function pu(o){var a=o.deletions;if((o.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var u=a[i];ln=u,$0(u,o)}I0(o)}for(o=o.child;o!==null;){switch(a=o,a.tag){case 0:case 11:case 15:ra(8,a,a.return),pu(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,pu(a));break;default:pu(a)}o=o.sibling}}function $0(o,a){for(;ln!==null;){var i=ln;switch(i.tag){case 0:case 11:case 15:ra(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var u=i.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:cl(i.memoizedState.cache)}if(u=i.child,u!==null)u.return=i,ln=u;else e:for(i=o;ln!==null;){u=ln;var g=u.sibling,y=u.return;if(A0(u),u===i){ln=null;break e}if(g!==null){g.return=y,ln=g;break e}ln=y}}}var AR={getCacheForType:function(o){var a=fn(Yt),i=a.data.get(o);return i===void 0&&(i=o(),a.data.set(o,i)),i},cacheSignal:function(){return fn(Yt).controller.signal}},jR=typeof WeakMap=="function"?WeakMap:Map,dt=0,St=null,Je=null,rt=0,ht=0,rr=null,oa=!1,Js=!1,Kh=!1,jo=0,Pt=0,aa=0,es=0,Zh=0,or=0,ei=0,Nl=null,Gn=null,Wh=!1,gu=0,U0=0,vu=1/0,yu=null,sa=null,Jt=0,ia=null,ti=null,Do=0,Qh=0,Xh=null,B0=null,Rl=0,Jh=null;function ar(){return(dt&2)!==0&&rt!==0?rt&-rt:k.T!==null?am():bf()}function H0(){if(or===0)if((rt&536870912)===0||st){var o=Pe;Pe<<=1,(Pe&3932160)===0&&(Pe=262144),or=o}else or=536870912;return o=tr.current,o!==null&&(o.flags|=32),or}function Kn(o,a,i){(o===St&&(ht===2||ht===9)||o.cancelPendingCommit!==null)&&(ni(o,0),la(o,rt,or,!1)),xt(o,i),((dt&2)===0||o!==St)&&(o===St&&((dt&2)===0&&(es|=i),Pt===4&&la(o,rt,or,!1)),to(o))}function q0(o,a,i){if((dt&6)!==0)throw Error(r(327));var u=!i&&(a&127)===0&&(a&o.expiredLanes)===0||wt(o,a),g=u?zR(o,a):tm(o,a,!0),y=u;do{if(g===0){Js&&!u&&la(o,a,0,!1);break}else{if(i=o.current.alternate,y&&!DR(i)){g=tm(o,a,!1),y=!1;continue}if(g===2){if(y=a,o.errorRecoveryDisabledLanes&y)var E=0;else E=o.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){a=E;e:{var O=o;g=Nl;var F=O.current.memoizedState.isDehydrated;if(F&&(ni(O,E).flags|=256),E=tm(O,E,!1),E!==2){if(Kh&&!F){O.errorRecoveryDisabledLanes|=y,es|=y,g=4;break e}y=Gn,Gn=g,y!==null&&(Gn===null?Gn=y:Gn.push.apply(Gn,y))}g=E}if(y=!1,g!==2)continue}}if(g===1){ni(o,0),la(o,a,0,!0);break}e:{switch(u=o,y=g,y){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:la(u,a,or,!oa);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(g=gu+300-me(),10<g)){if(la(u,a,or,!oa),Se(u,0,!0)!==0)break e;Do=a,u.timeoutHandle=wx(Y0.bind(null,u,i,Gn,yu,Wh,a,or,es,ei,oa,y,"Throttled",-0,0),g);break e}Y0(u,i,Gn,yu,Wh,a,or,es,ei,oa,y,null,-0,0)}}break}while(!0);to(o)}function Y0(o,a,i,u,g,y,E,O,F,Z,se,ce,Q,re){if(o.timeoutHandle=-1,ce=a.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yo},F0(a,y,ce);var Ee=(y&62914560)===y?gu-me():(y&4194048)===y?U0-me():0;if(Ee=vM(ce,Ee),Ee!==null){Do=y,o.cancelPendingCommit=Ee(ex.bind(null,o,a,y,i,u,g,E,O,F,se,ce,null,Q,re)),la(o,y,E,!Z);return}}ex(o,a,y,i,u,g,E,O,F)}function DR(o){for(var a=o;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var u=0;u<i.length;u++){var g=i[u],y=g.getSnapshot;g=g.value;try{if(!Jn(y(),g))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===o)break;for(;a.sibling===null;){if(a.return===null||a.return===o)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function la(o,a,i,u){a&=~Zh,a&=~es,o.suspendedLanes|=a,o.pingedLanes&=~a,u&&(o.warmLanes|=a),u=o.expirationTimes;for(var g=a;0<g;){var y=31-It(g),E=1<<y;u[y]=-1,g&=~E}i!==0&&La(o,i,a)}function bu(){return(dt&6)===0?(Ml(0),!1):!0}function em(){if(Je!==null){if(ht===0)var o=Je.return;else o=Je,wo=qa=null,gh(o),Ys=null,dl=0,o=Je;for(;o!==null;)C0(o.alternate,o),o=o.return;Je=null}}function ni(o,a){var i=o.timeoutHandle;i!==-1&&(o.timeoutHandle=-1,JR(i)),i=o.cancelPendingCommit,i!==null&&(o.cancelPendingCommit=null,i()),Do=0,em(),St=o,Je=i=xo(o.current,null),rt=a,ht=0,rr=null,oa=!1,Js=wt(o,a),Kh=!1,ei=or=Zh=es=aa=Pt=0,Gn=Nl=null,Wh=!1,(a&8)!==0&&(a|=a&32);var u=o.entangledLanes;if(u!==0)for(o=o.entanglements,u&=a;0<u;){var g=31-It(u),y=1<<g;a|=o[g],u&=~y}return jo=a,Vc(),i}function G0(o,a){Ye=null,k.H=bl,a===qs||a===Kc?(a=cb(),ht=3):a===oh?(a=cb(),ht=4):ht=a===jh?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,rr=a,Je===null&&(Pt=1,lu(o,yr(a,o.current)))}function K0(){var o=tr.current;return o===null?!0:(rt&4194048)===rt?wr===null:(rt&62914560)===rt||(rt&536870912)!==0?o===wr:!1}function Z0(){var o=k.H;return k.H=bl,o===null?bl:o}function W0(){var o=k.A;return k.A=AR,o}function xu(){Pt=4,oa||(rt&4194048)!==rt&&tr.current!==null||(Js=!0),(aa&134217727)===0&&(es&134217727)===0||St===null||la(St,rt,or,!1)}function tm(o,a,i){var u=dt;dt|=2;var g=Z0(),y=W0();(St!==o||rt!==a)&&(yu=null,ni(o,a)),a=!1;var E=Pt;e:do try{if(ht!==0&&Je!==null){var O=Je,F=rr;switch(ht){case 8:em(),E=6;break e;case 3:case 2:case 9:case 6:tr.current===null&&(a=!0);var Z=ht;if(ht=0,rr=null,ri(o,O,F,Z),i&&Js){E=0;break e}break;default:Z=ht,ht=0,rr=null,ri(o,O,F,Z)}}kR(),E=Pt;break}catch(se){G0(o,se)}while(!0);return a&&o.shellSuspendCounter++,wo=qa=null,dt=u,k.H=g,k.A=y,Je===null&&(St=null,rt=0,Vc()),E}function kR(){for(;Je!==null;)Q0(Je)}function zR(o,a){var i=dt;dt|=2;var u=Z0(),g=W0();St!==o||rt!==a?(yu=null,vu=me()+500,ni(o,a)):Js=wt(o,a);e:do try{if(ht!==0&&Je!==null){a=Je;var y=rr;t:switch(ht){case 1:ht=0,rr=null,ri(o,a,y,1);break;case 2:case 9:if(ib(y)){ht=0,rr=null,X0(a);break}a=function(){ht!==2&&ht!==9||St!==o||(ht=7),to(o)},y.then(a,a);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:ib(y)?(ht=0,rr=null,X0(a)):(ht=0,rr=null,ri(o,a,y,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var O=Je;if(E?Lx(E):O.stateNode.complete){ht=0,rr=null;var F=O.sibling;if(F!==null)Je=F;else{var Z=O.return;Z!==null?(Je=Z,Su(Z)):Je=null}break t}}ht=0,rr=null,ri(o,a,y,5);break;case 6:ht=0,rr=null,ri(o,a,y,6);break;case 8:em(),Pt=6;break e;default:throw Error(r(462))}}PR();break}catch(se){G0(o,se)}while(!0);return wo=qa=null,k.H=u,k.A=g,dt=i,Je!==null?0:(St=null,rt=0,Vc(),Pt)}function PR(){for(;Je!==null&&!te();)Q0(Je)}function Q0(o){var a=S0(o.alternate,o,jo);o.memoizedProps=o.pendingProps,a===null?Su(o):Je=a}function X0(o){var a=o,i=a.alternate;switch(a.tag){case 15:case 0:a=p0(i,a,a.pendingProps,a.type,void 0,rt);break;case 11:a=p0(i,a,a.pendingProps,a.type.render,a.ref,rt);break;case 5:gh(a);default:C0(i,a),a=Je=Wy(a,jo),a=S0(i,a,jo)}o.memoizedProps=o.pendingProps,a===null?Su(o):Je=a}function ri(o,a,i,u){wo=qa=null,gh(a),Ys=null,dl=0;var g=a.return;try{if(_R(o,g,a,i,rt)){Pt=1,lu(o,yr(i,o.current)),Je=null;return}}catch(y){if(g!==null)throw Je=g,y;Pt=1,lu(o,yr(i,o.current)),Je=null;return}a.flags&32768?(st||u===1?o=!0:Js||(rt&536870912)!==0?o=!1:(oa=o=!0,(u===2||u===9||u===3||u===6)&&(u=tr.current,u!==null&&u.tag===13&&(u.flags|=16384))),J0(a,o)):Su(a)}function Su(o){var a=o;do{if((a.flags&32768)!==0){J0(a,oa);return}o=a.return;var i=NR(a.alternate,a,jo);if(i!==null){Je=i;return}if(a=a.sibling,a!==null){Je=a;return}Je=a=o}while(a!==null);Pt===0&&(Pt=5)}function J0(o,a){do{var i=RR(o.alternate,o);if(i!==null){i.flags&=32767,Je=i;return}if(i=o.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(o=o.sibling,o!==null)){Je=o;return}Je=o=i}while(o!==null);Pt=6,Je=null}function ex(o,a,i,u,g,y,E,O,F){o.cancelPendingCommit=null;do wu();while(Jt!==0);if((dt&6)!==0)throw Error(r(327));if(a!==null){if(a===o.current)throw Error(r(177));if(y=a.lanes|a.childLanes,y|=Bf,In(o,i,y,E,O,F),o===St&&(Je=St=null,rt=0),ti=a,ia=o,Do=i,Qh=y,Xh=g,B0=u,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,VR(nt,function(){return ax(),null})):(o.callbackNode=null,o.callbackPriority=0),u=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||u){u=k.T,k.T=null,g=Y.p,Y.p=2,E=dt,dt|=4;try{MR(o,a,i)}finally{dt=E,Y.p=g,k.T=u}}Jt=1,tx(),nx(),rx()}}function tx(){if(Jt===1){Jt=0;var o=ia,a=ti,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=k.T,k.T=null;var u=Y.p;Y.p=2;var g=dt;dt|=4;try{z0(a,o);var y=hm,E=$y(o.containerInfo),O=y.focusedElem,F=y.selectionRange;if(E!==O&&O&&O.ownerDocument&&Vy(O.ownerDocument.documentElement,O)){if(F!==null&&Ff(O)){var Z=F.start,se=F.end;if(se===void 0&&(se=Z),"selectionStart"in O)O.selectionStart=Z,O.selectionEnd=Math.min(se,O.value.length);else{var ce=O.ownerDocument||document,Q=ce&&ce.defaultView||window;if(Q.getSelection){var re=Q.getSelection(),Ee=O.textContent.length,Fe=Math.min(F.start,Ee),yt=F.end===void 0?Fe:Math.min(F.end,Ee);!re.extend&&Fe>yt&&(E=yt,yt=Fe,Fe=E);var q=Iy(O,Fe),$=Iy(O,yt);if(q&&$&&(re.rangeCount!==1||re.anchorNode!==q.node||re.anchorOffset!==q.offset||re.focusNode!==$.node||re.focusOffset!==$.offset)){var K=ce.createRange();K.setStart(q.node,q.offset),re.removeAllRanges(),Fe>yt?(re.addRange(K),re.extend($.node,$.offset)):(K.setEnd($.node,$.offset),re.addRange(K))}}}}for(ce=[],re=O;re=re.parentNode;)re.nodeType===1&&ce.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ce.length;O++){var le=ce[O];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}ku=!!fm,hm=fm=null}finally{dt=g,Y.p=u,k.T=i}}o.current=a,Jt=2}}function nx(){if(Jt===2){Jt=0;var o=ia,a=ti,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=k.T,k.T=null;var u=Y.p;Y.p=2;var g=dt;dt|=4;try{O0(o,a.alternate,a)}finally{dt=g,Y.p=u,k.T=i}}Jt=3}}function rx(){if(Jt===4||Jt===3){Jt=0,xe();var o=ia,a=ti,i=Do,u=B0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Jt=5:(Jt=0,ti=ia=null,ox(o,o.pendingLanes));var g=o.pendingLanes;if(g===0&&(sa=null),kr(i),a=a.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(Xn,a,void 0,(a.current.flags&128)===128)}catch{}if(u!==null){a=k.T,g=Y.p,Y.p=2,k.T=null;try{for(var y=o.onRecoverableError,E=0;E<u.length;E++){var O=u[E];y(O.value,{componentStack:O.stack})}}finally{k.T=a,Y.p=g}}(Do&3)!==0&&wu(),to(o),g=o.pendingLanes,(i&261930)!==0&&(g&42)!==0?o===Jh?Rl++:(Rl=0,Jh=o):Rl=0,Ml(0)}}function ox(o,a){(o.pooledCacheLanes&=a)===0&&(a=o.pooledCache,a!=null&&(o.pooledCache=null,cl(a)))}function wu(){return tx(),nx(),rx(),ax()}function ax(){if(Jt!==5)return!1;var o=ia,a=Qh;Qh=0;var i=kr(Do),u=k.T,g=Y.p;try{Y.p=32>i?32:i,k.T=null,i=Xh,Xh=null;var y=ia,E=Do;if(Jt=0,ti=ia=null,Do=0,(dt&6)!==0)throw Error(r(331));var O=dt;if(dt|=4,V0(y.current),L0(y,y.current,E,i),dt=O,Ml(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(Xn,y)}catch{}return!0}finally{Y.p=g,k.T=u,ox(o,a)}}function sx(o,a,i){a=yr(i,a),a=Ah(o.stateNode,a,2),o=ea(o,a,2),o!==null&&(xt(o,2),to(o))}function mt(o,a,i){if(o.tag===3)sx(o,o,i);else for(;a!==null;){if(a.tag===3){sx(a,o,i);break}else if(a.tag===1){var u=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(sa===null||!sa.has(u))){o=yr(i,o),i=i0(2),u=ea(a,i,2),u!==null&&(l0(i,u,a,o),xt(u,2),to(u));break}}a=a.return}}function nm(o,a,i){var u=o.pingCache;if(u===null){u=o.pingCache=new jR;var g=new Set;u.set(a,g)}else g=u.get(a),g===void 0&&(g=new Set,u.set(a,g));g.has(i)||(Kh=!0,g.add(i),o=LR.bind(null,o,a,i),a.then(o,o))}function LR(o,a,i){var u=o.pingCache;u!==null&&u.delete(a),o.pingedLanes|=o.suspendedLanes&i,o.warmLanes&=~i,St===o&&(rt&i)===i&&(Pt===4||Pt===3&&(rt&62914560)===rt&&300>me()-gu?(dt&2)===0&&ni(o,0):Zh|=i,ei===rt&&(ei=0)),to(o)}function ix(o,a){a===0&&(a=an()),o=Ua(o,a),o!==null&&(xt(o,a),to(o))}function FR(o){var a=o.memoizedState,i=0;a!==null&&(i=a.retryLane),ix(o,i)}function IR(o,a){var i=0;switch(o.tag){case 31:case 13:var u=o.stateNode,g=o.memoizedState;g!==null&&(i=g.retryLane);break;case 19:u=o.stateNode;break;case 22:u=o.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(a),ix(o,i)}function VR(o,a){return V(o,a)}var Cu=null,oi=null,rm=!1,_u=!1,om=!1,ca=0;function to(o){o!==oi&&o.next===null&&(oi===null?Cu=oi=o:oi=oi.next=o),_u=!0,rm||(rm=!0,UR())}function Ml(o,a){if(!om&&_u){om=!0;do for(var i=!1,u=Cu;u!==null;){if(o!==0){var g=u.pendingLanes;if(g===0)var y=0;else{var E=u.suspendedLanes,O=u.pingedLanes;y=(1<<31-It(42|o)+1)-1,y&=g&~(E&~O),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(i=!0,dx(u,y))}else y=rt,y=Se(u,u===St?y:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(y&3)===0||wt(u,y)||(i=!0,dx(u,y));u=u.next}while(i);om=!1}}function $R(){lx()}function lx(){_u=rm=!1;var o=0;ca!==0&&XR()&&(o=ca);for(var a=me(),i=null,u=Cu;u!==null;){var g=u.next,y=cx(u,a);y===0?(u.next=null,i===null?Cu=g:i.next=g,g===null&&(oi=i)):(i=u,(o!==0||(y&3)!==0)&&(_u=!0)),u=g}Jt!==0&&Jt!==5||Ml(o),ca!==0&&(ca=0)}function cx(o,a){for(var i=o.suspendedLanes,u=o.pingedLanes,g=o.expirationTimes,y=o.pendingLanes&-62914561;0<y;){var E=31-It(y),O=1<<E,F=g[E];F===-1?((O&i)===0||(O&u)!==0)&&(g[E]=qt(O,a)):F<=a&&(o.expiredLanes|=O),y&=~O}if(a=St,i=rt,i=Se(o,o===a?i:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),u=o.callbackNode,i===0||o===a&&(ht===2||ht===9)||o.cancelPendingCommit!==null)return u!==null&&u!==null&&G(u),o.callbackNode=null,o.callbackPriority=0;if((i&3)===0||wt(o,i)){if(a=i&-i,a===o.callbackPriority)return a;switch(u!==null&&G(u),kr(i)){case 2:case 8:i=tt;break;case 32:i=nt;break;case 268435456:i=yn;break;default:i=nt}return u=ux.bind(null,o),i=V(i,u),o.callbackPriority=a,o.callbackNode=i,a}return u!==null&&u!==null&&G(u),o.callbackPriority=2,o.callbackNode=null,2}function ux(o,a){if(Jt!==0&&Jt!==5)return o.callbackNode=null,o.callbackPriority=0,null;var i=o.callbackNode;if(wu()&&o.callbackNode!==i)return null;var u=rt;return u=Se(o,o===St?u:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),u===0?null:(q0(o,u,a),cx(o,me()),o.callbackNode!=null&&o.callbackNode===i?ux.bind(null,o):null)}function dx(o,a){if(wu())return null;q0(o,a,!0)}function UR(){eM(function(){(dt&6)!==0?V(Te,$R):lx()})}function am(){if(ca===0){var o=Bs;o===0&&(o=Xe,Xe<<=1,(Xe&261888)===0&&(Xe=256)),ca=o}return ca}function fx(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:jc(""+o)}function hx(o,a){var i=a.ownerDocument.createElement("input");return i.name=a.name,i.value=a.value,o.id&&i.setAttribute("form",o.id),a.parentNode.insertBefore(i,a),o=new FormData(o),i.parentNode.removeChild(i),o}function BR(o,a,i,u,g){if(a==="submit"&&i&&i.stateNode===g){var y=fx((g[Un]||null).action),E=u.submitter;E&&(a=(a=E[Un]||null)?fx(a.formAction):E.getAttribute("formAction"),a!==null&&(y=a,E=null));var O=new Pc("action","action",null,u,g);o.push({event:O,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(ca!==0){var F=E?hx(g,E):new FormData(g);Eh(i,{pending:!0,data:F,method:g.method,action:y},null,F)}}else typeof y=="function"&&(O.preventDefault(),F=E?hx(g,E):new FormData(g),Eh(i,{pending:!0,data:F,method:g.method,action:y},y,F))},currentTarget:g}]})}}for(var sm=0;sm<Uf.length;sm++){var im=Uf[sm],HR=im.toLowerCase(),qR=im[0].toUpperCase()+im.slice(1);zr(HR,"on"+qR)}zr(Hy,"onAnimationEnd"),zr(qy,"onAnimationIteration"),zr(Yy,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(iR,"onTransitionRun"),zr(lR,"onTransitionStart"),zr(cR,"onTransitionCancel"),zr(Gy,"onTransitionEnd"),Ms("onMouseEnter",["mouseout","mouseover"]),Ms("onMouseLeave",["mouseout","mouseover"]),Ms("onPointerEnter",["pointerout","pointerover"]),Ms("onPointerLeave",["pointerout","pointerover"]),Fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ol="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(" "),YR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ol));function mx(o,a){a=(a&4)!==0;for(var i=0;i<o.length;i++){var u=o[i],g=u.event;u=u.listeners;e:{var y=void 0;if(a)for(var E=u.length-1;0<=E;E--){var O=u[E],F=O.instance,Z=O.currentTarget;if(O=O.listener,F!==y&&g.isPropagationStopped())break e;y=O,g.currentTarget=Z;try{y(g)}catch(se){Ic(se)}g.currentTarget=null,y=F}else for(E=0;E<u.length;E++){if(O=u[E],F=O.instance,Z=O.currentTarget,O=O.listener,F!==y&&g.isPropagationStopped())break e;y=O,g.currentTarget=Z;try{y(g)}catch(se){Ic(se)}g.currentTarget=null,y=F}}}}function et(o,a){var i=a[xf];i===void 0&&(i=a[xf]=new Set);var u=o+"__bubble";i.has(u)||(px(a,o,2,!1),i.add(u))}function lm(o,a,i){var u=0;a&&(u|=4),px(i,o,u,a)}var Eu="_reactListening"+Math.random().toString(36).slice(2);function cm(o){if(!o[Eu]){o[Eu]=!0,ly.forEach(function(i){i!=="selectionchange"&&(YR.has(i)||lm(i,!1,o),lm(i,!0,o))});var a=o.nodeType===9?o:o.ownerDocument;a===null||a[Eu]||(a[Eu]=!0,lm("selectionchange",!1,a))}}function px(o,a,i,u){switch(Hx(a)){case 2:var g=xM;break;case 8:g=SM;break;default:g=_m}i=g.bind(null,a,i,o),g=void 0,!Mf||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(g=!0),u?g!==void 0?o.addEventListener(a,i,{capture:!0,passive:g}):o.addEventListener(a,i,!0):g!==void 0?o.addEventListener(a,i,{passive:g}):o.addEventListener(a,i,!1)}function um(o,a,i,u,g){var y=u;if((a&1)===0&&(a&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var O=u.stateNode.containerInfo;if(O===g)break;if(E===4)for(E=u.return;E!==null;){var F=E.tag;if((F===3||F===4)&&E.stateNode.containerInfo===g)return;E=E.return}for(;O!==null;){if(E=Ts(O),E===null)return;if(F=E.tag,F===5||F===6||F===26||F===27){u=y=E;continue e}O=O.parentNode}}u=u.return}xy(function(){var Z=y,se=Nf(i),ce=[];e:{var Q=Ky.get(o);if(Q!==void 0){var re=Pc,Ee=o;switch(o){case"keypress":if(kc(i)===0)break e;case"keydown":case"keyup":re=IN;break;case"focusin":Ee="focus",re=Df;break;case"focusout":Ee="blur",re=Df;break;case"beforeblur":case"afterblur":re=Df;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Cy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=NN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=UN;break;case Hy:case qy:case Yy:re=ON;break;case Gy:re=HN;break;case"scroll":case"scrollend":re=EN;break;case"wheel":re=YN;break;case"copy":case"cut":case"paste":re=jN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Ey;break;case"toggle":case"beforetoggle":re=KN}var Fe=(a&4)!==0,yt=!Fe&&(o==="scroll"||o==="scrollend"),q=Fe?Q!==null?Q+"Capture":null:Q;Fe=[];for(var $=Z,K;$!==null;){var le=$;if(K=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||K===null||q===null||(le=Xi($,q),le!=null&&Fe.push(Al($,le,K))),yt)break;$=$.return}0<Fe.length&&(Q=new re(Q,Ee,null,i,se),ce.push({event:Q,listeners:Fe}))}}if((a&7)===0){e:{if(Q=o==="mouseover"||o==="pointerover",re=o==="mouseout"||o==="pointerout",Q&&i!==Tf&&(Ee=i.relatedTarget||i.fromElement)&&(Ts(Ee)||Ee[Es]))break e;if((re||Q)&&(Q=se.window===se?se:(Q=se.ownerDocument)?Q.defaultView||Q.parentWindow:window,re?(Ee=i.relatedTarget||i.toElement,re=Z,Ee=Ee?Ts(Ee):null,Ee!==null&&(yt=l(Ee),Fe=Ee.tag,Ee!==yt||Fe!==5&&Fe!==27&&Fe!==6)&&(Ee=null)):(re=null,Ee=Z),re!==Ee)){if(Fe=Cy,le="onMouseLeave",q="onMouseEnter",$="mouse",(o==="pointerout"||o==="pointerover")&&(Fe=Ey,le="onPointerLeave",q="onPointerEnter",$="pointer"),yt=re==null?Q:Qi(re),K=Ee==null?Q:Qi(Ee),Q=new Fe(le,$+"leave",re,i,se),Q.target=yt,Q.relatedTarget=K,le=null,Ts(se)===Z&&(Fe=new Fe(q,$+"enter",Ee,i,se),Fe.target=K,Fe.relatedTarget=yt,le=Fe),yt=le,re&&Ee)t:{for(Fe=GR,q=re,$=Ee,K=0,le=q;le;le=Fe(le))K++;le=0;for(var ke=$;ke;ke=Fe(ke))le++;for(;0<K-le;)q=Fe(q),K--;for(;0<le-K;)$=Fe($),le--;for(;K--;){if(q===$||$!==null&&q===$.alternate){Fe=q;break t}q=Fe(q),$=Fe($)}Fe=null}else Fe=null;re!==null&&gx(ce,Q,re,Fe,!1),Ee!==null&&yt!==null&&gx(ce,yt,Ee,Fe,!0)}}e:{if(Q=Z?Qi(Z):window,re=Q.nodeName&&Q.nodeName.toLowerCase(),re==="select"||re==="input"&&Q.type==="file")var ct=Dy;else if(Ay(Q))if(ky)ct=oR;else{ct=nR;var Me=tR}else re=Q.nodeName,!re||re.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?Z&&Ef(Z.elementType)&&(ct=Dy):ct=rR;if(ct&&(ct=ct(o,Z))){jy(ce,ct,i,se);break e}Me&&Me(o,Q,Z),o==="focusout"&&Z&&Q.type==="number"&&Z.memoizedProps.value!=null&&_f(Q,"number",Q.value)}switch(Me=Z?Qi(Z):window,o){case"focusin":(Ay(Me)||Me.contentEditable==="true")&&(zs=Me,If=Z,sl=null);break;case"focusout":sl=If=zs=null;break;case"mousedown":Vf=!0;break;case"contextmenu":case"mouseup":case"dragend":Vf=!1,Uy(ce,i,se);break;case"selectionchange":if(sR)break;case"keydown":case"keyup":Uy(ce,i,se)}var Ke;if(zf)e:{switch(o){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else ks?My(o,i)&&(ot="onCompositionEnd"):o==="keydown"&&i.keyCode===229&&(ot="onCompositionStart");ot&&(Ty&&i.locale!=="ko"&&(ks||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&ks&&(Ke=Sy()):(Go=se,Of="value"in Go?Go.value:Go.textContent,ks=!0)),Me=Tu(Z,ot),0<Me.length&&(ot=new _y(ot,o,null,i,se),ce.push({event:ot,listeners:Me}),Ke?ot.data=Ke:(Ke=Oy(i),Ke!==null&&(ot.data=Ke)))),(Ke=WN?QN(o,i):XN(o,i))&&(ot=Tu(Z,"onBeforeInput"),0<ot.length&&(Me=new _y("onBeforeInput","beforeinput",null,i,se),ce.push({event:Me,listeners:ot}),Me.data=Ke)),BR(ce,o,Z,i,se)}mx(ce,a)})}function Al(o,a,i){return{instance:o,listener:a,currentTarget:i}}function Tu(o,a){for(var i=a+"Capture",u=[];o!==null;){var g=o,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=Xi(o,i),g!=null&&u.unshift(Al(o,g,y)),g=Xi(o,a),g!=null&&u.push(Al(o,g,y))),o.tag===3)return u;o=o.return}return[]}function GR(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function gx(o,a,i,u,g){for(var y=a._reactName,E=[];i!==null&&i!==u;){var O=i,F=O.alternate,Z=O.stateNode;if(O=O.tag,F!==null&&F===u)break;O!==5&&O!==26&&O!==27||Z===null||(F=Z,g?(Z=Xi(i,y),Z!=null&&E.unshift(Al(i,Z,F))):g||(Z=Xi(i,y),Z!=null&&E.push(Al(i,Z,F)))),i=i.return}E.length!==0&&o.push({event:a,listeners:E})}var KR=/\r\n?/g,ZR=/\u0000|\uFFFD/g;function vx(o){return(typeof o=="string"?o:""+o).replace(KR,`
10
+ `).replace(ZR,"")}function yx(o,a){return a=vx(a),vx(o)===a}function vt(o,a,i,u,g,y){switch(i){case"children":typeof u=="string"?a==="body"||a==="textarea"&&u===""||As(o,u):(typeof u=="number"||typeof u=="bigint")&&a!=="body"&&As(o,""+u);break;case"className":Oc(o,"class",u);break;case"tabIndex":Oc(o,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Oc(o,i,u);break;case"style":yy(o,u,y);break;case"data":if(a!=="object"){Oc(o,"data",u);break}case"src":case"href":if(u===""&&(a!=="a"||i!=="href")){o.removeAttribute(i);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){o.removeAttribute(i);break}u=jc(""+u),o.setAttribute(i,u);break;case"action":case"formAction":if(typeof u=="function"){o.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(i==="formAction"?(a!=="input"&&vt(o,a,"name",g.name,g,null),vt(o,a,"formEncType",g.formEncType,g,null),vt(o,a,"formMethod",g.formMethod,g,null),vt(o,a,"formTarget",g.formTarget,g,null)):(vt(o,a,"encType",g.encType,g,null),vt(o,a,"method",g.method,g,null),vt(o,a,"target",g.target,g,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){o.removeAttribute(i);break}u=jc(""+u),o.setAttribute(i,u);break;case"onClick":u!=null&&(o.onclick=yo);break;case"onScroll":u!=null&&et("scroll",o);break;case"onScrollEnd":u!=null&&et("scrollend",o);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(i=u.__html,i!=null){if(g.children!=null)throw Error(r(60));o.innerHTML=i}}break;case"multiple":o.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":o.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){o.removeAttribute("xlink:href");break}i=jc(""+u),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?o.setAttribute(i,""+u):o.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?o.setAttribute(i,""):o.removeAttribute(i);break;case"capture":case"download":u===!0?o.setAttribute(i,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?o.setAttribute(i,u):o.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?o.setAttribute(i,u):o.removeAttribute(i);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?o.removeAttribute(i):o.setAttribute(i,u);break;case"popover":et("beforetoggle",o),et("toggle",o),Mc(o,"popover",u);break;case"xlinkActuate":vo(o,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":vo(o,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":vo(o,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":vo(o,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":vo(o,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":vo(o,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":vo(o,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":vo(o,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":vo(o,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Mc(o,"is",u);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=CN.get(i)||i,Mc(o,i,u))}}function dm(o,a,i,u,g,y){switch(i){case"style":yy(o,u,y);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(i=u.__html,i!=null){if(g.children!=null)throw Error(r(60));o.innerHTML=i}}break;case"children":typeof u=="string"?As(o,u):(typeof u=="number"||typeof u=="bigint")&&As(o,""+u);break;case"onScroll":u!=null&&et("scroll",o);break;case"onScrollEnd":u!=null&&et("scrollend",o);break;case"onClick":u!=null&&(o.onclick=yo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cy.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(g=i.endsWith("Capture"),a=i.slice(2,g?i.length-7:void 0),y=o[Un]||null,y=y!=null?y[i]:null,typeof y=="function"&&o.removeEventListener(a,y,g),typeof u=="function")){typeof y!="function"&&y!==null&&(i in o?o[i]=null:o.hasAttribute(i)&&o.removeAttribute(i)),o.addEventListener(a,u,g);break e}i in o?o[i]=u:u===!0?o.setAttribute(i,""):Mc(o,i,u)}}}function mn(o,a,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",o),et("load",o);var u=!1,g=!1,y;for(y in i)if(i.hasOwnProperty(y)){var E=i[y];if(E!=null)switch(y){case"src":u=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:vt(o,a,y,E,i,null)}}g&&vt(o,a,"srcSet",i.srcSet,i,null),u&&vt(o,a,"src",i.src,i,null);return;case"input":et("invalid",o);var O=y=E=g=null,F=null,Z=null;for(u in i)if(i.hasOwnProperty(u)){var se=i[u];if(se!=null)switch(u){case"name":g=se;break;case"type":E=se;break;case"checked":F=se;break;case"defaultChecked":Z=se;break;case"value":y=se;break;case"defaultValue":O=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,a));break;default:vt(o,a,u,se,i,null)}}my(o,y,O,F,Z,E,g,!1);return;case"select":et("invalid",o),u=E=y=null;for(g in i)if(i.hasOwnProperty(g)&&(O=i[g],O!=null))switch(g){case"value":y=O;break;case"defaultValue":E=O;break;case"multiple":u=O;default:vt(o,a,g,O,i,null)}a=y,i=E,o.multiple=!!u,a!=null?Os(o,!!u,a,!1):i!=null&&Os(o,!!u,i,!0);return;case"textarea":et("invalid",o),y=g=u=null;for(E in i)if(i.hasOwnProperty(E)&&(O=i[E],O!=null))switch(E){case"value":u=O;break;case"defaultValue":g=O;break;case"children":y=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:vt(o,a,E,O,i,null)}gy(o,u,g,y);return;case"option":for(F in i)if(i.hasOwnProperty(F)&&(u=i[F],u!=null))switch(F){case"selected":o.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:vt(o,a,F,u,i,null)}return;case"dialog":et("beforetoggle",o),et("toggle",o),et("cancel",o),et("close",o);break;case"iframe":case"object":et("load",o);break;case"video":case"audio":for(u=0;u<Ol.length;u++)et(Ol[u],o);break;case"image":et("error",o),et("load",o);break;case"details":et("toggle",o);break;case"embed":case"source":case"link":et("error",o),et("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in i)if(i.hasOwnProperty(Z)&&(u=i[Z],u!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:vt(o,a,Z,u,i,null)}return;default:if(Ef(a)){for(se in i)i.hasOwnProperty(se)&&(u=i[se],u!==void 0&&dm(o,a,se,u,i,void 0));return}}for(O in i)i.hasOwnProperty(O)&&(u=i[O],u!=null&&vt(o,a,O,u,i,null))}function WR(o,a,i,u){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,E=null,O=null,F=null,Z=null,se=null;for(re in i){var ce=i[re];if(i.hasOwnProperty(re)&&ce!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":F=ce;default:u.hasOwnProperty(re)||vt(o,a,re,null,u,ce)}}for(var Q in u){var re=u[Q];if(ce=i[Q],u.hasOwnProperty(Q)&&(re!=null||ce!=null))switch(Q){case"type":y=re;break;case"name":g=re;break;case"checked":Z=re;break;case"defaultChecked":se=re;break;case"value":E=re;break;case"defaultValue":O=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,a));break;default:re!==ce&&vt(o,a,Q,re,u,ce)}}Cf(o,E,O,F,Z,se,y,g);return;case"select":re=E=O=Q=null;for(y in i)if(F=i[y],i.hasOwnProperty(y)&&F!=null)switch(y){case"value":break;case"multiple":re=F;default:u.hasOwnProperty(y)||vt(o,a,y,null,u,F)}for(g in u)if(y=u[g],F=i[g],u.hasOwnProperty(g)&&(y!=null||F!=null))switch(g){case"value":Q=y;break;case"defaultValue":O=y;break;case"multiple":E=y;default:y!==F&&vt(o,a,g,y,u,F)}a=O,i=E,u=re,Q!=null?Os(o,!!i,Q,!1):!!u!=!!i&&(a!=null?Os(o,!!i,a,!0):Os(o,!!i,i?[]:"",!1));return;case"textarea":re=Q=null;for(O in i)if(g=i[O],i.hasOwnProperty(O)&&g!=null&&!u.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:vt(o,a,O,null,u,g)}for(E in u)if(g=u[E],y=i[E],u.hasOwnProperty(E)&&(g!=null||y!=null))switch(E){case"value":Q=g;break;case"defaultValue":re=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==y&&vt(o,a,E,g,u,y)}py(o,Q,re);return;case"option":for(var Ee in i)if(Q=i[Ee],i.hasOwnProperty(Ee)&&Q!=null&&!u.hasOwnProperty(Ee))switch(Ee){case"selected":o.selected=!1;break;default:vt(o,a,Ee,null,u,Q)}for(F in u)if(Q=u[F],re=i[F],u.hasOwnProperty(F)&&Q!==re&&(Q!=null||re!=null))switch(F){case"selected":o.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:vt(o,a,F,Q,u,re)}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 Fe in i)Q=i[Fe],i.hasOwnProperty(Fe)&&Q!=null&&!u.hasOwnProperty(Fe)&&vt(o,a,Fe,null,u,Q);for(Z in u)if(Q=u[Z],re=i[Z],u.hasOwnProperty(Z)&&Q!==re&&(Q!=null||re!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,a));break;default:vt(o,a,Z,Q,u,re)}return;default:if(Ef(a)){for(var yt in i)Q=i[yt],i.hasOwnProperty(yt)&&Q!==void 0&&!u.hasOwnProperty(yt)&&dm(o,a,yt,void 0,u,Q);for(se in u)Q=u[se],re=i[se],!u.hasOwnProperty(se)||Q===re||Q===void 0&&re===void 0||dm(o,a,se,Q,u,re);return}}for(var q in i)Q=i[q],i.hasOwnProperty(q)&&Q!=null&&!u.hasOwnProperty(q)&&vt(o,a,q,null,u,Q);for(ce in u)Q=u[ce],re=i[ce],!u.hasOwnProperty(ce)||Q===re||Q==null&&re==null||vt(o,a,ce,Q,u,re)}function bx(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function QR(){if(typeof performance.getEntriesByType=="function"){for(var o=0,a=0,i=performance.getEntriesByType("resource"),u=0;u<i.length;u++){var g=i[u],y=g.transferSize,E=g.initiatorType,O=g.duration;if(y&&O&&bx(E)){for(E=0,O=g.responseEnd,u+=1;u<i.length;u++){var F=i[u],Z=F.startTime;if(Z>O)break;var se=F.transferSize,ce=F.initiatorType;se&&bx(ce)&&(F=F.responseEnd,E+=se*(F<O?1:(O-Z)/(F-Z)))}if(--u,a+=8*(y+E)/(g.duration/1e3),o++,10<o)break}}if(0<o)return a/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var fm=null,hm=null;function Nu(o){return o.nodeType===9?o:o.ownerDocument}function xx(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Sx(o,a){if(o===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&a==="foreignObject"?0:o}function mm(o,a){return o==="textarea"||o==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var pm=null;function XR(){var o=window.event;return o&&o.type==="popstate"?o===pm?!1:(pm=o,!0):(pm=null,!1)}var wx=typeof setTimeout=="function"?setTimeout:void 0,JR=typeof clearTimeout=="function"?clearTimeout:void 0,Cx=typeof Promise=="function"?Promise:void 0,eM=typeof queueMicrotask=="function"?queueMicrotask:typeof Cx<"u"?function(o){return Cx.resolve(null).then(o).catch(tM)}:wx;function tM(o){setTimeout(function(){throw o})}function ua(o){return o==="head"}function _x(o,a){var i=a,u=0;do{var g=i.nextSibling;if(o.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"||i==="/&"){if(u===0){o.removeChild(g),li(a);return}u--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")u++;else if(i==="html")jl(o.ownerDocument.documentElement);else if(i==="head"){i=o.ownerDocument.head,jl(i);for(var y=i.firstChild;y;){var E=y.nextSibling,O=y.nodeName;y[Wi]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&y.rel.toLowerCase()==="stylesheet"||i.removeChild(y),y=E}}else i==="body"&&jl(o.ownerDocument.body);i=g}while(i);li(a)}function Ex(o,a){var i=o;o=0;do{var u=i.nextSibling;if(i.nodeType===1?a?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(a?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),u&&u.nodeType===8)if(i=u.data,i==="/$"){if(o===0)break;o--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||o++;i=u}while(i)}function gm(o){var a=o.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var i=a;switch(a=a.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":gm(i),Sf(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}o.removeChild(i)}}function nM(o,a,i,u){for(;o.nodeType===1;){var g=i;if(o.nodeName.toLowerCase()!==a.toLowerCase()){if(!u&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(u){if(!o[Wi])switch(a){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(y=o.getAttribute("rel"),y==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(y!==g.rel||o.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||o.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||o.getAttribute("title")!==(g.title==null?null:g.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(y=o.getAttribute("src"),(y!==(g.src==null?null:g.src)||o.getAttribute("type")!==(g.type==null?null:g.type)||o.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(a==="input"&&o.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&o.getAttribute("name")===y)return o}else return o;if(o=Cr(o.nextSibling),o===null)break}return null}function rM(o,a,i){if(a==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!i||(o=Cr(o.nextSibling),o===null))return null;return o}function Tx(o,a){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!a||(o=Cr(o.nextSibling),o===null))return null;return o}function vm(o){return o.data==="$?"||o.data==="$~"}function ym(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function oM(o,a){var i=o.ownerDocument;if(o.data==="$~")o._reactRetry=a;else if(o.data!=="$?"||i.readyState!=="loading")a();else{var u=function(){a(),i.removeEventListener("DOMContentLoaded",u)};i.addEventListener("DOMContentLoaded",u),o._reactRetry=u}}function Cr(o){for(;o!=null;o=o.nextSibling){var a=o.nodeType;if(a===1||a===3)break;if(a===8){if(a=o.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return o}var bm=null;function Nx(o){o=o.nextSibling;for(var a=0;o;){if(o.nodeType===8){var i=o.data;if(i==="/$"||i==="/&"){if(a===0)return Cr(o.nextSibling);a--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||a++}o=o.nextSibling}return null}function Rx(o){o=o.previousSibling;for(var a=0;o;){if(o.nodeType===8){var i=o.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(a===0)return o;a--}else i!=="/$"&&i!=="/&"||a++}o=o.previousSibling}return null}function Mx(o,a,i){switch(a=Nu(i),o){case"html":if(o=a.documentElement,!o)throw Error(r(452));return o;case"head":if(o=a.head,!o)throw Error(r(453));return o;case"body":if(o=a.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function jl(o){for(var a=o.attributes;a.length;)o.removeAttributeNode(a[0]);Sf(o)}var _r=new Map,Ox=new Set;function Ru(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var ko=Y.d;Y.d={f:aM,r:sM,D:iM,C:lM,L:cM,m:uM,X:fM,S:dM,M:hM};function aM(){var o=ko.f(),a=bu();return o||a}function sM(o){var a=Ns(o);a!==null&&a.tag===5&&a.type==="form"?Gb(a):ko.r(o)}var ai=typeof document>"u"?null:document;function Ax(o,a,i){var u=ai;if(u&&typeof a=="string"&&a){var g=gr(a);g='link[rel="'+o+'"][href="'+g+'"]',typeof i=="string"&&(g+='[crossorigin="'+i+'"]'),Ox.has(g)||(Ox.add(g),o={rel:o,crossOrigin:i,href:a},u.querySelector(g)===null&&(a=u.createElement("link"),mn(a,"link",o),sn(a),u.head.appendChild(a)))}}function iM(o){ko.D(o),Ax("dns-prefetch",o,null)}function lM(o,a){ko.C(o,a),Ax("preconnect",o,a)}function cM(o,a,i){ko.L(o,a,i);var u=ai;if(u&&o&&a){var g='link[rel="preload"][as="'+gr(a)+'"]';a==="image"&&i&&i.imageSrcSet?(g+='[imagesrcset="'+gr(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(g+='[imagesizes="'+gr(i.imageSizes)+'"]')):g+='[href="'+gr(o)+'"]';var y=g;switch(a){case"style":y=si(o);break;case"script":y=ii(o)}_r.has(y)||(o=p({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:o,as:a},i),_r.set(y,o),u.querySelector(g)!==null||a==="style"&&u.querySelector(Dl(y))||a==="script"&&u.querySelector(kl(y))||(a=u.createElement("link"),mn(a,"link",o),sn(a),u.head.appendChild(a)))}}function uM(o,a){ko.m(o,a);var i=ai;if(i&&o){var u=a&&typeof a.as=="string"?a.as:"script",g='link[rel="modulepreload"][as="'+gr(u)+'"][href="'+gr(o)+'"]',y=g;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=ii(o)}if(!_r.has(y)&&(o=p({rel:"modulepreload",href:o},a),_r.set(y,o),i.querySelector(g)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(kl(y)))return}u=i.createElement("link"),mn(u,"link",o),sn(u),i.head.appendChild(u)}}}function dM(o,a,i){ko.S(o,a,i);var u=ai;if(u&&o){var g=Rs(u).hoistableStyles,y=si(o);a=a||"default";var E=g.get(y);if(!E){var O={loading:0,preload:null};if(E=u.querySelector(Dl(y)))O.loading=5;else{o=p({rel:"stylesheet",href:o,"data-precedence":a},i),(i=_r.get(y))&&xm(o,i);var F=E=u.createElement("link");sn(F),mn(F,"link",o),F._p=new Promise(function(Z,se){F.onload=Z,F.onerror=se}),F.addEventListener("load",function(){O.loading|=1}),F.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Mu(E,a,u)}E={type:"stylesheet",instance:E,count:1,state:O},g.set(y,E)}}}function fM(o,a){ko.X(o,a);var i=ai;if(i&&o){var u=Rs(i).hoistableScripts,g=ii(o),y=u.get(g);y||(y=i.querySelector(kl(g)),y||(o=p({src:o,async:!0},a),(a=_r.get(g))&&Sm(o,a),y=i.createElement("script"),sn(y),mn(y,"link",o),i.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(g,y))}}function hM(o,a){ko.M(o,a);var i=ai;if(i&&o){var u=Rs(i).hoistableScripts,g=ii(o),y=u.get(g);y||(y=i.querySelector(kl(g)),y||(o=p({src:o,async:!0,type:"module"},a),(a=_r.get(g))&&Sm(o,a),y=i.createElement("script"),sn(y),mn(y,"link",o),i.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},u.set(g,y))}}function jx(o,a,i,u){var g=(g=he.current)?Ru(g):null;if(!g)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=si(i.href),i=Rs(g).hoistableStyles,u=i.get(a),u||(u={type:"style",instance:null,count:0,state:null},i.set(a,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){o=si(i.href);var y=Rs(g).hoistableStyles,E=y.get(o);if(E||(g=g.ownerDocument||g,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(o,E),(y=g.querySelector(Dl(o)))&&!y._p&&(E.instance=y,E.state.loading=5),_r.has(o)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},_r.set(o,i),y||mM(g,o,i,E.state))),a&&u===null)throw Error(r(528,""));return E}if(a&&u!==null)throw Error(r(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ii(i),i=Rs(g).hoistableScripts,u=i.get(a),u||(u={type:"script",instance:null,count:0,state:null},i.set(a,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function si(o){return'href="'+gr(o)+'"'}function Dl(o){return'link[rel="stylesheet"]['+o+"]"}function Dx(o){return p({},o,{"data-precedence":o.precedence,precedence:null})}function mM(o,a,i,u){o.querySelector('link[rel="preload"][as="style"]['+a+"]")?u.loading=1:(a=o.createElement("link"),u.preload=a,a.addEventListener("load",function(){return u.loading|=1}),a.addEventListener("error",function(){return u.loading|=2}),mn(a,"link",i),sn(a),o.head.appendChild(a))}function ii(o){return'[src="'+gr(o)+'"]'}function kl(o){return"script[async]"+o}function kx(o,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var u=o.querySelector('style[data-href~="'+gr(i.href)+'"]');if(u)return a.instance=u,sn(u),u;var g=p({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return u=(o.ownerDocument||o).createElement("style"),sn(u),mn(u,"style",g),Mu(u,i.precedence,o),a.instance=u;case"stylesheet":g=si(i.href);var y=o.querySelector(Dl(g));if(y)return a.state.loading|=4,a.instance=y,sn(y),y;u=Dx(i),(g=_r.get(g))&&xm(u,g),y=(o.ownerDocument||o).createElement("link"),sn(y);var E=y;return E._p=new Promise(function(O,F){E.onload=O,E.onerror=F}),mn(y,"link",u),a.state.loading|=4,Mu(y,i.precedence,o),a.instance=y;case"script":return y=ii(i.src),(g=o.querySelector(kl(y)))?(a.instance=g,sn(g),g):(u=i,(g=_r.get(y))&&(u=p({},i),Sm(u,g)),o=o.ownerDocument||o,g=o.createElement("script"),sn(g),mn(g,"link",u),o.head.appendChild(g),a.instance=g);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(u=a.instance,a.state.loading|=4,Mu(u,i.precedence,o));return a.instance}function Mu(o,a,i){for(var u=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=u.length?u[u.length-1]:null,y=g,E=0;E<u.length;E++){var O=u[E];if(O.dataset.precedence===a)y=O;else if(y!==g)break}y?y.parentNode.insertBefore(o,y.nextSibling):(a=i.nodeType===9?i.head:i,a.insertBefore(o,a.firstChild))}function xm(o,a){o.crossOrigin==null&&(o.crossOrigin=a.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=a.referrerPolicy),o.title==null&&(o.title=a.title)}function Sm(o,a){o.crossOrigin==null&&(o.crossOrigin=a.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=a.referrerPolicy),o.integrity==null&&(o.integrity=a.integrity)}var Ou=null;function zx(o,a,i){if(Ou===null){var u=new Map,g=Ou=new Map;g.set(i,u)}else g=Ou,u=g.get(i),u||(u=new Map,g.set(i,u));if(u.has(o))return u;for(u.set(o,null),i=i.getElementsByTagName(o),g=0;g<i.length;g++){var y=i[g];if(!(y[Wi]||y[un]||o==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var E=y.getAttribute(a)||"";E=o+E;var O=u.get(E);O?O.push(y):u.set(E,[y])}}return u}function Px(o,a,i){o=o.ownerDocument||o,o.head.insertBefore(i,a==="title"?o.querySelector("head > title"):null)}function pM(o,a,i){if(i===1||a.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return o=a.disabled,typeof a.precedence=="string"&&o==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Lx(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function gM(o,a,i,u){if(i.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var g=si(u.href),y=a.querySelector(Dl(g));if(y){a=y._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(o.count++,o=Au.bind(o),a.then(o,o)),i.state.loading|=4,i.instance=y,sn(y);return}y=a.ownerDocument||a,u=Dx(u),(g=_r.get(g))&&xm(u,g),y=y.createElement("link"),sn(y);var E=y;E._p=new Promise(function(O,F){E.onload=O,E.onerror=F}),mn(y,"link",u),i.instance=y}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(o.count++,i=Au.bind(o),a.addEventListener("load",i),a.addEventListener("error",i))}}var wm=0;function vM(o,a){return o.stylesheets&&o.count===0&&Du(o,o.stylesheets),0<o.count||0<o.imgCount?function(i){var u=setTimeout(function(){if(o.stylesheets&&Du(o,o.stylesheets),o.unsuspend){var y=o.unsuspend;o.unsuspend=null,y()}},6e4+a);0<o.imgBytes&&wm===0&&(wm=62500*QR());var g=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Du(o,o.stylesheets),o.unsuspend)){var y=o.unsuspend;o.unsuspend=null,y()}},(o.imgBytes>wm?50:800)+a);return o.unsuspend=i,function(){o.unsuspend=null,clearTimeout(u),clearTimeout(g)}}:null}function Au(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Du(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var ju=null;function Du(o,a){o.stylesheets=null,o.unsuspend!==null&&(o.count++,ju=new Map,a.forEach(yM,o),ju=null,Au.call(o))}function yM(o,a){if(!(a.state.loading&4)){var i=ju.get(o);if(i)var u=i.get(null);else{i=new Map,ju.set(o,i);for(var g=o.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var E=g[y];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(i.set(E.dataset.precedence,E),u=E)}u&&i.set(null,u)}g=a.instance,E=g.getAttribute("data-precedence"),y=i.get(E)||u,y===u&&i.set(null,g),i.set(E,g),this.count++,u=Au.bind(this),g.addEventListener("load",u),g.addEventListener("error",u),y?y.parentNode.insertBefore(g,y.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(g,o.firstChild)),a.state.loading|=4}}var zl={$$typeof:M,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function bM(o,a,i,u,g,y,E,O,F){this.tag=1,this.containerInfo=o,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=mr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mr(0),this.hiddenUpdates=mr(null),this.identifierPrefix=u,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function Fx(o,a,i,u,g,y,E,O,F,Z,se,ce){return o=new bM(o,a,i,E,F,Z,se,ce,O),a=1,y===!0&&(a|=24),y=er(3,null,null,a),o.current=y,y.stateNode=o,a=th(),a.refCount++,o.pooledCache=a,a.refCount++,y.memoizedState={element:u,isDehydrated:i,cache:a},ah(y),o}function Ix(o){return o?(o=Fs,o):Fs}function Vx(o,a,i,u,g,y){g=Ix(g),u.context===null?u.context=g:u.pendingContext=g,u=Jo(a),u.payload={element:i},y=y===void 0?null:y,y!==null&&(u.callback=y),i=ea(o,u,a),i!==null&&(Kn(i,o,a),hl(i,o,a))}function $x(o,a){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var i=o.retryLane;o.retryLane=i!==0&&i<a?i:a}}function Cm(o,a){$x(o,a),(o=o.alternate)&&$x(o,a)}function Ux(o){if(o.tag===13||o.tag===31){var a=Ua(o,67108864);a!==null&&Kn(a,o,67108864),Cm(o,67108864)}}function Bx(o){if(o.tag===13||o.tag===31){var a=ar();a=_s(a);var i=Ua(o,a);i!==null&&Kn(i,o,a),Cm(o,a)}}var ku=!0;function xM(o,a,i,u){var g=k.T;k.T=null;var y=Y.p;try{Y.p=2,_m(o,a,i,u)}finally{Y.p=y,k.T=g}}function SM(o,a,i,u){var g=k.T;k.T=null;var y=Y.p;try{Y.p=8,_m(o,a,i,u)}finally{Y.p=y,k.T=g}}function _m(o,a,i,u){if(ku){var g=Em(u);if(g===null)um(o,a,u,zu,i),qx(o,u);else if(CM(g,o,a,i,u))u.stopPropagation();else if(qx(o,u),a&4&&-1<wM.indexOf(o)){for(;g!==null;){var y=Ns(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var E=Mt(y.pendingLanes);if(E!==0){var O=y;for(O.pendingLanes|=2,O.entangledLanes|=2;E;){var F=1<<31-It(E);O.entanglements[1]|=F,E&=~F}to(y),(dt&6)===0&&(vu=me()+500,Ml(0))}}break;case 31:case 13:O=Ua(y,2),O!==null&&Kn(O,y,2),bu(),Cm(y,2)}if(y=Em(u),y===null&&um(o,a,u,zu,i),y===g)break;g=y}g!==null&&u.stopPropagation()}else um(o,a,u,null,i)}}function Em(o){return o=Nf(o),Tm(o)}var zu=null;function Tm(o){if(zu=null,o=Ts(o),o!==null){var a=l(o);if(a===null)o=null;else{var i=a.tag;if(i===13){if(o=c(a),o!==null)return o;o=null}else if(i===31){if(o=d(a),o!==null)return o;o=null}else if(i===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;o=null}else a!==o&&(o=null)}}return zu=o,null}function Hx(o){switch(o){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(ge()){case Te:return 2;case tt:return 8;case nt:case Ht:return 32;case yn:return 268435456;default:return 32}default:return 32}}var Nm=!1,da=null,fa=null,ha=null,Pl=new Map,Ll=new Map,ma=[],wM="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 qx(o,a){switch(o){case"focusin":case"focusout":da=null;break;case"dragenter":case"dragleave":fa=null;break;case"mouseover":case"mouseout":ha=null;break;case"pointerover":case"pointerout":Pl.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ll.delete(a.pointerId)}}function Fl(o,a,i,u,g,y){return o===null||o.nativeEvent!==y?(o={blockedOn:a,domEventName:i,eventSystemFlags:u,nativeEvent:y,targetContainers:[g]},a!==null&&(a=Ns(a),a!==null&&Ux(a)),o):(o.eventSystemFlags|=u,a=o.targetContainers,g!==null&&a.indexOf(g)===-1&&a.push(g),o)}function CM(o,a,i,u,g){switch(a){case"focusin":return da=Fl(da,o,a,i,u,g),!0;case"dragenter":return fa=Fl(fa,o,a,i,u,g),!0;case"mouseover":return ha=Fl(ha,o,a,i,u,g),!0;case"pointerover":var y=g.pointerId;return Pl.set(y,Fl(Pl.get(y)||null,o,a,i,u,g)),!0;case"gotpointercapture":return y=g.pointerId,Ll.set(y,Fl(Ll.get(y)||null,o,a,i,u,g)),!0}return!1}function Yx(o){var a=Ts(o.target);if(a!==null){var i=l(a);if(i!==null){if(a=i.tag,a===13){if(a=c(i),a!==null){o.blockedOn=a,sy(o.priority,function(){Bx(i)});return}}else if(a===31){if(a=d(i),a!==null){o.blockedOn=a,sy(o.priority,function(){Bx(i)});return}}else if(a===3&&i.stateNode.current.memoizedState.isDehydrated){o.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Pu(o){if(o.blockedOn!==null)return!1;for(var a=o.targetContainers;0<a.length;){var i=Em(o.nativeEvent);if(i===null){i=o.nativeEvent;var u=new i.constructor(i.type,i);Tf=u,i.target.dispatchEvent(u),Tf=null}else return a=Ns(i),a!==null&&Ux(a),o.blockedOn=i,!1;a.shift()}return!0}function Gx(o,a,i){Pu(o)&&i.delete(a)}function _M(){Nm=!1,da!==null&&Pu(da)&&(da=null),fa!==null&&Pu(fa)&&(fa=null),ha!==null&&Pu(ha)&&(ha=null),Pl.forEach(Gx),Ll.forEach(Gx)}function Lu(o,a){o.blockedOn===a&&(o.blockedOn=null,Nm||(Nm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_M)))}var Fu=null;function Kx(o){Fu!==o&&(Fu=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fu===o&&(Fu=null);for(var a=0;a<o.length;a+=3){var i=o[a],u=o[a+1],g=o[a+2];if(typeof u!="function"){if(Tm(u||i)===null)continue;break}var y=Ns(i);y!==null&&(o.splice(a,3),a-=3,Eh(y,{pending:!0,data:g,method:i.method,action:u},u,g))}}))}function li(o){function a(F){return Lu(F,o)}da!==null&&Lu(da,o),fa!==null&&Lu(fa,o),ha!==null&&Lu(ha,o),Pl.forEach(a),Ll.forEach(a);for(var i=0;i<ma.length;i++){var u=ma[i];u.blockedOn===o&&(u.blockedOn=null)}for(;0<ma.length&&(i=ma[0],i.blockedOn===null);)Yx(i),i.blockedOn===null&&ma.shift();if(i=(o.ownerDocument||o).$$reactFormReplay,i!=null)for(u=0;u<i.length;u+=3){var g=i[u],y=i[u+1],E=g[Un]||null;if(typeof y=="function")E||Kx(i);else if(E){var O=null;if(y&&y.hasAttribute("formAction")){if(g=y,E=y[Un]||null)O=E.formAction;else if(Tm(g)!==null)continue}else O=E.action;typeof O=="function"?i[u+1]=O:(i.splice(u,3),u-=3),Kx(i)}}}function Zx(){function o(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(E){return g=E})},focusReset:"manual",scroll:"manual"})}function a(){g!==null&&(g(),g=null),u||setTimeout(i,20)}function i(){if(!u&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,g=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(i,100),function(){u=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),g!==null&&(g(),g=null)}}}function Rm(o){this._internalRoot=o}Iu.prototype.render=Rm.prototype.render=function(o){var a=this._internalRoot;if(a===null)throw Error(r(409));var i=a.current,u=ar();Vx(i,u,o,a,null,null)},Iu.prototype.unmount=Rm.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var a=o.containerInfo;Vx(o.current,2,null,o,null,null),bu(),a[Es]=null}};function Iu(o){this._internalRoot=o}Iu.prototype.unstable_scheduleHydration=function(o){if(o){var a=bf();o={blockedOn:null,target:o,priority:a};for(var i=0;i<ma.length&&a!==0&&a<ma[i].priority;i++);ma.splice(i,0,o),i===0&&Yx(o)}};var Wx=t.version;if(Wx!=="19.2.3")throw Error(r(527,Wx,"19.2.3"));Y.findDOMNode=function(o){var a=o._reactInternals;if(a===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=m(a),o=o!==null?v(o):null,o=o===null?null:o.stateNode,o};var EM={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{Xn=Vu.inject(EM),Ft=Vu}catch{}}return Vl.createRoot=function(o,a){if(!s(o))throw Error(r(299));var i=!1,u="",g=r0,y=o0,E=a0;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(y=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError)),a=Fx(o,1,!1,null,null,i,u,null,g,y,E,Zx),o[Es]=a.current,cm(o),new Rm(a)},Vl.hydrateRoot=function(o,a,i){if(!s(o))throw Error(r(299));var u=!1,g="",y=r0,E=o0,O=a0,F=null;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(E=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError),i.formState!==void 0&&(F=i.formState)),a=Fx(o,1,!0,a,i??null,u,g,F,y,E,O,Zx),a.context=Ix(null),i=a.current,u=ar(),u=_s(u),g=Jo(u),g.callback=null,ea(i,g,u),i=u,a.current.lanes=i,xt(a,i),to(a),o[Es]=a.current,cm(o),new Iu(a)},Vl.version="19.2.3",Vl}var iS;function oO(){if(iS)return jm.exports;iS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),jm.exports=rO(),jm.exports}var aO=oO(),hc=e=>e.type==="checkbox",os=e=>e instanceof Date,Wn=e=>e==null;const x1=e=>typeof e=="object";var Wt=e=>!Wn(e)&&!Array.isArray(e)&&x1(e)&&!os(e),S1=e=>Wt(e)&&e.target?hc(e.target)?e.target.checked:e.target.value:e,sO=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,w1=(e,t)=>e.has(sO(t)),iO=e=>{const t=e.constructor&&e.constructor.prototype;return Wt(t)&&t.hasOwnProperty("isPrototypeOf")},Rg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Nt(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(Rg&&(e instanceof Blob||r))&&(n||Wt(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!iO(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=Nt(e[s]));else return e;return t}var jd=e=>/^\w*$/.test(e),Ct=e=>e===void 0,Dd=e=>Array.isArray(e)?e.filter(Boolean):[],Mg=e=>Dd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),be=(e,t,n)=>{if(!t||!Wt(e))return n;const r=(jd(t)?[t]:Mg(t)).reduce((s,l)=>Wn(s)?s:s[l],e);return Ct(r)||r===e?Ct(e[t])?n:e[t]:r},ir=e=>typeof e=="boolean",ft=(e,t,n)=>{let r=-1;const s=jd(t)?[t]:Mg(t),l=s.length,c=l-1;for(;++r<l;){const d=s[r];let f=n;if(r!==c){const m=e[d];f=Wt(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=f,e=e[d]}};const dd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Nr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},zo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Og=I.createContext(null);Og.displayName="HookFormContext";const Bt=()=>I.useContext(Og),C1=e=>{const{children:t,...n}=e;return I.createElement(Og.Provider,{value:n},t)};var _1=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(s,l,{get:()=>{const c=l;return t._proxyFormState[c]!==Nr.all&&(t._proxyFormState[c]=!r||Nr.all),n&&(n[c]=!0),e[c]}});return s};const kd=typeof window<"u"?I.useLayoutEffect:I.useEffect;function lO(e){const t=Bt(),{control:n=t.control,disabled:r,name:s,exact:l}=e||{},[c,d]=I.useState(n._formState),f=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return kd(()=>n._subscribe({name:s,formState:f.current,exact:l,callback:m=>{!r&&d({...n._formState,...m})}}),[s,r,l]),I.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>_1(c,n,f.current,!1),[c,n])}var cr=e=>typeof e=="string",jp=(e,t,n,r,s)=>cr(e)?(r&&t.watch.add(e),be(n,e,s)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),be(n,l))):(r&&(t.watchAll=!0),n),Dp=e=>Wn(e)||!x1(e);function Br(e,t,n=new WeakSet){if(Dp(e)||Dp(t))return Object.is(e,t);if(os(e)&&os(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const l of r){const c=e[l];if(!s.includes(l))return!1;if(l!=="ref"){const d=t[l];if(os(c)&&os(d)||Wt(c)&&Wt(d)||Array.isArray(c)&&Array.isArray(d)?!Br(c,d,n):!Object.is(c,d))return!1}}return!0}function Ur(e){const t=Bt(),{control:n=t.control,name:r,defaultValue:s,disabled:l,exact:c,compute:d}=e||{},f=I.useRef(s),m=I.useRef(d),v=I.useRef(void 0),p=I.useRef(n),x=I.useRef(r);m.current=d;const[S,_]=I.useState(()=>{const R=n._getWatch(r,f.current);return m.current?m.current(R):R}),w=I.useCallback(R=>{const j=jp(r,n._names,R||n._formValues,!1,f.current);return m.current?m.current(j):j},[n._formValues,n._names,r]),C=I.useCallback(R=>{if(!l){const j=jp(r,n._names,R||n._formValues,!1,f.current);if(m.current){const A=m.current(j);Br(A,v.current)||(_(A),v.current=A)}else _(j)}},[n._formValues,n._names,l,r]);kd(()=>((p.current!==n||!Br(x.current,r))&&(p.current=n,x.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:R=>{C(R.values)}})),[n,c,r,C]),I.useEffect(()=>n._removeUnmounted());const T=p.current!==n,N=x.current,M=I.useMemo(()=>{if(l)return null;const R=!T&&!Br(N,r);return T||R?w():null},[l,T,r,N,w]);return M!==null?M:S}function cO(e){const t=Bt(),{name:n,disabled:r,control:s=t.control,shouldUnregister:l,defaultValue:c,exact:d=!0}=e,f=w1(s._names.array,n),m=I.useMemo(()=>be(s._formValues,n,be(s._defaultValues,n,c)),[s,n,c]),v=Ur({control:s,name:n,defaultValue:m,exact:d}),p=lO({control:s,name:n,exact:d}),x=I.useRef(e),S=I.useRef(void 0),_=I.useRef(s.register(n,{...e.rules,value:v,...ir(e.disabled)?{disabled:e.disabled}:{}}));x.current=e;const w=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!be(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!be(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!be(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!be(p.validatingFields,n)},error:{enumerable:!0,get:()=>be(p.errors,n)}}),[p,n]),C=I.useCallback(R=>_.current.onChange({target:{value:S1(R),name:n},type:dd.CHANGE}),[n]),T=I.useCallback(()=>_.current.onBlur({target:{value:be(s._formValues,n),name:n},type:dd.BLUR}),[n,s._formValues]),N=I.useCallback(R=>{const j=be(s._fields,n);j&&R&&(j._f.ref={focus:()=>R.focus&&R.focus(),select:()=>R.select&&R.select(),setCustomValidity:A=>R.setCustomValidity(A),reportValidity:()=>R.reportValidity()})},[s._fields,n]),M=I.useMemo(()=>({name:n,value:v,...ir(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:C,onBlur:T,ref:N}),[n,r,p.disabled,C,T,N,v]);return I.useEffect(()=>{const R=s._options.shouldUnregister||l,j=S.current;j&&j!==n&&!f&&s.unregister(j),s.register(n,{...x.current.rules,...ir(x.current.disabled)?{disabled:x.current.disabled}:{}});const A=(D,L)=>{const B=be(s._fields,D);B&&B._f&&(B._f.mount=L)};if(A(n,!0),R){const D=Nt(be(s._options.defaultValues,n,x.current.defaultValue));ft(s._defaultValues,n,D),Ct(be(s._formValues,n))&&ft(s._formValues,n,D)}return!f&&s.register(n),S.current=n,()=>{(f?R&&!s._state.action:R)?s.unregister(n):A(n,!1)}},[n,s,f,l]),I.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),I.useMemo(()=>({field:M,formState:p,fieldState:w}),[M,p,w])}const Mr=e=>e.render(cO(e));var Ag=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Qn=e=>Array.isArray(e)?e:[e],lS=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function E1(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],l=t[r];if(s&&Wt(s)&&l){const c=E1(s,l);Wt(c)&&(n[r]=c)}else e[r]&&(n[r]=l)}return n}var Sn=e=>Wt(e)&&!Object.keys(e).length,jg=e=>e.type==="file",Hr=e=>typeof e=="function",fd=e=>{if(!Rg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},T1=e=>e.type==="select-multiple",Dg=e=>e.type==="radio",uO=e=>Dg(e)||hc(e),Pm=e=>fd(e)&&e.isConnected;function dO(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Ct(e)?r++:e[t[r++]];return e}function fO(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ct(e[t]))return!1;return!0}function Ut(e,t){const n=Array.isArray(t)?t:jd(t)?[t]:Mg(t),r=n.length===1?e:dO(e,n),s=n.length-1,l=n[s];return r&&delete r[l],s!==0&&(Wt(r)&&Sn(r)||Array.isArray(r)&&fO(r))&&Ut(e,n.slice(0,-1)),e}var hO=e=>{for(const t in e)if(Hr(e[t]))return!0;return!1};function N1(e){return Array.isArray(e)||Wt(e)&&!hO(e)}function kp(e,t={}){for(const n in e){const r=e[n];N1(r)?(t[n]=Array.isArray(r)?[]:{},kp(r,t[n])):Ct(r)||(t[n]=!0)}return t}function yi(e,t,n){n||(n=kp(t));for(const r in e){const s=e[r];if(N1(s))Ct(t)||Dp(n[r])?n[r]=kp(s,Array.isArray(s)?[]:{}):yi(s,Wn(t)?{}:t[r],n[r]);else{const l=t[r];n[r]=!Br(s,l)}}return n}const cS={value:!1,isValid:!1},uS={value:!0,isValid:!0};var R1=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ct(e[0].attributes.value)?Ct(e[0].value)||e[0].value===""?uS:{value:e[0].value,isValid:!0}:uS:cS}return cS},M1=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Ct(e)?e:t?e===""?NaN:e&&+e:n&&cr(e)?new Date(e):r?r(e):e;const dS={isValid:!1,value:null};var O1=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,dS):dS;function fS(e){const t=e.ref;return jg(t)?t.files:Dg(t)?O1(e.refs).value:T1(t)?[...t.selectedOptions].map(({value:n})=>n):hc(t)?R1(e.refs).value:M1(Ct(t.value)?e.ref.value:t.value,e)}var mO=(e,t,n,r)=>{const s={};for(const l of e){const c=be(t,l);c&&ft(s,l,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},hd=e=>e instanceof RegExp,$l=e=>Ct(e)?e:hd(e)?e.source:Wt(e)?hd(e.value)?e.value.source:e.value:e,wi=e=>({isOnSubmit:!e||e===Nr.onSubmit,isOnBlur:e===Nr.onBlur,isOnChange:e===Nr.onChange,isOnAll:e===Nr.all,isOnTouch:e===Nr.onTouched});const hS="AsyncFunction";var pO=e=>!!e&&!!e.validate&&!!(Hr(e.validate)&&e.validate.constructor.name===hS||Wt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===hS)),gO=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),zp=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ei=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const l=be(e,s);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],s)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(Ei(d,t))break}else if(Wt(d)&&Ei(d,t))break}}};function mS(e,t,n){const r=be(e,n);if(r||jd(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const l=s.join("."),c=be(t,l),d=be(e,l);if(c&&!Array.isArray(c)&&n!==l)return{name:n};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:n}}var vO=(e,t,n,r)=>{n(e);const{name:s,...l}=e;return Sn(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||Nr.all))},yO=(e,t,n)=>!e||!t||e===t||Qn(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),bO=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,xO=(e,t)=>!Dd(be(e,t)).length&&Ut(e,t),A1=(e,t,n)=>{const r=Qn(be(e,n));return ft(r,"root",t[n]),ft(e,n,r),e};function pS(e,t,n="validate"){if(cr(e)||Array.isArray(e)&&e.every(cr)||ir(e)&&!e)return{type:n,message:cr(e)?e:"",ref:t}}var ci=e=>Wt(e)&&!hd(e)?e:{value:e,message:""},Pp=async(e,t,n,r,s,l)=>{const{ref:c,refs:d,required:f,maxLength:m,minLength:v,min:p,max:x,pattern:S,validate:_,name:w,valueAsNumber:C,mount:T}=e._f,N=be(n,w);if(!T||t.has(w))return{};const M=d?d[0]:c,R=ie=>{s&&M.reportValidity&&(M.setCustomValidity(ir(ie)?"":ie||""),M.reportValidity())},j={},A=Dg(c),D=hc(c),L=A||D,B=(C||jg(c))&&Ct(c.value)&&Ct(N)||fd(c)&&c.value===""||N===""||Array.isArray(N)&&!N.length,ne=Ag.bind(null,w,r,j),J=(ie,ue,ae,pe=zo.maxLength,k=zo.minLength)=>{const Y=ie?ue:ae;j[w]={type:ie?pe:k,message:Y,ref:c,...ne(ie?pe:k,Y)}};if(l?!Array.isArray(N)||!N.length:f&&(!L&&(B||Wn(N))||ir(N)&&!N||D&&!R1(d).isValid||A&&!O1(d).isValid)){const{value:ie,message:ue}=cr(f)?{value:!!f,message:f}:ci(f);if(ie&&(j[w]={type:zo.required,message:ue,ref:M,...ne(zo.required,ue)},!r))return R(ue),j}if(!B&&(!Wn(p)||!Wn(x))){let ie,ue;const ae=ci(x),pe=ci(p);if(!Wn(N)&&!isNaN(N)){const k=c.valueAsNumber||N&&+N;Wn(ae.value)||(ie=k>ae.value),Wn(pe.value)||(ue=k<pe.value)}else{const k=c.valueAsDate||new Date(N),Y=ve=>new Date(new Date().toDateString()+" "+ve),H=c.type=="time",ee=c.type=="week";cr(ae.value)&&N&&(ie=H?Y(N)>Y(ae.value):ee?N>ae.value:k>new Date(ae.value)),cr(pe.value)&&N&&(ue=H?Y(N)<Y(pe.value):ee?N<pe.value:k<new Date(pe.value))}if((ie||ue)&&(J(!!ie,ae.message,pe.message,zo.max,zo.min),!r))return R(j[w].message),j}if((m||v)&&!B&&(cr(N)||l&&Array.isArray(N))){const ie=ci(m),ue=ci(v),ae=!Wn(ie.value)&&N.length>+ie.value,pe=!Wn(ue.value)&&N.length<+ue.value;if((ae||pe)&&(J(ae,ie.message,ue.message),!r))return R(j[w].message),j}if(S&&!B&&cr(N)){const{value:ie,message:ue}=ci(S);if(hd(ie)&&!N.match(ie)&&(j[w]={type:zo.pattern,message:ue,ref:c,...ne(zo.pattern,ue)},!r))return R(ue),j}if(_){if(Hr(_)){const ie=await _(N,n),ue=pS(ie,M);if(ue&&(j[w]={...ue,...ne(zo.validate,ue.message)},!r))return R(ue.message),j}else if(Wt(_)){let ie={};for(const ue in _){if(!Sn(ie)&&!r)break;const ae=pS(await _[ue](N,n),M,ue);ae&&(ie={...ae,...ne(ue,ae.message)},R(ae.message),r&&(j[w]=ie))}if(!Sn(ie)&&(j[w]={ref:M,...ie},!r))return j}}return R(!0),j};const SO={mode:Nr.onSubmit,reValidateMode:Nr.onChange,shouldFocusError:!0};function wO(e={}){let t={...SO,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Hr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Wt(t.defaultValues)||Wt(t.values)?Nt(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:Nt(s),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let p={...v};const x={array:lS(),state:lS()},S=t.criteriaMode===Nr.all,_=V=>G=>{clearTimeout(m),m=setTimeout(V,G)},w=async V=>{if(!t.disabled&&(v.isValid||p.isValid||V)){const G=t.resolver?Sn((await D()).errors):await B(r,!0);G!==n.isValid&&x.state.next({isValid:G})}},C=(V,G)=>{!t.disabled&&(v.isValidating||v.validatingFields||p.isValidating||p.validatingFields)&&((V||Array.from(d.mount)).forEach(te=>{te&&(G?ft(n.validatingFields,te,G):Ut(n.validatingFields,te))}),x.state.next({validatingFields:n.validatingFields,isValidating:!Sn(n.validatingFields)}))},T=(V,G=[],te,xe,me=!0,ge=!0)=>{if(xe&&te&&!t.disabled){if(c.action=!0,ge&&Array.isArray(be(r,V))){const Te=te(be(r,V),xe.argA,xe.argB);me&&ft(r,V,Te)}if(ge&&Array.isArray(be(n.errors,V))){const Te=te(be(n.errors,V),xe.argA,xe.argB);me&&ft(n.errors,V,Te),xO(n.errors,V)}if((v.touchedFields||p.touchedFields)&&ge&&Array.isArray(be(n.touchedFields,V))){const Te=te(be(n.touchedFields,V),xe.argA,xe.argB);me&&ft(n.touchedFields,V,Te)}(v.dirtyFields||p.dirtyFields)&&(n.dirtyFields=yi(s,l)),x.state.next({name:V,isDirty:J(V,G),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else ft(l,V,G)},N=(V,G)=>{ft(n.errors,V,G),x.state.next({errors:n.errors})},M=V=>{n.errors=V,x.state.next({errors:n.errors,isValid:!1})},R=(V,G,te,xe)=>{const me=be(r,V);if(me){const ge=be(l,V,Ct(te)?be(s,V):te);Ct(ge)||xe&&xe.defaultChecked||G?ft(l,V,G?ge:fS(me._f)):ae(V,ge),c.mount&&!c.action&&w()}},j=(V,G,te,xe,me)=>{let ge=!1,Te=!1;const tt={name:V};if(!t.disabled){if(!te||xe){(v.isDirty||p.isDirty)&&(Te=n.isDirty,n.isDirty=tt.isDirty=J(),ge=Te!==tt.isDirty);const nt=Br(be(s,V),G);Te=!!be(n.dirtyFields,V),nt?Ut(n.dirtyFields,V):ft(n.dirtyFields,V,!0),tt.dirtyFields=n.dirtyFields,ge=ge||(v.dirtyFields||p.dirtyFields)&&Te!==!nt}if(te){const nt=be(n.touchedFields,V);nt||(ft(n.touchedFields,V,te),tt.touchedFields=n.touchedFields,ge=ge||(v.touchedFields||p.touchedFields)&&nt!==te)}ge&&me&&x.state.next(tt)}return ge?tt:{}},A=(V,G,te,xe)=>{const me=be(n.errors,V),ge=(v.isValid||p.isValid)&&ir(G)&&n.isValid!==G;if(t.delayError&&te?(f=_(()=>N(V,te)),f(t.delayError)):(clearTimeout(m),f=null,te?ft(n.errors,V,te):Ut(n.errors,V)),(te?!Br(me,te):me)||!Sn(xe)||ge){const Te={...xe,...ge&&ir(G)?{isValid:G}:{},errors:n.errors,name:V};n={...n,...Te},x.state.next(Te)}},D=async V=>{C(V,!0);const G=await t.resolver(l,t.context,mO(V||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(V),G},L=async V=>{const{errors:G}=await D(V);if(V)for(const te of V){const xe=be(G,te);xe?ft(n.errors,te,xe):Ut(n.errors,te)}else n.errors=G;return G},B=async(V,G,te={valid:!0})=>{for(const xe in V){const me=V[xe];if(me){const{_f:ge,...Te}=me;if(ge){const tt=d.array.has(ge.name),nt=me._f&&pO(me._f);nt&&v.validatingFields&&C([ge.name],!0);const Ht=await Pp(me,d.disabled,l,S,t.shouldUseNativeValidation&&!G,tt);if(nt&&v.validatingFields&&C([ge.name]),Ht[ge.name]&&(te.valid=!1,G))break;!G&&(be(Ht,ge.name)?tt?A1(n.errors,Ht,ge.name):ft(n.errors,ge.name,Ht[ge.name]):Ut(n.errors,ge.name))}!Sn(Te)&&await B(Te,G,te)}}return te.valid},ne=()=>{for(const V of d.unMount){const G=be(r,V);G&&(G._f.refs?G._f.refs.every(te=>!Pm(te)):!Pm(G._f.ref))&&X(V)}d.unMount=new Set},J=(V,G)=>!t.disabled&&(V&&G&&ft(l,V,G),!Br(ve(),s)),ie=(V,G,te)=>jp(V,d,{...c.mount?l:Ct(G)?s:cr(V)?{[V]:G}:G},te,G),ue=V=>Dd(be(c.mount?l:s,V,t.shouldUnregister?be(s,V,[]):[])),ae=(V,G,te={})=>{const xe=be(r,V);let me=G;if(xe){const ge=xe._f;ge&&(!ge.disabled&&ft(l,V,M1(G,ge)),me=fd(ge.ref)&&Wn(G)?"":G,T1(ge.ref)?[...ge.ref.options].forEach(Te=>Te.selected=me.includes(Te.value)):ge.refs?hc(ge.ref)?ge.refs.forEach(Te=>{(!Te.defaultChecked||!Te.disabled)&&(Array.isArray(me)?Te.checked=!!me.find(tt=>tt===Te.value):Te.checked=me===Te.value||!!me)}):ge.refs.forEach(Te=>Te.checked=Te.value===me):jg(ge.ref)?ge.ref.value="":(ge.ref.value=me,ge.ref.type||x.state.next({name:V,values:Nt(l)})))}(te.shouldDirty||te.shouldTouch)&&j(V,me,te.shouldTouch,te.shouldDirty,!0),te.shouldValidate&&ee(V)},pe=(V,G,te)=>{for(const xe in G){if(!G.hasOwnProperty(xe))return;const me=G[xe],ge=V+"."+xe,Te=be(r,ge);(d.array.has(V)||Wt(me)||Te&&!Te._f)&&!os(me)?pe(ge,me,te):ae(ge,me,te)}},k=(V,G,te={})=>{const xe=be(r,V),me=d.array.has(V),ge=Nt(G);ft(l,V,ge),me?(x.array.next({name:V,values:Nt(l)}),(v.isDirty||v.dirtyFields||p.isDirty||p.dirtyFields)&&te.shouldDirty&&x.state.next({name:V,dirtyFields:yi(s,l),isDirty:J(V,ge)})):xe&&!xe._f&&!Wn(ge)?pe(V,ge,te):ae(V,ge,te),zp(V,d)&&x.state.next({...n,name:V}),x.state.next({name:c.mount?V:void 0,values:Nt(l)})},Y=async V=>{c.mount=!0;const G=V.target;let te=G.name,xe=!0;const me=be(r,te),ge=nt=>{xe=Number.isNaN(nt)||os(nt)&&isNaN(nt.getTime())||Br(nt,be(l,te,nt))},Te=wi(t.mode),tt=wi(t.reValidateMode);if(me){let nt,Ht;const yn=G.type?fS(me._f):S1(V),Nn=V.type===dd.BLUR||V.type===dd.FOCUS_OUT,hr=!gO(me._f)&&!t.resolver&&!be(n.errors,te)&&!me._f.deps||bO(Nn,be(n.touchedFields,te),n.isSubmitted,tt,Te),Xn=zp(te,d,Nn);ft(l,te,yn),Nn?(!G||!G.readOnly)&&(me._f.onBlur&&me._f.onBlur(V),f&&f(0)):me._f.onChange&&me._f.onChange(V);const Ft=j(te,yn,Nn),Rn=!Sn(Ft)||Xn;if(!Nn&&x.state.next({name:te,type:V.type,values:Nt(l)}),hr)return(v.isValid||p.isValid)&&(t.mode==="onBlur"?Nn&&w():Nn||w()),Rn&&x.state.next({name:te,...Xn?{}:Ft});if(!Nn&&Xn&&x.state.next({...n}),t.resolver){const{errors:It}=await D([te]);if(ge(yn),xe){const qo=mS(n.errors,r,te),Qr=mS(It,r,qo.name||te);nt=Qr.error,te=Qr.name,Ht=Sn(It)}}else C([te],!0),nt=(await Pp(me,d.disabled,l,S,t.shouldUseNativeValidation))[te],C([te]),ge(yn),xe&&(nt?Ht=!1:(v.isValid||p.isValid)&&(Ht=await B(r,!0)));xe&&(me._f.deps&&(!Array.isArray(me._f.deps)||me._f.deps.length>0)&&ee(me._f.deps),A(te,Ht,nt,Ft))}},H=(V,G)=>{if(be(n.errors,G)&&V.focus)return V.focus(),1},ee=async(V,G={})=>{let te,xe;const me=Qn(V);if(t.resolver){const ge=await L(Ct(V)?V:me);te=Sn(ge),xe=V?!me.some(Te=>be(ge,Te)):te}else V?(xe=(await Promise.all(me.map(async ge=>{const Te=be(r,ge);return await B(Te&&Te._f?{[ge]:Te}:Te)}))).every(Boolean),!(!xe&&!n.isValid)&&w()):xe=te=await B(r);return x.state.next({...!cr(V)||(v.isValid||p.isValid)&&te!==n.isValid?{}:{name:V},...t.resolver||!V?{isValid:te}:{},errors:n.errors}),G.shouldFocus&&!xe&&Ei(r,H,V?me:d.mount),xe},ve=(V,G)=>{let te={...c.mount?l:s};return G&&(te=E1(G.dirtyFields?n.dirtyFields:n.touchedFields,te)),Ct(V)?te:cr(V)?be(te,V):V.map(xe=>be(te,xe))},z=(V,G)=>({invalid:!!be((G||n).errors,V),isDirty:!!be((G||n).dirtyFields,V),error:be((G||n).errors,V),isValidating:!!be(n.validatingFields,V),isTouched:!!be((G||n).touchedFields,V)}),P=V=>{V&&Qn(V).forEach(G=>Ut(n.errors,G)),x.state.next({errors:V?n.errors:{}})},U=(V,G,te)=>{const xe=(be(r,V,{_f:{}})._f||{}).ref,me=be(n.errors,V)||{},{ref:ge,message:Te,type:tt,...nt}=me;ft(n.errors,V,{...nt,...G,ref:xe}),x.state.next({name:V,errors:n.errors,isValid:!1}),te&&te.shouldFocus&&xe&&xe.focus&&xe.focus()},W=(V,G)=>Hr(V)?x.state.subscribe({next:te=>"values"in te&&V(ie(void 0,G),te)}):ie(V,G,!0),oe=V=>x.state.subscribe({next:G=>{yO(V.name,G.name,V.exact)&&vO(G,V.formState||v,Tn,V.reRenderRoot)&&V.callback({values:{...l},...n,...G,defaultValues:s})}}).unsubscribe,he=V=>(c.mount=!0,p={...p,...V.formState},oe({...V,formState:p})),X=(V,G={})=>{for(const te of V?Qn(V):d.mount)d.mount.delete(te),d.array.delete(te),G.keepValue||(Ut(r,te),Ut(l,te)),!G.keepError&&Ut(n.errors,te),!G.keepDirty&&Ut(n.dirtyFields,te),!G.keepTouched&&Ut(n.touchedFields,te),!G.keepIsValidating&&Ut(n.validatingFields,te),!t.shouldUnregister&&!G.keepDefaultValue&&Ut(s,te);x.state.next({values:Nt(l)}),x.state.next({...n,...G.keepDirty?{isDirty:J()}:{}}),!G.keepIsValid&&w()},ye=({disabled:V,name:G})=>{(ir(V)&&c.mount||V||d.disabled.has(G))&&(V?d.disabled.add(G):d.disabled.delete(G))},_e=(V,G={})=>{let te=be(r,V);const xe=ir(G.disabled)||ir(t.disabled);return ft(r,V,{...te||{},_f:{...te&&te._f?te._f:{ref:{name:V}},name:V,mount:!0,...G}}),d.mount.add(V),te?ye({disabled:ir(G.disabled)?G.disabled:t.disabled,name:V}):R(V,!0,G.value),{...xe?{disabled:G.disabled||t.disabled}:{},...t.progressive?{required:!!G.required,min:$l(G.min),max:$l(G.max),minLength:$l(G.minLength),maxLength:$l(G.maxLength),pattern:$l(G.pattern)}:{},name:V,onChange:Y,onBlur:Y,ref:me=>{if(me){_e(V,G),te=be(r,V);const ge=Ct(me.value)&&me.querySelectorAll&&me.querySelectorAll("input,select,textarea")[0]||me,Te=uO(ge),tt=te._f.refs||[];if(Te?tt.find(nt=>nt===ge):ge===te._f.ref)return;ft(r,V,{_f:{...te._f,...Te?{refs:[...tt.filter(Pm),ge,...Array.isArray(be(s,V))?[{}]:[]],ref:{type:ge.type,name:V}}:{ref:ge}}}),R(V,!1,void 0,ge)}else te=be(r,V,{}),te._f&&(te._f.mount=!1),(t.shouldUnregister||G.shouldUnregister)&&!(w1(d.array,V)&&c.action)&&d.unMount.add(V)}}},De=()=>t.shouldFocusError&&Ei(r,H,d.mount),qe=V=>{ir(V)&&(x.state.next({disabled:V}),Ei(r,(G,te)=>{const xe=be(r,te);xe&&(G.disabled=xe._f.disabled||V,Array.isArray(xe._f.refs)&&xe._f.refs.forEach(me=>{me.disabled=xe._f.disabled||V}))},0,!1))},Ge=(V,G)=>async te=>{let xe;te&&(te.preventDefault&&te.preventDefault(),te.persist&&te.persist());let me=Nt(l);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:ge,values:Te}=await D();n.errors=ge,me=Nt(Te)}else await B(r);if(d.disabled.size)for(const ge of d.disabled)Ut(me,ge);if(Ut(n.errors,"root"),Sn(n.errors)){x.state.next({errors:{}});try{await V(me,te)}catch(ge){xe=ge}}else G&&await G({...n.errors},te),De(),setTimeout(De);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Sn(n.errors)&&!xe,submitCount:n.submitCount+1,errors:n.errors}),xe)throw xe},Lt=(V,G={})=>{be(r,V)&&(Ct(G.defaultValue)?k(V,Nt(be(s,V))):(k(V,G.defaultValue),ft(s,V,Nt(G.defaultValue))),G.keepTouched||Ut(n.touchedFields,V),G.keepDirty||(Ut(n.dirtyFields,V),n.isDirty=G.defaultValue?J(V,Nt(be(s,V))):J()),G.keepError||(Ut(n.errors,V),v.isValid&&w()),x.state.next({...n}))},Rt=(V,G={})=>{const te=V?Nt(V):s,xe=Nt(te),me=Sn(V),ge=me?s:xe;if(G.keepDefaultValues||(s=te),!G.keepValues){if(G.keepDirtyValues){const Te=new Set([...d.mount,...Object.keys(yi(s,l))]);for(const tt of Array.from(Te))be(n.dirtyFields,tt)?ft(ge,tt,be(l,tt)):k(tt,be(ge,tt))}else{if(Rg&&Ct(V))for(const Te of d.mount){const tt=be(r,Te);if(tt&&tt._f){const nt=Array.isArray(tt._f.refs)?tt._f.refs[0]:tt._f.ref;if(fd(nt)){const Ht=nt.closest("form");if(Ht){Ht.reset();break}}}}if(G.keepFieldsRef)for(const Te of d.mount)k(Te,be(ge,Te));else r={}}l=t.shouldUnregister?G.keepDefaultValues?Nt(s):{}:Nt(ge),x.array.next({values:{...ge}}),x.state.next({values:{...ge}})}d={mount:G.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!v.isValid||!!G.keepIsValid||!!G.keepDirtyValues||!t.shouldUnregister&&!Sn(ge),c.watch=!!t.shouldUnregister,c.action=!1,G.keepErrors||(n.errors={}),x.state.next({submitCount:G.keepSubmitCount?n.submitCount:0,isDirty:me?!1:G.keepDirty?n.isDirty:!!(G.keepDefaultValues&&!Br(V,s)),isSubmitted:G.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:me?{}:G.keepDirtyValues?G.keepDefaultValues&&l?yi(s,l):n.dirtyFields:G.keepDefaultValues&&V?yi(s,V):G.keepDirty?n.dirtyFields:{},touchedFields:G.keepTouched?n.touchedFields:{},errors:G.keepErrors?n.errors:{},isSubmitSuccessful:G.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},En=(V,G)=>Rt(Hr(V)?V(l):V,G),Fn=(V,G={})=>{const te=be(r,V),xe=te&&te._f;if(xe){const me=xe.refs?xe.refs[0]:xe.ref;me.focus&&(me.focus(),G.shouldSelect&&Hr(me.select)&&me.select())}},Tn=V=>{n={...n,...V}},on={control:{register:_e,unregister:X,getFieldState:z,handleSubmit:Ge,setError:U,_subscribe:oe,_runSchema:D,_focusError:De,_getWatch:ie,_getDirty:J,_setValid:w,_setFieldArray:T,_setDisabledField:ye,_setErrors:M,_getFieldArray:ue,_reset:Rt,_resetDefaultValues:()=>Hr(t.defaultValues)&&t.defaultValues().then(V=>{En(V,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:ne,_disableForm:qe,_subjects:x,_proxyFormState:v,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state(V){c=V},get _defaultValues(){return s},get _names(){return d},set _names(V){d=V},get _formState(){return n},get _options(){return t},set _options(V){t={...t,...V}}},subscribe:he,trigger:ee,register:_e,handleSubmit:Ge,watch:W,setValue:k,getValues:ve,reset:En,resetField:Lt,clearErrors:P,unregister:X,setError:U,setFocus:Fn,getFieldState:z};return{...on,formControl:on}}var ga=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Lm=(e,t,n={})=>n.shouldFocus||Ct(n.shouldFocus)?n.focusName||`${e}.${Ct(n.focusIndex)?t:n.focusIndex}.`:"",Fm=(e,t)=>[...e,...Qn(t)],Im=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Vm(e,t,n){return[...e.slice(0,t),...Qn(n),...e.slice(t)]}var $m=(e,t,n)=>Array.isArray(e)?(Ct(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Um=(e,t)=>[...Qn(t),...Qn(e)];function CO(e,t){let n=0;const r=[...e];for(const s of t)r.splice(s-n,1),n++;return Dd(r).length?r:[]}var Bm=(e,t)=>Ct(t)?[]:CO(e,Qn(t).sort((n,r)=>n-r)),Hm=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},gS=(e,t,n)=>(e[t]=n,e);function Lp(e){const t=Bt(),{control:n=t.control,name:r,keyName:s="id",shouldUnregister:l,rules:c}=e,[d,f]=I.useState(n._getFieldArray(r)),m=I.useRef(n._getFieldArray(r).map(ga)),v=I.useRef(!1);n._names.array.add(r),I.useMemo(()=>c&&d.length>=0&&n.register(r,c),[n,r,d.length,c]),kd(()=>n._subjects.array.subscribe({next:({values:R,name:j})=>{if(j===r||!j){const A=be(R,r);Array.isArray(A)&&(f(A),m.current=A.map(ga))}}}).unsubscribe,[n,r]);const p=I.useCallback(R=>{v.current=!0,n._setFieldArray(r,R)},[n,r]),x=(R,j)=>{const A=Qn(Nt(R)),D=Fm(n._getFieldArray(r),A);n._names.focus=Lm(r,D.length-1,j),m.current=Fm(m.current,A.map(ga)),p(D),f(D),n._setFieldArray(r,D,Fm,{argA:Im(R)})},S=(R,j)=>{const A=Qn(Nt(R)),D=Um(n._getFieldArray(r),A);n._names.focus=Lm(r,0,j),m.current=Um(m.current,A.map(ga)),p(D),f(D),n._setFieldArray(r,D,Um,{argA:Im(R)})},_=R=>{const j=Bm(n._getFieldArray(r),R);m.current=Bm(m.current,R),p(j),f(j),!Array.isArray(be(n._fields,r))&&ft(n._fields,r,void 0),n._setFieldArray(r,j,Bm,{argA:R})},w=(R,j,A)=>{const D=Qn(Nt(j)),L=Vm(n._getFieldArray(r),R,D);n._names.focus=Lm(r,R,A),m.current=Vm(m.current,R,D.map(ga)),p(L),f(L),n._setFieldArray(r,L,Vm,{argA:R,argB:Im(j)})},C=(R,j)=>{const A=n._getFieldArray(r);Hm(A,R,j),Hm(m.current,R,j),p(A),f(A),n._setFieldArray(r,A,Hm,{argA:R,argB:j},!1)},T=(R,j)=>{const A=n._getFieldArray(r);$m(A,R,j),$m(m.current,R,j),p(A),f(A),n._setFieldArray(r,A,$m,{argA:R,argB:j},!1)},N=(R,j)=>{const A=Nt(j),D=gS(n._getFieldArray(r),R,A);m.current=[...D].map((L,B)=>!L||B===R?ga():m.current[B]),p(D),f([...D]),n._setFieldArray(r,D,gS,{argA:R,argB:A},!0,!1)},M=R=>{const j=Qn(Nt(R));m.current=j.map(ga),p([...j]),f([...j]),n._setFieldArray(r,[...j],A=>A,{},!0,!1)};return I.useEffect(()=>{if(n._state.action=!1,zp(r,n._names)&&n._subjects.state.next({...n._formState}),v.current&&(!wi(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!wi(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(R=>{const j=be(R.errors,r),A=be(n._formState.errors,r);(A?!j&&A.type||j&&(A.type!==j.type||A.message!==j.message):j&&j.type)&&(j?ft(n._formState.errors,r,j):Ut(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const R=be(n._fields,r);R&&R._f&&!(wi(n._options.reValidateMode).isOnSubmit&&wi(n._options.mode).isOnSubmit)&&Pp(R,n._names.disabled,n._formValues,n._options.criteriaMode===Nr.all,n._options.shouldUseNativeValidation,!0).then(j=>!Sn(j)&&n._subjects.state.next({errors:A1(n._formState.errors,j,r)}))}n._subjects.state.next({name:r,values:Nt(n._formValues)}),n._names.focus&&Ei(n._fields,(R,j)=>{if(n._names.focus&&j.startsWith(n._names.focus)&&R.focus)return R.focus(),1}),n._names.focus="",n._setValid(),v.current=!1},[d,r,n]),I.useEffect(()=>(!be(n._formValues,r)&&n._setFieldArray(r),()=>{const R=(j,A)=>{const D=be(n._fields,j);D&&D._f&&(D._f.mount=A)};n._options.shouldUnregister||l?n.unregister(r):R(r,!1)}),[r,n,s,l]),{swap:I.useCallback(C,[p,r,n]),move:I.useCallback(T,[p,r,n]),prepend:I.useCallback(S,[p,r,n]),append:I.useCallback(x,[p,r,n]),remove:I.useCallback(_,[p,r,n]),insert:I.useCallback(w,[p,r,n]),update:I.useCallback(N,[p,r,n]),replace:I.useCallback(M,[p,r,n]),fields:I.useMemo(()=>d.map((R,j)=>({...R,[s]:m.current[j]||ga()})),[d,s])}}function j1(e={}){const t=I.useRef(void 0),n=I.useRef(void 0),[r,s]=I.useState({isDirty:!1,isValidating:!1,isLoading:Hr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Hr(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Hr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=wO(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,kd(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>s({...l._formState}),reRenderRoot:!0});return s(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),I.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),I.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),I.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),I.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==r.isDirty&&l._subjects.state.next({isDirty:c})}},[l,r.isDirty]),I.useEffect(()=>{var c;e.values&&!Br(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),!((c=l._options.resetOptions)===null||c===void 0)&&c.keepIsValid||l._setValid(),n.current=e.values,s(d=>({...d}))):l._resetDefaultValues()},[l,e.values]),I.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),t.current.formState=_1(r,l),t.current}const vS=(e,t,n)=>{if(e&&"reportValidity"in e){const r=be(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Fp=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?vS(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>vS(s,n,e))}},yS=(e,t)=>{t.shouldUseNativeValidation&&Fp(e,t);const n={};for(const r in e){const s=be(t.fields,r),l=Object.assign(e[r]||{},{ref:s&&s.ref});if(_O(t.names||Object.keys(e),r)){const c=Object.assign({},be(n,r));ft(c,"root",l),ft(n,r,c)}else ft(n,r,l)}return n},_O=(e,t)=>{const n=bS(t);return e.some(r=>bS(r).match(`^${n}\\.\\d+`))};function bS(e){return e.replace(/\]|\[/g,"")}function de(e,t,n){function r(d,f){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,f);const m=c.prototype,v=Object.keys(m);for(let p=0;p<v.length;p++){const x=v[p];x in d||(d[x]=m[x].bind(d))}}const s=n?.Parent??Object;class l extends s{}Object.defineProperty(l,"name",{value:e});function c(d){var f;const m=n?.Parent?new l:this;r(m,d),(f=m._zod).deferred??(f.deferred=[]);for(const v of m._zod.deferred)v();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>n?.Parent&&d instanceof n.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class Ti extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class D1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const k1={};function cs(e){return k1}function z1(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,s])=>t.indexOf(+r)===-1).map(([r,s])=>s)}function Ip(e,t){return typeof t=="bigint"?t.toString():t}function kg(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function zg(e){return e==null}function Pg(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const xS=Symbol("evaluating");function _t(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==xS)return r===void 0&&(r=xS,r=n()),r},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function ys(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function bs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function SS(e){return JSON.stringify(e)}function EO(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const P1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function md(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const TO=kg(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function tc(e){if(md(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(md(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function L1(e){return tc(e)?{...e}:Array.isArray(e)?[...e]:e}const NO=new Set(["string","number","symbol"]);function zd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ma(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function $e(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function RO(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function MO(e,t){const n=e._zod.def,r=bs(e._zod.def,{get shape(){const s={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(s[l]=n.shape[l])}return ys(this,"shape",s),s},checks:[]});return Ma(e,r)}function OO(e,t){const n=e._zod.def,r=bs(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete s[l]}return ys(this,"shape",s),s},checks:[]});return Ma(e,r)}function AO(e,t){if(!tc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const s=bs(e._zod.def,{get shape(){const l={...e._zod.def.shape,...t};return ys(this,"shape",l),l},checks:[]});return Ma(e,s)}function jO(e,t){if(!tc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return ys(this,"shape",r),r},checks:e._zod.def.checks};return Ma(e,n)}function DO(e,t){const n=bs(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return ys(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Ma(e,n)}function kO(e,t,n){const r=bs(t._zod.def,{get shape(){const s=t._zod.def.shape,l={...s};if(n)for(const c in n){if(!(c in s))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=e?new e({type:"optional",innerType:s[c]}):s[c])}else for(const c in s)l[c]=e?new e({type:"optional",innerType:s[c]}):s[c];return ys(this,"shape",l),l},checks:[]});return Ma(t,r)}function zO(e,t,n){const r=bs(t._zod.def,{get shape(){const s=t._zod.def.shape,l={...s};if(n)for(const c in n){if(!(c in l))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(l[c]=new e({type:"nonoptional",innerType:s[c]}))}else for(const c in s)l[c]=new e({type:"nonoptional",innerType:s[c]});return ys(this,"shape",l),l},checks:[]});return Ma(t,r)}function Ci(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function F1(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function $u(e){return typeof e=="string"?e:e?.message}function us(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const s=$u(e.inst?._zod.def?.error?.(e))??$u(t?.error?.(e))??$u(n.customError?.(e))??$u(n.localeError?.(e))??"Invalid input";r.message=s}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Lg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function nc(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const I1=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ip,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Fg=de("$ZodError",I1),Pd=de("$ZodError",I1,{Parent:Error});function PO(e,t=n=>n.message){const n={},r=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}function LO(e,t=n=>n.message){const n={_errors:[]},r=s=>{for(const l of s.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>r({issues:c}));else if(l.code==="invalid_key")r({issues:l.issues});else if(l.code==="invalid_element")r({issues:l.issues});else if(l.path.length===0)n._errors.push(t(l));else{let c=n,d=0;for(;d<l.path.length;){const f=l.path[d];d===l.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(t(l))):c[f]=c[f]||{_errors:[]},c=c[f],d++}}};return r(e),n}const Ld=e=>(t,n,r,s)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new Ti;if(c.issues.length){const d=new(s?.Err??e)(c.issues.map(f=>us(f,l,cs())));throw P1(d,s?.callee),d}return c.value},FO=Ld(Pd),Fd=e=>async(t,n,r,s)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new(s?.Err??e)(c.issues.map(f=>us(f,l,cs())));throw P1(d,s?.callee),d}return c.value},IO=Fd(Pd),Id=e=>(t,n,r)=>{const s=r?{...r,async:!1}:{async:!1},l=t._zod.run({value:n,issues:[]},s);if(l instanceof Promise)throw new Ti;return l.issues.length?{success:!1,error:new(e??Fg)(l.issues.map(c=>us(c,s,cs())))}:{success:!0,data:l.value}},VO=Id(Pd),Vd=e=>async(t,n,r)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},s);return l instanceof Promise&&(l=await l),l.issues.length?{success:!1,error:new e(l.issues.map(c=>us(c,s,cs())))}:{success:!0,data:l.value}},$O=Vd(Pd),UO=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ld(e)(t,n,s)},BO=e=>(t,n,r)=>Ld(e)(t,n,r),HO=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fd(e)(t,n,s)},qO=e=>async(t,n,r)=>Fd(e)(t,n,r),YO=e=>(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Id(e)(t,n,s)},GO=e=>(t,n,r)=>Id(e)(t,n,r),KO=e=>async(t,n,r)=>{const s=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Vd(e)(t,n,s)},ZO=e=>async(t,n,r)=>Vd(e)(t,n,r),WO=/^[cC][^\s-]{8,}$/,QO=/^[0-9a-z]+$/,XO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,JO=/^[0-9a-vA-V]{20}$/,eA=/^[A-Za-z0-9]{27}$/,tA=/^[a-zA-Z0-9_-]{21}$/,nA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rA=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,wS=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,oA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function sA(){return new RegExp(aA,"u")}const iA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,lA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,cA=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,uA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,V1=/^[A-Za-z0-9_-]*$/,fA=/^\+(?:[0-9]){6,14}[0-9]$/,$1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",hA=new RegExp(`^${$1}$`);function U1(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function mA(e){return new RegExp(`^${U1(e)}$`)}function pA(e){const t=U1({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${$1}T(?:${r})$`)}const gA=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},vA=/^(?:true|false)$/i,yA=/^[^A-Z]*$/,bA=/^[^a-z]*$/,uo=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),xA=de("$ZodCheckMaxLength",(e,t)=>{var n;uo.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!zg(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const s=r.value;if(s.length<=t.maximum)return;const c=Lg(s);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),SA=de("$ZodCheckMinLength",(e,t)=>{var n;uo.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!zg(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const s=r.value;if(s.length>=t.minimum)return;const c=Lg(s);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),wA=de("$ZodCheckLengthEquals",(e,t)=>{var n;uo.init(e,t),(n=e._zod.def).when??(n.when=r=>{const s=r.value;return!zg(s)&&s.length!==void 0}),e._zod.onattach.push(r=>{const s=r._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=r=>{const s=r.value,l=s.length;if(l===t.length)return;const c=Lg(s),d=l>t.length;r.issues.push({origin:c,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),$d=de("$ZodCheckStringFormat",(e,t)=>{var n,r;uo.init(e,t),e._zod.onattach.push(s=>{const l=s._zod.bag;l.format=t.format,t.pattern&&(l.patterns??(l.patterns=new Set),l.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),CA=de("$ZodCheckRegex",(e,t)=>{$d.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_A=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yA),$d.init(e,t)}),EA=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bA),$d.init(e,t)}),TA=de("$ZodCheckIncludes",(e,t)=>{uo.init(e,t);const n=zd(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(s=>{const l=s._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),NA=de("$ZodCheckStartsWith",(e,t)=>{uo.init(e,t);const n=new RegExp(`^${zd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),RA=de("$ZodCheckEndsWith",(e,t)=>{uo.init(e,t);const n=new RegExp(`.*${zd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),MA=de("$ZodCheckOverwrite",(e,t)=>{uo.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class OA{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
11
+ `).filter(c=>c),s=Math.min(...r.map(c=>c.length-c.trimStart().length)),l=r.map(c=>c.slice(s)).map(c=>" ".repeat(this.indent*2)+c);for(const c of l)this.content.push(c)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(l=>` ${l}`)];return new t(...n,s.join(`
12
+ `))}}const AA={major:4,minor:2,patch:1},Xt=de("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=AA;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const l of s._zod.onattach)l(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,d,f)=>{let m=Ci(c),v;for(const p of d){if(p._zod.def.when){if(!p._zod.def.when(c))continue}else if(m)continue;const x=c.issues.length,S=p._zod.check(c);if(S instanceof Promise&&f?.async===!1)throw new Ti;if(v||S instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await S,c.issues.length!==x&&(m||(m=Ci(c,x)))});else{if(c.issues.length===x)continue;m||(m=Ci(c,x))}}return v?v.then(()=>c):c},l=(c,d,f)=>{if(Ci(c))return c.aborted=!0,c;const m=s(d,r,f);if(m instanceof Promise){if(f.async===!1)throw new Ti;return m.then(v=>e._zod.parse(v,f))}return e._zod.parse(m,f)};e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){const m=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return m instanceof Promise?m.then(v=>l(v,c,d)):l(m,c,d)}const f=e._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new Ti;return f.then(m=>s(m,r,d))}return s(f,r,d)}}e["~standard"]={validate:s=>{try{const l=VO(e,s);return l.success?{value:l.data}:{issues:l.error?.issues}}catch{return $O(e,s).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}}),Ig=de("$ZodString",(e,t)=>{Xt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??gA(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),jt=de("$ZodStringFormat",(e,t)=>{$d.init(e,t),Ig.init(e,t)}),jA=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rA),jt.init(e,t)}),DA=de("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=wS(r))}else t.pattern??(t.pattern=wS());jt.init(e,t)}),kA=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=oA),jt.init(e,t)}),zA=de("$ZodURL",(e,t)=>{jt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),s=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),PA=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=sA()),jt.init(e,t)}),LA=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=tA),jt.init(e,t)}),FA=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=WO),jt.init(e,t)}),IA=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=QO),jt.init(e,t)}),VA=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=XO),jt.init(e,t)}),$A=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=JO),jt.init(e,t)}),UA=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eA),jt.init(e,t)}),BA=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=pA(t)),jt.init(e,t)}),HA=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=hA),jt.init(e,t)}),qA=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=mA(t)),jt.init(e,t)}),YA=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=nA),jt.init(e,t)}),GA=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=iA),jt.init(e,t),e._zod.bag.format="ipv4"}),KA=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=lA),jt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),ZA=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cA),jt.init(e,t)}),WA=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=uA),jt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[s,l]=r;if(!l)throw new Error;const c=Number(l);if(`${c}`!==l)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function B1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const QA=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=dA),jt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{B1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function XA(e){if(!V1.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return B1(n)}const JA=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=V1),jt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{XA(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ej=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=fA),jt.init(e,t)});function tj(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const s=JSON.parse(atob(r));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const nj=de("$ZodJWT",(e,t)=>{jt.init(e,t),e._zod.check=n=>{tj(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),rj=de("$ZodBoolean",(e,t)=>{Xt.init(e,t),e._zod.pattern=vA,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),oj=de("$ZodUnknown",(e,t)=>{Xt.init(e,t),e._zod.parse=n=>n}),aj=de("$ZodNever",(e,t)=>{Xt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function CS(e,t,n){e.issues.length&&t.issues.push(...F1(n,e.issues)),t.value[n]=e.value}const sj=de("$ZodArray",(e,t)=>{Xt.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const l=[];for(let c=0;c<s.length;c++){const d=s[c],f=t.element._zod.run({value:d,issues:[]},r);f instanceof Promise?l.push(f.then(m=>CS(m,n,c))):CS(f,n,c)}return l.length?Promise.all(l).then(()=>n):n}});function pd(e,t,n,r){e.issues.length&&t.issues.push(...F1(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function H1(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=RO(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function q1(e,t,n,r,s,l){const c=[],d=s.keySet,f=s.catchall._zod,m=f.def.type;for(const v in t){if(d.has(v))continue;if(m==="never"){c.push(v);continue}const p=f.run({value:t[v],issues:[]},r);p instanceof Promise?e.push(p.then(x=>pd(x,n,v,t))):pd(p,n,v,t)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:l}),e.length?Promise.all(e).then(()=>n):n}const ij=de("$ZodObject",(e,t)=>{if(Xt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const d=t.shape;Object.defineProperty(t,"shape",{get:()=>{const f={...d};return Object.defineProperty(t,"shape",{value:f}),f}})}const r=kg(()=>H1(t));_t(e._zod,"propValues",()=>{const d=t.shape,f={};for(const m in d){const v=d[m]._zod;if(v.values){f[m]??(f[m]=new Set);for(const p of v.values)f[m].add(p)}}return f});const s=md,l=t.catchall;let c;e._zod.parse=(d,f)=>{c??(c=r.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;d.value={};const v=[],p=c.shape;for(const x of c.keys){const _=p[x]._zod.run({value:m[x],issues:[]},f);_ instanceof Promise?v.push(_.then(w=>pd(w,d,x,m))):pd(_,d,x,m)}return l?q1(v,m,d,f,r.value,e):v.length?Promise.all(v).then(()=>d):d}}),lj=de("$ZodObjectJIT",(e,t)=>{ij.init(e,t);const n=e._zod.parse,r=kg(()=>H1(t)),s=x=>{const S=new OA(["shape","payload","ctx"]),_=r.value,w=M=>{const R=SS(M);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};S.write("const input = payload.value;");const C=Object.create(null);let T=0;for(const M of _.keys)C[M]=`key_${T++}`;S.write("const newResult = {};");for(const M of _.keys){const R=C[M],j=SS(M);S.write(`const ${R} = ${w(M)};`),S.write(`
13
+ if (${R}.issues.length) {
14
+ payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
15
+ ...iss,
16
+ path: iss.path ? [${j}, ...iss.path] : [${j}]
17
+ })));
18
+ }
19
+
20
+
21
+ if (${R}.value === undefined) {
22
+ if (${j} in input) {
23
+ newResult[${j}] = undefined;
24
+ }
25
+ } else {
26
+ newResult[${j}] = ${R}.value;
27
+ }
28
+
29
+ `)}S.write("payload.value = newResult;"),S.write("return payload;");const N=S.compile();return(M,R)=>N(x,M,R)};let l;const c=md,d=!k1.jitless,m=d&&TO.value,v=t.catchall;let p;e._zod.parse=(x,S)=>{p??(p=r.value);const _=x.value;return c(_)?d&&m&&S?.async===!1&&S.jitless!==!0?(l||(l=s(t.shape)),x=l(x,S),v?q1([],_,x,S,p,e):x):n(x,S):(x.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),x)}});function _S(e,t,n,r){for(const l of e)if(l.issues.length===0)return t.value=l.value,t;const s=e.filter(l=>!Ci(l));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(l=>l.issues.map(c=>us(c,r,cs())))}),t)}const cj=de("$ZodUnion",(e,t)=>{Xt.init(e,t),_t(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),_t(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),_t(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),_t(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(l=>l._zod.pattern);return new RegExp(`^(${s.map(l=>Pg(l.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,l)=>{if(n)return r(s,l);let c=!1;const d=[];for(const f of t.options){const m=f._zod.run({value:s.value,issues:[]},l);if(m instanceof Promise)d.push(m),c=!0;else{if(m.issues.length===0)return m;d.push(m)}}return c?Promise.all(d).then(f=>_S(f,s,e,l)):_S(d,s,e,l)}}),uj=de("$ZodIntersection",(e,t)=>{Xt.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,l=t.left._zod.run({value:s,issues:[]},r),c=t.right._zod.run({value:s,issues:[]},r);return l instanceof Promise||c instanceof Promise?Promise.all([l,c]).then(([f,m])=>ES(n,f,m)):ES(n,l,c)}});function Vp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(tc(e)&&tc(t)){const n=Object.keys(t),r=Object.keys(e).filter(l=>n.indexOf(l)!==-1),s={...e,...t};for(const l of r){const c=Vp(e[l],t[l]);if(!c.valid)return{valid:!1,mergeErrorPath:[l,...c.mergeErrorPath]};s[l]=c.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],l=t[r],c=Vp(s,l);if(!c.valid)return{valid:!1,mergeErrorPath:[r,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ES(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Ci(e))return e;const r=Vp(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const dj=de("$ZodEnum",(e,t)=>{Xt.init(e,t);const n=z1(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>NO.has(typeof s)).map(s=>typeof s=="string"?zd(s):s.toString()).join("|")})$`),e._zod.parse=(s,l)=>{const c=s.value;return r.has(c)||s.issues.push({code:"invalid_value",values:n,input:c,inst:e}),s}}),fj=de("$ZodTransform",(e,t)=>{Xt.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new D1(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(c=>(n.value=c,n));if(s instanceof Promise)throw new Ti;return n.value=s,n}});function TS(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const hj=de("$ZodOptional",(e,t)=>{Xt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_t(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Pg(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(l=>TS(l,n.value)):TS(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),mj=de("$ZodNullable",(e,t)=>{Xt.init(e,t),_t(e._zod,"optin",()=>t.innerType._zod.optin),_t(e._zod,"optout",()=>t.innerType._zod.optout),_t(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Pg(n.source)}|null)$`):void 0}),_t(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),pj=de("$ZodDefault",(e,t)=>{Xt.init(e,t),e._zod.optin="optional",_t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(l=>NS(l,t)):NS(s,t)}});function NS(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const gj=de("$ZodPrefault",(e,t)=>{Xt.init(e,t),e._zod.optin="optional",_t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),vj=de("$ZodNonOptional",(e,t)=>{Xt.init(e,t),_t(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(l=>RS(l,e)):RS(s,e)}});function RS(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const yj=de("$ZodCatch",(e,t)=>{Xt.init(e,t),_t(e._zod,"optin",()=>t.innerType._zod.optin),_t(e._zod,"optout",()=>t.innerType._zod.optout),_t(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(l=>(n.value=l.value,l.issues.length&&(n.value=t.catchValue({...n,error:{issues:l.issues.map(c=>us(c,r,cs()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(l=>us(l,r,cs()))},input:n.value}),n.issues=[]),n)}}),bj=de("$ZodPipe",(e,t)=>{Xt.init(e,t),_t(e._zod,"values",()=>t.in._zod.values),_t(e._zod,"optin",()=>t.in._zod.optin),_t(e._zod,"optout",()=>t.out._zod.optout),_t(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const l=t.out._zod.run(n,r);return l instanceof Promise?l.then(c=>Uu(c,t.in,r)):Uu(l,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(l=>Uu(l,t.out,r)):Uu(s,t.out,r)}});function Uu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const xj=de("$ZodReadonly",(e,t)=>{Xt.init(e,t),_t(e._zod,"propValues",()=>t.innerType._zod.propValues),_t(e._zod,"values",()=>t.innerType._zod.values),_t(e._zod,"optin",()=>t.innerType?._zod?.optin),_t(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(MS):MS(s)}});function MS(e){return e.value=Object.freeze(e.value),e}const Sj=de("$ZodCustom",(e,t)=>{uo.init(e,t),Xt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(l=>OS(l,n,r,e));OS(s,n,r,e)}});function OS(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(nc(s))}}var AS;class wj{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Cj(){return new wj}(AS=globalThis).__zod_globalRegistry??(AS.__zod_globalRegistry=Cj());const Kl=globalThis.__zod_globalRegistry;function _j(e,t){return new e({type:"string",...$e(t)})}function Ej(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$e(t)})}function jS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$e(t)})}function Tj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$e(t)})}function Nj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$e(t)})}function Rj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$e(t)})}function Mj(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$e(t)})}function Oj(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$e(t)})}function Aj(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$e(t)})}function jj(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$e(t)})}function Dj(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$e(t)})}function kj(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$e(t)})}function zj(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$e(t)})}function Pj(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$e(t)})}function Lj(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$e(t)})}function Fj(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$e(t)})}function Ij(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$e(t)})}function Vj(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$e(t)})}function $j(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$e(t)})}function Uj(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$e(t)})}function Bj(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$e(t)})}function Hj(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$e(t)})}function qj(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$e(t)})}function Yj(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$e(t)})}function Gj(e,t){return new e({type:"string",format:"date",check:"string_format",...$e(t)})}function Kj(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$e(t)})}function Zj(e,t){return new e({type:"string",format:"duration",check:"string_format",...$e(t)})}function Wj(e,t){return new e({type:"boolean",...$e(t)})}function Qj(e){return new e({type:"unknown"})}function Xj(e,t){return new e({type:"never",...$e(t)})}function Y1(e,t){return new xA({check:"max_length",...$e(t),maximum:e})}function gd(e,t){return new SA({check:"min_length",...$e(t),minimum:e})}function G1(e,t){return new wA({check:"length_equals",...$e(t),length:e})}function Jj(e,t){return new CA({check:"string_format",format:"regex",...$e(t),pattern:e})}function eD(e){return new _A({check:"string_format",format:"lowercase",...$e(e)})}function tD(e){return new EA({check:"string_format",format:"uppercase",...$e(e)})}function nD(e,t){return new TA({check:"string_format",format:"includes",...$e(t),includes:e})}function rD(e,t){return new NA({check:"string_format",format:"starts_with",...$e(t),prefix:e})}function oD(e,t){return new RA({check:"string_format",format:"ends_with",...$e(t),suffix:e})}function zi(e){return new MA({check:"overwrite",tx:e})}function aD(e){return zi(t=>t.normalize(e))}function sD(){return zi(e=>e.trim())}function iD(){return zi(e=>e.toLowerCase())}function lD(){return zi(e=>e.toUpperCase())}function cD(){return zi(e=>EO(e))}function uD(e,t,n){return new e({type:"array",element:t,...$e(n)})}function dD(e,t,n){return new e({type:"custom",check:"custom",fn:t,...$e(n)})}function fD(e){const t=hD(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(nc(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(nc(s))}},e(n.value,n)));return t}function hD(e,t){const n=new uo({check:"custom",...$e(t)});return n._zod.check=e,n}function K1(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Kl,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function pn(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,l=t.seen.get(e);if(l)return l.count++,n.schemaPath.includes(e)&&(l.cycle=n.path),l.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const d=e._zod.toJSONSchema?.();if(d)c.schema=d;else{const v={...n,schemaPath:[...n.schemaPath,e],path:n.path},p=e._zod.parent;if(p)c.ref=p,pn(p,t,v),t.seen.get(p).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,v);else{const x=c.schema,S=t.processors[s.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);S(e,t,x,v)}}const f=t.metadataRegistry.get(e);return f&&Object.assign(c.schema,f),t.io==="input"&&On(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((r=c.schema).default??(r.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function Z1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const v=e.external.registry.get(l[0])?.id,p=e.external.uri??(S=>S);if(v)return{ref:p(v)};const x=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=x,{defId:x,ref:`${p("__shared")}#/${c}/${x}`}}if(l[1]===n)return{ref:"#"};const f=`#/${c}/`,m=l[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:f+m}},s=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:d,defId:f}=r(l);c.def={...c.schema},f&&(c.defId=f);const m=c.schema;for(const v in m)delete m[v];m.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
30
+
31
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=l[1];if(t===l[0]){s(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){s(l);continue}}if(e.metadataRegistry.get(l[0])?.id){s(l);continue}if(c.cycle){s(l);continue}if(c.count>1&&e.reused==="ref"){s(l);continue}}}function W1(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=c=>{const d=e.seen.get(c),f=d.def??d.schema,m={...f};if(d.ref===null)return;const v=d.ref;if(d.ref=null,v){r(v);const p=e.seen.get(v).schema;p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(p)):(Object.assign(f,p),Object.assign(f,m))}d.isParent||e.override({zodSchema:c,jsonSchema:f,path:d.path??[]})};for(const c of[...e.seen.entries()].reverse())r(c[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(c)}Object.assign(s,n.def??n.schema);const l=e.external?.defs??{};for(const c of e.seen.entries()){const d=c[1];d.def&&d.defId&&(l[d.defId]=d.def)}e.external||Object.keys(l).length>0&&(e.target==="draft-2020-12"?s.$defs=l:s.definitions=l);try{const c=JSON.parse(JSON.stringify(s));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:vd(t,"input"),output:vd(t,"output")}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function On(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return On(r.element,n);if(r.type==="set")return On(r.valueType,n);if(r.type==="lazy")return On(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return On(r.innerType,n);if(r.type==="intersection")return On(r.left,n)||On(r.right,n);if(r.type==="record"||r.type==="map")return On(r.keyType,n)||On(r.valueType,n);if(r.type==="pipe")return On(r.in,n)||On(r.out,n);if(r.type==="object"){for(const s in r.shape)if(On(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(On(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(On(s,n))return!0;return!!(r.rest&&On(r.rest,n))}return!1}const mD=(e,t={})=>n=>{const r=K1({...n,processors:t});return pn(e,r),Z1(r,e),W1(r,e)},vd=(e,t)=>n=>{const{libraryOptions:r,target:s}=n??{},l=K1({...r??{},target:s,io:t,processors:{}});return pn(e,l),Z1(l,e),W1(l,e)},pD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gD=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:l,maximum:c,format:d,patterns:f,contentEncoding:m}=e._zod.bag;if(typeof l=="number"&&(s.minLength=l),typeof c=="number"&&(s.maxLength=c),d&&(s.format=pD[d]??d,s.format===""&&delete s.format),m&&(s.contentEncoding=m),f&&f.size>0){const v=[...f];v.length===1?s.pattern=v[0].source:v.length>1&&(s.allOf=[...v.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},vD=(e,t,n,r)=>{n.type="boolean"},yD=(e,t,n,r)=>{n.not={}},bD=(e,t,n,r)=>{},xD=(e,t,n,r)=>{const s=e._zod.def,l=z1(s.entries);l.every(c=>typeof c=="number")&&(n.type="number"),l.every(c=>typeof c=="string")&&(n.type="string"),n.enum=l},SD=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wD=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},CD=(e,t,n,r)=>{const s=n,l=e._zod.def,{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(s.minItems=c),typeof d=="number"&&(s.maxItems=d),s.type="array",s.items=pn(l.element,t,{...r,path:[...r.path,"items"]})},_D=(e,t,n,r)=>{const s=n,l=e._zod.def;s.type="object",s.properties={};const c=l.shape;for(const m in c)s.properties[m]=pn(c[m],t,{...r,path:[...r.path,"properties",m]});const d=new Set(Object.keys(c)),f=new Set([...d].filter(m=>{const v=l.shape[m]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));f.size>0&&(s.required=Array.from(f)),l.catchall?._zod.def.type==="never"?s.additionalProperties=!1:l.catchall?l.catchall&&(s.additionalProperties=pn(l.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},ED=(e,t,n,r)=>{const s=e._zod.def,l=s.inclusive===!1,c=s.options.map((d,f)=>pn(d,t,{...r,path:[...r.path,l?"oneOf":"anyOf",f]}));l?n.oneOf=c:n.anyOf=c},TD=(e,t,n,r)=>{const s=e._zod.def,l=pn(s.left,t,{...r,path:[...r.path,"allOf",0]}),c=pn(s.right,t,{...r,path:[...r.path,"allOf",1]}),d=m=>"allOf"in m&&Object.keys(m).length===1,f=[...d(l)?l.allOf:[l],...d(c)?c.allOf:[c]];n.allOf=f},ND=(e,t,n,r)=>{const s=e._zod.def,l=pn(s.innerType,t,r),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=s.innerType,n.nullable=!0):n.anyOf=[l,{type:"null"}]},RD=(e,t,n,r)=>{const s=e._zod.def;pn(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType},MD=(e,t,n,r)=>{const s=e._zod.def;pn(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},OD=(e,t,n,r)=>{const s=e._zod.def;pn(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},AD=(e,t,n,r)=>{const s=e._zod.def;pn(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType;let c;try{c=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},jD=(e,t,n,r)=>{const s=e._zod.def,l=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;pn(l,t,r);const c=t.seen.get(e);c.ref=l},DD=(e,t,n,r)=>{const s=e._zod.def;pn(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType,n.readOnly=!0},kD=(e,t,n,r)=>{const s=e._zod.def;pn(s.innerType,t,r);const l=t.seen.get(e);l.ref=s.innerType};function DS(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function zD(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var d=r.unionErrors[0].errors[0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(v){return v.errors.forEach(function(p){return e.push(p)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=Ag(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function PD(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var d=r.errors[0][0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(v){return v.forEach(function(p){return e.push(p)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=Ag(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function LD(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,s,l){try{return Promise.resolve(DS(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&Fp({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return Array.isArray(d?.issues)})(c))return{values:{},errors:yS(zD(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,l){try{return Promise.resolve(DS(function(){return Promise.resolve((n.mode==="sync"?FO:IO)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&Fp({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof Fg})(c))return{values:{},errors:yS(PD(c.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}var Pi=b1();const Q1=h1(Pi);function FD(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const ID=e=>{switch(e){case"success":return UD;case"info":return HD;case"warning":return BD;case"error":return qD;default:return null}},VD=Array(12).fill(0),$D=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},VD.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),UD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),BD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.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"})),HD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),qD=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),YD=I.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"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),GD=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let $p=1;class KD{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,l=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:$p++,c=this.toasts.find(f=>f.id===l),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),c?this.toasts=this.toasts.map(f=>f.id===l?(this.publish({...f,...t,id:l,title:r}),{...f,...t,id:l,dismissible:d,title:r}):f):this.addToast({title:r,...s,dismissible:d,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let l=r!==void 0,c;const d=s.then(async m=>{if(c=["resolve",m],I.isValidElement(m))l=!1,this.create({id:r,type:"default",message:m});else if(WD(m)&&!m.ok){l=!1;const p=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,_=typeof p=="object"&&!I.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:x,..._})}else if(m instanceof Error){l=!1;const p=typeof n.error=="function"?await n.error(m):n.error,x=typeof n.description=="function"?await n.description(m):n.description,_=typeof p=="object"&&!I.isValidElement(p)?p:{message:p};this.create({id:r,type:"error",description:x,..._})}else if(n.success!==void 0){l=!1;const p=typeof n.success=="function"?await n.success(m):n.success,x=typeof n.description=="function"?await n.description(m):n.description,_=typeof p=="object"&&!I.isValidElement(p)?p:{message:p};this.create({id:r,type:"success",description:x,..._})}}).catch(async m=>{if(c=["reject",m],n.error!==void 0){l=!1;const v=typeof n.error=="function"?await n.error(m):n.error,p=typeof n.description=="function"?await n.description(m):n.description,S=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:r,type:"error",description:p,...S})}}).finally(()=>{l&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((m,v)=>d.then(()=>c[0]==="reject"?v(c[1]):m(c[1])).catch(v));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=n?.id||$p++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Zn=new KD,ZD=(e,t)=>{const n=t?.id||$p++;return Zn.addToast({title:e,...t,id:n}),n},WD=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",QD=ZD,XD=()=>Zn.toasts,JD=()=>Zn.getActiveToasts(),at=Object.assign(QD,{success:Zn.success,info:Zn.info,warning:Zn.warning,error:Zn.error,custom:Zn.custom,message:Zn.message,promise:Zn.promise,dismiss:Zn.dismiss,loading:Zn.loading},{getHistory:XD,getToasts:JD});FD("[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 Bu(e){return e.label!==void 0}const ek=3,tk="24px",nk="16px",kS=4e3,rk=356,ok=14,ak=45,sk=200;function no(...e){return e.filter(Boolean).join(" ")}function ik(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const lk=e=>{var t,n,r,s,l,c,d,f,m;const{invert:v,toast:p,unstyled:x,interacting:S,setHeights:_,visibleToasts:w,heights:C,index:T,toasts:N,expanded:M,removeToast:R,defaultRichColors:j,closeButton:A,style:D,cancelButtonStyle:L,actionButtonStyle:B,className:ne="",descriptionClassName:J="",duration:ie,position:ue,gap:ae,expandByDefault:pe,classNames:k,icons:Y,closeButtonAriaLabel:H="Close toast"}=e,[ee,ve]=I.useState(null),[z,P]=I.useState(null),[U,W]=I.useState(!1),[oe,he]=I.useState(!1),[X,ye]=I.useState(!1),[_e,De]=I.useState(!1),[qe,Ge]=I.useState(!1),[Lt,Rt]=I.useState(0),[En,Fn]=I.useState(0),Tn=I.useRef(p.duration||ie||kS),Ho=I.useRef(null),on=I.useRef(null),V=T===0,G=T+1<=w,te=p.type,xe=p.dismissible!==!1,me=p.className||"",ge=p.descriptionClassName||"",Te=I.useMemo(()=>C.findIndex(Se=>Se.toastId===p.id)||0,[C,p.id]),tt=I.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:A},[p.closeButton,A]),nt=I.useMemo(()=>p.duration||ie||kS,[p.duration,ie]),Ht=I.useRef(0),yn=I.useRef(0),Nn=I.useRef(0),hr=I.useRef(null),[Xn,Ft]=ue.split("-"),Rn=I.useMemo(()=>C.reduce((Se,wt,qt)=>qt>=Te?Se:Se+wt.height,0),[C,Te]),It=GD(),qo=p.invert||v,Qr=te==="loading";yn.current=I.useMemo(()=>Te*ae+Rn,[Te,Rn]),I.useEffect(()=>{Tn.current=nt},[nt]),I.useEffect(()=>{W(!0)},[]),I.useEffect(()=>{const Se=on.current;if(Se){const wt=Se.getBoundingClientRect().height;return Fn(wt),_(qt=>[{toastId:p.id,height:wt,position:p.position},...qt]),()=>_(qt=>qt.filter(an=>an.toastId!==p.id))}},[_,p.id]),I.useLayoutEffect(()=>{if(!U)return;const Se=on.current,wt=Se.style.height;Se.style.height="auto";const qt=Se.getBoundingClientRect().height;Se.style.height=wt,Fn(qt),_(an=>an.find(xt=>xt.toastId===p.id)?an.map(xt=>xt.toastId===p.id?{...xt,height:qt}:xt):[{toastId:p.id,height:qt,position:p.position},...an])},[U,p.title,p.description,_,p.id,p.jsx,p.action,p.cancel]);const Le=I.useCallback(()=>{he(!0),Rt(yn.current),_(Se=>Se.filter(wt=>wt.toastId!==p.id)),setTimeout(()=>{R(p)},sk)},[p,R,_,yn]);I.useEffect(()=>{if(p.promise&&te==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return M||S||It?(()=>{if(Nn.current<Ht.current){const an=new Date().getTime()-Ht.current;Tn.current=Tn.current-an}Nn.current=new Date().getTime()})():(()=>{Tn.current!==1/0&&(Ht.current=new Date().getTime(),Se=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),Le()},Tn.current))})(),()=>clearTimeout(Se)},[M,S,p,te,It,Le]),I.useEffect(()=>{p.delete&&(Le(),p.onDismiss==null||p.onDismiss.call(p,p))},[Le,p.delete]);function Xe(){var Se;if(Y?.loading){var wt;return I.createElement("div",{className:no(k?.loader,p==null||(wt=p.classNames)==null?void 0:wt.loader,"sonner-loader"),"data-visible":te==="loading"},Y.loading)}return I.createElement($D,{className:no(k?.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:te==="loading"})}const Pe=p.icon||Y?.[te]||ID(te);var We,Mt;return I.createElement("li",{tabIndex:0,ref:on,className:no(ne,me,k?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,k?.default,k?.[te],p==null||(n=p.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(We=p.richColors)!=null?We:j,"data-styled":!(p.jsx||p.unstyled||x),"data-mounted":U,"data-promise":!!p.promise,"data-swiped":qe,"data-removed":oe,"data-visible":G,"data-y-position":Xn,"data-x-position":Ft,"data-index":T,"data-front":V,"data-swiping":X,"data-dismissible":xe,"data-type":te,"data-invert":qo,"data-swipe-out":_e,"data-swipe-direction":z,"data-expanded":!!(M||pe&&U),"data-testid":p.testId,style:{"--index":T,"--toasts-before":T,"--z-index":N.length-T,"--offset":`${oe?Lt:yn.current}px`,"--initial-height":pe?"auto":`${En}px`,...D,...p.style},onDragEnd:()=>{ye(!1),ve(null),hr.current=null},onPointerDown:Se=>{Se.button!==2&&(Qr||!xe||(Ho.current=new Date,Rt(yn.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(ye(!0),hr.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,wt,qt;if(_e||!xe)return;hr.current=null;const an=Number(((Se=on.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),mr=Number(((wt=on.current)==null?void 0:wt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),xt=new Date().getTime()-((qt=Ho.current)==null?void 0:qt.getTime()),In=ee==="x"?an:mr,La=Math.abs(In)/xt;if(Math.abs(In)>=ak||La>.11){Rt(yn.current),p.onDismiss==null||p.onDismiss.call(p,p),P(ee==="x"?an>0?"right":"left":mr>0?"down":"up"),Le(),De(!0);return}else{var Vn,$n;(Vn=on.current)==null||Vn.style.setProperty("--swipe-amount-x","0px"),($n=on.current)==null||$n.style.setProperty("--swipe-amount-y","0px")}Ge(!1),ye(!1),ve(null)},onPointerMove:Se=>{var wt,qt,an;if(!hr.current||!xe||((wt=window.getSelection())==null?void 0:wt.toString().length)>0)return;const xt=Se.clientY-hr.current.y,In=Se.clientX-hr.current.x;var La;const Vn=(La=e.swipeDirections)!=null?La:ik(ue);!ee&&(Math.abs(In)>1||Math.abs(xt)>1)&&ve(Math.abs(In)>Math.abs(xt)?"x":"y");let $n={x:0,y:0};const _s=kr=>1/(1.5+Math.abs(kr)/20);if(ee==="y"){if(Vn.includes("top")||Vn.includes("bottom"))if(Vn.includes("top")&&xt<0||Vn.includes("bottom")&&xt>0)$n.y=xt;else{const kr=xt*_s(xt);$n.y=Math.abs(kr)<Math.abs(xt)?kr:xt}}else if(ee==="x"&&(Vn.includes("left")||Vn.includes("right")))if(Vn.includes("left")&&In<0||Vn.includes("right")&&In>0)$n.x=In;else{const kr=In*_s(In);$n.x=Math.abs(kr)<Math.abs(In)?kr:In}(Math.abs($n.x)>0||Math.abs($n.y)>0)&&Ge(!0),(qt=on.current)==null||qt.style.setProperty("--swipe-amount-x",`${$n.x}px`),(an=on.current)==null||an.style.setProperty("--swipe-amount-y",`${$n.y}px`)}},tt&&!p.jsx&&te!=="loading"?I.createElement("button",{"aria-label":H,"data-disabled":Qr,"data-close-button":!0,onClick:Qr||!xe?()=>{}:()=>{Le(),p.onDismiss==null||p.onDismiss.call(p,p)},className:no(k?.closeButton,p==null||(r=p.classNames)==null?void 0:r.closeButton)},(Mt=Y?.close)!=null?Mt:YD):null,(te||p.icon||p.promise)&&p.icon!==null&&(Y?.[te]!==null||p.icon)?I.createElement("div",{"data-icon":"",className:no(k?.icon,p==null||(s=p.classNames)==null?void 0:s.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Xe():null,p.type!=="loading"?Pe:null):null,I.createElement("div",{"data-content":"",className:no(k?.content,p==null||(l=p.classNames)==null?void 0:l.content)},I.createElement("div",{"data-title":"",className:no(k?.title,p==null||(c=p.classNames)==null?void 0:c.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?I.createElement("div",{"data-description":"",className:no(J,ge,k?.description,p==null||(d=p.classNames)==null?void 0:d.description)},typeof p.description=="function"?p.description():p.description):null),I.isValidElement(p.cancel)?p.cancel:p.cancel&&Bu(p.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||L,onClick:Se=>{Bu(p.cancel)&&xe&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),Le())},className:no(k?.cancelButton,p==null||(f=p.classNames)==null?void 0:f.cancelButton)},p.cancel.label):null,I.isValidElement(p.action)?p.action:p.action&&Bu(p.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||B,onClick:Se=>{Bu(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&Le())},className:no(k?.actionButton,p==null||(m=p.classNames)==null?void 0:m.actionButton)},p.action.label):null)};function zS(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function ck(e,t){const n={};return[e,t].forEach((r,s)=>{const l=s===1,c=l?"--mobile-offset":"--offset",d=l?nk:tk;function f(m){["top","right","bottom","left"].forEach(v=>{n[`${c}-${v}`]=typeof m=="number"?`${m}px`:m})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(m=>{r[m]===void 0?n[`${c}-${m}`]=d:n[`${c}-${m}`]=typeof r[m]=="number"?`${r[m]}px`:r[m]}):f(d)}),n}const uk=I.forwardRef(function(t,n){const{id:r,invert:s,position:l="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:f,className:m,offset:v,mobileOffset:p,theme:x="light",richColors:S,duration:_,style:w,visibleToasts:C=ek,toastOptions:T,dir:N=zS(),gap:M=ok,icons:R,containerAriaLabel:j="Notifications"}=t,[A,D]=I.useState([]),L=I.useMemo(()=>r?A.filter(U=>U.toasterId===r):A.filter(U=>!U.toasterId),[A,r]),B=I.useMemo(()=>Array.from(new Set([l].concat(L.filter(U=>U.position).map(U=>U.position)))),[L,l]),[ne,J]=I.useState([]),[ie,ue]=I.useState(!1),[ae,pe]=I.useState(!1),[k,Y]=I.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=I.useRef(null),ee=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ve=I.useRef(null),z=I.useRef(!1),P=I.useCallback(U=>{D(W=>{var oe;return(oe=W.find(he=>he.id===U.id))!=null&&oe.delete||Zn.dismiss(U.id),W.filter(({id:he})=>he!==U.id)})},[]);return I.useEffect(()=>Zn.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{D(W=>W.map(oe=>oe.id===U.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{Q1.flushSync(()=>{D(W=>{const oe=W.findIndex(he=>he.id===U.id);return oe!==-1?[...W.slice(0,oe),{...W[oe],...U},...W.slice(oe+1)]:[U,...W]})})})}),[A]),I.useEffect(()=>{if(x!=="system"){Y(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Y("dark"):Y("light")),typeof window>"u")return;const U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:W})=>{Y(W?"dark":"light")})}catch{U.addListener(({matches:oe})=>{try{Y(oe?"dark":"light")}catch(he){console.error(he)}})}},[x]),I.useEffect(()=>{A.length<=1&&ue(!1)},[A]),I.useEffect(()=>{const U=W=>{var oe;if(c.every(ye=>W[ye]||W.code===ye)){var X;ue(!0),(X=H.current)==null||X.focus()}W.code==="Escape"&&(document.activeElement===H.current||(oe=H.current)!=null&&oe.contains(document.activeElement))&&ue(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[c]),I.useEffect(()=>{if(H.current)return()=>{ve.current&&(ve.current.focus({preventScroll:!0}),ve.current=null,z.current=!1)}},[H.current]),I.createElement("section",{ref:n,"aria-label":`${j} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((U,W)=>{var oe;const[he,X]=U.split("-");return L.length?I.createElement("ol",{key:U,dir:N==="auto"?zS():N,tabIndex:-1,ref:H,className:m,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":he,"data-x-position":X,style:{"--front-toast-height":`${((oe=ne[0])==null?void 0:oe.height)||0}px`,"--width":`${rk}px`,"--gap":`${M}px`,...w,...ck(v,p)},onBlur:ye=>{z.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(z.current=!1,ve.current&&(ve.current.focus({preventScroll:!0}),ve.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||z.current||(z.current=!0,ve.current=ye.relatedTarget)},onMouseEnter:()=>ue(!0),onMouseMove:()=>ue(!0),onMouseLeave:()=>{ae||ue(!1)},onDragEnd:()=>ue(!1),onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||pe(!0)},onPointerUp:()=>pe(!1)},L.filter(ye=>!ye.position&&W===0||ye.position===U).map((ye,_e)=>{var De,qe;return I.createElement(lk,{key:ye.id,icons:R,index:_e,toast:ye,defaultRichColors:S,duration:(De=T?.duration)!=null?De:_,className:T?.className,descriptionClassName:T?.descriptionClassName,invert:s,visibleToasts:C,closeButton:(qe=T?.closeButton)!=null?qe:f,interacting:ae,position:U,style:T?.style,unstyled:T?.unstyled,classNames:T?.classNames,cancelButtonStyle:T?.cancelButtonStyle,actionButtonStyle:T?.actionButtonStyle,closeButtonAriaLabel:T?.closeButtonAriaLabel,removeToast:P,toasts:L.filter(Ge=>Ge.position==ye.position),heights:ne.filter(Ge=>Ge.position==ye.position),setHeights:J,expandByDefault:d,gap:M,expanded:ie,swipeDirections:t.swipeDirections})})):null}))});function X1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=X1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function J1(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=X1(e))&&(r&&(r+=" "),r+=t);return r}const PS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,LS=J1,Vg=(e,t)=>n=>{var r;if(t?.variants==null)return LS(e,n?.class,n?.className);const{variants:s,defaultVariants:l}=t,c=Object.keys(s).map(m=>{const v=n?.[m],p=l?.[m];if(v===null)return null;const x=PS(v)||PS(p);return s[m][x]}),d=n&&Object.entries(n).reduce((m,v)=>{let[p,x]=v;return x===void 0||(m[p]=x),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,v)=>{let{class:p,className:x,...S}=v;return Object.entries(S).every(_=>{let[w,C]=_;return Array.isArray(C)?C.includes({...l,...d}[w]):{...l,...d}[w]===C})?[...m,p,x]:m},[]);return LS(e,c,f,n?.class,n?.className)};function FS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Dn(...e){return t=>{let n=!1;const r=e.map(s=>{const l=FS(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():FS(e[s],null)}}}}function Ze(...e){return b.useCallback(Dn(...e),e)}function dk(e){const t=fk(e),n=b.forwardRef((r,s)=>{const{children:l,...c}=r,d=b.Children.toArray(l),f=d.find(mk);if(f){const m=f.props.children,v=d.map(p=>p===f?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:p);return h.jsx(t,{...c,ref:s,children:b.isValidElement(m)?b.cloneElement(m,void 0,v):null})}return h.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function fk(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const c=gk(s),d=pk(l,s.props);return s.type!==b.Fragment&&(d.ref=r?Dn(r,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hk=Symbol("radix.slottable");function mk(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hk}function pk(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function gk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=vk.reduce((e,t)=>{const n=dk(`Primitive.${t}`),r=b.forwardRef((s,l)=>{const{asChild:c,...d}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function eC(e,t){e&&Pi.flushSync(()=>e.dispatchEvent(t))}var tC=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"}),yk="VisuallyHidden",nC=b.forwardRef((e,t)=>h.jsx(je.span,{...e,ref:t,style:{...tC,...e.style}}));nC.displayName=yk;var bk=nC;function xk(e,t){const n=b.createContext(t),r=l=>{const{children:c,...d}=l,f=b.useMemo(()=>d,Object.values(d));return h.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function s(l){const c=b.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function Or(e,t=[]){let n=[];function r(l,c){const d=b.createContext(c),f=n.length;n=[...n,c];const m=p=>{const{scope:x,children:S,..._}=p,w=x?.[e]?.[f]||d,C=b.useMemo(()=>_,Object.values(_));return h.jsx(w.Provider,{value:C,children:S})};m.displayName=l+"Provider";function v(p,x){const S=x?.[e]?.[f]||d,_=b.useContext(S);if(_)return _;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[m,v]}const s=()=>{const l=n.map(c=>b.createContext(c));return function(d){const f=d?.[e]||l;return b.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return s.scopeName=e,[r,Sk(s,...t)]}function Sk(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=r.reduce((d,{useScope:f,scopeName:m})=>{const p=f(l)[`__scope${m}`];return{...d,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function IS(e){const t=wk(e),n=b.forwardRef((r,s)=>{const{children:l,...c}=r,d=b.Children.toArray(l),f=d.find(_k);if(f){const m=f.props.children,v=d.map(p=>p===f?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:p);return h.jsx(t,{...c,ref:s,children:b.isValidElement(m)?b.cloneElement(m,void 0,v):null})}return h.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function wk(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const c=Tk(s),d=Ek(l,s.props);return s.type!==b.Fragment&&(d.ref=r?Dn(r,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ck=Symbol("radix.slottable");function _k(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ck}function Ek(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function Tk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $g(e){const t=e+"CollectionProvider",[n,r]=Or(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=w=>{const{scope:C,children:T}=w,N=I.useRef(null),M=I.useRef(new Map).current;return h.jsx(s,{scope:C,itemMap:M,collectionRef:N,children:T})};c.displayName=t;const d=e+"CollectionSlot",f=IS(d),m=I.forwardRef((w,C)=>{const{scope:T,children:N}=w,M=l(d,T),R=Ze(C,M.collectionRef);return h.jsx(f,{ref:R,children:N})});m.displayName=d;const v=e+"CollectionItemSlot",p="data-radix-collection-item",x=IS(v),S=I.forwardRef((w,C)=>{const{scope:T,children:N,...M}=w,R=I.useRef(null),j=Ze(C,R),A=l(v,T);return I.useEffect(()=>(A.itemMap.set(R,{ref:R,...M}),()=>void A.itemMap.delete(R))),h.jsx(x,{[p]:"",ref:j,children:N})});S.displayName=v;function _(w){const C=l(e+"CollectionConsumer",w);return I.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const M=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((A,D)=>M.indexOf(A.ref.current)-M.indexOf(D.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:m,ItemSlot:S},_,r]}function Ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}var gn=globalThis?.document?b.useLayoutEffect:()=>{},Nk=m1[" useInsertionEffect ".trim().toString()]||gn;function lo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,c]=Rk({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:s;{const v=b.useRef(e!==void 0);b.useEffect(()=>{const p=v.current;p!==d&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${d?"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.`),v.current=d},[d,r])}const m=b.useCallback(v=>{if(d){const p=Mk(v)?v(e):v;p!==e&&c.current?.(p)}else l(v)},[d,e,l,c]);return[f,m]}function Rk({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),s=b.useRef(n),l=b.useRef(t);return Nk(()=>{l.current=t},[t]),b.useEffect(()=>{s.current!==n&&(l.current?.(n),s.current=n)},[n,s]),[n,r,l]}function Mk(e){return typeof e=="function"}function Ok(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var vn=e=>{const{present:t,children:n}=e,r=Ak(t),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),l=Ze(r.ref,jk(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:l}):null};vn.displayName="Presence";function Ak(e){const[t,n]=b.useState(),r=b.useRef(null),s=b.useRef(e),l=b.useRef("none"),c=e?"mounted":"unmounted",[d,f]=Ok(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const m=Hu(r.current);l.current=d==="mounted"?m:"none"},[d]),gn(()=>{const m=r.current,v=s.current;if(v!==e){const x=l.current,S=Hu(m);e?f("MOUNT"):S==="none"||m?.display==="none"?f("UNMOUNT"):f(v&&x!==S?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),gn(()=>{if(t){let m;const v=t.ownerDocument.defaultView??window,p=S=>{const w=Hu(r.current).includes(CSS.escape(S.animationName));if(S.target===t&&w&&(f("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=S=>{S.target===t&&(l.current=Hu(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{v.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:b.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function Hu(e){return e?.animationName||"none"}function jk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dk=m1[" useId ".trim().toString()]||(()=>{}),kk=0;function nn(e){const[t,n]=b.useState(Dk());return gn(()=>{n(r=>r??String(kk++))},[e]),e||(t?`radix-${t}`:"")}var zk=b.createContext(void 0);function Ud(e){const t=b.useContext(zk);return e||t||"ltr"}function cn(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function Pk(e,t=globalThis?.document){const n=cn(e);b.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Lk="DismissableLayer",Up="dismissableLayer.update",Fk="dismissableLayer.pointerDownOutside",Ik="dismissableLayer.focusOutside",VS,rC=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Li=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,m=b.useContext(rC),[v,p]=b.useState(null),x=v?.ownerDocument??globalThis?.document,[,S]=b.useState({}),_=Ze(t,D=>p(D)),w=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),T=w.indexOf(C),N=v?w.indexOf(v):-1,M=m.layersWithOutsidePointerEventsDisabled.size>0,R=N>=T,j=Uk(D=>{const L=D.target,B=[...m.branches].some(ne=>ne.contains(L));!R||B||(s?.(D),c?.(D),D.defaultPrevented||d?.())},x),A=Bk(D=>{const L=D.target;[...m.branches].some(ne=>ne.contains(L))||(l?.(D),c?.(D),D.defaultPrevented||d?.())},x);return Pk(D=>{N===m.layers.size-1&&(r?.(D),!D.defaultPrevented&&d&&(D.preventDefault(),d()))},x),b.useEffect(()=>{if(v)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(VS=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(v)),m.layers.add(v),$S(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=VS)}},[v,x,n,m]),b.useEffect(()=>()=>{v&&(m.layers.delete(v),m.layersWithOutsidePointerEventsDisabled.delete(v),$S())},[v,m]),b.useEffect(()=>{const D=()=>S({});return document.addEventListener(Up,D),()=>document.removeEventListener(Up,D)},[]),h.jsx(je.div,{...f,ref:_,style:{pointerEvents:M?R?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,j.onPointerDownCapture)})});Li.displayName=Lk;var Vk="DismissableLayerBranch",$k=b.forwardRef((e,t)=>{const n=b.useContext(rC),r=b.useRef(null),s=Ze(t,r);return b.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),h.jsx(je.div,{...e,ref:s})});$k.displayName=Vk;function Uk(e,t=globalThis?.document){const n=cn(e),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let f=function(){oC(Fk,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Bk(e,t=globalThis?.document){const n=cn(e),r=b.useRef(!1);return b.useEffect(()=>{const s=l=>{l.target&&!r.current&&oC(Ik,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $S(){const e=new CustomEvent(Up);document.dispatchEvent(e)}function oC(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?eC(s,l):s.dispatchEvent(l)}var qm="focusScope.autoFocusOnMount",Ym="focusScope.autoFocusOnUnmount",US={bubbles:!1,cancelable:!0},Hk="FocusScope",mc=b.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[d,f]=b.useState(null),m=cn(s),v=cn(l),p=b.useRef(null),x=Ze(t,w=>f(w)),S=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let w=function(M){if(S.paused||!d)return;const R=M.target;d.contains(R)?p.current=R:ba(p.current,{select:!0})},C=function(M){if(S.paused||!d)return;const R=M.relatedTarget;R!==null&&(d.contains(R)||ba(p.current,{select:!0}))},T=function(M){if(document.activeElement===document.body)for(const j of M)j.removedNodes.length>0&&ba(d)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const N=new MutationObserver(T);return d&&N.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),N.disconnect()}}},[r,d,S.paused]),b.useEffect(()=>{if(d){HS.add(S);const w=document.activeElement;if(!d.contains(w)){const T=new CustomEvent(qm,US);d.addEventListener(qm,m),d.dispatchEvent(T),T.defaultPrevented||(qk(Wk(aC(d)),{select:!0}),document.activeElement===w&&ba(d))}return()=>{d.removeEventListener(qm,m),setTimeout(()=>{const T=new CustomEvent(Ym,US);d.addEventListener(Ym,v),d.dispatchEvent(T),T.defaultPrevented||ba(w??document.body,{select:!0}),d.removeEventListener(Ym,v),HS.remove(S)},0)}}},[d,m,v,S]);const _=b.useCallback(w=>{if(!n&&!r||S.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,T=document.activeElement;if(C&&T){const N=w.currentTarget,[M,R]=Yk(N);M&&R?!w.shiftKey&&T===R?(w.preventDefault(),n&&ba(M,{select:!0})):w.shiftKey&&T===M&&(w.preventDefault(),n&&ba(R,{select:!0})):T===N&&w.preventDefault()}},[n,r,S.paused]);return h.jsx(je.div,{tabIndex:-1,...c,ref:x,onKeyDown:_})});mc.displayName=Hk;function qk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ba(r,{select:t}),document.activeElement!==n)return}function Yk(e){const t=aC(e),n=BS(t,e),r=BS(t.reverse(),e);return[n,r]}function aC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function BS(e,t){for(const n of e)if(!Gk(n,{upTo:t}))return n}function Gk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Kk(e){return e instanceof HTMLInputElement&&"select"in e}function ba(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Kk(e)&&t&&e.select()}}var HS=Zk();function Zk(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=qS(e,t),e.unshift(t)},remove(t){e=qS(e,t),e[0]?.resume()}}}function qS(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Wk(e){return e.filter(t=>t.tagName!=="A")}var Qk="Portal",Fi=b.forwardRef((e,t)=>{const{container:n,...r}=e,[s,l]=b.useState(!1);gn(()=>l(!0),[]);const c=n||s&&globalThis?.document?.body;return c?Q1.createPortal(h.jsx(je.div,{...r,ref:t}),c):null});Fi.displayName=Qk;var Gm=0;function Bd(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??YS()),document.body.insertAdjacentElement("beforeend",e[1]??YS()),Gm++,()=>{Gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gm--}},[])}function YS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var oo=function(){return oo=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},oo.apply(this,arguments)};function sC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function Xk(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var sd="right-scroll-bar-position",id="width-before-scroll-bar",Jk="with-scroll-bars-hidden",ez="--removed-body-scroll-bar-size";function Km(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tz(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var nz=typeof window<"u"?b.useLayoutEffect:b.useEffect,GS=new WeakMap;function rz(e,t){var n=tz(null,function(r){return e.forEach(function(s){return Km(s,r)})});return nz(function(){var r=GS.get(n);if(r){var s=new Set(r),l=new Set(e),c=n.current;s.forEach(function(d){l.has(d)||Km(d,null)}),l.forEach(function(d){s.has(d)||Km(d,c)})}GS.set(n,e)},[e]),n}function oz(e){return e}function az(e,t){t===void 0&&(t=oz);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var f=function(){var v=c;c=[],v.forEach(l)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(v){c.push(v),m()},filter:function(v){return c=c.filter(v),n}}}};return s}function sz(e){e===void 0&&(e={});var t=az(null);return t.options=oo({async:!0,ssr:!1},e),t}var iC=function(e){var t=e.sideCar,n=sC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,oo({},n))};iC.isSideCarExport=!0;function iz(e,t){return e.useMedium(t),iC}var lC=sz(),Zm=function(){},Hd=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:Zm,onWheelCapture:Zm,onTouchMoveCapture:Zm}),s=r[0],l=r[1],c=e.forwardProps,d=e.children,f=e.className,m=e.removeScrollBar,v=e.enabled,p=e.shards,x=e.sideCar,S=e.noRelative,_=e.noIsolation,w=e.inert,C=e.allowPinchZoom,T=e.as,N=T===void 0?"div":T,M=e.gapMode,R=sC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=x,A=rz([n,t]),D=oo(oo({},R),s);return b.createElement(b.Fragment,null,v&&b.createElement(j,{sideCar:lC,removeScrollBar:m,shards:p,noRelative:S,noIsolation:_,inert:w,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:M}),c?b.cloneElement(b.Children.only(d),oo(oo({},D),{ref:A})):b.createElement(N,oo({},D,{className:f,ref:A}),d))});Hd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hd.classNames={fullWidth:id,zeroRight:sd};var lz=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function cz(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lz();return t&&e.setAttribute("nonce",t),e}function uz(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dz(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fz=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cz())&&(uz(t,n),dz(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hz=function(){var e=fz();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},cC=function(){var e=hz(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},mz={left:0,top:0,right:0,gap:0},Wm=function(e){return parseInt(e||"",10)||0},pz=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Wm(n),Wm(r),Wm(s)]},gz=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mz;var t=pz(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vz=cC(),Ni="data-scroll-locked",yz=function(e,t,n,r){var s=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
32
+ .`.concat(Jk,` {
33
+ overflow: hidden `).concat(r,`;
34
+ padding-right: `).concat(d,"px ").concat(r,`;
35
+ }
36
+ body[`).concat(Ni,`] {
37
+ overflow: hidden `).concat(r,`;
38
+ overscroll-behavior: contain;
39
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
40
+ padding-left: `.concat(s,`px;
41
+ padding-top: `).concat(l,`px;
42
+ padding-right: `).concat(c,`px;
43
+ margin-left:0;
44
+ margin-top:0;
45
+ margin-right: `).concat(d,"px ").concat(r,`;
46
+ `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
47
+ }
48
+
49
+ .`).concat(sd,` {
50
+ right: `).concat(d,"px ").concat(r,`;
51
+ }
52
+
53
+ .`).concat(id,` {
54
+ margin-right: `).concat(d,"px ").concat(r,`;
55
+ }
56
+
57
+ .`).concat(sd," .").concat(sd,` {
58
+ right: 0 `).concat(r,`;
59
+ }
60
+
61
+ .`).concat(id," .").concat(id,` {
62
+ margin-right: 0 `).concat(r,`;
63
+ }
64
+
65
+ body[`).concat(Ni,`] {
66
+ `).concat(ez,": ").concat(d,`px;
67
+ }
68
+ `)},KS=function(){var e=parseInt(document.body.getAttribute(Ni)||"0",10);return isFinite(e)?e:0},bz=function(){b.useEffect(function(){return document.body.setAttribute(Ni,(KS()+1).toString()),function(){var e=KS()-1;e<=0?document.body.removeAttribute(Ni):document.body.setAttribute(Ni,e.toString())}},[])},xz=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;bz();var l=b.useMemo(function(){return gz(s)},[s]);return b.createElement(vz,{styles:yz(l,!t,s,n?"":"!important")})},Bp=!1;if(typeof window<"u")try{var qu=Object.defineProperty({},"passive",{get:function(){return Bp=!0,!0}});window.addEventListener("test",qu,qu),window.removeEventListener("test",qu,qu)}catch{Bp=!1}var ui=Bp?{passive:!1}:!1,Sz=function(e){return e.tagName==="TEXTAREA"},uC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Sz(e)&&n[t]==="visible")},wz=function(e){return uC(e,"overflowY")},Cz=function(e){return uC(e,"overflowX")},ZS=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=dC(e,r);if(s){var l=fC(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},_z=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ez=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},dC=function(e,t){return e==="v"?wz(t):Cz(t)},fC=function(e,t){return e==="v"?_z(t):Ez(t)},Tz=function(e,t){return e==="h"&&t==="rtl"?-1:1},Nz=function(e,t,n,r,s){var l=Tz(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,f=t.contains(d),m=!1,v=c>0,p=0,x=0;do{if(!d)break;var S=fC(e,d),_=S[0],w=S[1],C=S[2],T=w-C-l*_;(_||T)&&dC(e,d)&&(p+=T,x+=_);var N=d.parentNode;d=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(v&&Math.abs(p)<1||!v&&Math.abs(x)<1)&&(m=!0),m},Yu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},WS=function(e){return[e.deltaX,e.deltaY]},QS=function(e){return e&&"current"in e?e.current:e},Rz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Mz=function(e){return`
69
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
70
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
71
+ `)},Oz=0,di=[];function Az(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),s=b.useState(Oz++)[0],l=b.useState(cC)[0],c=b.useRef(e);b.useEffect(function(){c.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=Xk([e.lockRef.current],(e.shards||[]).map(QS),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=b.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!c.current.allowPinchZoom;var T=Yu(w),N=n.current,M="deltaX"in w?w.deltaX:N[0]-T[0],R="deltaY"in w?w.deltaY:N[1]-T[1],j,A=w.target,D=Math.abs(M)>Math.abs(R)?"h":"v";if("touches"in w&&D==="h"&&A.type==="range")return!1;var L=window.getSelection(),B=L&&L.anchorNode,ne=B?B===A||B.contains(A):!1;if(ne)return!1;var J=ZS(D,A);if(!J)return!0;if(J?j=D:(j=D==="v"?"h":"v",J=ZS(D,A)),!J)return!1;if(!r.current&&"changedTouches"in w&&(M||R)&&(r.current=j),!j)return!0;var ie=r.current||j;return Nz(ie,C,w,ie==="h"?M:R)},[]),f=b.useCallback(function(w){var C=w;if(!(!di.length||di[di.length-1]!==l)){var T="deltaY"in C?WS(C):Yu(C),N=t.current.filter(function(j){return j.name===C.type&&(j.target===C.target||C.target===j.shadowParent)&&Rz(j.delta,T)})[0];if(N&&N.should){C.cancelable&&C.preventDefault();return}if(!N){var M=(c.current.shards||[]).map(QS).filter(Boolean).filter(function(j){return j.contains(C.target)}),R=M.length>0?d(C,M[0]):!c.current.noIsolation;R&&C.cancelable&&C.preventDefault()}}},[]),m=b.useCallback(function(w,C,T,N){var M={name:w,delta:C,target:T,should:N,shadowParent:jz(T)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(R){return R!==M})},1)},[]),v=b.useCallback(function(w){n.current=Yu(w),r.current=void 0},[]),p=b.useCallback(function(w){m(w.type,WS(w),w.target,d(w,e.lockRef.current))},[]),x=b.useCallback(function(w){m(w.type,Yu(w),w.target,d(w,e.lockRef.current))},[]);b.useEffect(function(){return di.push(l),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",f,ui),document.addEventListener("touchmove",f,ui),document.addEventListener("touchstart",v,ui),function(){di=di.filter(function(w){return w!==l}),document.removeEventListener("wheel",f,ui),document.removeEventListener("touchmove",f,ui),document.removeEventListener("touchstart",v,ui)}},[]);var S=e.removeScrollBar,_=e.inert;return b.createElement(b.Fragment,null,_?b.createElement(l,{styles:Mz(s)}):null,S?b.createElement(xz,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function jz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Dz=iz(lC,Az);var pc=b.forwardRef(function(e,t){return b.createElement(Hd,oo({},e,{ref:t,sideCar:Dz}))});pc.classNames=Hd.classNames;var kz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fi=new WeakMap,Gu=new WeakMap,Ku={},Qm=0,hC=function(e){return e&&(e.host||hC(e.parentNode))},zz=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hC(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Pz=function(e,t,n,r){var s=zz(t,Array.isArray(e)?e:[e]);Ku[n]||(Ku[n]=new WeakMap);var l=Ku[n],c=[],d=new Set,f=new Set(s),m=function(p){!p||d.has(p)||(d.add(p),m(p.parentNode))};s.forEach(m);var v=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(x){if(d.has(x))v(x);else try{var S=x.getAttribute(r),_=S!==null&&S!=="false",w=(fi.get(x)||0)+1,C=(l.get(x)||0)+1;fi.set(x,w),l.set(x,C),c.push(x),w===1&&_&&Gu.set(x,!0),C===1&&x.setAttribute(n,"true"),_||x.setAttribute(r,"true")}catch(T){console.error("aria-hidden: cannot operate on ",x,T)}})};return v(t),d.clear(),Qm++,function(){c.forEach(function(p){var x=fi.get(p)-1,S=l.get(p)-1;fi.set(p,x),l.set(p,S),x||(Gu.has(p)||p.removeAttribute(r),Gu.delete(p)),S||p.removeAttribute(n)}),Qm--,Qm||(fi=new WeakMap,fi=new WeakMap,Gu=new WeakMap,Ku={})}},qd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=kz(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),Pz(r,s,n,"aria-hidden")):function(){return null}};function Lz(e){const t=Fz(e),n=b.forwardRef((r,s)=>{const{children:l,...c}=r,d=b.Children.toArray(l),f=d.find(Vz);if(f){const m=f.props.children,v=d.map(p=>p===f?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:p);return h.jsx(t,{...c,ref:s,children:b.isValidElement(m)?b.cloneElement(m,void 0,v):null})}return h.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function Fz(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const c=Uz(s),d=$z(l,s.props);return s.type!==b.Fragment&&(d.ref=r?Dn(r,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Iz=Symbol("radix.slottable");function Vz(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iz}function $z(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function Uz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yd="Dialog",[mC]=Or(Yd),[Bz,Wr]=mC(Yd),pC=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=b.useRef(null),f=b.useRef(null),[m,v]=lo({prop:r,defaultProp:s??!1,onChange:l,caller:Yd});return h.jsx(Bz,{scope:t,triggerRef:d,contentRef:f,contentId:nn(),titleId:nn(),descriptionId:nn(),open:m,onOpenChange:v,onOpenToggle:b.useCallback(()=>v(p=>!p),[v]),modal:c,children:n})};pC.displayName=Yd;var gC="DialogTrigger",vC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wr(gC,n),l=Ze(t,s.triggerRef);return h.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Hg(s.open),...r,ref:l,onClick:Ce(e.onClick,s.onOpenToggle)})});vC.displayName=gC;var Ug="DialogPortal",[Hz,yC]=mC(Ug,{forceMount:void 0}),bC=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=Wr(Ug,t);return h.jsx(Hz,{scope:t,forceMount:n,children:b.Children.map(r,c=>h.jsx(vn,{present:n||l.open,children:h.jsx(Fi,{asChild:!0,container:s,children:c})}))})};bC.displayName=Ug;var yd="DialogOverlay",xC=b.forwardRef((e,t)=>{const n=yC(yd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=Wr(yd,e.__scopeDialog);return l.modal?h.jsx(vn,{present:r||l.open,children:h.jsx(Yz,{...s,ref:t})}):null});xC.displayName=yd;var qz=Lz("DialogOverlay.RemoveScroll"),Yz=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wr(yd,n);return h.jsx(pc,{as:qz,allowPinchZoom:!0,shards:[s.contentRef],children:h.jsx(je.div,{"data-state":Hg(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ds="DialogContent",SC=b.forwardRef((e,t)=>{const n=yC(ds,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=Wr(ds,e.__scopeDialog);return h.jsx(vn,{present:r||l.open,children:l.modal?h.jsx(Gz,{...s,ref:t}):h.jsx(Kz,{...s,ref:t})})});SC.displayName=ds;var Gz=b.forwardRef((e,t)=>{const n=Wr(ds,e.__scopeDialog),r=b.useRef(null),s=Ze(t,n.contentRef,r);return b.useEffect(()=>{const l=r.current;if(l)return qd(l)},[]),h.jsx(wC,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,l=>{l.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,l=>l.preventDefault())})}),Kz=b.forwardRef((e,t)=>{const n=Wr(ds,e.__scopeDialog),r=b.useRef(!1),s=b.useRef(!1);return h.jsx(wC,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(r.current||n.triggerRef.current?.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;n.triggerRef.current?.contains(c)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),wC=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,d=Wr(ds,n),f=b.useRef(null),m=Ze(t,f);return Bd(),h.jsxs(h.Fragment,{children:[h.jsx(mc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:h.jsx(Li,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Hg(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Zz,{titleId:d.titleId}),h.jsx(Qz,{contentRef:f,descriptionId:d.descriptionId})]})]})}),Bg="DialogTitle",CC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wr(Bg,n);return h.jsx(je.h2,{id:s.titleId,...r,ref:t})});CC.displayName=Bg;var _C="DialogDescription",EC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wr(_C,n);return h.jsx(je.p,{id:s.descriptionId,...r,ref:t})});EC.displayName=_C;var TC="DialogClose",NC=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Wr(TC,n);return h.jsx(je.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>s.onOpenChange(!1))})});NC.displayName=TC;function Hg(e){return e?"open":"closed"}var RC="DialogTitleWarning",[fY,MC]=xk(RC,{contentName:ds,titleName:Bg,docsSlug:"dialog"}),Zz=({titleId:e})=>{const t=MC(RC),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
72
+
73
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
74
+
75
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Wz="DialogDescriptionWarning",Qz=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${MC(Wz).contentName}}.`;return b.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},qg=pC,Xz=vC,Yg=bC,Gg=xC,Kg=SC,OC=CC,AC=EC,Gd=NC;function Zg(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Wg(e){const[t,n]=b.useState(void 0);return gn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,d;if("borderBoxSize"in l){const f=l.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Kd="Checkbox",[Jz]=Or(Kd),[e4,Qg]=Jz(Kd);function t4(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:l,form:c,name:d,onCheckedChange:f,required:m,value:v="on",internal_do_not_use_render:p}=e,[x,S]=lo({prop:n,defaultProp:s??!1,onChange:f,caller:Kd}),[_,w]=b.useState(null),[C,T]=b.useState(null),N=b.useRef(!1),M=_?!!c||!!_.closest("form"):!0,R={checked:x,disabled:l,setChecked:S,control:_,setControl:w,name:d,form:c,value:v,hasConsumerStoppedPropagationRef:N,required:m,defaultChecked:Sa(s)?!1:s,isFormControl:M,bubbleInput:C,setBubbleInput:T};return h.jsx(e4,{scope:t,...R,children:n4(p)?p(R):r})}var jC="CheckboxTrigger",DC=b.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:l,value:c,disabled:d,checked:f,required:m,setControl:v,setChecked:p,hasConsumerStoppedPropagationRef:x,isFormControl:S,bubbleInput:_}=Qg(jC,e),w=Ze(s,v),C=b.useRef(f);return b.useEffect(()=>{const T=l?.form;if(T){const N=()=>p(C.current);return T.addEventListener("reset",N),()=>T.removeEventListener("reset",N)}},[l,p]),h.jsx(je.button,{type:"button",role:"checkbox","aria-checked":Sa(f)?"mixed":f,"aria-required":m,"data-state":IC(f),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:w,onKeyDown:Ce(t,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:Ce(n,T=>{p(N=>Sa(N)?!0:!N),_&&S&&(x.current=T.isPropagationStopped(),x.current||T.stopPropagation())})})});DC.displayName=jC;var kC=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:f,onCheckedChange:m,form:v,...p}=e;return h.jsx(t4,{__scopeCheckbox:n,checked:s,defaultChecked:l,disabled:d,required:c,onCheckedChange:m,name:r,form:v,value:f,internal_do_not_use_render:({isFormControl:x})=>h.jsxs(h.Fragment,{children:[h.jsx(DC,{...p,ref:t,__scopeCheckbox:n}),x&&h.jsx(FC,{__scopeCheckbox:n})]})})});kC.displayName=Kd;var zC="CheckboxIndicator",PC=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,l=Qg(zC,n);return h.jsx(vn,{present:r||Sa(l.checked)||l.checked===!0,children:h.jsx(je.span,{"data-state":IC(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});PC.displayName=zC;var LC="CheckboxBubbleInput",FC=b.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:l,defaultChecked:c,required:d,disabled:f,name:m,value:v,form:p,bubbleInput:x,setBubbleInput:S}=Qg(LC,e),_=Ze(n,S),w=Zg(l),C=Wg(r);b.useEffect(()=>{const N=x;if(!N)return;const M=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(M,"checked").set,A=!s.current;if(w!==l&&j){const D=new Event("click",{bubbles:A});N.indeterminate=Sa(l),j.call(N,Sa(l)?!1:l),N.dispatchEvent(D)}},[x,w,l,s]);const T=b.useRef(Sa(l)?!1:l);return h.jsx(je.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??T.current,required:d,disabled:f,name:m,value:v,form:p,...t,tabIndex:-1,ref:_,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});FC.displayName=LC;function n4(e){return typeof e=="function"}function Sa(e){return e==="indeterminate"}function IC(e){return Sa(e)?"indeterminate":e?"checked":"unchecked"}const r4=["top","right","bottom","left"],_a=Math.min,lr=Math.max,bd=Math.round,Zu=Math.floor,io=e=>({x:e,y:e}),o4={left:"right",right:"left",bottom:"top",top:"bottom"},a4={start:"end",end:"start"};function Hp(e,t,n){return lr(e,_a(t,n))}function $o(e,t){return typeof e=="function"?e(t):e}function Uo(e){return e.split("-")[0]}function Ii(e){return e.split("-")[1]}function Xg(e){return e==="x"?"y":"x"}function Jg(e){return e==="y"?"height":"width"}const s4=new Set(["top","bottom"]);function ao(e){return s4.has(Uo(e))?"y":"x"}function ev(e){return Xg(ao(e))}function i4(e,t,n){n===void 0&&(n=!1);const r=Ii(e),s=ev(e),l=Jg(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=xd(c)),[c,xd(c)]}function l4(e){const t=xd(e);return[qp(e),t,qp(t)]}function qp(e){return e.replace(/start|end/g,t=>a4[t])}const XS=["left","right"],JS=["right","left"],c4=["top","bottom"],u4=["bottom","top"];function d4(e,t,n){switch(e){case"top":case"bottom":return n?t?JS:XS:t?XS:JS;case"left":case"right":return t?c4:u4;default:return[]}}function f4(e,t,n,r){const s=Ii(e);let l=d4(Uo(e),n==="start",r);return s&&(l=l.map(c=>c+"-"+s),t&&(l=l.concat(l.map(qp)))),l}function xd(e){return e.replace(/left|right|bottom|top/g,t=>o4[t])}function h4(e){return{top:0,right:0,bottom:0,left:0,...e}}function VC(e){return typeof e!="number"?h4(e):{top:e,right:e,bottom:e,left:e}}function Sd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function ew(e,t,n){let{reference:r,floating:s}=e;const l=ao(t),c=ev(t),d=Jg(c),f=Uo(t),m=l==="y",v=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,x=r[d]/2-s[d]/2;let S;switch(f){case"top":S={x:v,y:r.y-s.height};break;case"bottom":S={x:v,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y:p};break;case"left":S={x:r.x-s.width,y:p};break;default:S={x:r.x,y:r.y}}switch(Ii(t)){case"start":S[c]-=x*(n&&m?-1:1);break;case"end":S[c]+=x*(n&&m?-1:1);break}return S}const m4=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:v,y:p}=ew(m,r,f),x=r,S={},_=0;for(let w=0;w<d.length;w++){const{name:C,fn:T}=d[w],{x:N,y:M,data:R,reset:j}=await T({x:v,y:p,initialPlacement:r,placement:x,strategy:s,middlewareData:S,rects:m,platform:c,elements:{reference:e,floating:t}});v=N??v,p=M??p,S={...S,[C]:{...S[C],...R}},j&&_<=50&&(_++,typeof j=="object"&&(j.placement&&(x=j.placement),j.rects&&(m=j.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):j.rects),{x:v,y:p}=ew(m,x,f)),w=-1)}return{x:v,y:p,placement:x,strategy:s,middlewareData:S}};async function rc(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:v="viewport",elementContext:p="floating",altBoundary:x=!1,padding:S=0}=$o(t,e),_=VC(S),C=d[x?p==="floating"?"reference":"floating":p],T=Sd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:v,strategy:f})),N=p==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),R=await(l.isElement==null?void 0:l.isElement(M))?await(l.getScale==null?void 0:l.getScale(M))||{x:1,y:1}:{x:1,y:1},j=Sd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:N,offsetParent:M,strategy:f}):N);return{top:(T.top-j.top+_.top)/R.y,bottom:(j.bottom-T.bottom+_.bottom)/R.y,left:(T.left-j.left+_.left)/R.x,right:(j.right-T.right+_.right)/R.x}}const p4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:m,padding:v=0}=$o(e,t)||{};if(m==null)return{};const p=VC(v),x={x:n,y:r},S=ev(s),_=Jg(S),w=await c.getDimensions(m),C=S==="y",T=C?"top":"left",N=C?"bottom":"right",M=C?"clientHeight":"clientWidth",R=l.reference[_]+l.reference[S]-x[S]-l.floating[_],j=x[S]-l.reference[S],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let D=A?A[M]:0;(!D||!await(c.isElement==null?void 0:c.isElement(A)))&&(D=d.floating[M]||l.floating[_]);const L=R/2-j/2,B=D/2-w[_]/2-1,ne=_a(p[T],B),J=_a(p[N],B),ie=ne,ue=D-w[_]-J,ae=D/2-w[_]/2+L,pe=Hp(ie,ae,ue),k=!f.arrow&&Ii(s)!=null&&ae!==pe&&l.reference[_]/2-(ae<ie?ne:J)-w[_]/2<0,Y=k?ae<ie?ae-ie:ae-ue:0;return{[S]:x[S]+Y,data:{[S]:pe,centerOffset:ae-pe-Y,...k&&{alignmentOffset:Y}},reset:k}}}),g4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:c,initialPlacement:d,platform:f,elements:m}=t,{mainAxis:v=!0,crossAxis:p=!0,fallbackPlacements:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:w=!0,...C}=$o(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const T=Uo(s),N=ao(d),M=Uo(d)===d,R=await(f.isRTL==null?void 0:f.isRTL(m.floating)),j=x||(M||!w?[xd(d)]:l4(d)),A=_!=="none";!x&&A&&j.push(...f4(d,w,_,R));const D=[d,...j],L=await rc(t,C),B=[];let ne=((r=l.flip)==null?void 0:r.overflows)||[];if(v&&B.push(L[T]),p){const ae=i4(s,c,R);B.push(L[ae[0]],L[ae[1]])}if(ne=[...ne,{placement:s,overflows:B}],!B.every(ae=>ae<=0)){var J,ie;const ae=(((J=l.flip)==null?void 0:J.index)||0)+1,pe=D[ae];if(pe&&(!(p==="alignment"?N!==ao(pe):!1)||ne.every(H=>ao(H.placement)===N?H.overflows[0]>0:!0)))return{data:{index:ae,overflows:ne},reset:{placement:pe}};let k=(ie=ne.filter(Y=>Y.overflows[0]<=0).sort((Y,H)=>Y.overflows[1]-H.overflows[1])[0])==null?void 0:ie.placement;if(!k)switch(S){case"bestFit":{var ue;const Y=(ue=ne.filter(H=>{if(A){const ee=ao(H.placement);return ee===N||ee==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ee=>ee>0).reduce((ee,ve)=>ee+ve,0)]).sort((H,ee)=>H[1]-ee[1])[0])==null?void 0:ue[0];Y&&(k=Y);break}case"initialPlacement":k=d;break}if(s!==k)return{reset:{placement:k}}}return{}}}};function tw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nw(e){return r4.some(t=>e[t]>=0)}const v4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=$o(e,t);switch(r){case"referenceHidden":{const l=await rc(t,{...s,elementContext:"reference"}),c=tw(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:nw(c)}}}case"escaped":{const l=await rc(t,{...s,altBoundary:!0}),c=tw(l,n.floating);return{data:{escapedOffsets:c,escaped:nw(c)}}}default:return{}}}}},$C=new Set(["left","top"]);async function y4(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=Uo(n),d=Ii(n),f=ao(n)==="y",m=$C.has(c)?-1:1,v=l&&f?-1:1,p=$o(t,e);let{mainAxis:x,crossAxis:S,alignmentAxis:_}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return d&&typeof _=="number"&&(S=d==="end"?_*-1:_),f?{x:S*v,y:x*m}:{x:x*m,y:S*v}}const b4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:c,middlewareData:d}=t,f=await y4(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:s+f.x,y:l+f.y,data:{...f,placement:c}}}}},x4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:T,y:N}=C;return{x:T,y:N}}},...f}=$o(e,t),m={x:n,y:r},v=await rc(t,f),p=ao(Uo(s)),x=Xg(p);let S=m[x],_=m[p];if(l){const C=x==="y"?"top":"left",T=x==="y"?"bottom":"right",N=S+v[C],M=S-v[T];S=Hp(N,S,M)}if(c){const C=p==="y"?"top":"left",T=p==="y"?"bottom":"right",N=_+v[C],M=_-v[T];_=Hp(N,_,M)}const w=d.fn({...t,[x]:S,[p]:_});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[x]:l,[p]:c}}}}}},S4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=$o(e,t),v={x:n,y:r},p=ao(s),x=Xg(p);let S=v[x],_=v[p];const w=$o(d,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const M=x==="y"?"height":"width",R=l.reference[x]-l.floating[M]+C.mainAxis,j=l.reference[x]+l.reference[M]-C.mainAxis;S<R?S=R:S>j&&(S=j)}if(m){var T,N;const M=x==="y"?"width":"height",R=$C.has(Uo(s)),j=l.reference[p]-l.floating[M]+(R&&((T=c.offset)==null?void 0:T[p])||0)+(R?0:C.crossAxis),A=l.reference[p]+l.reference[M]+(R?0:((N=c.offset)==null?void 0:N[p])||0)-(R?C.crossAxis:0);_<j?_=j:_>A&&(_=A)}return{[x]:S,[p]:_}}}},w4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...m}=$o(e,t),v=await rc(t,m),p=Uo(s),x=Ii(s),S=ao(s)==="y",{width:_,height:w}=l.floating;let C,T;p==="top"||p==="bottom"?(C=p,T=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(T=p,C=x==="end"?"top":"bottom");const N=w-v.top-v.bottom,M=_-v.left-v.right,R=_a(w-v[C],N),j=_a(_-v[T],M),A=!t.middlewareData.shift;let D=R,L=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=M),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=N),A&&!x){const ne=lr(v.left,0),J=lr(v.right,0),ie=lr(v.top,0),ue=lr(v.bottom,0);S?L=_-2*(ne!==0||J!==0?ne+J:lr(v.left,v.right)):D=w-2*(ie!==0||ue!==0?ie+ue:lr(v.top,v.bottom))}await f({...t,availableWidth:L,availableHeight:D});const B=await c.getDimensions(d.floating);return _!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function Zd(){return typeof window<"u"}function Vi(e){return UC(e)?(e.nodeName||"").toLowerCase():"#document"}function ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fo(e){var t;return(t=(UC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function UC(e){return Zd()?e instanceof Node||e instanceof ur(e).Node:!1}function Gr(e){return Zd()?e instanceof Element||e instanceof ur(e).Element:!1}function co(e){return Zd()?e instanceof HTMLElement||e instanceof ur(e).HTMLElement:!1}function rw(e){return!Zd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ur(e).ShadowRoot}const C4=new Set(["inline","contents"]);function gc(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Kr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!C4.has(s)}const _4=new Set(["table","td","th"]);function E4(e){return _4.has(Vi(e))}const T4=[":popover-open",":modal"];function Wd(e){return T4.some(t=>{try{return e.matches(t)}catch{return!1}})}const N4=["transform","translate","scale","rotate","perspective"],R4=["transform","translate","scale","rotate","perspective","filter"],M4=["paint","layout","strict","content"];function tv(e){const t=nv(),n=Gr(e)?Kr(e):e;return N4.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||R4.some(r=>(n.willChange||"").includes(r))||M4.some(r=>(n.contain||"").includes(r))}function O4(e){let t=Ea(e);for(;co(t)&&!Mi(t);){if(tv(t))return t;if(Wd(t))return null;t=Ea(t)}return null}function nv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const A4=new Set(["html","body","#document"]);function Mi(e){return A4.has(Vi(e))}function Kr(e){return ur(e).getComputedStyle(e)}function Qd(e){return Gr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ea(e){if(Vi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rw(e)&&e.host||fo(e);return rw(t)?t.host:t}function BC(e){const t=Ea(e);return Mi(t)?e.ownerDocument?e.ownerDocument.body:e.body:co(t)&&gc(t)?t:BC(t)}function oc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=BC(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),c=ur(s);if(l){const d=Yp(c);return t.concat(c,c.visualViewport||[],gc(s)?s:[],d&&n?oc(d):[])}return t.concat(s,oc(s,[],n))}function Yp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HC(e){const t=Kr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=co(e),l=s?e.offsetWidth:n,c=s?e.offsetHeight:r,d=bd(n)!==l||bd(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function rv(e){return Gr(e)?e:e.contextElement}function Ri(e){const t=rv(e);if(!co(t))return io(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=HC(t);let c=(l?bd(n.width):n.width)/r,d=(l?bd(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const j4=io(0);function qC(e){const t=ur(e);return!nv()||!t.visualViewport?j4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function D4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ur(e)?!1:t}function fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=rv(e);let c=io(1);t&&(r?Gr(r)&&(c=Ri(r)):c=Ri(e));const d=D4(l,n,r)?qC(l):io(0);let f=(s.left+d.x)/c.x,m=(s.top+d.y)/c.y,v=s.width/c.x,p=s.height/c.y;if(l){const x=ur(l),S=r&&Gr(r)?ur(r):r;let _=x,w=Yp(_);for(;w&&r&&S!==_;){const C=Ri(w),T=w.getBoundingClientRect(),N=Kr(w),M=T.left+(w.clientLeft+parseFloat(N.paddingLeft))*C.x,R=T.top+(w.clientTop+parseFloat(N.paddingTop))*C.y;f*=C.x,m*=C.y,v*=C.x,p*=C.y,f+=M,m+=R,_=ur(w),w=Yp(_)}}return Sd({width:v,height:p,x:f,y:m})}function Xd(e,t){const n=Qd(e).scrollLeft;return t?t.left+n:fs(fo(e)).left+n}function YC(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Xd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function k4(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",c=fo(r),d=t?Wd(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},m=io(1);const v=io(0),p=co(r);if((p||!p&&!l)&&((Vi(r)!=="body"||gc(c))&&(f=Qd(r)),co(r))){const S=fs(r);m=Ri(r),v.x=S.x+r.clientLeft,v.y=S.y+r.clientTop}const x=c&&!p&&!l?YC(c,f):io(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+v.x+x.x,y:n.y*m.y-f.scrollTop*m.y+v.y+x.y}}function z4(e){return Array.from(e.getClientRects())}function P4(e){const t=fo(e),n=Qd(e),r=e.ownerDocument.body,s=lr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=lr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Xd(e);const d=-n.scrollTop;return Kr(r).direction==="rtl"&&(c+=lr(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:c,y:d}}const ow=25;function L4(e,t){const n=ur(e),r=fo(e),s=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(s){l=s.width,c=s.height;const v=nv();(!v||v&&t==="fixed")&&(d=s.offsetLeft,f=s.offsetTop)}const m=Xd(r);if(m<=0){const v=r.ownerDocument,p=v.body,x=getComputedStyle(p),S=v.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,_=Math.abs(r.clientWidth-p.clientWidth-S);_<=ow&&(l-=_)}else m<=ow&&(l+=m);return{width:l,height:c,x:d,y:f}}const F4=new Set(["absolute","fixed"]);function I4(e,t){const n=fs(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=co(e)?Ri(e):io(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=s*l.x,m=r*l.y;return{width:c,height:d,x:f,y:m}}function aw(e,t,n){let r;if(t==="viewport")r=L4(e,n);else if(t==="document")r=P4(fo(e));else if(Gr(t))r=I4(t,n);else{const s=qC(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Sd(r)}function GC(e,t){const n=Ea(e);return n===t||!Gr(n)||Mi(n)?!1:Kr(n).position==="fixed"||GC(n,t)}function V4(e,t){const n=t.get(e);if(n)return n;let r=oc(e,[],!1).filter(d=>Gr(d)&&Vi(d)!=="body"),s=null;const l=Kr(e).position==="fixed";let c=l?Ea(e):e;for(;Gr(c)&&!Mi(c);){const d=Kr(c),f=tv(c);!f&&d.position==="fixed"&&(s=null),(l?!f&&!s:!f&&d.position==="static"&&!!s&&F4.has(s.position)||gc(c)&&!f&&GC(e,c))?r=r.filter(v=>v!==c):s=d,c=Ea(c)}return t.set(e,r),r}function $4(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?Wd(t)?[]:V4(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((m,v)=>{const p=aw(t,v,s);return m.top=lr(p.top,m.top),m.right=_a(p.right,m.right),m.bottom=_a(p.bottom,m.bottom),m.left=lr(p.left,m.left),m},aw(t,d,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function U4(e){const{width:t,height:n}=HC(e);return{width:t,height:n}}function B4(e,t,n){const r=co(t),s=fo(t),l=n==="fixed",c=fs(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=io(0);function m(){f.x=Xd(s)}if(r||!r&&!l)if((Vi(t)!=="body"||gc(s))&&(d=Qd(t)),r){const S=fs(t,!0,l,t);f.x=S.x+t.clientLeft,f.y=S.y+t.clientTop}else s&&m();l&&!r&&s&&m();const v=s&&!r&&!l?YC(s,d):io(0),p=c.left+d.scrollLeft-f.x-v.x,x=c.top+d.scrollTop-f.y-v.y;return{x:p,y:x,width:c.width,height:c.height}}function Xm(e){return Kr(e).position==="static"}function sw(e,t){if(!co(e)||Kr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return fo(e)===n&&(n=n.ownerDocument.body),n}function KC(e,t){const n=ur(e);if(Wd(e))return n;if(!co(e)){let s=Ea(e);for(;s&&!Mi(s);){if(Gr(s)&&!Xm(s))return s;s=Ea(s)}return n}let r=sw(e,t);for(;r&&E4(r)&&Xm(r);)r=sw(r,t);return r&&Mi(r)&&Xm(r)&&!tv(r)?n:r||O4(e)||n}const H4=async function(e){const t=this.getOffsetParent||KC,n=this.getDimensions,r=await n(e.floating);return{reference:B4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function q4(e){return Kr(e).direction==="rtl"}const Y4={convertOffsetParentRelativeRectToViewportRelativeRect:k4,getDocumentElement:fo,getClippingRect:$4,getOffsetParent:KC,getElementRects:H4,getClientRects:z4,getDimensions:U4,getScale:Ri,isElement:Gr,isRTL:q4};function ZC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function G4(e,t){let n=null,r;const s=fo(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),l();const m=e.getBoundingClientRect(),{left:v,top:p,width:x,height:S}=m;if(d||t(),!x||!S)return;const _=Zu(p),w=Zu(s.clientWidth-(v+x)),C=Zu(s.clientHeight-(p+S)),T=Zu(v),M={rootMargin:-_+"px "+-w+"px "+-C+"px "+-T+"px",threshold:lr(0,_a(1,f))||1};let R=!0;function j(A){const D=A[0].intersectionRatio;if(D!==f){if(!R)return c();D?c(!1,D):r=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!ZC(m,e.getBoundingClientRect())&&c(),R=!1}try{n=new IntersectionObserver(j,{...M,root:s.ownerDocument})}catch{n=new IntersectionObserver(j,M)}n.observe(e)}return c(!0),l}function K4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,m=rv(e),v=s||l?[...m?oc(m):[],...oc(t)]:[];v.forEach(T=>{s&&T.addEventListener("scroll",n,{passive:!0}),l&&T.addEventListener("resize",n)});const p=m&&d?G4(m,n):null;let x=-1,S=null;c&&(S=new ResizeObserver(T=>{let[N]=T;N&&N.target===m&&S&&(S.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var M;(M=S)==null||M.observe(t)})),n()}),m&&!f&&S.observe(m),S.observe(t));let _,w=f?fs(e):null;f&&C();function C(){const T=fs(e);w&&!ZC(w,T)&&n(),w=T,_=requestAnimationFrame(C)}return n(),()=>{var T;v.forEach(N=>{s&&N.removeEventListener("scroll",n),l&&N.removeEventListener("resize",n)}),p?.(),(T=S)==null||T.disconnect(),S=null,f&&cancelAnimationFrame(_)}}const Z4=b4,W4=x4,Q4=g4,X4=w4,J4=v4,iw=p4,e5=S4,t5=(e,t,n)=>{const r=new Map,s={platform:Y4,...n},l={...s.platform,_c:r};return m4(e,t,{...s,platform:l})};var n5=typeof document<"u",r5=function(){},ld=n5?b.useLayoutEffect:r5;function wd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!wd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!wd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function WC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lw(e,t){const n=WC(e);return Math.round(t*n)/n}function Jm(e){const t=b.useRef(e);return ld(()=>{t.current=e}),t}function o5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:m}=e,[v,p]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,S]=b.useState(r);wd(x,r)||S(r);const[_,w]=b.useState(null),[C,T]=b.useState(null),N=b.useCallback(H=>{H!==A.current&&(A.current=H,w(H))},[]),M=b.useCallback(H=>{H!==D.current&&(D.current=H,T(H))},[]),R=l||_,j=c||C,A=b.useRef(null),D=b.useRef(null),L=b.useRef(v),B=f!=null,ne=Jm(f),J=Jm(s),ie=Jm(m),ue=b.useCallback(()=>{if(!A.current||!D.current)return;const H={placement:t,strategy:n,middleware:x};J.current&&(H.platform=J.current),t5(A.current,D.current,H).then(ee=>{const ve={...ee,isPositioned:ie.current!==!1};ae.current&&!wd(L.current,ve)&&(L.current=ve,Pi.flushSync(()=>{p(ve)}))})},[x,t,n,J,ie]);ld(()=>{m===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[m]);const ae=b.useRef(!1);ld(()=>(ae.current=!0,()=>{ae.current=!1}),[]),ld(()=>{if(R&&(A.current=R),j&&(D.current=j),R&&j){if(ne.current)return ne.current(R,j,ue);ue()}},[R,j,ue,ne,B]);const pe=b.useMemo(()=>({reference:A,floating:D,setReference:N,setFloating:M}),[N,M]),k=b.useMemo(()=>({reference:R,floating:j}),[R,j]),Y=b.useMemo(()=>{const H={position:n,left:0,top:0};if(!k.floating)return H;const ee=lw(k.floating,v.x),ve=lw(k.floating,v.y);return d?{...H,transform:"translate("+ee+"px, "+ve+"px)",...WC(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:ve}},[n,d,k.floating,v.x,v.y]);return b.useMemo(()=>({...v,update:ue,refs:pe,elements:k,floatingStyles:Y}),[v,ue,pe,k,Y])}const a5=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?iw({element:r.current,padding:s}).fn(n):{}:r?iw({element:r,padding:s}).fn(n):{}}}},s5=(e,t)=>({...Z4(e),options:[e,t]}),i5=(e,t)=>({...W4(e),options:[e,t]}),l5=(e,t)=>({...e5(e),options:[e,t]}),c5=(e,t)=>({...Q4(e),options:[e,t]}),u5=(e,t)=>({...X4(e),options:[e,t]}),d5=(e,t)=>({...J4(e),options:[e,t]}),f5=(e,t)=>({...a5(e),options:[e,t]});var h5="Arrow",QC=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return h.jsx(je.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});QC.displayName=h5;var m5=QC,ov="Popper",[XC,Oa]=Or(ov),[p5,JC]=XC(ov),e_=e=>{const{__scopePopper:t,children:n}=e,[r,s]=b.useState(null);return h.jsx(p5,{scope:t,anchor:r,onAnchorChange:s,children:n})};e_.displayName=ov;var t_="PopperAnchor",n_=b.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=JC(t_,n),c=b.useRef(null),d=Ze(t,c),f=b.useRef(null);return b.useEffect(()=>{const m=f.current;f.current=r?.current||c.current,m!==f.current&&l.onAnchorChange(f.current)}),r?null:h.jsx(je.div,{...s,ref:d})});n_.displayName=t_;var av="PopperContent",[g5,v5]=XC(av),r_=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:v=0,sticky:p="partial",hideWhenDetached:x=!1,updatePositionStrategy:S="optimized",onPlaced:_,...w}=e,C=JC(av,n),[T,N]=b.useState(null),M=Ze(t,X=>N(X)),[R,j]=b.useState(null),A=Wg(R),D=A?.width??0,L=A?.height??0,B=r+(l!=="center"?"-"+l:""),ne=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},J=Array.isArray(m)?m:[m],ie=J.length>0,ue={padding:ne,boundary:J.filter(b5),altBoundary:ie},{refs:ae,floatingStyles:pe,placement:k,isPositioned:Y,middlewareData:H}=o5({strategy:"fixed",placement:B,whileElementsMounted:(...X)=>K4(...X,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[s5({mainAxis:s+L,alignmentAxis:c}),f&&i5({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?l5():void 0,...ue}),f&&c5({...ue}),u5({...ue,apply:({elements:X,rects:ye,availableWidth:_e,availableHeight:De})=>{const{width:qe,height:Ge}=ye.reference,Lt=X.floating.style;Lt.setProperty("--radix-popper-available-width",`${_e}px`),Lt.setProperty("--radix-popper-available-height",`${De}px`),Lt.setProperty("--radix-popper-anchor-width",`${qe}px`),Lt.setProperty("--radix-popper-anchor-height",`${Ge}px`)}}),R&&f5({element:R,padding:d}),x5({arrowWidth:D,arrowHeight:L}),x&&d5({strategy:"referenceHidden",...ue})]}),[ee,ve]=s_(k),z=cn(_);gn(()=>{Y&&z?.()},[Y,z]);const P=H.arrow?.x,U=H.arrow?.y,W=H.arrow?.centerOffset!==0,[oe,he]=b.useState();return gn(()=>{T&&he(window.getComputedStyle(T).zIndex)},[T]),h.jsx("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...pe,transform:Y?pe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(g5,{scope:n,placedSide:ee,onArrowChange:j,arrowX:P,arrowY:U,shouldHideArrow:W,children:h.jsx(je.div,{"data-side":ee,"data-align":ve,...w,ref:M,style:{...w.style,animation:Y?void 0:"none"}})})})});r_.displayName=av;var o_="PopperArrow",y5={top:"bottom",right:"left",bottom:"top",left:"right"},a_=b.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=v5(o_,r),c=y5[l.placedSide];return h.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:h.jsx(m5,{...s,ref:n,style:{...s.style,display:"block"}})})});a_.displayName=o_;function b5(e){return e!==null}var x5=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,c=s.arrow?.centerOffset!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,v]=s_(n),p={start:"0%",center:"50%",end:"100%"}[v],x=(s.arrow?.x??0)+d/2,S=(s.arrow?.y??0)+f/2;let _="",w="";return m==="bottom"?(_=c?p:`${x}px`,w=`${-f}px`):m==="top"?(_=c?p:`${x}px`,w=`${r.floating.height+f}px`):m==="right"?(_=`${-f}px`,w=c?p:`${S}px`):m==="left"&&(_=`${r.floating.width+f}px`,w=c?p:`${S}px`),{data:{x:_,y:w}}}});function s_(e){const[t,n="center"]=e.split("-");return[t,n]}var vc=e_,yc=n_,Jd=r_,ef=a_,ep="rovingFocusGroup.onEntryFocus",S5={bubbles:!1,cancelable:!0},bc="RovingFocusGroup",[Gp,i_,w5]=$g(bc),[C5,l_]=Or(bc,[w5]),[_5,E5]=C5(bc),c_=b.forwardRef((e,t)=>h.jsx(Gp.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Gp.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(T5,{...e,ref:t})})}));c_.displayName=bc;var T5=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:v=!1,...p}=e,x=b.useRef(null),S=Ze(t,x),_=Ud(l),[w,C]=lo({prop:c,defaultProp:d??null,onChange:f,caller:bc}),[T,N]=b.useState(!1),M=cn(m),R=i_(n),j=b.useRef(!1),[A,D]=b.useState(0);return b.useEffect(()=>{const L=x.current;if(L)return L.addEventListener(ep,M),()=>L.removeEventListener(ep,M)},[M]),h.jsx(_5,{scope:n,orientation:r,dir:_,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(L=>C(L),[C]),onItemShiftTab:b.useCallback(()=>N(!0),[]),onFocusableItemAdd:b.useCallback(()=>D(L=>L+1),[]),onFocusableItemRemove:b.useCallback(()=>D(L=>L-1),[]),children:h.jsx(je.div,{tabIndex:T||A===0?-1:0,"data-orientation":r,...p,ref:S,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{j.current=!0}),onFocus:Ce(e.onFocus,L=>{const B=!j.current;if(L.target===L.currentTarget&&B&&!T){const ne=new CustomEvent(ep,S5);if(L.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const J=R().filter(k=>k.focusable),ie=J.find(k=>k.active),ue=J.find(k=>k.id===w),pe=[ie,ue,...J].filter(Boolean).map(k=>k.ref.current);f_(pe,v)}}j.current=!1}),onBlur:Ce(e.onBlur,()=>N(!1))})})}),u_="RovingFocusGroupItem",d_=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:c,...d}=e,f=nn(),m=l||f,v=E5(u_,n),p=v.currentTabStopId===m,x=i_(n),{onFocusableItemAdd:S,onFocusableItemRemove:_,currentTabStopId:w}=v;return b.useEffect(()=>{if(r)return S(),()=>_()},[r,S,_]),h.jsx(Gp.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:h.jsx(je.span,{tabIndex:p?0:-1,"data-orientation":v.orientation,...d,ref:t,onMouseDown:Ce(e.onMouseDown,C=>{r?v.onItemFocus(m):C.preventDefault()}),onFocus:Ce(e.onFocus,()=>v.onItemFocus(m)),onKeyDown:Ce(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){v.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const T=M5(C,v.orientation,v.dir);if(T!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let M=x().filter(R=>R.focusable).map(R=>R.ref.current);if(T==="last")M.reverse();else if(T==="prev"||T==="next"){T==="prev"&&M.reverse();const R=M.indexOf(C.currentTarget);M=v.loop?O5(M,R+1):M.slice(R+1)}setTimeout(()=>f_(M))}}),children:typeof c=="function"?c({isCurrentTabStop:p,hasTabStop:w!=null}):c})})});d_.displayName=u_;var N5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function M5(e,t,n){const r=R5(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return N5[r]}function f_(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function O5(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var A5=c_,j5=d_;function D5(e){const t=k5(e),n=b.forwardRef((r,s)=>{const{children:l,...c}=r,d=b.Children.toArray(l),f=d.find(P5);if(f){const m=f.props.children,v=d.map(p=>p===f?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:p);return h.jsx(t,{...c,ref:s,children:b.isValidElement(m)?b.cloneElement(m,void 0,v):null})}return h.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function k5(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const c=F5(s),d=L5(l,s.props);return s.type!==b.Fragment&&(d.ref=r?Dn(r,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var z5=Symbol("radix.slottable");function P5(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===z5}function L5(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function F5(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Kp=["Enter"," "],I5=["ArrowDown","PageUp","Home"],h_=["ArrowUp","PageDown","End"],V5=[...I5,...h_],$5={ltr:[...Kp,"ArrowRight"],rtl:[...Kp,"ArrowLeft"]},U5={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xc="Menu",[ac,B5,H5]=$g(xc),[xs,m_]=Or(xc,[H5,Oa,l_]),Sc=Oa(),p_=l_(),[g_,Aa]=xs(xc),[q5,wc]=xs(xc),v_=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:c=!0}=e,d=Sc(t),[f,m]=b.useState(null),v=b.useRef(!1),p=cn(l),x=Ud(s);return b.useEffect(()=>{const S=()=>{v.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>v.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),h.jsx(vc,{...d,children:h.jsx(g_,{scope:t,open:n,onOpenChange:p,content:f,onContentChange:m,children:h.jsx(q5,{scope:t,onClose:b.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:v,dir:x,modal:c,children:r})})})};v_.displayName=xc;var Y5="MenuAnchor",sv=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sc(n);return h.jsx(yc,{...s,...r,ref:t})});sv.displayName=Y5;var iv="MenuPortal",[G5,y_]=xs(iv,{forceMount:void 0}),b_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=Aa(iv,t);return h.jsx(G5,{scope:t,forceMount:n,children:h.jsx(vn,{present:n||l.open,children:h.jsx(Fi,{asChild:!0,container:s,children:r})})})};b_.displayName=iv;var Rr="MenuContent",[K5,lv]=xs(Rr),x_=b.forwardRef((e,t)=>{const n=y_(Rr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Aa(Rr,e.__scopeMenu),c=wc(Rr,e.__scopeMenu);return h.jsx(ac.Provider,{scope:e.__scopeMenu,children:h.jsx(vn,{present:r||l.open,children:h.jsx(ac.Slot,{scope:e.__scopeMenu,children:c.modal?h.jsx(Z5,{...s,ref:t}):h.jsx(W5,{...s,ref:t})})})})}),Z5=b.forwardRef((e,t)=>{const n=Aa(Rr,e.__scopeMenu),r=b.useRef(null),s=Ze(t,r);return b.useEffect(()=>{const l=r.current;if(l)return qd(l)},[]),h.jsx(cv,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),W5=b.forwardRef((e,t)=>{const n=Aa(Rr,e.__scopeMenu);return h.jsx(cv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Q5=D5("MenuContent.ScrollLock"),cv=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:p,onInteractOutside:x,onDismiss:S,disableOutsideScroll:_,...w}=e,C=Aa(Rr,n),T=wc(Rr,n),N=Sc(n),M=p_(n),R=B5(n),[j,A]=b.useState(null),D=b.useRef(null),L=Ze(t,D,C.onContentChange),B=b.useRef(0),ne=b.useRef(""),J=b.useRef(0),ie=b.useRef(null),ue=b.useRef("right"),ae=b.useRef(0),pe=_?pc:b.Fragment,k=_?{as:Q5,allowPinchZoom:!0}:void 0,Y=ee=>{const ve=ne.current+ee,z=R().filter(X=>!X.disabled),P=document.activeElement,U=z.find(X=>X.ref.current===P)?.textValue,W=z.map(X=>X.textValue),oe=c3(W,ve,U),he=z.find(X=>X.textValue===oe)?.ref.current;(function X(ye){ne.current=ye,window.clearTimeout(B.current),ye!==""&&(B.current=window.setTimeout(()=>X(""),1e3))})(ve),he&&setTimeout(()=>he.focus())};b.useEffect(()=>()=>window.clearTimeout(B.current),[]),Bd();const H=b.useCallback(ee=>ue.current===ie.current?.side&&d3(ee,ie.current?.area),[]);return h.jsx(K5,{scope:n,searchRef:ne,onItemEnter:b.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),onItemLeave:b.useCallback(ee=>{H(ee)||(D.current?.focus(),A(null))},[H]),onTriggerLeave:b.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),pointerGraceTimerRef:J,onPointerGraceIntentChange:b.useCallback(ee=>{ie.current=ee},[]),children:h.jsx(pe,{...k,children:h.jsx(mc,{asChild:!0,trapped:s,onMountAutoFocus:Ce(l,ee=>{ee.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:h.jsx(Li,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:v,onFocusOutside:p,onInteractOutside:x,onDismiss:S,children:h.jsx(A5,{asChild:!0,...M,dir:T.dir,orientation:"vertical",loop:r,currentTabStopId:j,onCurrentTabStopIdChange:A,onEntryFocus:Ce(f,ee=>{T.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Jd,{role:"menu","aria-orientation":"vertical","data-state":L_(C.open),"data-radix-menu-content":"",dir:T.dir,...N,...w,ref:L,style:{outline:"none",...w.style},onKeyDown:Ce(w.onKeyDown,ee=>{const z=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,P=ee.ctrlKey||ee.altKey||ee.metaKey,U=ee.key.length===1;z&&(ee.key==="Tab"&&ee.preventDefault(),!P&&U&&Y(ee.key));const W=D.current;if(ee.target!==W||!V5.includes(ee.key))return;ee.preventDefault();const he=R().filter(X=>!X.disabled).map(X=>X.ref.current);h_.includes(ee.key)&&he.reverse(),i3(he)}),onBlur:Ce(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(B.current),ne.current="")}),onPointerMove:Ce(e.onPointerMove,sc(ee=>{const ve=ee.target,z=ae.current!==ee.clientX;if(ee.currentTarget.contains(ve)&&z){const P=ee.clientX>ae.current?"right":"left";ue.current=P,ae.current=ee.clientX}}))})})})})})})});x_.displayName=Rr;var X5="MenuGroup",uv=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(je.div,{role:"group",...r,ref:t})});uv.displayName=X5;var J5="MenuLabel",S_=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(je.div,{...r,ref:t})});S_.displayName=J5;var Cd="MenuItem",cw="menu.itemSelect",tf=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=b.useRef(null),c=wc(Cd,e.__scopeMenu),d=lv(Cd,e.__scopeMenu),f=Ze(t,l),m=b.useRef(!1),v=()=>{const p=l.current;if(!n&&p){const x=new CustomEvent(cw,{bubbles:!0,cancelable:!0});p.addEventListener(cw,S=>r?.(S),{once:!0}),eC(p,x),x.defaultPrevented?m.current=!1:c.onClose()}};return h.jsx(w_,{...s,ref:f,disabled:n,onClick:Ce(e.onClick,v),onPointerDown:p=>{e.onPointerDown?.(p),m.current=!0},onPointerUp:Ce(e.onPointerUp,p=>{m.current||p.currentTarget?.click()}),onKeyDown:Ce(e.onKeyDown,p=>{const x=d.searchRef.current!=="";n||x&&p.key===" "||Kp.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});tf.displayName=Cd;var w_=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,c=lv(Cd,n),d=p_(n),f=b.useRef(null),m=Ze(t,f),[v,p]=b.useState(!1),[x,S]=b.useState("");return b.useEffect(()=>{const _=f.current;_&&S((_.textContent??"").trim())},[l.children]),h.jsx(ac.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:h.jsx(j5,{asChild:!0,...d,focusable:!r,children:h.jsx(je.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:m,onPointerMove:Ce(e.onPointerMove,sc(_=>{r?c.onItemLeave(_):(c.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,sc(_=>c.onItemLeave(_))),onFocus:Ce(e.onFocus,()=>p(!0)),onBlur:Ce(e.onBlur,()=>p(!1))})})})}),e3="MenuCheckboxItem",C_=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return h.jsx(R_,{scope:e.__scopeMenu,checked:n,children:h.jsx(tf,{role:"menuitemcheckbox","aria-checked":_d(n)?"mixed":n,...s,ref:t,"data-state":hv(n),onSelect:Ce(s.onSelect,()=>r?.(_d(n)?!0:!n),{checkForDefaultPrevented:!1})})})});C_.displayName=e3;var __="MenuRadioGroup",[t3,n3]=xs(__,{value:void 0,onValueChange:()=>{}}),E_=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=cn(r);return h.jsx(t3,{scope:e.__scopeMenu,value:n,onValueChange:l,children:h.jsx(uv,{...s,ref:t})})});E_.displayName=__;var T_="MenuRadioItem",N_=b.forwardRef((e,t)=>{const{value:n,...r}=e,s=n3(T_,e.__scopeMenu),l=n===s.value;return h.jsx(R_,{scope:e.__scopeMenu,checked:l,children:h.jsx(tf,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":hv(l),onSelect:Ce(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});N_.displayName=T_;var dv="MenuItemIndicator",[R_,r3]=xs(dv,{checked:!1}),M_=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=r3(dv,n);return h.jsx(vn,{present:r||_d(l.checked)||l.checked===!0,children:h.jsx(je.span,{...s,ref:t,"data-state":hv(l.checked)})})});M_.displayName=dv;var o3="MenuSeparator",O_=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});O_.displayName=o3;var a3="MenuArrow",A_=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Sc(n);return h.jsx(ef,{...s,...r,ref:t})});A_.displayName=a3;var fv="MenuSub",[s3,j_]=xs(fv),D_=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,l=Aa(fv,t),c=Sc(t),[d,f]=b.useState(null),[m,v]=b.useState(null),p=cn(s);return b.useEffect(()=>(l.open===!1&&p(!1),()=>p(!1)),[l.open,p]),h.jsx(vc,{...c,children:h.jsx(g_,{scope:t,open:r,onOpenChange:p,content:m,onContentChange:v,children:h.jsx(s3,{scope:t,contentId:nn(),triggerId:nn(),trigger:d,onTriggerChange:f,children:n})})})};D_.displayName=fv;var Zl="MenuSubTrigger",k_=b.forwardRef((e,t)=>{const n=Aa(Zl,e.__scopeMenu),r=wc(Zl,e.__scopeMenu),s=j_(Zl,e.__scopeMenu),l=lv(Zl,e.__scopeMenu),c=b.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:f}=l,m={__scopeMenu:e.__scopeMenu},v=b.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return b.useEffect(()=>v,[v]),b.useEffect(()=>{const p=d.current;return()=>{window.clearTimeout(p),f(null)}},[d,f]),h.jsx(sv,{asChild:!0,...m,children:h.jsx(w_,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":L_(n.open),...e,ref:Dn(t,s.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,sc(p=>{l.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:Ce(e.onPointerLeave,sc(p=>{v();const x=n.content?.getBoundingClientRect();if(x){const S=n.content?.dataset.side,_=S==="right",w=_?-5:5,C=x[_?"left":"right"],T=x[_?"right":"left"];l.onPointerGraceIntentChange({area:[{x:p.clientX+w,y:p.clientY},{x:C,y:x.top},{x:T,y:x.top},{x:T,y:x.bottom},{x:C,y:x.bottom}],side:S}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(p),p.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,p=>{const x=l.searchRef.current!=="";e.disabled||x&&p.key===" "||$5[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});k_.displayName=Zl;var z_="MenuSubContent",P_=b.forwardRef((e,t)=>{const n=y_(Rr,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Aa(Rr,e.__scopeMenu),c=wc(Rr,e.__scopeMenu),d=j_(z_,e.__scopeMenu),f=b.useRef(null),m=Ze(t,f);return h.jsx(ac.Provider,{scope:e.__scopeMenu,children:h.jsx(vn,{present:r||l.open,children:h.jsx(ac.Slot,{scope:e.__scopeMenu,children:h.jsx(cv,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{c.isUsingKeyboardRef.current&&f.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,v=>{v.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,v=>{c.onClose(),v.preventDefault()}),onKeyDown:Ce(e.onKeyDown,v=>{const p=v.currentTarget.contains(v.target),x=U5[c.dir].includes(v.key);p&&x&&(l.onOpenChange(!1),d.trigger?.focus(),v.preventDefault())})})})})})});P_.displayName=z_;function L_(e){return e?"open":"closed"}function _d(e){return e==="indeterminate"}function hv(e){return _d(e)?"indeterminate":e?"checked":"unchecked"}function i3(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function l3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function c3(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=l3(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function u3(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],m=d.x,v=d.y,p=f.x,x=f.y;v>r!=x>r&&n<(p-m)*(r-v)/(x-v)+m&&(s=!s)}return s}function d3(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return u3(n,t)}function sc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var f3=v_,h3=sv,m3=b_,p3=x_,g3=uv,v3=S_,y3=tf,b3=C_,x3=E_,S3=N_,w3=M_,C3=O_,_3=A_,E3=D_,T3=k_,N3=P_,nf="DropdownMenu",[R3]=Or(nf,[m_]),_n=m_(),[M3,F_]=R3(nf),I_=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,f=_n(t),m=b.useRef(null),[v,p]=lo({prop:s,defaultProp:l??!1,onChange:c,caller:nf});return h.jsx(M3,{scope:t,triggerId:nn(),triggerRef:m,contentId:nn(),open:v,onOpenChange:p,onOpenToggle:b.useCallback(()=>p(x=>!x),[p]),modal:d,children:h.jsx(f3,{...f,open:v,onOpenChange:p,dir:r,modal:d,children:n})})};I_.displayName=nf;var V_="DropdownMenuTrigger",$_=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,l=F_(V_,n),c=_n(n);return h.jsx(h3,{asChild:!0,...c,children:h.jsx(je.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Dn(t,l.triggerRef),onPointerDown:Ce(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:Ce(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});$_.displayName=V_;var O3="DropdownMenuPortal",U_=e=>{const{__scopeDropdownMenu:t,...n}=e,r=_n(t);return h.jsx(m3,{...r,...n})};U_.displayName=O3;var B_="DropdownMenuContent",H_=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=F_(B_,n),l=_n(n),c=b.useRef(!1);return h.jsx(p3,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...r,ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,d=>{c.current||s.triggerRef.current?.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,d=>{const f=d.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,v=f.button===2||m;(!s.modal||v)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});H_.displayName=B_;var A3="DropdownMenuGroup",q_=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(g3,{...s,...r,ref:t})});q_.displayName=A3;var j3="DropdownMenuLabel",D3=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(v3,{...s,...r,ref:t})});D3.displayName=j3;var k3="DropdownMenuItem",Y_=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(y3,{...s,...r,ref:t})});Y_.displayName=k3;var z3="DropdownMenuCheckboxItem",P3=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(b3,{...s,...r,ref:t})});P3.displayName=z3;var L3="DropdownMenuRadioGroup",F3=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(x3,{...s,...r,ref:t})});F3.displayName=L3;var I3="DropdownMenuRadioItem",V3=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(S3,{...s,...r,ref:t})});V3.displayName=I3;var $3="DropdownMenuItemIndicator",U3=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(w3,{...s,...r,ref:t})});U3.displayName=$3;var B3="DropdownMenuSeparator",G_=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(C3,{...s,...r,ref:t})});G_.displayName=B3;var H3="DropdownMenuArrow",q3=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(_3,{...s,...r,ref:t})});q3.displayName=H3;var Y3=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:l}=e,c=_n(t),[d,f]=lo({prop:r,defaultProp:l??!1,onChange:s,caller:"DropdownMenuSub"});return h.jsx(E3,{...c,open:d,onOpenChange:f,children:n})},G3="DropdownMenuSubTrigger",K_=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(T3,{...s,...r,ref:t})});K_.displayName=G3;var K3="DropdownMenuSubContent",Z_=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=_n(n);return h.jsx(N3,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Z_.displayName=K3;var Z3=I_,W3=$_,W_=U_,Q3=H_,X3=q_,J3=Y_,eP=G_,tP=Y3,nP=K_,rP=Z_,oP="Label",Q_=b.forwardRef((e,t)=>h.jsx(je.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Q_.displayName=oP;var aP=Q_;function Zp(e,[t,n]){return Math.min(n,Math.max(t,e))}function sP(e){const t=iP(e),n=b.forwardRef((r,s)=>{const{children:l,...c}=r,d=b.Children.toArray(l),f=d.find(cP);if(f){const m=f.props.children,v=d.map(p=>p===f?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:p);return h.jsx(t,{...c,ref:s,children:b.isValidElement(m)?b.cloneElement(m,void 0,v):null})}return h.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function iP(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const c=dP(s),d=uP(l,s.props);return s.type!==b.Fragment&&(d.ref=r?Dn(r,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lP=Symbol("radix.slottable");function cP(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lP}function uP(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function dP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rf="Popover",[X_]=Or(rf,[Oa]),Cc=Oa(),[fP,ja]=X_(rf),J_=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!1}=e,d=Cc(t),f=b.useRef(null),[m,v]=b.useState(!1),[p,x]=lo({prop:r,defaultProp:s??!1,onChange:l,caller:rf});return h.jsx(vc,{...d,children:h.jsx(fP,{scope:t,contentId:nn(),triggerRef:f,open:p,onOpenChange:x,onOpenToggle:b.useCallback(()=>x(S=>!S),[x]),hasCustomAnchor:m,onCustomAnchorAdd:b.useCallback(()=>v(!0),[]),onCustomAnchorRemove:b.useCallback(()=>v(!1),[]),modal:c,children:n})})};J_.displayName=rf;var eE="PopoverAnchor",tE=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ja(eE,n),l=Cc(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=s;return b.useEffect(()=>(c(),()=>d()),[c,d]),h.jsx(yc,{...l,...r,ref:t})});tE.displayName=eE;var nE="PopoverTrigger",rE=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ja(nE,n),l=Cc(n),c=Ze(t,s.triggerRef),d=h.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":lE(s.open),...r,ref:c,onClick:Ce(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?d:h.jsx(yc,{asChild:!0,...l,children:d})});rE.displayName=nE;var mv="PopoverPortal",[hP,mP]=X_(mv,{forceMount:void 0}),oE=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=ja(mv,t);return h.jsx(hP,{scope:t,forceMount:n,children:h.jsx(vn,{present:n||l.open,children:h.jsx(Fi,{asChild:!0,container:s,children:r})})})};oE.displayName=mv;var Oi="PopoverContent",aE=b.forwardRef((e,t)=>{const n=mP(Oi,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=ja(Oi,e.__scopePopover);return h.jsx(vn,{present:r||l.open,children:l.modal?h.jsx(gP,{...s,ref:t}):h.jsx(vP,{...s,ref:t})})});aE.displayName=Oi;var pP=sP("PopoverContent.RemoveScroll"),gP=b.forwardRef((e,t)=>{const n=ja(Oi,e.__scopePopover),r=b.useRef(null),s=Ze(t,r),l=b.useRef(!1);return b.useEffect(()=>{const c=r.current;if(c)return qd(c)},[]),h.jsx(pc,{as:pP,allowPinchZoom:!0,children:h.jsx(sE,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,c=>{c.preventDefault(),l.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,m=d.button===2||f;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Ce(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),vP=b.forwardRef((e,t)=>{const n=ja(Oi,e.__scopePopover),r=b.useRef(!1),s=b.useRef(!1);return h.jsx(sE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(r.current||n.triggerRef.current?.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;n.triggerRef.current?.contains(c)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),sE=b.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:v,...p}=e,x=ja(Oi,n),S=Cc(n);return Bd(),h.jsx(mc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:h.jsx(Li,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:v,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:h.jsx(Jd,{"data-state":lE(x.open),role:"dialog",id:x.contentId,...S,...p,ref:t,style:{...p.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)"}})})})}),iE="PopoverClose",yP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ja(iE,n);return h.jsx(je.button,{type:"button",...r,ref:t,onClick:Ce(e.onClick,()=>s.onOpenChange(!1))})});yP.displayName=iE;var bP="PopoverArrow",xP=b.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Cc(n);return h.jsx(ef,{...s,...r,ref:t})});xP.displayName=bP;function lE(e){return e?"open":"closed"}var SP=J_,wP=tE,CP=rE,_P=oE,EP=aE;function TP(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var pv="ScrollArea",[cE]=Or(pv),[NP,Ar]=cE(pv),uE=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:l=600,...c}=e,[d,f]=b.useState(null),[m,v]=b.useState(null),[p,x]=b.useState(null),[S,_]=b.useState(null),[w,C]=b.useState(null),[T,N]=b.useState(0),[M,R]=b.useState(0),[j,A]=b.useState(!1),[D,L]=b.useState(!1),B=Ze(t,J=>f(J)),ne=Ud(s);return h.jsx(NP,{scope:n,type:r,dir:ne,scrollHideDelay:l,scrollArea:d,viewport:m,onViewportChange:v,content:p,onContentChange:x,scrollbarX:S,onScrollbarXChange:_,scrollbarXEnabled:j,onScrollbarXEnabledChange:A,scrollbarY:w,onScrollbarYChange:C,scrollbarYEnabled:D,onScrollbarYEnabledChange:L,onCornerWidthChange:N,onCornerHeightChange:R,children:h.jsx(je.div,{dir:ne,...c,ref:B,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})});uE.displayName=pv;var dE="ScrollAreaViewport",fE=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...l}=e,c=Ar(dE,n),d=b.useRef(null),f=Ze(t,d,c.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),h.jsx(je.div,{"data-radix-scroll-area-viewport":"",...l,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});fE.displayName=dE;var ho="ScrollAreaScrollbar",hE=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Ar(ho,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=s,d=e.orientation==="horizontal";return b.useEffect(()=>(d?l(!0):c(!0),()=>{d?l(!1):c(!1)}),[d,l,c]),s.type==="hover"?h.jsx(RP,{...r,ref:t,forceMount:n}):s.type==="scroll"?h.jsx(MP,{...r,ref:t,forceMount:n}):s.type==="auto"?h.jsx(mE,{...r,ref:t,forceMount:n}):s.type==="always"?h.jsx(gv,{...r,ref:t}):null});hE.displayName=ho;var RP=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Ar(ho,e.__scopeScrollArea),[l,c]=b.useState(!1);return b.useEffect(()=>{const d=s.scrollArea;let f=0;if(d){const m=()=>{window.clearTimeout(f),c(!0)},v=()=>{f=window.setTimeout(()=>c(!1),s.scrollHideDelay)};return d.addEventListener("pointerenter",m),d.addEventListener("pointerleave",v),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",m),d.removeEventListener("pointerleave",v)}}},[s.scrollArea,s.scrollHideDelay]),h.jsx(vn,{present:n||l,children:h.jsx(mE,{"data-state":l?"visible":"hidden",...r,ref:t})})}),MP=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Ar(ho,e.__scopeScrollArea),l=e.orientation==="horizontal",c=af(()=>f("SCROLL_END"),100),[d,f]=TP("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(d==="idle"){const m=window.setTimeout(()=>f("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(m)}},[d,s.scrollHideDelay,f]),b.useEffect(()=>{const m=s.viewport,v=l?"scrollLeft":"scrollTop";if(m){let p=m[v];const x=()=>{const S=m[v];p!==S&&(f("SCROLL"),c()),p=S};return m.addEventListener("scroll",x),()=>m.removeEventListener("scroll",x)}},[s.viewport,l,f,c]),h.jsx(vn,{present:n||d!=="hidden",children:h.jsx(gv,{"data-state":d==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ce(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Ce(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),mE=b.forwardRef((e,t)=>{const n=Ar(ho,e.__scopeScrollArea),{forceMount:r,...s}=e,[l,c]=b.useState(!1),d=e.orientation==="horizontal",f=af(()=>{if(n.viewport){const m=n.viewport.offsetWidth<n.viewport.scrollWidth,v=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?m:v)}},10);return Ai(n.viewport,f),Ai(n.content,f),h.jsx(vn,{present:r||l,children:h.jsx(gv,{"data-state":l?"visible":"hidden",...s,ref:t})})}),gv=b.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=Ar(ho,e.__scopeScrollArea),l=b.useRef(null),c=b.useRef(0),[d,f]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=bE(d.viewport,d.content),v={...r,sizes:d,onSizesChange:f,hasThumb:m>0&&m<1,onThumbChange:x=>l.current=x,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:x=>c.current=x};function p(x,S){return zP(x,c.current,d,S)}return n==="horizontal"?h.jsx(OP,{...v,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const x=s.viewport.scrollLeft,S=uw(x,d,s.dir);l.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=p(x,s.dir))}}):n==="vertical"?h.jsx(AP,{...v,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const x=s.viewport.scrollTop,S=uw(x,d);l.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=p(x))}}):null}),OP=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,l=Ar(ho,e.__scopeScrollArea),[c,d]=b.useState(),f=b.useRef(null),m=Ze(t,f,l.onScrollbarXChange);return b.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),h.jsx(gE,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":of(n)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.x),onDragScroll:v=>e.onDragScroll(v.x),onWheelScroll:(v,p)=>{if(l.viewport){const x=l.viewport.scrollLeft+v.deltaX;e.onWheelScroll(x),SE(x,p)&&v.preventDefault()}},onResize:()=>{f.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Td(c.paddingLeft),paddingEnd:Td(c.paddingRight)}})}})}),AP=b.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,l=Ar(ho,e.__scopeScrollArea),[c,d]=b.useState(),f=b.useRef(null),m=Ze(t,f,l.onScrollbarYChange);return b.useEffect(()=>{f.current&&d(getComputedStyle(f.current))},[f]),h.jsx(gE,{"data-orientation":"vertical",...s,ref:m,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":of(n)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.y),onDragScroll:v=>e.onDragScroll(v.y),onWheelScroll:(v,p)=>{if(l.viewport){const x=l.viewport.scrollTop+v.deltaY;e.onWheelScroll(x),SE(x,p)&&v.preventDefault()}},onResize:()=>{f.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Td(c.paddingTop),paddingEnd:Td(c.paddingBottom)}})}})}),[jP,pE]=cE(ho),gE=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:d,onThumbPositionChange:f,onDragScroll:m,onWheelScroll:v,onResize:p,...x}=e,S=Ar(ho,n),[_,w]=b.useState(null),C=Ze(t,B=>w(B)),T=b.useRef(null),N=b.useRef(""),M=S.viewport,R=r.content-r.viewport,j=cn(v),A=cn(f),D=af(p,10);function L(B){if(T.current){const ne=B.clientX-T.current.left,J=B.clientY-T.current.top;m({x:ne,y:J})}}return b.useEffect(()=>{const B=ne=>{const J=ne.target;_?.contains(J)&&j(ne,R)};return document.addEventListener("wheel",B,{passive:!1}),()=>document.removeEventListener("wheel",B,{passive:!1})},[M,_,R,j]),b.useEffect(A,[r,A]),Ai(_,D),Ai(S.content,D),h.jsx(jP,{scope:n,scrollbar:_,hasThumb:s,onThumbChange:cn(l),onThumbPointerUp:cn(c),onThumbPositionChange:A,onThumbPointerDown:cn(d),children:h.jsx(je.div,{...x,ref:C,style:{position:"absolute",...x.style},onPointerDown:Ce(e.onPointerDown,B=>{B.button===0&&(B.target.setPointerCapture(B.pointerId),T.current=_.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),L(B))}),onPointerMove:Ce(e.onPointerMove,L),onPointerUp:Ce(e.onPointerUp,B=>{const ne=B.target;ne.hasPointerCapture(B.pointerId)&&ne.releasePointerCapture(B.pointerId),document.body.style.webkitUserSelect=N.current,S.viewport&&(S.viewport.style.scrollBehavior=""),T.current=null})})})}),Ed="ScrollAreaThumb",vE=b.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=pE(Ed,e.__scopeScrollArea);return h.jsx(vn,{present:n||s.hasThumb,children:h.jsx(DP,{ref:t,...r})})}),DP=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,l=Ar(Ed,n),c=pE(Ed,n),{onThumbPositionChange:d}=c,f=Ze(t,p=>c.onThumbChange(p)),m=b.useRef(void 0),v=af(()=>{m.current&&(m.current(),m.current=void 0)},100);return b.useEffect(()=>{const p=l.viewport;if(p){const x=()=>{if(v(),!m.current){const S=PP(p,d);m.current=S,d()}};return d(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[l.viewport,v,d]),h.jsx(je.div,{"data-state":c.hasThumb?"visible":"hidden",...s,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ce(e.onPointerDownCapture,p=>{const S=p.target.getBoundingClientRect(),_=p.clientX-S.left,w=p.clientY-S.top;c.onThumbPointerDown({x:_,y:w})}),onPointerUp:Ce(e.onPointerUp,c.onThumbPointerUp)})});vE.displayName=Ed;var vv="ScrollAreaCorner",yE=b.forwardRef((e,t)=>{const n=Ar(vv,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?h.jsx(kP,{...e,ref:t}):null});yE.displayName=vv;var kP=b.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Ar(vv,n),[l,c]=b.useState(0),[d,f]=b.useState(0),m=!!(l&&d);return Ai(s.scrollbarX,()=>{const v=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(v),f(v)}),Ai(s.scrollbarY,()=>{const v=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(v),c(v)}),m?h.jsx(je.div,{...r,ref:t,style:{width:l,height:d,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Td(e){return e?parseInt(e,10):0}function bE(e,t){const n=e/t;return isNaN(n)?0:n}function of(e){const t=bE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function zP(e,t,n,r="ltr"){const s=of(n),l=s/2,c=t||l,d=s-c,f=n.scrollbar.paddingStart+c,m=n.scrollbar.size-n.scrollbar.paddingEnd-d,v=n.content-n.viewport,p=r==="ltr"?[0,v]:[v*-1,0];return xE([f,m],p)(e)}function uw(e,t,n="ltr"){const r=of(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-s,c=t.content-t.viewport,d=l-r,f=n==="ltr"?[0,c]:[c*-1,0],m=Zp(e,f);return xE([0,c],[0,d])(m)}function xE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function SE(e,t){return e>0&&e<t}var PP=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function s(){const l={left:e.scrollLeft,top:e.scrollTop},c=n.left!==l.left,d=n.top!==l.top;(c||d)&&t(),n=l,r=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(r)};function af(e,t){const n=cn(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ai(e,t){const n=cn(t);gn(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var LP=uE,FP=fE,IP=yE;function VP(e){const t=$P(e),n=b.forwardRef((r,s)=>{const{children:l,...c}=r,d=b.Children.toArray(l),f=d.find(BP);if(f){const m=f.props.children,v=d.map(p=>p===f?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:p);return h.jsx(t,{...c,ref:s,children:b.isValidElement(m)?b.cloneElement(m,void 0,v):null})}return h.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function $P(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const c=qP(s),d=HP(l,s.props);return s.type!==b.Fragment&&(d.ref=r?Dn(r,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UP=Symbol("radix.slottable");function BP(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UP}function HP(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function qP(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YP=[" ","Enter","ArrowUp","ArrowDown"],GP=[" ","Enter"],hs="Select",[sf,lf,KP]=$g(hs),[$i]=Or(hs,[KP,Oa]),cf=Oa(),[ZP,Da]=$i(hs),[WP,QP]=$i(hs),wE=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:f,dir:m,name:v,autoComplete:p,disabled:x,required:S,form:_}=e,w=cf(t),[C,T]=b.useState(null),[N,M]=b.useState(null),[R,j]=b.useState(!1),A=Ud(m),[D,L]=lo({prop:r,defaultProp:s??!1,onChange:l,caller:hs}),[B,ne]=lo({prop:c,defaultProp:d,onChange:f,caller:hs}),J=b.useRef(null),ie=C?_||!!C.closest("form"):!0,[ue,ae]=b.useState(new Set),pe=Array.from(ue).map(k=>k.props.value).join(";");return h.jsx(vc,{...w,children:h.jsxs(ZP,{required:S,scope:t,trigger:C,onTriggerChange:T,valueNode:N,onValueNodeChange:M,valueNodeHasChildren:R,onValueNodeHasChildrenChange:j,contentId:nn(),value:B,onValueChange:ne,open:D,onOpenChange:L,dir:A,triggerPointerDownPosRef:J,disabled:x,children:[h.jsx(sf.Provider,{scope:t,children:h.jsx(WP,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(k=>{ae(Y=>new Set(Y).add(k))},[]),onNativeOptionRemove:b.useCallback(k=>{ae(Y=>{const H=new Set(Y);return H.delete(k),H})},[]),children:n})}),ie?h.jsxs(HE,{"aria-hidden":!0,required:S,tabIndex:-1,name:v,autoComplete:p,value:B,onChange:k=>ne(k.target.value),disabled:x,form:_,children:[B===void 0?h.jsx("option",{value:""}):null,Array.from(ue)]},pe):null]})})};wE.displayName=hs;var CE="SelectTrigger",_E=b.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=cf(n),c=Da(CE,n),d=c.disabled||r,f=Ze(t,c.onTriggerChange),m=lf(n),v=b.useRef("touch"),[p,x,S]=YE(w=>{const C=m().filter(M=>!M.disabled),T=C.find(M=>M.value===c.value),N=GE(C,w,T);N!==void 0&&c.onValueChange(N.value)}),_=w=>{d||(c.onOpenChange(!0),S()),w&&(c.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return h.jsx(yc,{asChild:!0,...l,children:h.jsx(je.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":qE(c.value)?"":void 0,...s,ref:f,onClick:Ce(s.onClick,w=>{w.currentTarget.focus(),v.current!=="mouse"&&_(w)}),onPointerDown:Ce(s.onPointerDown,w=>{v.current=w.pointerType;const C=w.target;C.hasPointerCapture(w.pointerId)&&C.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(_(w),w.preventDefault())}),onKeyDown:Ce(s.onKeyDown,w=>{const C=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&x(w.key),!(C&&w.key===" ")&&YP.includes(w.key)&&(_(),w.preventDefault())})})})});_E.displayName=CE;var EE="SelectValue",TE=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:c="",...d}=e,f=Da(EE,n),{onValueNodeHasChildrenChange:m}=f,v=l!==void 0,p=Ze(t,f.onValueNodeChange);return gn(()=>{m(v)},[m,v]),h.jsx(je.span,{...d,ref:p,style:{pointerEvents:"none"},children:qE(f.value)?h.jsx(h.Fragment,{children:c}):l})});TE.displayName=EE;var XP="SelectIcon",NE=b.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return h.jsx(je.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});NE.displayName=XP;var JP="SelectPortal",RE=e=>h.jsx(Fi,{asChild:!0,...e});RE.displayName=JP;var ms="SelectContent",ME=b.forwardRef((e,t)=>{const n=Da(ms,e.__scopeSelect),[r,s]=b.useState();if(gn(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?Pi.createPortal(h.jsx(OE,{scope:e.__scopeSelect,children:h.jsx(sf.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),l):null}return h.jsx(AE,{...e,ref:t})});ME.displayName=ms;var Ir=10,[OE,ka]=$i(ms),e6="SelectContentImpl",t6=VP("SelectContent.RemoveScroll"),AE=b.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:f,align:m,alignOffset:v,arrowPadding:p,collisionBoundary:x,collisionPadding:S,sticky:_,hideWhenDetached:w,avoidCollisions:C,...T}=e,N=Da(ms,n),[M,R]=b.useState(null),[j,A]=b.useState(null),D=Ze(t,X=>R(X)),[L,B]=b.useState(null),[ne,J]=b.useState(null),ie=lf(n),[ue,ae]=b.useState(!1),pe=b.useRef(!1);b.useEffect(()=>{if(M)return qd(M)},[M]),Bd();const k=b.useCallback(X=>{const[ye,..._e]=ie().map(Ge=>Ge.ref.current),[De]=_e.slice(-1),qe=document.activeElement;for(const Ge of X)if(Ge===qe||(Ge?.scrollIntoView({block:"nearest"}),Ge===ye&&j&&(j.scrollTop=0),Ge===De&&j&&(j.scrollTop=j.scrollHeight),Ge?.focus(),document.activeElement!==qe))return},[ie,j]),Y=b.useCallback(()=>k([L,M]),[k,L,M]);b.useEffect(()=>{ue&&Y()},[ue,Y]);const{onOpenChange:H,triggerPointerDownPosRef:ee}=N;b.useEffect(()=>{if(M){let X={x:0,y:0};const ye=De=>{X={x:Math.abs(Math.round(De.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(De.pageY)-(ee.current?.y??0))}},_e=De=>{X.x<=10&&X.y<=10?De.preventDefault():M.contains(De.target)||H(!1),document.removeEventListener("pointermove",ye),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",_e,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",_e,{capture:!0})}}},[M,H,ee]),b.useEffect(()=>{const X=()=>H(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[H]);const[ve,z]=YE(X=>{const ye=ie().filter(qe=>!qe.disabled),_e=ye.find(qe=>qe.ref.current===document.activeElement),De=GE(ye,X,_e);De&&setTimeout(()=>De.ref.current.focus())}),P=b.useCallback((X,ye,_e)=>{const De=!pe.current&&!_e;(N.value!==void 0&&N.value===ye||De)&&(B(X),De&&(pe.current=!0))},[N.value]),U=b.useCallback(()=>M?.focus(),[M]),W=b.useCallback((X,ye,_e)=>{const De=!pe.current&&!_e;(N.value!==void 0&&N.value===ye||De)&&J(X)},[N.value]),oe=r==="popper"?Wp:jE,he=oe===Wp?{side:d,sideOffset:f,align:m,alignOffset:v,arrowPadding:p,collisionBoundary:x,collisionPadding:S,sticky:_,hideWhenDetached:w,avoidCollisions:C}:{};return h.jsx(OE,{scope:n,content:M,viewport:j,onViewportChange:A,itemRefCallback:P,selectedItem:L,onItemLeave:U,itemTextRefCallback:W,focusSelectedItem:Y,selectedItemText:ne,position:r,isPositioned:ue,searchRef:ve,children:h.jsx(pc,{as:t6,allowPinchZoom:!0,children:h.jsx(mc,{asChild:!0,trapped:N.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Ce(s,X=>{N.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:h.jsx(Li,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:h.jsx(oe,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:X=>X.preventDefault(),...T,...he,onPlaced:()=>ae(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Ce(T.onKeyDown,X=>{const ye=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ye&&X.key.length===1&&z(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let De=ie().filter(qe=>!qe.disabled).map(qe=>qe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(De=De.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const qe=X.target,Ge=De.indexOf(qe);De=De.slice(Ge+1)}setTimeout(()=>k(De)),X.preventDefault()}})})})})})})});AE.displayName=e6;var n6="SelectItemAlignedPosition",jE=b.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=Da(ms,n),c=ka(ms,n),[d,f]=b.useState(null),[m,v]=b.useState(null),p=Ze(t,D=>v(D)),x=lf(n),S=b.useRef(!1),_=b.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:T,focusSelectedItem:N}=c,M=b.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&w&&C&&T){const D=l.trigger.getBoundingClientRect(),L=m.getBoundingClientRect(),B=l.valueNode.getBoundingClientRect(),ne=T.getBoundingClientRect();if(l.dir!=="rtl"){const qe=ne.left-L.left,Ge=B.left-qe,Lt=D.left-Ge,Rt=D.width+Lt,En=Math.max(Rt,L.width),Fn=window.innerWidth-Ir,Tn=Zp(Ge,[Ir,Math.max(Ir,Fn-En)]);d.style.minWidth=Rt+"px",d.style.left=Tn+"px"}else{const qe=L.right-ne.right,Ge=window.innerWidth-B.right-qe,Lt=window.innerWidth-D.right-Ge,Rt=D.width+Lt,En=Math.max(Rt,L.width),Fn=window.innerWidth-Ir,Tn=Zp(Ge,[Ir,Math.max(Ir,Fn-En)]);d.style.minWidth=Rt+"px",d.style.right=Tn+"px"}const J=x(),ie=window.innerHeight-Ir*2,ue=w.scrollHeight,ae=window.getComputedStyle(m),pe=parseInt(ae.borderTopWidth,10),k=parseInt(ae.paddingTop,10),Y=parseInt(ae.borderBottomWidth,10),H=parseInt(ae.paddingBottom,10),ee=pe+k+ue+H+Y,ve=Math.min(C.offsetHeight*5,ee),z=window.getComputedStyle(w),P=parseInt(z.paddingTop,10),U=parseInt(z.paddingBottom,10),W=D.top+D.height/2-Ir,oe=ie-W,he=C.offsetHeight/2,X=C.offsetTop+he,ye=pe+k+X,_e=ee-ye;if(ye<=W){const qe=J.length>0&&C===J[J.length-1].ref.current;d.style.bottom="0px";const Ge=m.clientHeight-w.offsetTop-w.offsetHeight,Lt=Math.max(oe,he+(qe?U:0)+Ge+Y),Rt=ye+Lt;d.style.height=Rt+"px"}else{const qe=J.length>0&&C===J[0].ref.current;d.style.top="0px";const Lt=Math.max(W,pe+w.offsetTop+(qe?P:0)+he)+_e;d.style.height=Lt+"px",w.scrollTop=ye-W+w.offsetTop}d.style.margin=`${Ir}px 0`,d.style.minHeight=ve+"px",d.style.maxHeight=ie+"px",r?.(),requestAnimationFrame(()=>S.current=!0)}},[x,l.trigger,l.valueNode,d,m,w,C,T,l.dir,r]);gn(()=>M(),[M]);const[R,j]=b.useState();gn(()=>{m&&j(window.getComputedStyle(m).zIndex)},[m]);const A=b.useCallback(D=>{D&&_.current===!0&&(M(),N?.(),_.current=!1)},[M,N]);return h.jsx(o6,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:S,onScrollButtonChange:A,children:h.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:h.jsx(je.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});jE.displayName=n6;var r6="SelectPopperPosition",Wp=b.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ir,...l}=e,c=cf(n);return h.jsx(Jd,{...c,...l,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...l.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)"}})});Wp.displayName=r6;var[o6,yv]=$i(ms,{}),Qp="SelectViewport",DE=b.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=ka(Qp,n),c=yv(Qp,n),d=Ze(t,l.onViewportChange),f=b.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),h.jsx(sf.Slot,{scope:n,children:h.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ce(s.onScroll,m=>{const v=m.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:x}=c;if(x?.current&&p){const S=Math.abs(f.current-v.scrollTop);if(S>0){const _=window.innerHeight-Ir*2,w=parseFloat(p.style.minHeight),C=parseFloat(p.style.height),T=Math.max(w,C);if(T<_){const N=T+S,M=Math.min(_,N),R=N-M;p.style.height=M+"px",p.style.bottom==="0px"&&(v.scrollTop=R>0?R:0,p.style.justifyContent="flex-end")}}}f.current=v.scrollTop})})})]})});DE.displayName=Qp;var kE="SelectGroup",[a6,s6]=$i(kE),i6=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=nn();return h.jsx(a6,{scope:n,id:s,children:h.jsx(je.div,{role:"group","aria-labelledby":s,...r,ref:t})})});i6.displayName=kE;var zE="SelectLabel",l6=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=s6(zE,n);return h.jsx(je.div,{id:s.id,...r,ref:t})});l6.displayName=zE;var Nd="SelectItem",[c6,PE]=$i(Nd),LE=b.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...c}=e,d=Da(Nd,n),f=ka(Nd,n),m=d.value===r,[v,p]=b.useState(l??""),[x,S]=b.useState(!1),_=Ze(t,N=>f.itemRefCallback?.(N,r,s)),w=nn(),C=b.useRef("touch"),T=()=>{s||(d.onValueChange(r),d.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(c6,{scope:n,value:r,disabled:s,textId:w,isSelected:m,onItemTextChange:b.useCallback(N=>{p(M=>M||(N?.textContent??"").trim())},[]),children:h.jsx(sf.ItemSlot,{scope:n,value:r,disabled:s,textValue:v,children:h.jsx(je.div,{role:"option","aria-labelledby":w,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:_,onFocus:Ce(c.onFocus,()=>S(!0)),onBlur:Ce(c.onBlur,()=>S(!1)),onClick:Ce(c.onClick,()=>{C.current!=="mouse"&&T()}),onPointerUp:Ce(c.onPointerUp,()=>{C.current==="mouse"&&T()}),onPointerDown:Ce(c.onPointerDown,N=>{C.current=N.pointerType}),onPointerMove:Ce(c.onPointerMove,N=>{C.current=N.pointerType,s?f.onItemLeave?.():C.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(c.onPointerLeave,N=>{N.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Ce(c.onKeyDown,N=>{f.searchRef?.current!==""&&N.key===" "||(GP.includes(N.key)&&T(),N.key===" "&&N.preventDefault())})})})})});LE.displayName=Nd;var Wl="SelectItemText",FE=b.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,c=Da(Wl,n),d=ka(Wl,n),f=PE(Wl,n),m=QP(Wl,n),[v,p]=b.useState(null),x=Ze(t,T=>p(T),f.onItemTextChange,T=>d.itemTextRefCallback?.(T,f.value,f.disabled)),S=v?.textContent,_=b.useMemo(()=>h.jsx("option",{value:f.value,disabled:f.disabled,children:S},f.value),[f.disabled,f.value,S]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=m;return gn(()=>(w(_),()=>C(_)),[w,C,_]),h.jsxs(h.Fragment,{children:[h.jsx(je.span,{id:f.textId,...l,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Pi.createPortal(l.children,c.valueNode):null]})});FE.displayName=Wl;var IE="SelectItemIndicator",VE=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return PE(IE,n).isSelected?h.jsx(je.span,{"aria-hidden":!0,...r,ref:t}):null});VE.displayName=IE;var Xp="SelectScrollUpButton",$E=b.forwardRef((e,t)=>{const n=ka(Xp,e.__scopeSelect),r=yv(Xp,e.__scopeSelect),[s,l]=b.useState(!1),c=Ze(t,r.onScrollButtonChange);return gn(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollTop>0;l(m)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?h.jsx(BE,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});$E.displayName=Xp;var Jp="SelectScrollDownButton",UE=b.forwardRef((e,t)=>{const n=ka(Jp,e.__scopeSelect),r=yv(Jp,e.__scopeSelect),[s,l]=b.useState(!1),c=Ze(t,r.onScrollButtonChange);return gn(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollHeight-f.clientHeight,v=Math.ceil(f.scrollTop)<m;l(v)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?h.jsx(BE,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});UE.displayName=Jp;var BE=b.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=ka("SelectScrollButton",n),c=b.useRef(null),d=lf(n),f=b.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return b.useEffect(()=>()=>f(),[f]),gn(()=>{d().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),h.jsx(je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ce(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Ce(s.onPointerMove,()=>{l.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Ce(s.onPointerLeave,()=>{f()})})}),u6="SelectSeparator",d6=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return h.jsx(je.div,{"aria-hidden":!0,...r,ref:t})});d6.displayName=u6;var eg="SelectArrow",f6=b.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=cf(n),l=Da(eg,n),c=ka(eg,n);return l.open&&c.position==="popper"?h.jsx(ef,{...s,...r,ref:t}):null});f6.displayName=eg;var h6="SelectBubbleInput",HE=b.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=b.useRef(null),l=Ze(r,s),c=Zg(t);return b.useEffect(()=>{const d=s.current;if(!d)return;const f=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&v){const p=new Event("change",{bubbles:!0});v.call(d,t),d.dispatchEvent(p)}},[c,t]),h.jsx(je.select,{...n,style:{...tC,...n.style},ref:l,defaultValue:t})});HE.displayName=h6;function qE(e){return e===""||e===void 0}function YE(e){const t=cn(e),n=b.useRef(""),r=b.useRef(0),s=b.useCallback(c=>{const d=n.current+c;t(d),(function f(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(d)},[t]),l=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function GE(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=m6(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function m6(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var p6=wE,g6=_E,v6=TE,y6=NE,b6=RE,x6=ME,S6=DE,w6=LE,C6=FE,_6=VE,E6=$E,T6=UE;function N6(e){const t=R6(e),n=b.forwardRef((r,s)=>{const{children:l,...c}=r,d=b.Children.toArray(l),f=d.find(O6);if(f){const m=f.props.children,v=d.map(p=>p===f?b.Children.count(m)>1?b.Children.only(null):b.isValidElement(m)?m.props.children:null:p);return h.jsx(t,{...c,ref:s,children:b.isValidElement(m)?b.cloneElement(m,void 0,v):null})}return h.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}var KE=N6("Slot");function R6(e){const t=b.forwardRef((n,r)=>{const{children:s,...l}=n;if(b.isValidElement(s)){const c=j6(s),d=A6(l,s.props);return s.type!==b.Fragment&&(d.ref=r?Dn(r,c):c),b.cloneElement(s,d)}return b.Children.count(s)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var M6=Symbol("radix.slottable");function O6(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===M6}function A6(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function j6(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uf="Switch",[D6]=Or(uf),[k6,z6]=D6(uf),ZE=b.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:f="on",onCheckedChange:m,form:v,...p}=e,[x,S]=b.useState(null),_=Ze(t,M=>S(M)),w=b.useRef(!1),C=x?v||!!x.closest("form"):!0,[T,N]=lo({prop:s,defaultProp:l??!1,onChange:m,caller:uf});return h.jsxs(k6,{scope:n,checked:T,disabled:d,children:[h.jsx(je.button,{type:"button",role:"switch","aria-checked":T,"aria-required":c,"data-state":JE(T),"data-disabled":d?"":void 0,disabled:d,value:f,...p,ref:_,onClick:Ce(e.onClick,M=>{N(R=>!R),C&&(w.current=M.isPropagationStopped(),w.current||M.stopPropagation())})}),C&&h.jsx(XE,{control:x,bubbles:!w.current,name:r,value:f,checked:T,required:c,disabled:d,form:v,style:{transform:"translateX(-100%)"}})]})});ZE.displayName=uf;var WE="SwitchThumb",QE=b.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=z6(WE,n);return h.jsx(je.span,{"data-state":JE(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});QE.displayName=WE;var P6="SwitchBubbleInput",XE=b.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},l)=>{const c=b.useRef(null),d=Ze(c,l),f=Zg(n),m=Wg(t);return b.useEffect(()=>{const v=c.current;if(!v)return;const p=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==n&&S){const _=new Event("click",{bubbles:r});S.call(v,n),v.dispatchEvent(_)}},[f,n,r]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:d,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});XE.displayName=P6;function JE(e){return e?"checked":"unchecked"}var L6=ZE,F6=QE,I6=Symbol("radix.slottable");function V6(e){const t=({children:n})=>h.jsx(h.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=I6,t}var[df]=Or("Tooltip",[Oa]),ff=Oa(),e2="TooltipProvider",$6=700,tg="tooltip.open",[U6,bv]=df(e2),t2=e=>{const{__scopeTooltip:t,delayDuration:n=$6,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,c=b.useRef(!0),d=b.useRef(!1),f=b.useRef(0);return b.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),h.jsx(U6,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:b.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};t2.displayName=e2;var ic="Tooltip",[B6,_c]=df(ic),n2=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,f=bv(ic,e.__scopeTooltip),m=ff(t),[v,p]=b.useState(null),x=nn(),S=b.useRef(0),_=c??f.disableHoverableContent,w=d??f.delayDuration,C=b.useRef(!1),[T,N]=lo({prop:r,defaultProp:s??!1,onChange:D=>{D?(f.onOpen(),document.dispatchEvent(new CustomEvent(tg))):f.onClose(),l?.(D)},caller:ic}),M=b.useMemo(()=>T?C.current?"delayed-open":"instant-open":"closed",[T]),R=b.useCallback(()=>{window.clearTimeout(S.current),S.current=0,C.current=!1,N(!0)},[N]),j=b.useCallback(()=>{window.clearTimeout(S.current),S.current=0,N(!1)},[N]),A=b.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{C.current=!0,N(!0),S.current=0},w)},[w,N]);return b.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),h.jsx(vc,{...m,children:h.jsx(B6,{scope:t,contentId:x,open:T,stateAttribute:M,trigger:v,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{f.isOpenDelayedRef.current?A():R()},[f.isOpenDelayedRef,A,R]),onTriggerLeave:b.useCallback(()=>{_?j():(window.clearTimeout(S.current),S.current=0)},[j,_]),onOpen:R,onClose:j,disableHoverableContent:_,children:n})})};n2.displayName=ic;var ng="TooltipTrigger",r2=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=_c(ng,n),l=bv(ng,n),c=ff(n),d=b.useRef(null),f=Ze(t,d,s.onTriggerChange),m=b.useRef(!1),v=b.useRef(!1),p=b.useCallback(()=>m.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),h.jsx(yc,{asChild:!0,...c,children:h.jsx(je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Ce(e.onPointerMove,x=>{x.pointerType!=="touch"&&!v.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),v.current=!0)}),onPointerLeave:Ce(e.onPointerLeave,()=>{s.onTriggerLeave(),v.current=!1}),onPointerDown:Ce(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ce(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Ce(e.onBlur,s.onClose),onClick:Ce(e.onClick,s.onClose)})})});r2.displayName=ng;var xv="TooltipPortal",[H6,q6]=df(xv,{forceMount:void 0}),o2=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=_c(xv,t);return h.jsx(H6,{scope:t,forceMount:n,children:h.jsx(vn,{present:n||l.open,children:h.jsx(Fi,{asChild:!0,container:s,children:r})})})};o2.displayName=xv;var ji="TooltipContent",a2=b.forwardRef((e,t)=>{const n=q6(ji,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,c=_c(ji,e.__scopeTooltip);return h.jsx(vn,{present:r||c.open,children:c.disableHoverableContent?h.jsx(s2,{side:s,...l,ref:t}):h.jsx(Y6,{side:s,...l,ref:t})})}),Y6=b.forwardRef((e,t)=>{const n=_c(ji,e.__scopeTooltip),r=bv(ji,e.__scopeTooltip),s=b.useRef(null),l=Ze(t,s),[c,d]=b.useState(null),{trigger:f,onClose:m}=n,v=s.current,{onPointerInTransitChange:p}=r,x=b.useCallback(()=>{d(null),p(!1)},[p]),S=b.useCallback((_,w)=>{const C=_.currentTarget,T={x:_.clientX,y:_.clientY},N=W6(T,C.getBoundingClientRect()),M=Q6(T,N),R=X6(w.getBoundingClientRect()),j=eL([...M,...R]);d(j),p(!0)},[p]);return b.useEffect(()=>()=>x(),[x]),b.useEffect(()=>{if(f&&v){const _=C=>S(C,v),w=C=>S(C,f);return f.addEventListener("pointerleave",_),v.addEventListener("pointerleave",w),()=>{f.removeEventListener("pointerleave",_),v.removeEventListener("pointerleave",w)}}},[f,v,S,x]),b.useEffect(()=>{if(c){const _=w=>{const C=w.target,T={x:w.clientX,y:w.clientY},N=f?.contains(C)||v?.contains(C),M=!J6(T,c);N?x():M&&(x(),m())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[f,v,c,m,x]),h.jsx(s2,{...e,ref:l})}),[G6,K6]=df(ic,{isInside:!1}),Z6=V6("TooltipContent"),s2=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=_c(ji,n),m=ff(n),{onClose:v}=f;return b.useEffect(()=>(document.addEventListener(tg,v),()=>document.removeEventListener(tg,v)),[v]),b.useEffect(()=>{if(f.trigger){const p=x=>{x.target?.contains(f.trigger)&&v()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[f.trigger,v]),h.jsx(Li,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:p=>p.preventDefault(),onDismiss:v,children:h.jsxs(Jd,{"data-state":f.stateAttribute,...m,...d,ref:t,style:{...d.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:[h.jsx(Z6,{children:r}),h.jsx(G6,{scope:n,isInside:!0,children:h.jsx(bk,{id:f.contentId,role:"tooltip",children:s||r})})]})})});a2.displayName=ji;var i2="TooltipArrow",l2=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ff(n);return K6(i2,n).isInside?null:h.jsx(ef,{...s,...r,ref:t})});l2.displayName=i2;function W6(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Q6(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function X6(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function J6(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],m=d.x,v=d.y,p=f.x,x=f.y;v>r!=x>r&&n<(p-m)*(r-v)/(x-v)+m&&(s=!s)}return s}function eL(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),tL(t)}function tL(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var nL=t2,rL=n2,oL=r2,aL=o2,sL=a2,iL=l2;const lL=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},cL=(e,t)=>({classGroupId:e,validator:t}),c2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Rd="-",dw=[],uL="arbitrary..",dL=e=>{const t=hL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return fL(c);const d=c.split(Rd),f=d[0]===""&&d.length>1?1:0;return u2(d,f,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const f=r[c],m=n[c];return f?m?lL(m,f):f:m||dw}return n[c]||dw}}},u2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const m=u2(e,t+1,l);if(m)return m}const c=n.validators;if(c===null)return;const d=t===0?e.join(Rd):e.slice(t).join(Rd),f=c.length;for(let m=0;m<f;m++){const v=c[m];if(v.validator(d))return v.classGroupId}},fL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?uL+r:void 0})(),hL=e=>{const{theme:t,classGroups:n}=e;return mL(n,t)},mL=(e,t)=>{const n=c2();for(const r in e){const s=e[r];Sv(s,n,r,t)}return n},Sv=(e,t,n,r)=>{const s=e.length;for(let l=0;l<s;l++){const c=e[l];pL(c,t,n,r)}},pL=(e,t,n,r)=>{if(typeof e=="string"){gL(e,t,n);return}if(typeof e=="function"){vL(e,t,n,r);return}yL(e,t,n,r)},gL=(e,t,n)=>{const r=e===""?t:d2(t,e);r.classGroupId=n},vL=(e,t,n,r)=>{if(bL(e)){Sv(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(cL(n,e))},yL=(e,t,n,r)=>{const s=Object.entries(e),l=s.length;for(let c=0;c<l;c++){const[d,f]=s[c];Sv(f,d2(t,d),n,r)}},d2=(e,t)=>{let n=e;const r=t.split(Rd),s=r.length;for(let l=0;l<s;l++){const c=r[l];let d=n.nextPart.get(c);d||(d=c2(),n.nextPart.set(c,d)),n=d}return n},bL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,xL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(l,c)=>{n[l]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let c=n[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return s(l,c),c},set(l,c){l in n?n[l]=c:s(l,c)}}},rg="!",fw=":",SL=[],hw=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),wL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let c=0,d=0,f=0,m;const v=s.length;for(let w=0;w<v;w++){const C=s[w];if(c===0&&d===0){if(C===fw){l.push(s.slice(f,w)),f=w+1;continue}if(C==="/"){m=w;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const p=l.length===0?s:s.slice(f);let x=p,S=!1;p.endsWith(rg)?(x=p.slice(0,-1),S=!0):p.startsWith(rg)&&(x=p.slice(1),S=!0);const _=m&&m>f?m-f:void 0;return hw(l,S,x,_)};if(t){const s=t+fw,l=r;r=c=>c.startsWith(s)?l(c.slice(s.length)):hw(SL,!1,c,void 0,!0)}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},CL=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let l=0;l<n.length;l++){const c=n[l],d=c[0]==="[",f=t.has(c);d||f?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(c)):s.push(c)}return s.length>0&&(s.sort(),r.push(...s)),r}},_L=e=>({cache:xL(e.cacheSize),parseClassName:wL(e),sortModifiers:CL(e),...dL(e)}),EL=/\s+/,TL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,c=[],d=e.trim().split(EL);let f="";for(let m=d.length-1;m>=0;m-=1){const v=d[m],{isExternal:p,modifiers:x,hasImportantModifier:S,baseClassName:_,maybePostfixModifierPosition:w}=n(v);if(p){f=v+(f.length>0?" "+f:f);continue}let C=!!w,T=r(C?_.substring(0,w):_);if(!T){if(!C){f=v+(f.length>0?" "+f:f);continue}if(T=r(_),!T){f=v+(f.length>0?" "+f:f);continue}C=!1}const N=x.length===0?"":x.length===1?x[0]:l(x).join(":"),M=S?N+rg:N,R=M+T;if(c.indexOf(R)>-1)continue;c.push(R);const j=s(T,C);for(let A=0;A<j.length;++A){const D=j[A];c.push(M+D)}f=v+(f.length>0?" "+f:f)}return f},NL=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=f2(n))&&(s&&(s+=" "),s+=r);return s},f2=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=f2(e[r]))&&(n&&(n+=" "),n+=t);return n},RL=(e,...t)=>{let n,r,s,l;const c=f=>{const m=t.reduce((v,p)=>p(v),e());return n=_L(m),r=n.cache.get,s=n.cache.set,l=d,d(f)},d=f=>{const m=r(f);if(m)return m;const v=TL(f,n);return s(f,v),v};return l=c,(...f)=>l(NL(...f))},ML=[],en=e=>{const t=n=>n[e]||ML;return t.isThemeGetter=!0,t},h2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,m2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,OL=/^\d+\/\d+$/,AL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jL=/\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$/,DL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hi=e=>OL.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),va=e=>!!e&&Number.isInteger(Number(e)),tp=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),Po=e=>AL.test(e),PL=()=>!0,LL=e=>jL.test(e)&&!DL.test(e),p2=()=>!1,FL=e=>kL.test(e),IL=e=>zL.test(e),VL=e=>!Ne(e)&&!Re(e),$L=e=>Ui(e,y2,p2),Ne=e=>h2.test(e),ts=e=>Ui(e,b2,LL),np=e=>Ui(e,YL,Qe),mw=e=>Ui(e,g2,p2),UL=e=>Ui(e,v2,IL),Wu=e=>Ui(e,x2,FL),Re=e=>m2.test(e),Ul=e=>Bi(e,b2),BL=e=>Bi(e,GL),pw=e=>Bi(e,g2),HL=e=>Bi(e,y2),qL=e=>Bi(e,v2),Qu=e=>Bi(e,x2,!0),Ui=(e,t,n)=>{const r=h2.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Bi=(e,t,n=!1)=>{const r=m2.exec(e);return r?r[1]?t(r[1]):n:!1},g2=e=>e==="position"||e==="percentage",v2=e=>e==="image"||e==="url",y2=e=>e==="length"||e==="size"||e==="bg-size",b2=e=>e==="length",YL=e=>e==="number",GL=e=>e==="family-name",x2=e=>e==="shadow",KL=()=>{const e=en("color"),t=en("font"),n=en("text"),r=en("font-weight"),s=en("tracking"),l=en("leading"),c=en("breakpoint"),d=en("container"),f=en("spacing"),m=en("radius"),v=en("shadow"),p=en("inset-shadow"),x=en("text-shadow"),S=en("drop-shadow"),_=en("blur"),w=en("perspective"),C=en("aspect"),T=en("ease"),N=en("animate"),M=()=>["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"],j=()=>[...R(),Re,Ne],A=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],L=()=>[Re,Ne,f],B=()=>[hi,"full","auto",...L()],ne=()=>[va,"none","subgrid",Re,Ne],J=()=>["auto",{span:["full",va,Re,Ne]},va,Re,Ne],ie=()=>[va,"auto",Re,Ne],ue=()=>["auto","min","max","fr",Re,Ne],ae=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],pe=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...L()],Y=()=>[hi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],H=()=>[e,Re,Ne],ee=()=>[...R(),pw,mw,{position:[Re,Ne]}],ve=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",HL,$L,{size:[Re,Ne]}],P=()=>[tp,Ul,ts],U=()=>["","none","full",m,Re,Ne],W=()=>["",Qe,Ul,ts],oe=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[Qe,tp,pw,mw],ye=()=>["","none",_,Re,Ne],_e=()=>["none",Qe,Re,Ne],De=()=>["none",Qe,Re,Ne],qe=()=>[Qe,Re,Ne],Ge=()=>[hi,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Po],breakpoint:[Po],color:[PL],container:[Po],"drop-shadow":[Po],ease:["in","out","in-out"],font:[VL],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Po],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Po],shadow:[Po],spacing:["px",Qe],text:[Po],"text-shadow":[Po],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",hi,Ne,Re,C]}],container:["container"],columns:[{columns:[Qe,Ne,Re,d]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:j()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[va,"auto",Re,Ne]}],basis:[{basis:[hi,"full","auto",d,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,hi,"auto","initial","none",Ne]}],grow:[{grow:["",Qe,Re,Ne]}],shrink:[{shrink:["",Qe,Re,Ne]}],order:[{order:[va,"first","last","none",Re,Ne]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...ae(),"normal"]}],"justify-items":[{"justify-items":[...pe(),"normal"]}],"justify-self":[{"justify-self":["auto",...pe()]}],"align-content":[{content:["normal",...ae()]}],"align-items":[{items:[...pe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...pe(),{baseline:["","last"]}]}],"place-content":[{"place-content":ae()}],"place-items":[{"place-items":[...pe(),"baseline"]}],"place-self":[{"place-self":["auto",...pe()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[d,"screen",...Y()]}],"min-w":[{"min-w":[d,"screen","none",...Y()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,Ul,ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Re,np]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tp,Ne]}],"font-family":[{font:[BL,Ne,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Re,Ne]}],"line-clamp":[{"line-clamp":[Qe,"none",Re,np]}],leading:[{leading:[l,...L()]}],"list-image":[{"list-image":["none",Re,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,Ne]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Re,ts]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Qe,"auto",Re,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,Ne]}],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",Re,Ne]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:ve()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},va,Re,Ne],radial:["",Re,Ne],conic:[va,Re,Ne]},qL,UL]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:U()}],"rounded-s":[{"rounded-s":U()}],"rounded-e":[{"rounded-e":U()}],"rounded-t":[{"rounded-t":U()}],"rounded-r":[{"rounded-r":U()}],"rounded-b":[{"rounded-b":U()}],"rounded-l":[{"rounded-l":U()}],"rounded-ss":[{"rounded-ss":U()}],"rounded-se":[{"rounded-se":U()}],"rounded-ee":[{"rounded-ee":U()}],"rounded-es":[{"rounded-es":U()}],"rounded-tl":[{"rounded-tl":U()}],"rounded-tr":[{"rounded-tr":U()}],"rounded-br":[{"rounded-br":U()}],"rounded-bl":[{"rounded-bl":U()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Re,Ne]}],"outline-w":[{outline:["",Qe,Ul,ts]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",v,Qu,Wu]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",p,Qu,Wu]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Qe,ts]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",x,Qu,Wu]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Qe,Re,Ne]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Re,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:ve()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Re,Ne]}],filter:[{filter:["","none",Re,Ne]}],blur:[{blur:ye()}],brightness:[{brightness:[Qe,Re,Ne]}],contrast:[{contrast:[Qe,Re,Ne]}],"drop-shadow":[{"drop-shadow":["","none",S,Qu,Wu]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Qe,Re,Ne]}],"hue-rotate":[{"hue-rotate":[Qe,Re,Ne]}],invert:[{invert:["",Qe,Re,Ne]}],saturate:[{saturate:[Qe,Re,Ne]}],sepia:[{sepia:["",Qe,Re,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,Ne]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Re,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Re,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Re,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Re,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Re,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Re,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Re,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Re,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Re,Ne]}],ease:[{ease:["linear","initial",T,Re,Ne]}],delay:[{delay:[Qe,Re,Ne]}],animate:[{animate:["none",N,Re,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Re,Ne]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:De()}],"scale-x":[{"scale-x":De()}],"scale-y":[{"scale-y":De()}],"scale-z":[{"scale-z":De()}],"scale-3d":["scale-3d"],skew:[{skew:qe()}],"skew-x":[{"skew-x":qe()}],"skew-y":[{"skew-y":qe()}],transform:[{transform:[Re,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",Re,Ne]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Re,Ne]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Qe,Ul,ts,np]}],stroke:[{stroke:["none",...H()]}],"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"]}},ZL=RL(KL);function fe(...e){return ZL(J1(e))}const og=Vg("focus-visible:border-ring cursor-pointer focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-sm border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] [&_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 dark:bg-input/20 dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",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-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",xs:"h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",sm:"h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",lg:"h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",icon:"size-7 [&_svg:not([class*='size-'])]:size-3.5","icon-xs":"size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5","icon-sm":"size-6 [&_svg:not([class*='size-'])]:size-3","icon-lg":"size-8 [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{variant:"default",size:"default"}});function ze({className:e,variant:t="default",size:n="default",asChild:r=!1,...s}){const l=r?KE:"button";return h.jsx(l,{"data-slot":"button","data-variant":t,"data-size":n,className:fe(og({variant:t,size:n,className:e})),...s})}const WL=({onCancel:e,isLoading:t})=>h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx(ze,{type:"button",variant:"outline",size:"lg",onClick:e,disabled:t,children:"Cancel"}),h.jsx(ze,{type:"submit",variant:"default",size:"lg",disabled:t,children:"Save"})]});const QL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),XL=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),gw=e=>{const t=XL(e);return t.charAt(0).toUpperCase()+t.slice(1)},S2=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),JL=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var eF={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 tF=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...d},f)=>b.createElement("svg",{ref:f,...eF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:S2("lucide",s),...!l&&!JL(d)&&{"aria-hidden":"true"},...d},[...c.map(([m,v])=>b.createElement(m,v)),...Array.isArray(l)?l:[l]]));const Be=(e,t)=>{const n=b.forwardRef(({className:r,...s},l)=>b.createElement(tF,{ref:l,iconNode:t,className:S2(`lucide-${QL(gw(e))}`,`lucide-${e}`,r),...s}));return n.displayName=gw(e),n};const nF=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],rF=Be("arrow-left",nF);const oF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],w2=Be("arrow-right",oF);const aF=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],sF=Be("arrow-up-down",aF);const iF=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],lF=Be("brain",iF);const cF=[["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"}]],uF=Be("calendar",cF);const dF=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],C2=Be("check",dF);const fF=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_2=Be("chevron-down",fF);const hF=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],mF=Be("chevron-left",hF);const pF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],gF=Be("circle-alert",pF);const vF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],yF=Be("circle-check",vF);const bF=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],xF=Be("circle-play",bF);const SF=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],wF=Be("clock",SF);const CF=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],_F=Be("code",CF);const EF=[["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"}]],TF=Be("copy",EF);const NF=[["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"}]],vw=Be("database",NF);const RF=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],MF=Be("download",RF);const OF=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],AF=Be("eye",OF);const jF=[["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"}]],DF=Be("file-text",jF);const kF=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],zF=Be("funnel",kF);const PF=[["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"}]],LF=Be("git-branch",PF);const FF=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],IF=Be("info",FF);const VF=[["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"}]],$F=Be("key",VF);const UF=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],BF=Be("lightbulb",UF);const HF=[["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"}]],wv=Be("link",HF);const qF=[["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"}]],YF=Be("lock",qF);const GF=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],KF=Be("message-square",GF);const ZF=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],WF=Be("panel-left",ZF);const QF=[["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"}]],XF=Be("pin-off",QF);const JF=[["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"}]],eI=Be("pin",JF);const tI=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yw=Be("plus",tI);const nI=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],rI=Be("refresh-cw",nI);const oI=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],aI=Be("rotate-cw",oI);const sI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],iI=Be("search",sI);const lI=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],E2=Be("settings",lI);const cI=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],uI=Be("sparkles",cI);const dI=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],fI=Be("square-pen",dI);const hI=[["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"}]],bw=Be("table-2",hI);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"}]],pI=Be("trash-2",mI);const gI=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],vI=Be("triangle-alert",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"}]],bI=Be("upload",yI);const xI=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],SI=Be("users",xI);const wI=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],CI=Be("wand-sparkles",wI);const _I=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],EI=Be("x",_I);const TI=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],NI=Be("zap",TI);var RI={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};const lt=(e,t,n,r)=>{const s=b.forwardRef(({color:l="currentColor",size:c=24,stroke:d=2,title:f,className:m,children:v,...p},x)=>b.createElement("svg",{ref:x,...RI[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,m].join(" "),...e==="filled"?{fill:l}:{strokeWidth:d,stroke:l},...p},[f&&b.createElement("title",{key:"svg-title"},f),...r.map(([S,_])=>b.createElement(S,_)),...Array.isArray(v)?v:[v]]));return s.displayName=`${n}`,s};const MI=[["path",{d:"M12.802 2.165l5.575 2.389c.48 .206 .863 .589 1.07 1.07l2.388 5.574c.22 .512 .22 1.092 0 1.604l-2.389 5.575c-.206 .48 -.589 .863 -1.07 1.07l-5.574 2.388c-.512 .22 -1.092 .22 -1.604 0l-5.575 -2.389a2.036 2.036 0 0 1 -1.07 -1.07l-2.388 -5.574a2.036 2.036 0 0 1 0 -1.604l2.389 -5.575c.206 -.48 .589 -.863 1.07 -1.07l5.574 -2.388a2.036 2.036 0 0 1 1.604 0z",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],OI=lt("outline","alert-octagon","AlertOctagon",MI);const AI=[["path",{d:"M12 9v4",key:"svg-0"}],["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],jI=lt("outline","alert-triangle","AlertTriangle",AI);const DI=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],kI=lt("outline","arrow-down","ArrowDown",DI);const zI=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],PI=lt("outline","arrow-up","ArrowUp",zI);const LI=[["path",{d:"M3 9l4 -4l4 4m-4 -4v14",key:"svg-0"}],["path",{d:"M21 15l-4 4l-4 -4m4 4v-14",key:"svg-1"}]],FI=lt("outline","arrows-sort","ArrowsSort",LI);const II=[["path",{d:"M9 19c-4.3 1.4 -4.3 -2.5 -6 -3m12 5v-3.5c0 -1 .1 -1.4 -.5 -2c2.8 -.3 5.5 -1.4 5.5 -6a4.6 4.6 0 0 0 -1.3 -3.2a4.2 4.2 0 0 0 -.1 -3.2s-1.1 -.3 -3.5 1.3a12.3 12.3 0 0 0 -6.2 0c-2.4 -1.6 -3.5 -1.3 -3.5 -1.3a4.2 4.2 0 0 0 -.1 3.2a4.6 4.6 0 0 0 -1.3 3.2c0 4.6 2.7 5.7 5.5 6c-.6 .6 -.6 1.2 -.5 2v3.5",key:"svg-0"}]],VI=lt("outline","brand-github","BrandGithub",II);const $I=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Cv=lt("outline","check","Check",$I);const UI=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],_v=lt("outline","chevron-down","ChevronDown",UI);const BI=[["path",{d:"M7 6v12",key:"svg-0"}],["path",{d:"M18 6l-6 6l6 6",key:"svg-1"}]],HI=lt("outline","chevron-left-pipe","ChevronLeftPipe",BI);const qI=[["path",{d:"M15 6l-6 6l6 6",key:"svg-0"}]],T2=lt("outline","chevron-left","ChevronLeft",qI);const YI=[["path",{d:"M6 6l6 6l-6 6",key:"svg-0"}],["path",{d:"M17 5v13",key:"svg-1"}]],GI=lt("outline","chevron-right-pipe","ChevronRightPipe",YI);const KI=[["path",{d:"M9 6l6 6l-6 6",key:"svg-0"}]],Ev=lt("outline","chevron-right","ChevronRight",KI);const ZI=[["path",{d:"M6 15l6 -6l6 6",key:"svg-0"}]],N2=lt("outline","chevron-up","ChevronUp",ZI);const WI=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],QI=lt("outline","circle-check","CircleCheck",WI);const XI=[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],xw=lt("outline","copy","Copy",XI);const JI=[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],eV=lt("outline","dots","Dots",JI);const tV=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 11l5 5l5 -5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],rp=lt("outline","download","Download",tV);const nV=[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],rV=lt("outline","edit","Edit",nV);const oV=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2",key:"svg-1"}],["path",{d:"M10 12l4 5",key:"svg-2"}],["path",{d:"M10 17l4 -5",key:"svg-3"}]],aV=lt("outline","file-excel","FileExcel",oV);const sV=[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]],R2=lt("outline","filter","Filter",sV);const iV=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]],lV=lt("outline","info-circle","InfoCircle",iV);const cV=[["path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M9 4l0 16",key:"svg-1"}]],uV=lt("outline","layout-sidebar","LayoutSidebar",cV);const dV=[["path",{d:"M12 6l0 -3",key:"svg-0"}],["path",{d:"M16.25 7.75l2.15 -2.15",key:"svg-1"}],["path",{d:"M18 12l3 0",key:"svg-2"}],["path",{d:"M16.25 16.25l2.15 2.15",key:"svg-3"}],["path",{d:"M12 18l0 3",key:"svg-4"}],["path",{d:"M7.75 16.25l-2.15 2.15",key:"svg-5"}],["path",{d:"M6 12l-3 0",key:"svg-6"}],["path",{d:"M7.75 7.75l-2.15 -2.15",key:"svg-7"}]],fV=lt("outline","loader","Loader",dV);const hV=[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]],mV=lt("outline","pin","Pin",hV);const pV=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],gV=lt("outline","plus","Plus",pV);const vV=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],yV=lt("outline","refresh","Refresh",vV);const bV=[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],M2=lt("outline","search","Search",bV);const xV=[["path",{d:"M8 9l4 -4l4 4",key:"svg-0"}],["path",{d:"M16 15l-4 4l-4 -4",key:"svg-1"}]],SV=lt("outline","selector","Selector",xV);const wV=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],CV=lt("outline","settings","Settings",wV);const _V=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],O2=lt("outline","trash","Trash",_V);const EV=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Hi=lt("outline","x","X",EV);const TV=[["path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1",key:"svg-0"}]],NV=lt("filled","layout-sidebar-filled","LayoutSidebarFilled",TV);const RV=[["path",{d:"M15.113 3.21l.094 .083l5.5 5.5a1 1 0 0 1 -1.175 1.59l-3.172 3.171l-1.424 3.797a1 1 0 0 1 -.158 .277l-.07 .08l-1.5 1.5a1 1 0 0 1 -1.32 .082l-.095 -.083l-2.793 -2.792l-3.793 3.792a1 1 0 0 1 -1.497 -1.32l.083 -.094l3.792 -3.793l-2.792 -2.793a1 1 0 0 1 -.083 -1.32l.083 -.094l1.5 -1.5a1 1 0 0 1 .258 -.187l.098 -.042l3.796 -1.425l3.171 -3.17a1 1 0 0 1 1.497 -1.26z",key:"svg-0"}]],MV=lt("filled","pin-filled","PinFilled",RV);function Tv({...e}){return h.jsx(qg,{"data-slot":"sheet",...e})}function OV({...e}){return h.jsx(Xz,{"data-slot":"sheet-trigger",...e})}function AV({...e}){return h.jsx(Gd,{"data-slot":"sheet-close",...e})}function jV({...e}){return h.jsx(Yg,{"data-slot":"sheet-portal",...e})}function DV({className:e,...t}){return h.jsx(Gg,{"data-slot":"sheet-overlay",className:fe("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}function Nv({className:e,children:t,side:n="right",showCloseButton:r=!0,isPinned:s=!1,...l}){return h.jsxs(jV,{children:[!s&&h.jsx(DV,{}),h.jsxs(Kg,{"data-slot":"sheet-content","data-side":n,className:fe("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 z-50 flex flex-col bg-clip-padding text-xs/relaxed 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-none data-[side=right]:sm:max-w-sm",s?"absolute":"fixed",e),...l,children:[t,r&&h.jsx(Gd,{"data-slot":"sheet-close",asChild:!0,children:h.jsxs(ze,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[h.jsx(Hi,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function A2({className:e,...t}){return h.jsx("div",{"data-slot":"sheet-header",className:fe("gap-1.5 p-6 flex flex-col",e),...t})}function j2({className:e,...t}){return h.jsx(OC,{"data-slot":"sheet-title",className:fe("text-foreground text-sm font-medium",e),...t})}function kV({className:e,...t}){return h.jsx(AC,{"data-slot":"sheet-description",className:fe("text-muted-foreground text-xs/relaxed",e),...t})}const Sw=e=>{let t;const n=new Set,r=(m,v)=>{const p=typeof m=="function"?m(t):m;if(!Object.is(p,t)){const x=t;t=v??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(S=>S(t,x))}},s=()=>t,d={setState:r,getState:s,getInitialState:()=>f,subscribe:m=>(n.add(m),()=>n.delete(m))},f=t=e(r,s,d);return d},zV=(e=>e?Sw(e):Sw),PV=e=>e;function LV(e,t=PV){const n=I.useSyncExternalStore(e.subscribe,I.useCallback(()=>t(e.getState()),[e,t]),I.useCallback(()=>t(e.getInitialState()),[e,t]));return I.useDebugValue(n),n}const FV=e=>{const t=zV(e),n=r=>LV(t,r);return Object.assign(n,t),n},Rv=(e=>FV),jr=Rv()((e,t)=>({openSheets:[],recordReferenceData:{tableName:null,columnName:null,referencedColumn:null},openSheet:n=>e(r=>r.openSheets.includes(n)?{openSheets:[...r.openSheets.filter(s=>s!==n),n]}:{openSheets:[...r.openSheets,n]}),closeSheet:n=>e(r=>n?{openSheets:r.openSheets.filter(s=>s!==n)}:{openSheets:r.openSheets.slice(0,-1)}),closeAllSheets:()=>e({openSheets:[]}),toggleSheet:n=>e(r=>r.openSheets.includes(n)?{openSheets:r.openSheets.filter(s=>s!==n)}:(console.log("openSheets",r.openSheets,n),{openSheets:[...r.openSheets,n]})),isSheetOpen:n=>t().openSheets.includes(n),getSheetIndex:n=>t().openSheets.indexOf(n),setRecordReference:(n,r,s)=>e({recordReferenceData:{tableName:n,columnName:r,referencedColumn:s}})}));function jn({className:e,...t}){return h.jsx(aP,{"data-slot":"label",className:fe("gap-2 text-xs/relaxed 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",e),...t})}function kn({...e}){return h.jsx(p6,{"data-slot":"select",...e})}function zn({...e}){return h.jsx(v6,{"data-slot":"select-value",...e})}function Pn({className:e,size:t="default",children:n,...r}){return h.jsxs(g6,{"data-slot":"select-trigger","data-size":t,className:fe("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 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-sm border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 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",e),...r,children:[n,h.jsx(y6,{asChild:!0,children:h.jsx(SV,{className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Ln({className:e,children:t,position:n="item-aligned",align:r="center",...s}){return h.jsx(b6,{children:h.jsxs(x6,{"data-slot":"select-content",className:fe("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-32 rounded-lg 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",n==="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",e),position:n,align:r,...s,children:[h.jsx(IV,{}),h.jsx(S6,{"data-position":n,className:fe("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",n==="popper"&&""),children:t}),h.jsx(VV,{})]})})}function He({className:e,children:t,...n}){return h.jsxs(w6,{"data-slot":"select-item",className:fe("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-sm px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[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",e),...n,children:[h.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center",children:h.jsx(_6,{children:h.jsx(Cv,{className:"pointer-events-none"})})}),h.jsx(C6,{children:t})]})}function IV({className:e,...t}){return h.jsx(E6,{"data-slot":"select-scroll-up-button",className:fe("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:h.jsx(N2,{})})}function VV({className:e,...t}){return h.jsx(T6,{"data-slot":"select-scroll-down-button",className:fe("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5",e),...t,children:h.jsx(_v,{})})}const $V=({index:e})=>{const{control:t,watch:n}=Bt(),r=n("fields")?.filter(l=>l.columnName?.trim()),s=n(`fields.${e}.columnName`);return h.jsx(Mr,{control:t,name:`foreignKeys.${e}`,render:({field:l})=>h.jsx("div",{className:"flex flex-col gap-2 w-full",children:h.jsxs(kn,{defaultValue:s||"none",value:l.value?.columnName,onValueChange:c=>l.onChange({...l.value,columnName:c}),children:[h.jsx(Pn,{className:"w-full",children:h.jsx(zn,{placeholder:r?.length?"Select a column":"No columns found"})}),h.jsx(Ln,{children:r?.length>0?r.map(c=>h.jsx(He,{value:c.columnName,children:c.columnName},c.columnName)):h.jsx(He,{value:"none",disabled:!0,children:"No columns found"})})]})})})};var qi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},UV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},BV=class{#e=UV;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},as=new BV;function HV(e){setTimeout(e,0)}var ps=typeof window>"u"||"Deno"in globalThis;function An(){}function qV(e,t){return typeof e=="function"?e(t):e}function ag(e){return typeof e=="number"&&e>=0&&e!==1/0}function D2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function wa(e,t){return typeof e=="function"?e(t):e}function Tr(e,t){return typeof e=="function"?e(t):e}function ww(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:l,queryKey:c,stale:d}=e;if(c){if(r){if(t.queryHash!==Mv(c,t.options))return!1}else if(!lc(t.queryKey,c))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||s&&s!==t.state.fetchStatus||l&&!l(t))}function Cw(e,t){const{exact:n,status:r,predicate:s,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(gs(t.options.mutationKey)!==gs(l))return!1}else if(!lc(t.options.mutationKey,l))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Mv(e,t){return(t?.queryKeyHashFn||gs)(e)}function gs(e){return JSON.stringify(e,(t,n)=>sg(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function lc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>lc(e[n],t[n])):!1}var YV=Object.prototype.hasOwnProperty;function k2(e,t){if(e===t)return e;const n=_w(e)&&_w(t);if(!n&&!(sg(e)&&sg(t)))return t;const s=(n?e:Object.keys(e)).length,l=n?t:Object.keys(t),c=l.length,d=n?new Array(c):{};let f=0;for(let m=0;m<c;m++){const v=n?m:l[m],p=e[v],x=t[v];if(p===x){d[v]=p,(n?m<s:YV.call(e,v))&&f++;continue}if(p===null||x===null||typeof p!="object"||typeof x!="object"){d[v]=x;continue}const S=k2(p,x);d[v]=S,S===p&&f++}return s===c&&f===s?e:d}function Md(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function _w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sg(e){if(!Ew(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ew(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ew(e){return Object.prototype.toString.call(e)==="[object Object]"}function GV(e){return new Promise(t=>{as.setTimeout(t,e)})}function ig(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?k2(e,t):t}function KV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function ZV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ov=Symbol();function z2(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ov?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P2(e,t){return typeof e=="function"?e(...t):!!e}var WV=class extends qi{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ps&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Av=new WV;function lg(){let e,t;const n=new Promise((s,l)=>{e=s,t=l});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function QV(e){return e.state.status==="success"}var XV=HV;function JV(){let e=[],t=0,n=d=>{d()},r=d=>{d()},s=XV;const l=d=>{t?e.push(d):s(()=>{n(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||c()}return f},batchCalls:d=>(...f)=>{l(()=>{d(...f)})},schedule:l,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d},setScheduler:d=>{s=d}}}var tn=JV(),e$=class extends qi{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ps&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Od=new e$;function t$(e){return Math.min(1e3*2**e,3e4)}function L2(e){return(e??"online")==="online"?Od.isOnline():!0}var cg=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function F2(e){let t=!1,n=0,r;const s=lg(),l=()=>s.status!=="pending",c=w=>{if(!l()){const C=new cg(w);x(C),e.onCancel?.(C)}},d=()=>{t=!0},f=()=>{t=!1},m=()=>Av.isFocused()&&(e.networkMode==="always"||Od.isOnline())&&e.canRun(),v=()=>L2(e.networkMode)&&e.canRun(),p=w=>{l()||(r?.(),s.resolve(w))},x=w=>{l()||(r?.(),s.reject(w))},S=()=>new Promise(w=>{r=C=>{(l()||m())&&w(C)},e.onPause?.()}).then(()=>{r=void 0,l()||e.onContinue?.()}),_=()=>{if(l())return;let w;const C=n===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(T){w=Promise.reject(T)}Promise.resolve(w).then(p).catch(T=>{if(l())return;const N=e.retry??(ps?0:3),M=e.retryDelay??t$,R=typeof M=="function"?M(n,T):M,j=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,T);if(t||!j){x(T);return}n++,e.onFail?.(n,T),GV(R).then(()=>m()?void 0:S()).then(()=>{t?x(T):_()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(r?.(),s),cancelRetry:d,continueRetry:f,canStart:v,start:()=>(v()?_():S().then(_),s)}}var I2=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ag(this.gcTime)&&(this.#e=as.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ps?1/0:300*1e3))}clearGcTimeout(){this.#e&&(as.clearTimeout(this.#e),this.#e=void 0)}},n$=class extends I2{#e;#t;#n;#o;#r;#s;#i;constructor(e){super(),this.#i=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Nw(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Nw(this.options);t.data!==void 0&&(this.setState(Tw(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=ig(this.state.data,e,this.options);return this.#a({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(An).catch(An):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Tr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ov||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>wa(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!D2(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#i?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,r=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(this.#i=!0,n.signal)})},s=()=>{const d=z2(this.options,t),m=(()=>{const v={client:this.#o,queryKey:this.queryKey,meta:this.meta};return r(v),v})();return this.#i=!1,this.options.persister?this.options.persister(d,m,this):d(m)},c=(()=>{const d={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:s};return r(d),d})();this.options.behavior?.onFetch(c,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#a({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=F2({initialPromise:t?.initialPromise,fn:c.fetchFn,onCancel:d=>{d instanceof cg&&d.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(d,f)=>{this.#a({type:"failed",failureCount:d,error:f})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0});try{const d=await this.#r.start();if(d===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(d),this.#n.config.onSuccess?.(d,this),this.#n.config.onSettled?.(d,this.state.error,this),d}catch(d){if(d instanceof cg){if(d.silent)return this.#r.promise;if(d.revert){if(this.state.data===void 0)throw d;return this.state.data}}throw this.#a({type:"error",error:d}),this.#n.config.onError?.(d,this),this.#n.config.onSettled?.(this.state.data,d,this),d}finally{this.scheduleGc()}}#a(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...V2(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Tw(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),tn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function V2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:L2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Tw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Nw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var r$=class extends qi{constructor(e,t){super(),this.options=t,this.#e=e,this.#a=null,this.#i=lg(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#o=void 0;#r;#s;#i;#a;#p;#f;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Rw(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ug(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ug(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Tr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),t._defaulted&&!Md(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&Mw(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||Tr(this.options.enabled,this.#t)!==Tr(t.enabled,this.#t)||wa(this.options.staleTime,this.#t)!==wa(t.staleTime,this.#t))&&this.#g();const s=this.#v();r&&(this.#t!==n||Tr(this.options.enabled,this.#t)!==Tr(t.enabled,this.#t)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return a$(this,n)&&(this.#o=n,this.#s=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#o}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#i.status==="pending"&&this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#w();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(An)),t}#g(){this.#x();const e=wa(this.options.staleTime,this.#t);if(ps||this.#o.isStale||!ag(e))return;const n=D2(this.#o.dataUpdatedAt,e)+1;this.#c=as.setTimeout(()=>{this.#o.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#S(),this.#l=e,!(ps||Tr(this.options.enabled,this.#t)===!1||!ag(this.#l)||this.#l===0)&&(this.#u=as.setInterval(()=>{(this.options.refetchIntervalInBackground||Av.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(as.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(as.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,s=this.#o,l=this.#r,c=this.#s,f=e!==n?e.state:this.#n,{state:m}=e;let v={...m},p=!1,x;if(t._optimisticResults){const L=this.hasListeners(),B=!L&&Rw(e,t),ne=L&&Mw(e,n,t,r);(B||ne)&&(v={...v,...V2(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:S,errorUpdatedAt:_,status:w}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&w==="pending"){let L;s?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(L=s.data,C=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,L!==void 0&&(w="success",x=ig(s?.data,L,t),p=!0)}if(t.select&&x!==void 0&&!C)if(s&&x===l?.data&&t.select===this.#p)x=this.#f;else try{this.#p=t.select,x=t.select(x),x=ig(s?.data,x,t),this.#f=x,this.#a=null}catch(L){this.#a=L}this.#a&&(S=this.#a,x=this.#f,_=Date.now(),w="error");const T=v.fetchStatus==="fetching",N=w==="pending",M=w==="error",R=N&&T,j=x!==void 0,D={status:w,fetchStatus:v.fetchStatus,isPending:N,isSuccess:w==="success",isError:M,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:v.dataUpdatedAt,error:S,errorUpdatedAt:_,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>f.dataUpdateCount||v.errorUpdateCount>f.errorUpdateCount,isFetching:T,isRefetching:T&&!N,isLoadingError:M&&!j,isPaused:v.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:M&&j,isStale:jv(e,t),refetch:this.refetch,promise:this.#i,isEnabled:Tr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=J=>{D.status==="error"?J.reject(D.error):D.data!==void 0&&J.resolve(D.data)},B=()=>{const J=this.#i=D.promise=lg();L(J)},ne=this.#i;switch(ne.status){case"pending":e.queryHash===n.queryHash&&L(ne);break;case"fulfilled":(D.status==="error"||D.data!==ne.value)&&B();break;case"rejected":(D.status!=="error"||D.error!==ne.reason)&&B();break}}return D}updateResult(){const e=this.#o,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#s=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Md(t,e))return;this.#o=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,s=typeof r=="function"?r():r;if(s==="all"||!s&&!this.#m.size)return!0;const l=new Set(s??this.#m);return this.options.throwOnError&&l.add("error"),Object.keys(this.#o).some(c=>{const d=c;return this.#o[d]!==e[d]&&l.has(d)})};this.#C({listeners:n()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(e){tn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function o$(e,t){return Tr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Rw(e,t){return o$(e,t)||e.state.data!==void 0&&ug(e,t,t.refetchOnMount)}function ug(e,t,n){if(Tr(t.enabled,e)!==!1&&wa(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&jv(e,t)}return!1}function Mw(e,t,n,r){return(e!==t||Tr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&jv(e,n)}function jv(e,t){return Tr(t.enabled,e)!==!1&&e.isStaleByTime(wa(t.staleTime,e))}function a$(e,t){return!Md(e.getCurrentResult(),t)}function Ow(e){return{onFetch:(t,n)=>{const r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],c=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},f=0;const m=async()=>{let v=!1;const p=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},x=z2(t.options,t.fetchOptions),S=async(_,w,C)=>{if(v)return Promise.reject();if(w==null&&_.pages.length)return Promise.resolve(_);const N=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};return p(A),A})(),M=await x(N),{maxPages:R}=t.options,j=C?ZV:KV;return{pages:j(_.pages,M,R),pageParams:j(_.pageParams,w,R)}};if(s&&l.length){const _=s==="backward",w=_?s$:Aw,C={pages:l,pageParams:c},T=w(r,C);d=await S(C,T,_)}else{const _=e??l.length;do{const w=f===0?c[0]??r.initialPageParam:Aw(r,d);if(f>0&&w==null)break;d=await S(d,w),f++}while(f<_)}return d};t.options.persister?t.fetchFn=()=>t.options.persister?.(m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=m}}}function Aw(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function s$(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var i$=class extends I2{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||$2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=F2({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(l,c)=>{this.#r({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",s=!this.#o.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:s}),await this.#n.config.onMutate?.(e,this,n);const c=await this.options.onMutate?.(e,n);c!==this.state.context&&this.#r({type:"pending",context:c,variables:e,isPaused:s})}const l=await this.#o.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,n),await this.options.onSuccess?.(l,e,this.state.context,n),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(l,null,e,this.state.context,n),this.#r({type:"success",data:l}),l}catch(l){try{throw await this.#n.config.onError?.(l,e,this.state.context,this,n),await this.options.onError?.(l,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,l,e,this.state.context,n),l}finally{this.#r({type:"error",error:l})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),tn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function $2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var l$=class extends qi{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new i$({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Xu(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Xu(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Xu(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(s=>s.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Xu(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){tn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Cw(t,n))}findAll(e={}){return this.getAll().filter(t=>Cw(e,t))}notify(e){tn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return tn.batch(()=>Promise.all(e.map(t=>t.continue().catch(An))))}};function Xu(e){return e.options.scope?.id}var c$=class extends qi{#e;#t=void 0;#n;#o;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Md(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&gs(n.mutationKey)!==gs(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#s(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#s()}mutate(t,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??$2();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#s(t){tn.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#o.onSuccess?.(t.data,n,r,s),this.#o.onSettled?.(t.data,null,n,r,s)):t?.type==="error"&&(this.#o.onError?.(t.error,n,r,s),this.#o.onSettled?.(void 0,t.error,n,r,s))}this.listeners.forEach(n=>{n(this.#t)})})}},u$=class extends qi{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,s=t.queryHash??Mv(r,t);let l=this.get(s);return l||(l=new n$({client:e,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){tn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ww(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ww(e,n)):t}notify(e){tn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){tn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){tn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},d$=class{#e;#t;#n;#o;#r;#s;#i;#a;constructor(e={}){this.#e=e.queryCache||new u$,this.#t=e.mutationCache||new l$,this.#n=e.defaultOptions||{},this.#o=new Map,this.#r=new Map,this.#s=0}mount(){this.#s++,this.#s===1&&(this.#i=Av.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#a=Od.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#s--,this.#s===0&&(this.#i?.(),this.#i=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(wa(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(r.queryHash)?.state.data,c=qV(t,l);if(c!==void 0)return this.#e.build(this,r).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return tn.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;tn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return tn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=tn.batch(()=>this.#e.findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(An).catch(An)}invalidateQueries(e,t={}){return tn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=tn.batch(()=>this.#e.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let l=s.fetch(void 0,n);return n.throwOnError||(l=l.catch(An)),s.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(r).then(An)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(wa(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(An).catch(An)}fetchInfiniteQuery(e){return e.behavior=Ow(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(An).catch(An)}ensureInfiniteQueryData(e){return e.behavior=Ow(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Od.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#o.set(gs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{lc(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(gs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{lc(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Mv(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ov&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},U2=b.createContext(void 0),Yi=e=>{const t=b.useContext(U2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},f$=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(U2.Provider,{value:e,children:t})),B2=b.createContext(!1),h$=()=>b.useContext(B2);B2.Provider;function m$(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var p$=b.createContext(m$()),g$=()=>b.useContext(p$),v$=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},y$=e=>{b.useEffect(()=>{e.clearReset()},[e])},b$=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||P2(n,[e.error,r])),x$=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},S$=(e,t)=>e.isLoading&&e.isFetching&&!t,w$=(e,t)=>e?.suspense&&t.isPending,jw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function C$(e,t,n){const r=h$(),s=g$(),l=Yi(),c=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(c),c._optimisticResults=r?"isRestoring":"optimistic",x$(c),v$(c,s),y$(s);const d=!l.getQueryCache().get(c.queryHash),[f]=b.useState(()=>new t(l,c)),m=f.getOptimisticResult(c),v=!r&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(p=>{const x=v?f.subscribe(tn.batchCalls(p)):An;return f.updateResult(),x},[f,v]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),b.useEffect(()=>{f.setOptions(c)},[c,f]),w$(c,m))throw jw(c,f,s);if(b$({result:m,errorResetBoundary:s,throwOnError:c.throwOnError,query:l.getQueryCache().get(c.queryHash),suspense:c.suspense}))throw m.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(c,m),c.experimental_prefetchInRender&&!ps&&S$(m,r)&&(d?jw(c,f,s):l.getQueryCache().get(c.queryHash)?.promise)?.catch(An).finally(()=>{f.updateResult()}),c.notifyOnChangeProps?m:f.trackResult(m)}function Dv(e,t){return C$(e,r$)}function hf(e,t){const n=Yi(),[r]=b.useState(()=>new c$(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const s=b.useSyncExternalStore(b.useCallback(c=>r.subscribe(tn.batchCalls(c)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),l=b.useCallback((c,d)=>{r.mutate(c,d).catch(An)},[r]);if(s.error&&P2(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:l,mutateAsync:s.mutate}}function H2(e,t,n){try{return e(t)}catch(r){return AM("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,r,n),null}}function mo(e){function t(n){if(typeof n>"u")return null;let r="";if(Array.isArray(n)){if(n[0]===void 0)return null;r=n[0]}return typeof n=="string"&&(r=n),H2(e.parse,r)}return{type:"single",eq:(n,r)=>n===r,...e,parseServerSide:t,withDefault(n){return{...this,defaultValue:n,parseServerSide(r){return t(r)??n}}},withOptions(n){return{...this,...n}}}}mo({parse:e=>e,serialize:String});mo({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});mo({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});mo({parse:e=>{const t=parseInt(e,16);return t==t?t:null},serialize:e=>{const t=Math.round(e).toString(16);return(t.length&1?"0":"")+t}});mo({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});mo({parse:e=>e.toLowerCase()==="true",serialize:String});function kv(e,t){return e.valueOf()===t.valueOf()}mo({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:kv});mo({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:kv});mo({parse:e=>{const t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:kv});function Di(e){return mo({parse:t=>{try{const n=JSON.parse(t);if("~standard"in e){const r=e["~standard"].validate(n);if(r instanceof Promise)throw new Error("[nuqs] Only synchronous Standard Schemas are supported in parseAsJson.");return r.issues?null:r.value}return e(n)}catch{return null}},serialize:t=>JSON.stringify(t),eq(t,n){return t===n||JSON.stringify(t)===JSON.stringify(n)}})}const op=Ng(),_$={};function E$(e,t={}){const n=b.useId(),r=IM(),s=VM(),{history:l="replace",scroll:c=r?.scroll??!1,shallow:d=r?.shallow??!0,throttleMs:f=Xl.timeMs,limitUrlUpdates:m=r?.limitUrlUpdates,clearOnDefault:v=r?.clearOnDefault??!0,startTransition:p,urlKeys:x=_$}=t,S=Object.keys(e).join(","),_=b.useMemo(()=>Object.fromEntries(Object.keys(e).map(L=>[L,x[L]??L])),[S,JSON.stringify(x)]),w=FM(Object.values(_)),C=w.searchParams,T=b.useRef({}),N=b.useMemo(()=>Object.fromEntries(Object.keys(e).map(L=>[L,e[L].defaultValue??null])),[Object.values(e).map(({defaultValue:L})=>L).join(",")]),M=Am.useQueuedQueries(Object.values(_)),[R,j]=b.useState(()=>ap(e,x,C??new URLSearchParams,M).state),A=b.useRef(R);if(At("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,S,R,C),Object.keys(T.current).join("&")!==Object.values(_).join("&")){const{state:L,hasChanged:B}=ap(e,x,C,M,T.current,A.current);B&&(At("[nuq+ %s `%s`] State changed: %O",n,S,{state:L,initialSearchParams:C,queuedQueries:M,queryRef:T.current,stateRef:A.current}),A.current=L,j(L)),T.current=Object.fromEntries(Object.entries(_).map(([ne,J])=>[J,e[ne]?.type==="multi"?C?.getAll(J):C?.get(J)??null]))}b.useEffect(()=>{const{state:L,hasChanged:B}=ap(e,x,C,M,T.current,A.current);B&&(At("[nuq+ %s `%s`] State changed: %O",n,S,{state:L,initialSearchParams:C,queuedQueries:M,queryRef:T.current,stateRef:A.current}),A.current=L,j(L))},[Object.values(_).map(L=>`${L}=${C?.getAll(L)}`).join("&"),JSON.stringify(M)]),b.useEffect(()=>{const L=Object.keys(e).reduce((B,ne)=>(B[ne]=({state:J,query:ie})=>{j(ue=>{const{defaultValue:ae}=e[ne],pe=_[ne],k=J??ae??null,Y=ue[ne]??ae??null;return Object.is(Y,k)?(At("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,S,pe,J,ae,A.current),ue):(A.current={...A.current,[ne]:k},T.current[pe]=ie,At("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,S,pe,J,ae,A.current),A.current)})},B),{});for(const B of Object.keys(e)){const ne=_[B];At("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,ne,S),op.on(ne,L[B])}return()=>{for(const B of Object.keys(e)){const ne=_[B];At("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,ne,S),op.off(ne,L[B])}}},[S,_]);const D=b.useCallback((L,B={})=>{const ne=Object.fromEntries(Object.keys(e).map(Y=>[Y,null])),J=typeof L=="function"?L(Dw(A.current,N))??ne:L??ne;At("[nuq+ %s `%s`] setState: %O",n,S,J);let ie,ue=0,ae=!1;const pe=[];for(let[Y,H]of Object.entries(J)){const ee=e[Y],ve=_[Y];if(!ee||H===void 0)continue;(B.clearOnDefault??ee.clearOnDefault??v)&&H!==null&&ee.defaultValue!==void 0&&(ee.eq??((U,W)=>U===W))(H,ee.defaultValue)&&(H=null);const z=H===null?null:(ee.serialize??String)(H);op.emit(ve,{state:H,query:z});const P={key:ve,query:z,options:{history:B.history??ee.history??l,shallow:B.shallow??ee.shallow??d,scroll:B.scroll??ee.scroll??c,startTransition:B.startTransition??ee.startTransition??p}};if(B?.limitUrlUpdates?.method==="debounce"||m?.method==="debounce"||ee.limitUrlUpdates?.method==="debounce"){P.options.shallow===!0&&console.warn(fc(422));const U=B?.limitUrlUpdates?.timeMs??m?.timeMs??ee.limitUrlUpdates?.timeMs??Xl.timeMs,W=Am.push(P,U,w,s);ue<U&&(ie=W,ue=U)}else{const U=B?.limitUrlUpdates?.timeMs??ee?.limitUrlUpdates?.timeMs??m?.timeMs??B.throttleMs??ee.throttleMs??f;pe.push(Am.abort(ve)),ad.push(P,U),ae=!0}}const k=pe.reduce((Y,H)=>H(Y),ae?ad.flush(w,s):ad.getPendingPromise(w));return ie??k},[S,l,d,c,f,m?.method,m?.timeMs,p,_,w.updateUrl,w.getSearchParamsSnapshot,w.rateLimitFactor,s,N]);return[b.useMemo(()=>Dw(R,N),[R,N]),D]}function ap(e,t,n,r,s,l){let c=!1;const d=Object.entries(e).reduce((f,[m,v])=>{const p=t?.[m]??m,x=r[p],S=v.type==="multi"?[]:null,_=x===void 0?(v.type==="multi"?n?.getAll(p):n?.get(p))??S:x;return s&&l&&g1(s[p]??S,_)?(f[m]=l[m]??null,f):(c=!0,f[m]=(BM(_)?null:H2(v.parse,_,p))??null,s&&(s[p]=_),f)},{});if(!c){const f=Object.keys(e),m=Object.keys(l??{});c=f.length!==m.length||f.some(v=>!m.includes(v))}return{state:d,hasChanged:c}}function Dw(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function Ae(e,t={}){const{parse:n,type:r,serialize:s,eq:l,defaultValue:c,...d}=t,[{[e]:f},m]=E$({[e]:{parse:n??(v=>v),type:r,serialize:s,eq:l,defaultValue:c}},d);return[f,b.useCallback((v,p={})=>m(x=>({[e]:typeof v=="function"?v(x[e]):v}),p),[e,m])]}const we={SIDEBAR_TABLE_SEARCH:"s",ACTIVE_TABLE:"table",ACTIVE_TAB:"t",COLUMN_NAME:"columnName",CACHE_KEYS:{TABLES_LIST:"tablesList",TABLE_COLUMNS:"tableColumns",TABLE_DATA:"tableData",TABLE_DEFAULT_PAGE:1,TABLE_DEFAULT_LIMIT:50},TABLE_STATE_KEYS:{SORT:"sort",ORDER:"order",PAGE:"page",LIMIT:"limit",FILTERS:"filters"},REFERENCED_TABLE_STATE_KEYS:{ACTIVE_TABLE:"rTable",PAGE:"rPage",DEFAULT_PAGE:1,LIMIT:"rLimit",DEFAULT_LIMIT:30,FILTERS:"rFilters",SORT:"rSort",ORDER:"rOrder"},HOVER_ZONE:20,HOVER_DELAY:100},T$=[{id:"table",label:"Table"},{id:"schema",label:"Schema"},{id:"indexes",label:"Indexes"},{id:"runner",label:"Runner"},{id:"logs",label:"Logs"},{id:"visualizer",label:"Visualizer"}],N$={GITHUB:"https://github.com/husamql3/db-studio"},Ss="http://localhost:3333",Bo=e=>{let t;const[n]=Ae(we.ACTIVE_TABLE);e?t=e:t=n??"";const{data:r,isLoading:s,isRefetching:l,error:c,refetch:d}=Dv({queryKey:[we.CACHE_KEYS.TABLE_COLUMNS,t],queryFn:async()=>{try{const f=await fetch(`${Ss}/tables/${t}/columns`);if(!f.ok)throw new Error("Failed to fetch table columns");const m=await f.json();return console.log("useTableCols",m),m}catch(f){throw console.error("Error fetching table columns:",f),f}},enabled:!!t});return{tableCols:r,isLoadingTableCols:s,isRefetchingTableCols:l,errorTableCols:c,refetchTableCols:d}},R$=({index:e})=>{const{tableCols:t,isLoadingTableCols:n}=Bo(),{control:r}=Bt();return Ur({control:r,name:`foreignKeys.${e}`})?h.jsx(Mr,{control:r,name:`foreignKeys.${e}`,render:({field:l})=>h.jsxs(kn,{value:l.value?.referencedColumn,onValueChange:c=>l.onChange({...l.value,referencedColumn:c}),disabled:n,children:[h.jsx(Pn,{className:"w-full flex-1",disabled:n||!t?.length,children:h.jsx(zn,{placeholder:t?.length?"Select a column":"No columns found"})}),h.jsx(Ln,{children:t&&t.length>0&&n?h.jsx(He,{value:"none",disabled:!0,children:"No columns found"}):t?.filter(c=>c.columnName?.trim()).map(c=>h.jsx(He,{value:c.columnName,children:c.columnName},c.columnName))})]})}):null},q2={numeric:[{value:"int2",label:"int2",description:"Signed two-byte integer"},{value:"int4",label:"int4",description:"Signed four-byte integer"},{value:"int8",label:"int8",description:"Signed eight-byte integer"},{value:"float4",label:"float4",description:"Single precision floating-point number (4 bytes)"},{value:"float8",label:"float8",description:"Double precision floating-point number (8 bytes)"},{value:"numeric",label:"numeric",description:"Exact numeric of selectable precision"},{value:"serial",label:"serial",description:"Auto-incrementing four-byte integer"},{value:"bigserial",label:"bigserial",description:"Auto-incrementing eight-byte integer"}],text:[{value:"text",label:"text",description:"Variable-length character string"},{value:"varchar",label:"varchar",description:"Variable-length character string"},{value:"char",label:"char",description:"Fixed-length character string"},{value:"uuid",label:"uuid",description:"Universally unique identifier"}],boolean:[{value:"boolean",label:"boolean",description:"Logical boolean (true/false)"}],datetime:[{value:"date",label:"date",description:"Calendar date (year, month, day)"},{value:"time",label:"time",description:"Time of day (no time zone)"},{value:"timestamp",label:"timestamp",description:"Date and time (no time zone)"},{value:"timestamptz",label:"timestamptz",description:"Date and time with time zone"},{value:"interval",label:"interval",description:"Time span"}],json:[{value:"json",label:"json",description:"Textual JSON data"},{value:"jsonb",label:"jsonb",description:"Binary JSON data, decomposed"}],binary:[{value:"bytea",label:"bytea",description:'Binary data ("byte array")'}],network:[{value:"inet",label:"inet",description:"IPv4 or IPv6 host address"},{value:"cidr",label:"cidr",description:"IPv4 or IPv6 network address"},{value:"macaddr",label:"macaddr",description:"MAC (Media Access Control) address"},{value:"macaddr8",label:"macaddr8",description:"MAC address (EUI-64 format)"}],geometric:[{value:"point",label:"point",description:"Geometric point on a plane"},{value:"line",label:"line",description:"Infinite line on a plane"},{value:"polygon",label:"polygon",description:"Closed geometric path on a plane"}],other:[{value:"xml",label:"xml",description:"XML data"}]};Object.values(q2).flat().reduce((e,t)=>(e[t.value]=t.label,e),{});const Y2=["serial","bigserial"],G2=["int2","int4","int8","float4","float8","numeric","text","varchar","char","uuid","boolean","date","time","timestamp","timestamptz","interval","json","jsonb","bytea","inet","cidr","macaddr","macaddr8"],kw=[{name:"isNullable",label:"Is Nullable",description:"Specify if the column can assume a NULL value if no value is provided"},{name:"isUnique",label:"Is Unique",description:"Enforce if values in the column should be unique across rows"},{name:"isIdentity",label:"Is Identity",description:"Automatically assign a sequential unique number to the column"},{name:"isArray",label:"Define as Array",description:"Define your column as a variable-length multidimensional array"}],K2=[{value:"NO ACTION",label:"No action"},{value:"RESTRICT",label:"Restrict"},{value:"CASCADE",label:"Cascade"},{value:"SET NULL",label:"Set null"},{value:"SET DEFAULT",label:"Set default"}],M$=({index:e})=>{const{control:t}=Bt();return h.jsx(Mr,{control:t,name:`foreignKeys.${e}.onDelete`,defaultValue:"NO ACTION",render:({field:n})=>h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(jn,{htmlFor:`foreignKeys.${e}.onDelete`,children:"Action if referenced row is deleted"}),h.jsxs(kn,{value:n.value,onValueChange:r=>n.onChange(r),children:[h.jsx(Pn,{className:"w-full flex-1",children:h.jsx(zn,{placeholder:"Select an action"})}),h.jsx(Ln,{children:K2.map(r=>h.jsx(He,{value:r.value,children:r.label},r.value))})]})]})})},O$=({index:e})=>{const{control:t}=Bt();return h.jsx(Mr,{control:t,name:`foreignKeys.${e}.onUpdate`,defaultValue:"NO ACTION",render:({field:n})=>h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(jn,{htmlFor:`foreignKeys.${e}.onUpdate`,children:"Action if referenced row is updated"}),h.jsxs(kn,{value:n.value,onValueChange:r=>n.onChange(r),children:[h.jsx(Pn,{className:"w-full flex-1",children:h.jsx(zn,{placeholder:"Select an action"})}),h.jsx(Ln,{children:K2.map(r=>h.jsx(He,{value:r.value,children:r.label},r.value))})]})]})})},A$=({index:e})=>{const{control:t,watch:n}=Bt(),r=n(`foreignKeys.${e}.referencedTable`),s=Ur({control:t,name:`foreignKeys.${e}`});return!r||!s?null:h.jsxs("div",{className:"flex flex-col gap-4",children:[h.jsxs("p",{className:"text-xs text-muted-foreground",children:["Select columns from"," ",h.jsx("span",{className:"font-mono text-primary",children:s.referencedTable||"Unnamed table"})," ","to reference to"]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"grid grid-cols-2",children:[h.jsx(jn,{htmlFor:`foreignKeys.${e}.columnName`,children:n("tableName")||"Unnamed table"}),h.jsx(jn,{htmlFor:`foreignKeys.${e}.referencedColumn`,children:s.referencedTable||"Unnamed table"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx($V,{index:e}),h.jsx(w2,{className:"size-6 text-muted-foreground"})]}),h.jsx("div",{className:"flex items-center gap-2",children:h.jsx(R$,{index:e})})]}),h.jsx("hr",{className:"my-8 border-zinc-800"}),h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsx(O$,{index:e}),h.jsx(M$,{index:e})]})]})]})};var zw=1,j$=.9,D$=.8,k$=.17,sp=.1,ip=.999,z$=.9999,P$=.99,L$=/[\\\/_+.#"@\[\(\{&]/,F$=/[\\\/_+.#"@\[\(\{&]/g,I$=/[\s-]/,Z2=/[\s-]/g;function dg(e,t,n,r,s,l,c){if(l===t.length)return s===e.length?zw:P$;var d=`${s},${l}`;if(c[d]!==void 0)return c[d];for(var f=r.charAt(l),m=n.indexOf(f,s),v=0,p,x,S,_;m>=0;)p=dg(e,t,n,r,m+1,l+1,c),p>v&&(m===s?p*=zw:L$.test(e.charAt(m-1))?(p*=D$,S=e.slice(s,m-1).match(F$),S&&s>0&&(p*=Math.pow(ip,S.length))):I$.test(e.charAt(m-1))?(p*=j$,_=e.slice(s,m-1).match(Z2),_&&s>0&&(p*=Math.pow(ip,_.length))):(p*=k$,s>0&&(p*=Math.pow(ip,m-s))),e.charAt(m)!==t.charAt(l)&&(p*=z$)),(p<sp&&n.charAt(m-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(m-1)!==r.charAt(l))&&(x=dg(e,t,n,r,m+1,l+2,c),x*sp>p&&(p=x*sp)),p>v&&(v=p),m=n.indexOf(f,m+1);return c[d]=v,v}function Pw(e){return e.toLowerCase().replace(Z2," ")}function V$(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,dg(e,t,Pw(e),Pw(t),0,0,{})}var Bl='[cmdk-group=""]',lp='[cmdk-group-items=""]',$$='[cmdk-group-heading=""]',W2='[cmdk-item=""]',Lw=`${W2}:not([aria-disabled="true"])`,fg="cmdk-item-select",bi="data-value",U$=(e,t,n)=>V$(e,t,n),Q2=b.createContext(void 0),Ec=()=>b.useContext(Q2),X2=b.createContext(void 0),zv=()=>b.useContext(X2),J2=b.createContext(void 0),eT=b.forwardRef((e,t)=>{let n=xi(()=>{var P,U;return{search:"",value:(U=(P=e.value)!=null?P:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=xi(()=>new Set),s=xi(()=>new Map),l=xi(()=>new Map),c=xi(()=>new Set),d=tT(e),{label:f,children:m,value:v,onValueChange:p,filter:x,shouldFilter:S,loop:_,disablePointerSelection:w=!1,vimBindings:C=!0,...T}=e,N=nn(),M=nn(),R=nn(),j=b.useRef(null),A=J$();vs(()=>{if(v!==void 0){let P=v.trim();n.current.value=P,D.emit()}},[v]),vs(()=>{A(6,ue)},[]);let D=b.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,U,W)=>{var oe,he,X,ye;if(!Object.is(n.current[P],U)){if(n.current[P]=U,P==="search")ie(),ne(),A(1,J);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let _e=document.getElementById(R);_e?_e.focus():(oe=document.getElementById(N))==null||oe.focus()}if(A(7,()=>{var _e;n.current.selectedItemId=(_e=ae())==null?void 0:_e.id,D.emit()}),W||A(5,ue),((he=d.current)==null?void 0:he.value)!==void 0){let _e=U??"";(ye=(X=d.current).onValueChange)==null||ye.call(X,_e);return}}D.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),L=b.useMemo(()=>({value:(P,U,W)=>{var oe;U!==((oe=l.current.get(P))==null?void 0:oe.value)&&(l.current.set(P,{value:U,keywords:W}),n.current.filtered.items.set(P,B(U,W)),A(2,()=>{ne(),D.emit()}))},item:(P,U)=>(r.current.add(P),U&&(s.current.has(U)?s.current.get(U).add(P):s.current.set(U,new Set([P]))),A(3,()=>{ie(),ne(),n.current.value||J(),D.emit()}),()=>{l.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let W=ae();A(4,()=>{ie(),W?.getAttribute("id")===P&&J(),D.emit()})}),group:P=>(s.current.has(P)||s.current.set(P,new Set),()=>{l.current.delete(P),s.current.delete(P)}),filter:()=>d.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:N,inputId:R,labelId:M,listInnerRef:j}),[]);function B(P,U){var W,oe;let he=(oe=(W=d.current)==null?void 0:W.filter)!=null?oe:U$;return P?he(P,n.current.search,U):0}function ne(){if(!n.current.search||d.current.shouldFilter===!1)return;let P=n.current.filtered.items,U=[];n.current.filtered.groups.forEach(oe=>{let he=s.current.get(oe),X=0;he.forEach(ye=>{let _e=P.get(ye);X=Math.max(_e,X)}),U.push([oe,X])});let W=j.current;pe().sort((oe,he)=>{var X,ye;let _e=oe.getAttribute("id"),De=he.getAttribute("id");return((X=P.get(De))!=null?X:0)-((ye=P.get(_e))!=null?ye:0)}).forEach(oe=>{let he=oe.closest(lp);he?he.appendChild(oe.parentElement===he?oe:oe.closest(`${lp} > *`)):W.appendChild(oe.parentElement===W?oe:oe.closest(`${lp} > *`))}),U.sort((oe,he)=>he[1]-oe[1]).forEach(oe=>{var he;let X=(he=j.current)==null?void 0:he.querySelector(`${Bl}[${bi}="${encodeURIComponent(oe[0])}"]`);X?.parentElement.appendChild(X)})}function J(){let P=pe().find(W=>W.getAttribute("aria-disabled")!=="true"),U=P?.getAttribute(bi);D.setState("value",U||void 0)}function ie(){var P,U,W,oe;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let he=0;for(let X of r.current){let ye=(U=(P=l.current.get(X))==null?void 0:P.value)!=null?U:"",_e=(oe=(W=l.current.get(X))==null?void 0:W.keywords)!=null?oe:[],De=B(ye,_e);n.current.filtered.items.set(X,De),De>0&&he++}for(let[X,ye]of s.current)for(let _e of ye)if(n.current.filtered.items.get(_e)>0){n.current.filtered.groups.add(X);break}n.current.filtered.count=he}function ue(){var P,U,W;let oe=ae();oe&&(((P=oe.parentElement)==null?void 0:P.firstChild)===oe&&((W=(U=oe.closest(Bl))==null?void 0:U.querySelector($$))==null||W.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function ae(){var P;return(P=j.current)==null?void 0:P.querySelector(`${W2}[aria-selected="true"]`)}function pe(){var P;return Array.from(((P=j.current)==null?void 0:P.querySelectorAll(Lw))||[])}function k(P){let U=pe()[P];U&&D.setState("value",U.getAttribute(bi))}function Y(P){var U;let W=ae(),oe=pe(),he=oe.findIndex(ye=>ye===W),X=oe[he+P];(U=d.current)!=null&&U.loop&&(X=he+P<0?oe[oe.length-1]:he+P===oe.length?oe[0]:oe[he+P]),X&&D.setState("value",X.getAttribute(bi))}function H(P){let U=ae(),W=U?.closest(Bl),oe;for(;W&&!oe;)W=P>0?Q$(W,Bl):X$(W,Bl),oe=W?.querySelector(Lw);oe?D.setState("value",oe.getAttribute(bi)):Y(P)}let ee=()=>k(pe().length-1),ve=P=>{P.preventDefault(),P.metaKey?ee():P.altKey?H(1):Y(1)},z=P=>{P.preventDefault(),P.metaKey?k(0):P.altKey?H(-1):Y(-1)};return b.createElement(je.div,{ref:t,tabIndex:-1,...T,"cmdk-root":"",onKeyDown:P=>{var U;(U=T.onKeyDown)==null||U.call(T,P);let W=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||W))switch(P.key){case"n":case"j":{C&&P.ctrlKey&&ve(P);break}case"ArrowDown":{ve(P);break}case"p":case"k":{C&&P.ctrlKey&&z(P);break}case"ArrowUp":{z(P);break}case"Home":{P.preventDefault(),k(0);break}case"End":{P.preventDefault(),ee();break}case"Enter":{P.preventDefault();let oe=ae();if(oe){let he=new Event(fg);oe.dispatchEvent(he)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:tU},f),mf(e,P=>b.createElement(X2.Provider,{value:D},b.createElement(Q2.Provider,{value:L},P))))}),B$=b.forwardRef((e,t)=>{var n,r;let s=nn(),l=b.useRef(null),c=b.useContext(J2),d=Ec(),f=tT(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c?.forceMount;vs(()=>{if(!m)return d.item(s,c?.id)},[m]);let v=nT(s,l,[e.value,e.children,l],e.keywords),p=zv(),x=Ta(A=>A.value&&A.value===v.current),S=Ta(A=>m||d.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);b.useEffect(()=>{let A=l.current;if(!(!A||e.disabled))return A.addEventListener(fg,_),()=>A.removeEventListener(fg,_)},[S,e.onSelect,e.disabled]);function _(){var A,D;w(),(D=(A=f.current).onSelect)==null||D.call(A,v.current)}function w(){p.setState("value",v.current,!0)}if(!S)return null;let{disabled:C,value:T,onSelect:N,forceMount:M,keywords:R,...j}=e;return b.createElement(je.div,{ref:Dn(l,t),...j,id:s,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!x,"data-disabled":!!C,"data-selected":!!x,onPointerMove:C||d.getDisablePointerSelection()?void 0:w,onClick:C?void 0:_},e.children)}),H$=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...l}=e,c=nn(),d=b.useRef(null),f=b.useRef(null),m=nn(),v=Ec(),p=Ta(S=>s||v.filter()===!1?!0:S.search?S.filtered.groups.has(c):!0);vs(()=>v.group(c),[]),nT(c,d,[e.value,e.heading,f]);let x=b.useMemo(()=>({id:c,forceMount:s}),[s]);return b.createElement(je.div,{ref:Dn(d,t),...l,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&b.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),mf(e,S=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},b.createElement(J2.Provider,{value:x},S))))}),q$=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=b.useRef(null),l=Ta(c=>!c.search);return!n&&!l?null:b.createElement(je.div,{ref:Dn(s,t),...r,"cmdk-separator":"",role:"separator"})}),Y$=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,l=zv(),c=Ta(m=>m.search),d=Ta(m=>m.selectedItemId),f=Ec();return b.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),b.createElement(je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||l.setState("search",m.target.value),n?.(m.target.value)}})}),G$=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,l=b.useRef(null),c=b.useRef(null),d=Ta(m=>m.selectedItemId),f=Ec();return b.useEffect(()=>{if(c.current&&l.current){let m=c.current,v=l.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let S=m.offsetHeight;v.style.setProperty("--cmdk-list-height",S.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(p),x.unobserve(m)}}},[]),b.createElement(je.div,{ref:Dn(l,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:f.listId},mf(e,m=>b.createElement("div",{ref:Dn(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),K$=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:l,container:c,...d}=e;return b.createElement(qg,{open:n,onOpenChange:r},b.createElement(Yg,{container:c},b.createElement(Gg,{"cmdk-overlay":"",className:s}),b.createElement(Kg,{"aria-label":e.label,"cmdk-dialog":"",className:l},b.createElement(eT,{ref:t,...d}))))}),Z$=b.forwardRef((e,t)=>Ta(n=>n.filtered.count===0)?b.createElement(je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),W$=b.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...l}=e;return b.createElement(je.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},mf(e,c=>b.createElement("div",{"aria-hidden":!0},c)))}),ws=Object.assign(eT,{List:G$,Item:B$,Input:Y$,Group:H$,Separator:q$,Dialog:K$,Empty:Z$,Loading:W$});function Q$(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function X$(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function tT(e){let t=b.useRef(e);return vs(()=>{t.current=e}),t}var vs=typeof window>"u"?b.useEffect:b.useLayoutEffect;function xi(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function Ta(e){let t=zv(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function nT(e,t,n,r=[]){let s=b.useRef(),l=Ec();return vs(()=>{var c;let d=(()=>{var m;for(let v of n){if(typeof v=="string")return v.trim();if(typeof v=="object"&&"current"in v)return v.current?(m=v.current.textContent)==null?void 0:m.trim():s.current}})(),f=r.map(m=>m.trim());l.value(e,d,f),(c=t.current)==null||c.setAttribute(bi,d),s.current=d}),s}var J$=()=>{let[e,t]=b.useState(),n=xi(()=>new Map);return vs(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function eU(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function mf({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(eU(t),{ref:t.ref},n(t.props.children)):n(t)}var tU={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function rT({...e}){return h.jsx(qg,{"data-slot":"dialog",...e})}function nU({...e}){return h.jsx(Yg,{"data-slot":"dialog-portal",...e})}function rU({className:e,...t}){return h.jsx(Gg,{"data-slot":"dialog-overlay",className:fe("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function oT({className:e,children:t,showCloseButton:n=!0,...r}){return h.jsxs(nU,{children:[h.jsx(rU,{}),h.jsxs(Kg,{"data-slot":"dialog-content",className:fe("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-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",e),...r,children:[t,n&&h.jsx(Gd,{"data-slot":"dialog-close",asChild:!0,children:h.jsxs(ze,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[h.jsx(Hi,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function aT({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:fe("gap-1 flex flex-col",e),...t})}function oU({className:e,showCloseButton:t=!1,children:n,...r}){return h.jsxs("div",{"data-slot":"dialog-footer",className:fe("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&h.jsx(Gd,{asChild:!0,children:h.jsx(ze,{variant:"outline",children:"Close"})})]})}function sT({className:e,...t}){return h.jsx(OC,{"data-slot":"dialog-title",className:fe("text-sm font-medium",e),...t})}function iT({className:e,...t}){return h.jsx(AC,{"data-slot":"dialog-description",className:fe("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3",e),...t})}function wn({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:fe("bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-sm border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed 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",e),...n})}function Jl({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:fe("border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-sm border px-2 py-2 text-sm transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function aU({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:fe("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 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-7 rounded-sm border transition-colors has-data-[align=block-end]:rounded-sm has-data-[align=block-start]:rounded-sm has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-sm 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",e),...t})}const sU=Vg("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function iU({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:fe(sU({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}function Pv({className:e,...t}){return h.jsx(ws,{"data-slot":"command",className:fe("bg-popover text-popover-foreground rounded-xl flex size-full flex-col overflow-hidden",e),...t})}function lU({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:s=!1,...l}){return h.jsxs(rT,{...l,children:[h.jsxs(aT,{className:"sr-only",children:[h.jsx(sT,{children:e}),h.jsx(iT,{children:t})]}),h.jsx(oT,{className:fe("rounded-xl! p-0 overflow-hidden p-0",r),showCloseButton:s,children:h.jsx(Pv,{className:"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:n})})]})}function Lv({className:e,...t}){return h.jsx("div",{"data-slot":"command-input-wrapper",className:"p-2 w-full",children:h.jsxs(aU,{className:"bg-input/20 dark:bg-input/30 h-8!",children:[h.jsx(ws.Input,{"data-slot":"command-input",className:fe("w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),h.jsx(iU,{children:h.jsx(M2,{className:"size-3.5 shrink-0 opacity-50"})})]})})}function Fv({className:e,...t}){return h.jsx(ws.List,{"data-slot":"command-list",className:fe("no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",e),...t})}function Iv({className:e,...t}){return h.jsx(ws.Empty,{"data-slot":"command-empty",className:fe("py-6 text-center text-xs/relaxed",e),...t})}function Vr({className:e,...t}){return h.jsx(ws.Group,{"data-slot":"command-group",className:fe("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function ns({className:e,...t}){return h.jsx(ws.Separator,{"data-slot":"command-separator",className:fe("bg-border/50 -mx-1 my-1 h-px",e),...t})}function it({className:e,children:t,...n}){return h.jsxs(ws.Item,{"data-slot":"command-item",className:fe("data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex min-h-3 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none [&_svg:not([class*='size-'])]:size-3.5 [[data-slot=dialog-content]_&]:rounded-md group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,h.jsx(Cv,{className:"ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function za({...e}){return h.jsx(SP,{"data-slot":"popover",...e})}function Gi({...e}){return h.jsx(CP,{"data-slot":"popover-trigger",...e})}function Pa({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(_P,{children:h.jsx(EP,{"data-slot":"popover-content",align:t,sideOffset:n,className:fe("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-lg p-2.5 text-xs shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",e),...r})})}function lT({...e}){return h.jsx(wP,{"data-slot":"popover-anchor",...e})}const Vv=()=>{const{data:e,isLoading:t,error:n}=Dv({queryKey:[we.CACHE_KEYS.TABLES_LIST],queryFn:async()=>{try{const r=await fetch(`${Ss}/tables`);if(!r.ok)throw new Error("Failed to fetch tables list");return r.json()}catch(r){throw console.error("Error fetching tables list:",r),r}}});return{tablesList:e,isLoadingTablesList:t,errorTablesList:n}},cU=({index:e})=>{const[t,n]=b.useState(!1),{tablesList:r,isLoadingTablesList:s}=Vv(),{control:l,watch:c,setValue:d,getValues:f}=Bt(),m=c(`fields.${e}.columnName`),v=()=>{const p=f("foreignKeys")||[];if(!p[e]){const x=[...p];x.push({columnName:"",referencedTable:"",referencedColumn:"",onUpdate:"NO ACTION",onDelete:"NO ACTION"}),d("foreignKeys",x)}};return h.jsx(Mr,{control:l,name:`foreignKeys.${e}`,render:({field:p})=>h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsx(jn,{htmlFor:"referencedTable",children:"Select a table to reference to"}),h.jsxs(za,{onOpenChange:x=>{x&&v(),n(x)},open:t,children:[h.jsx(Gi,{asChild:!0,children:h.jsxs(ze,{"aria-expanded":t,className:"w-full justify-between border-input bg-background px-3 font-normal outline-none outline-offset-0 hover:bg-background focus-visible:outline-[3px]",id:"referencedTable",role:"combobox",variant:"outline",disabled:s,children:[h.jsx("span",{className:fe("truncate",!p.value?.referencedTable&&"text-muted-foreground"),children:p.value?.referencedTable||"---"}),h.jsx(_2,{"aria-hidden":"true",className:"shrink-0 text-muted-foreground/80",size:16})]})}),h.jsx(Pa,{align:"start",className:"w-full min-w-(--radix-popper-anchor-width) border-input p-0",children:h.jsxs(Pv,{children:[h.jsx(Lv,{placeholder:"Search table..."}),h.jsxs(Fv,{children:[h.jsx(Iv,{children:"No table found."}),h.jsx(Vr,{children:r?.map(x=>h.jsxs(it,{onSelect:()=>{p.onChange({...p.value,referencedTable:x.tableName}),d(`foreignKeys.${e}.columnName`,m),console.log(`foreignKeys.${e}.columnName`,m),n(!1)},value:x.tableName,children:[x.tableName,p.value?.referencedTable===x.tableName&&h.jsx(C2,{className:"ml-auto",size:16})]},x.tableName))})]})]})})]})]})})},uU=({index:e})=>{const{closeSheet:t,isSheetOpen:n}=jr(),{control:r}=Bt(),{remove:s}=Lp({control:r,name:"foreignKeys"}),l=()=>{s(e),t(`add-foreign-key-${e}`)};return h.jsx(Tv,{open:n(`add-foreign-key-${e}`),onOpenChange:c=>{c||t(`add-foreign-key-${e}`)},children:h.jsxs(Nv,{children:[h.jsx(A2,{children:h.jsx(j2,{children:"Add foreign key relationship"})}),h.jsxs("div",{className:"flex flex-col justify-between px-5 py-6 h-full flex-1",children:[h.jsxs("div",{className:"space-y-6 flex-1",children:[h.jsx(cU,{index:e}),h.jsx(A$,{index:e})]}),h.jsx(ze,{type:"button",variant:"outline",size:"sm",onClick:l,children:h.jsx("span",{className:"text-xs",children:"Reset Foreign Key"})})]})]})})},dU=Vg("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! 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 transition-colors 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 bg-input/20 dark:bg-input/30",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 fU({className:e,variant:t="default",asChild:n=!1,...r}){const s=n?KE:"span";return h.jsx(s,{"data-slot":"badge","data-variant":t,className:fe(dU({variant:t}),e),...r})}function Ad({className:e,...t}){return h.jsx(kC,{"data-slot":"checkbox",className:fe("border-input dark:bg-input/20 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/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:h.jsx(PC,{"data-slot":"checkbox-indicator",className:"[&>svg]:size-3.5 grid place-content-center text-current transition-none",children:h.jsx(Cv,{})})})}function $v({...e}){return h.jsx(Z3,{"data-slot":"dropdown-menu",...e})}function hU({...e}){return h.jsx(W_,{"data-slot":"dropdown-menu-portal",...e})}function Uv({...e}){return h.jsx(W3,{"data-slot":"dropdown-menu-trigger",...e})}function Bv({className:e,align:t="start",sideOffset:n=4,...r}){return h.jsx(W_,{children:h.jsx(Q3,{"data-slot":"dropdown-menu-content",sideOffset:n,align:t,className:fe("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-lg 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",e),...r})})}function cT({...e}){return h.jsx(X3,{"data-slot":"dropdown-menu-group",...e})}function $r({className:e,inset:t,variant:n="default",...r}){return h.jsx(J3,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:fe("focus:bg-accent cursor-pointer 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 min-h-7 gap-2 rounded-sm px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex 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",e),...r})}function hg({className:e,...t}){return h.jsx(eP,{"data-slot":"dropdown-menu-separator",className:fe("bg-border/50 -mx-1 my-1 h-px",e),...t})}function mU({...e}){return h.jsx(tP,{"data-slot":"dropdown-menu-sub",...e})}function pU({className:e,inset:t,children:n,...r}){return h.jsxs(nP,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:fe("focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-sm px-2 py-1 text-xs [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,h.jsx(Ev,{className:"ml-auto"})]})}function gU({className:e,...t}){return h.jsx(rP,{"data-slot":"dropdown-menu-sub-content",className:fe("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-lg p-1 shadow-md ring-1 duration-100 z-50 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden",e),...t})}const vU=({index:e,isDisabled:t})=>{const{control:n}=Bt(),r=Ur({control:n,name:`fields.${e}.columnType`}),s=Ur({control:n,name:`fields.${e}.isPrimaryKey`}),l=Ur({control:n,name:`fields.${e}.isNullable`}),c=Ur({control:n,name:`fields.${e}.isUnique`}),d=Ur({control:n,name:`fields.${e}.isIdentity`}),f=Ur({control:n,name:`fields.${e}.isArray`}),m=b.useCallback(p=>{switch(p){case"isNullable":return!s;case"isIdentity":return!Y2.includes(r);case"isArray":return G2.includes(r);default:return!0}},[s,r]),v=b.useMemo(()=>{const p={isNullable:l,isUnique:c,isIdentity:d,isArray:f};return kw.filter(x=>m(x.name)?!!p[x.name]:!1).length},[l,c,d,f,m]);return h.jsx("div",{className:"flex items-end justify-end",children:h.jsxs($v,{children:[h.jsx(Uv,{asChild:!0,children:h.jsxs(ze,{"aria-label":"Advanced options",type:"button",variant:"ghost",size:"icon",disabled:t,className:"h-9 w-9 relative",children:[h.jsx(E2,{className:"h-4 w-4"}),v>0&&h.jsx(fU,{className:"absolute -top-2 leading-0! left-full -translate-x-1/2 size-5 flex items-center justify-center text-xs",children:v>99?"99+":v})]})}),h.jsx(Bv,{className:"w-96 space-y-1",side:"bottom",align:"end",children:kw.map(p=>m(p.name)?h.jsx(Mr,{control:n,name:`fields.${e}.${p.name}`,render:({field:x})=>h.jsxs(jn,{htmlFor:`${p.name}-${e}`,className:"flex items-start gap-3 rounded-lg p-3 cursor-pointer hover:bg-accent/50 has-checked:bg-primary-foreground has-checked:border-blue-600",children:[h.jsx(Ad,{id:`${p.name}-${e}`,checked:!!x.value,onCheckedChange:S=>x.onChange(!!S),className:"data-[state=checked]:bg-blue-600 data-[state=checked]:border-blue-600",type:"button"}),h.jsxs("div",{className:"grid gap-1.5 font-normal",children:[h.jsx("p",{className:"text-sm leading-none font-medium",children:p.label}),h.jsx("p",{className:"text-sm text-muted-foreground",children:p.description})]})]})},p.name):null)})]})})},yU=({index:e})=>{const{openSheet:t}=jr(),{control:n,register:r,formState:{errors:s},watch:l}=Bt(),c=l(`foreignKeys.${e}.referencedTable`),d=()=>{t(`add-foreign-key-${e}`)};return h.jsx(Mr,{control:n,name:`fields.${e}.columnName`,render:()=>h.jsxs("div",{className:"flex",children:[h.jsx(wn,{id:`fields.${e}.columnName`,...r(`fields.${e}.columnName`,{required:"Column name is required"}),placeholder:"column_name",className:fe("-me-px flex-1 rounded-e-none shadow-none focus-visible:z-10",s?.fields?.[e]?.columnName?"border-destructive ring-destructive ring-1":"")}),h.jsx("button",{"aria-label":"Generate column name",className:fe("inline-flex w-7 h-7 items-center justify-center rounded-e-md border border-input bg-background text-muted-foreground/80 text-sm outline-none transition-[color,box-shadow] hover:text-accent-foreground focus:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",c?"":"border-dashed"),type:"button",onClick:d,children:h.jsx(wv,{"aria-hidden":"true",className:"size-3"})})]})})},bU=({index:e})=>{const[t,n]=b.useState(!1),{control:r,setValue:s,formState:{errors:l}}=Bt();return h.jsx(Mr,{control:r,name:`fields.${e}.columnType`,render:({field:c})=>h.jsxs(za,{open:t,onOpenChange:n,children:[h.jsx(Gi,{asChild:!0,children:h.jsxs(ze,{id:`columnType-${e}`,role:"combobox","aria-expanded":t,variant:"outline",className:fe("w-full justify-between border-input bg-background px-3 font-normal hover:bg-background",l?.fields?.[e]?.columnType?"border-destructive ring-destructive ring-1":""),children:[c.value||"Select type",h.jsx(_2,{"aria-hidden":"true",className:"-me-1 opacity-60",size:16})]})}),h.jsx(Pa,{align:"start",className:"w-full min-w-[--radix-popper-anchor-width] border-input p-0",children:h.jsxs(Pv,{children:[h.jsx(Lv,{placeholder:"Search type..."}),h.jsxs(Fv,{children:[h.jsx(Iv,{children:"No type found."}),Object.entries(q2).map(([d,f])=>h.jsx(Vr,{heading:d,children:f.map(m=>h.jsxs(it,{value:`${m.label} ${m.description}`,onSelect:()=>{c.onChange(m.value),Y2.includes(m.value)&&s(`fields.${e}.isIdentity`,!1),m.value&&!G2.includes(m.value)&&s(`fields.${e}.isArray`,!1),n(!1)},children:[h.jsxs("div",{className:"flex flex-col gap-1 items-start flex-1",children:[h.jsx("p",{className:"font-medium",children:m.label}),h.jsx("span",{className:"text-xs text-muted-foreground",children:m.description})]}),c.value===m.value&&h.jsx(C2,{className:"ml-auto shrink-0",size:16})]},m.value))},d))]})]})})]})})},xU=({index:e})=>{const{control:t,register:n,formState:{errors:r}}=Bt();return h.jsx(Mr,{control:t,name:`fields.${e}.defaultValue`,render:()=>h.jsx("div",{className:"flex flex-col gap-2",children:h.jsx(wn,{id:`fields.${e}.defaultValue`,...n(`fields.${e}.defaultValue`,{required:"Default value is required"}),placeholder:"NULL",className:r?.fields?.[e]?.defaultValue?"border-destructive ring-destructive ring-1":""})})})},SU=({index:e})=>{const{watch:t,control:n,register:r,setValue:s}=Bt(),l=t(`fields.${e}.isPrimaryKey`);return h.jsx(Mr,{control:n,name:`fields.${e}.isPrimaryKey`,render:()=>h.jsx("div",{className:"flex flex-1 items-center justify-start",children:h.jsx(Ad,{id:`fields.${e}.isPrimaryKey`,...r(`fields.${e}.isPrimaryKey`),onCheckedChange:c=>{s(`fields.${e}.isPrimaryKey`,!!c),s(`fields.${e}.isNullable`,!1)},checked:l,className:"size-5"})})})},Fw=({index:e,onRemove:t,canRemove:n})=>{const{control:r}=Bt(),s=Ur({control:r,name:`fields.${e}.isPrimaryKey`});return h.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[h.jsx(yU,{index:e}),h.jsx(bU,{index:e}),h.jsx(xU,{index:e}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(SU,{index:e}),h.jsx(vU,{index:e,isDisabled:!!s}),h.jsx("div",{className:"flex items-end justify-center",children:h.jsx(ze,{type:"button",variant:"ghost",className:"size-9",onClick:t,disabled:!n,children:h.jsx(EI,{className:"h-4 w-4"})})}),h.jsx(uU,{index:e})]})]})},wU={info:{icon:IF,containerClass:"border-blue-500/50 bg-blue-50/50 text-blue-600 dark:bg-blue-950/20",iconClass:"text-blue-500"},warning:{icon:vI,containerClass:"border-amber-500/50 bg-amber-50/50 text-amber-600 dark:bg-amber-950/20",iconClass:"text-amber-500"},error:{icon:gF,containerClass:"border-red-500/50 bg-red-50/50 text-red-600 dark:bg-red-950/20",iconClass:"text-red-500"},success:{icon:yF,containerClass:"border-emerald-500/50 bg-emerald-50/50 text-emerald-600 dark:bg-emerald-950/20",iconClass:"text-emerald-500"}},CU=({variant:e,title:t,message:n,className:r})=>{const s=wU[e],l=s.icon;return h.jsxs("div",{className:fe("rounded-md border px-4 py-3",s.containerClass,r),children:[h.jsxs("p",{className:fe("text-sm flex items-center gap-2",n?"mb-1":""),children:[h.jsx(l,{"aria-hidden":"true",className:fe("-mt-0.5 inline-flex opacity-80",s.iconClass),size:16}),h.jsx("span",{className:"font-medium",children:t})]}),n&&h.jsx("p",{className:"text-xs opacity-90 ml-7",children:n})]})},_U=()=>{const{control:e}=Bt(),{fields:t,append:n,remove:r}=Lp({control:e,name:"fields"}),{remove:s}=Lp({control:e,name:"foreignKeys"}),l=Ur({control:e,name:"fields"}),c=()=>{n({columnName:"",columnType:"",defaultValue:"",isPrimaryKey:!1,isNullable:!0,isUnique:!1,isIdentity:!1,isArray:!1})},d=v=>{t.length>1&&(r(v),s(v))},f=t.map((v,p)=>({field:v,index:p})).filter(({index:v})=>l?.[v]?.isPrimaryKey),m=t.map((v,p)=>({field:v,index:p})).filter(({index:v})=>!l?.[v]?.isPrimaryKey);return h.jsxs("div",{className:"space-y-2",children:[f.length>1&&h.jsx(CU,{variant:"info",title:"Composite primary key selected",className:"mb-6"}),h.jsxs("div",{className:"grid grid-cols-4 px-2",children:[h.jsx(jn,{className:"text-xs",children:"Column Name"}),h.jsx(jn,{className:"text-xs",children:"Column Type"}),h.jsx(jn,{className:"text-xs",children:"Default Value"}),h.jsx(jn,{className:"text-xs",children:"Primary"})]}),h.jsxs("div",{className:"space-y-2",children:[f.length>0&&h.jsx("div",{className:"bg-primary/10 rounded-lg px-2 py-3 space-y-2",children:f.map(({field:v,index:p})=>h.jsx(Fw,{index:p,onRemove:()=>d(p),canRemove:t.length>1},v.id))}),m.length>0&&h.jsx("div",{className:"space-y-2 px-2 py-3",children:m.map(({field:v,index:p})=>h.jsx(Fw,{index:p,onRemove:()=>d(p),canRemove:t.length>1},v.id))})]}),h.jsx("div",{className:"border border-dashed border-input rounded-lg flex justify-center items-center p-6",children:h.jsx(ze,{type:"button",variant:"secondary",size:"sm",onClick:c,children:"Add New Column"})})]})};function EU({className:e,children:t,errors:n,...r}){const s=b.useMemo(()=>{if(t)return t;if(!n?.length)return null;const l=[...new Map(n.map(c=>[c?.message,c])).values()];return l?.length===1?l[0]?.message:h.jsx("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:l.map((c,d)=>c?.message&&h.jsx("li",{children:c.message},d))})},[t,n]);return s?h.jsx("div",{role:"alert","data-slot":"field-error",className:fe("text-destructive text-xs/relaxed font-normal",e),...r,children:s}):null}const TU=()=>{const{control:e,register:t,formState:{errors:n}}=Bt();return h.jsx(Mr,{control:e,name:"tableName",render:()=>h.jsxs("div",{className:"flex gap-24 px-2",children:[h.jsx(jn,{htmlFor:"tableName",children:"Table Name"}),h.jsxs("div",{className:"flex-1 space-y-1",children:[h.jsx(wn,{id:"tableName",...t("tableName",{required:"Table name is required"}),className:n.tableName?"border-destructive ring-destructive ring-1":""}),n.tableName&&h.jsx(EU,{errors:[n.tableName]})]})]})})},NU=()=>{const{closeSheet:e}=jr(),t=Yi(),{mutateAsync:n,isPending:r}=hf({mutationFn:async l=>{const c=await fetch(`${Ss}/tables`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(!c.ok){const d=await c.json();throw console.log("Error:",d),new Error(d.message||"Failed to create table")}return console.log(l),c.json()},onSuccess:async l=>{await Promise.all([t.invalidateQueries({queryKey:[we.CACHE_KEYS.TABLES_LIST]}),t.invalidateQueries({queryKey:[we.CACHE_KEYS.TABLE_COLUMNS]})]),e(),console.log("Table created successfully:",l)},onError:l=>{console.error("Error creating table:",l)}});return{createTable:async(l,c)=>at.promise(n(l,c),{loading:"Creating table...",success:d=>d.message||"Table created successfully",error:d=>d.detail||d.message||"Failed to create table"}),isCreatingTable:r}},RU=de("ZodISODateTime",(e,t)=>{BA.init(e,t),kt.init(e,t)});function MU(e){return Yj(RU,e)}const OU=de("ZodISODate",(e,t)=>{HA.init(e,t),kt.init(e,t)});function AU(e){return Gj(OU,e)}const jU=de("ZodISOTime",(e,t)=>{qA.init(e,t),kt.init(e,t)});function DU(e){return Kj(jU,e)}const kU=de("ZodISODuration",(e,t)=>{YA.init(e,t),kt.init(e,t)});function zU(e){return Zj(kU,e)}const PU=(e,t)=>{Fg.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>LO(e,n)},flatten:{value:n=>PO(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ip,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ip,2)}},isEmpty:{get(){return e.issues.length===0}}})},Dr=de("ZodError",PU,{Parent:Error}),LU=Ld(Dr),FU=Fd(Dr),IU=Id(Dr),VU=Vd(Dr),$U=UO(Dr),UU=BO(Dr),BU=HO(Dr),HU=qO(Dr),qU=YO(Dr),YU=GO(Dr),GU=KO(Dr),KU=ZO(Dr),rn=de("ZodType",(e,t)=>(Xt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:vd(e,"input"),output:vd(e,"output")}}),e.toJSONSchema=mD(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(bs(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]})),e.clone=(n,r)=>Ma(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>LU(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>IU(e,n,r),e.parseAsync=async(n,r)=>FU(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>VU(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>$U(e,n,r),e.decode=(n,r)=>UU(e,n,r),e.encodeAsync=async(n,r)=>BU(e,n,r),e.decodeAsync=async(n,r)=>HU(e,n,r),e.safeEncode=(n,r)=>qU(e,n,r),e.safeDecode=(n,r)=>YU(e,n,r),e.safeEncodeAsync=async(n,r)=>GU(e,n,r),e.safeDecodeAsync=async(n,r)=>KU(e,n,r),e.refine=(n,r)=>e.check(P8(n,r)),e.superRefine=n=>e.check(L8(n)),e.overwrite=n=>e.check(zi(n)),e.optional=()=>$w(e),e.nullable=()=>Uw(e),e.nullish=()=>$w(Uw(e)),e.nonoptional=n=>M8(e,n),e.array=()=>mg(e),e.or=n=>x8([e,n]),e.and=n=>w8(e,n),e.transform=n=>vg(e,dT(n)),e.default=n=>T8(e,n),e.prefault=n=>R8(e,n),e.catch=n=>A8(e,n),e.pipe=n=>vg(e,n),e.readonly=()=>k8(e),e.describe=n=>{const r=e.clone();return Kl.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Kl.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Kl.get(e);const r=e.clone();return Kl.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),uT=de("_ZodString",(e,t)=>{Ig.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(r,s,l)=>gD(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Jj(...r)),e.includes=(...r)=>e.check(nD(...r)),e.startsWith=(...r)=>e.check(rD(...r)),e.endsWith=(...r)=>e.check(oD(...r)),e.min=(...r)=>e.check(gd(...r)),e.max=(...r)=>e.check(Y1(...r)),e.length=(...r)=>e.check(G1(...r)),e.nonempty=(...r)=>e.check(gd(1,...r)),e.lowercase=r=>e.check(eD(r)),e.uppercase=r=>e.check(tD(r)),e.trim=()=>e.check(sD()),e.normalize=(...r)=>e.check(aD(...r)),e.toLowerCase=()=>e.check(iD()),e.toUpperCase=()=>e.check(lD()),e.slugify=()=>e.check(cD())}),ZU=de("ZodString",(e,t)=>{Ig.init(e,t),uT.init(e,t),e.email=n=>e.check(Ej(WU,n)),e.url=n=>e.check(Oj(QU,n)),e.jwt=n=>e.check(qj(f8,n)),e.emoji=n=>e.check(Aj(XU,n)),e.guid=n=>e.check(jS(Iw,n)),e.uuid=n=>e.check(Tj(Ju,n)),e.uuidv4=n=>e.check(Nj(Ju,n)),e.uuidv6=n=>e.check(Rj(Ju,n)),e.uuidv7=n=>e.check(Mj(Ju,n)),e.nanoid=n=>e.check(jj(JU,n)),e.guid=n=>e.check(jS(Iw,n)),e.cuid=n=>e.check(Dj(e8,n)),e.cuid2=n=>e.check(kj(t8,n)),e.ulid=n=>e.check(zj(n8,n)),e.base64=n=>e.check(Uj(c8,n)),e.base64url=n=>e.check(Bj(u8,n)),e.xid=n=>e.check(Pj(r8,n)),e.ksuid=n=>e.check(Lj(o8,n)),e.ipv4=n=>e.check(Fj(a8,n)),e.ipv6=n=>e.check(Ij(s8,n)),e.cidrv4=n=>e.check(Vj(i8,n)),e.cidrv6=n=>e.check($j(l8,n)),e.e164=n=>e.check(Hj(d8,n)),e.datetime=n=>e.check(MU(n)),e.date=n=>e.check(AU(n)),e.time=n=>e.check(DU(n)),e.duration=n=>e.check(zU(n))});function is(e){return _j(ZU,e)}const kt=de("ZodStringFormat",(e,t)=>{jt.init(e,t),uT.init(e,t)}),WU=de("ZodEmail",(e,t)=>{kA.init(e,t),kt.init(e,t)}),Iw=de("ZodGUID",(e,t)=>{jA.init(e,t),kt.init(e,t)}),Ju=de("ZodUUID",(e,t)=>{DA.init(e,t),kt.init(e,t)}),QU=de("ZodURL",(e,t)=>{zA.init(e,t),kt.init(e,t)}),XU=de("ZodEmoji",(e,t)=>{PA.init(e,t),kt.init(e,t)}),JU=de("ZodNanoID",(e,t)=>{LA.init(e,t),kt.init(e,t)}),e8=de("ZodCUID",(e,t)=>{FA.init(e,t),kt.init(e,t)}),t8=de("ZodCUID2",(e,t)=>{IA.init(e,t),kt.init(e,t)}),n8=de("ZodULID",(e,t)=>{VA.init(e,t),kt.init(e,t)}),r8=de("ZodXID",(e,t)=>{$A.init(e,t),kt.init(e,t)}),o8=de("ZodKSUID",(e,t)=>{UA.init(e,t),kt.init(e,t)}),a8=de("ZodIPv4",(e,t)=>{GA.init(e,t),kt.init(e,t)}),s8=de("ZodIPv6",(e,t)=>{KA.init(e,t),kt.init(e,t)}),i8=de("ZodCIDRv4",(e,t)=>{ZA.init(e,t),kt.init(e,t)}),l8=de("ZodCIDRv6",(e,t)=>{WA.init(e,t),kt.init(e,t)}),c8=de("ZodBase64",(e,t)=>{QA.init(e,t),kt.init(e,t)}),u8=de("ZodBase64URL",(e,t)=>{JA.init(e,t),kt.init(e,t)}),d8=de("ZodE164",(e,t)=>{ej.init(e,t),kt.init(e,t)}),f8=de("ZodJWT",(e,t)=>{nj.init(e,t),kt.init(e,t)}),h8=de("ZodBoolean",(e,t)=>{rj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>vD(e,n,r)});function Hl(e){return Wj(h8,e)}const m8=de("ZodUnknown",(e,t)=>{oj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>bD()});function Vw(){return Qj(m8)}const p8=de("ZodNever",(e,t)=>{aj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>yD(e,n,r)});function g8(e){return Xj(p8,e)}const v8=de("ZodArray",(e,t)=>{sj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>CD(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(gd(n,r)),e.nonempty=n=>e.check(gd(1,n)),e.max=(n,r)=>e.check(Y1(n,r)),e.length=(n,r)=>e.check(G1(n,r)),e.unwrap=()=>e.element});function mg(e,t){return uD(v8,e,t)}const y8=de("ZodObject",(e,t)=>{lj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_D(e,n,r,s),_t(e,"shape",()=>t.shape),e.keyof=()=>gg(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Vw()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vw()}),e.strict=()=>e.clone({...e._zod.def,catchall:g8()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>AO(e,n),e.safeExtend=n=>jO(e,n),e.merge=n=>DO(e,n),e.pick=n=>MO(e,n),e.omit=n=>OO(e,n),e.partial=(...n)=>kO(fT,e,n[0]),e.required=(...n)=>zO(hT,e,n[0])});function Hv(e,t){const n={type:"object",shape:e??{},...$e(t)};return new y8(n)}const b8=de("ZodUnion",(e,t)=>{cj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ED(e,n,r,s),e.options=t.options});function x8(e,t){return new b8({type:"union",options:e,...$e(t)})}const S8=de("ZodIntersection",(e,t)=>{uj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>TD(e,n,r,s)});function w8(e,t){return new S8({type:"intersection",left:e,right:t})}const pg=de("ZodEnum",(e,t)=>{dj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(r,s,l)=>xD(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const l={};for(const c of r)if(n.has(c))l[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new pg({...t,checks:[],...$e(s),entries:l})},e.exclude=(r,s)=>{const l={...t.entries};for(const c of r)if(n.has(c))delete l[c];else throw new Error(`Key ${c} not found in enum`);return new pg({...t,checks:[],...$e(s),entries:l})}});function gg(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new pg({type:"enum",entries:n,...$e(t)})}const C8=de("ZodTransform",(e,t)=>{fj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>wD(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new D1(e.constructor.name);n.addIssue=l=>{if(typeof l=="string")n.issues.push(nc(l,n.value,t));else{const c=l;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(nc(c))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(l=>(n.value=l,n)):(n.value=s,n)}});function dT(e){return new C8({type:"transform",transform:e})}const fT=de("ZodOptional",(e,t)=>{hj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>kD(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function $w(e){return new fT({type:"optional",innerType:e})}const _8=de("ZodNullable",(e,t)=>{mj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>ND(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function Uw(e){return new _8({type:"nullable",innerType:e})}const E8=de("ZodDefault",(e,t)=>{pj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>MD(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function T8(e,t){return new E8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():L1(t)}})}const N8=de("ZodPrefault",(e,t)=>{gj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>OD(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function R8(e,t){return new N8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():L1(t)}})}const hT=de("ZodNonOptional",(e,t)=>{vj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>RD(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function M8(e,t){return new hT({type:"nonoptional",innerType:e,...$e(t)})}const O8=de("ZodCatch",(e,t)=>{yj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>AD(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function A8(e,t){return new O8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const j8=de("ZodPipe",(e,t)=>{bj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>jD(e,n,r,s),e.in=t.in,e.out=t.out});function vg(e,t){return new j8({type:"pipe",in:e,out:t})}const D8=de("ZodReadonly",(e,t)=>{xj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>DD(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function k8(e){return new D8({type:"readonly",innerType:e})}const z8=de("ZodCustom",(e,t)=>{Sj.init(e,t),rn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>SD(e,n)});function P8(e,t={}){return dD(z8,e,t)}function L8(e){return fD(e)}function F8(e,t){return vg(dT(e),t)}const I8=Hv({columnName:is().min(1,"Column name is required"),columnType:is().min(1,"Column type is required"),defaultValue:is(),isPrimaryKey:Hl(),isNullable:Hl(),isUnique:Hl(),isIdentity:Hl(),isArray:Hl()}),V8=Hv({columnName:is().min(1,"Column name is required"),referencedTable:is().min(1,"Referenced table is required"),referencedColumn:is().min(1,"Referenced column is required"),onUpdate:gg(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]).default("NO ACTION"),onDelete:gg(["CASCADE","SET NULL","SET DEFAULT","RESTRICT","NO ACTION"]).default("NO ACTION")}),$8=Hv({tableName:is().min(1,"Table name is required"),fields:mg(I8).min(1,"At least one column is required"),foreignKeys:F8(e=>{if(Array.isArray(e))return e.filter(t=>t==null?!1:typeof t=="object"?t.columnName&&t.referencedTable&&t.referencedColumn:!1)},mg(V8).optional())}),qv=({title:e,description:t,side:n="right",children:r,size:s="sm:max-w-2xl!",headerClassName:l="p-0 border-b border-zinc-800 p-3",titleClassName:c="text-lg font-semibold",contentClassName:d="px-5 py-6 space-y-6",open:f,onOpenChange:m})=>h.jsx(Tv,{open:f,onOpenChange:m,children:h.jsxs(Nv,{side:n,className:s,children:[h.jsxs(A2,{className:l,children:[h.jsx(j2,{className:c,children:e}),t&&h.jsx(kV,{className:"text-xs/relaxed text-muted-foreground",children:t})]}),h.jsx("div",{className:fe(d,"overflow-y-auto"),children:r})]})}),U8={tableName:"",fields:[{columnName:"",columnType:"",defaultValue:"",isPrimaryKey:!1,isNullable:!0,isUnique:!1,isIdentity:!1,isArray:!1}],foreignKeys:void 0},B8=()=>{const{closeSheet:e,isSheetOpen:t}=jr(),{createTable:n,isCreatingTable:r}=NU(),s=j1({mode:"onSubmit",defaultValues:U8,resolver:LD($8)}),l=async f=>{console.log("onSubmit",f);const m={...f,foreignKeys:f.foreignKeys?.filter(v=>v===null?!0:v.columnName&&v.referencedTable&&v.referencedColumn)};try{await n(m,{onSuccess:()=>{s.reset()},onError:v=>{console.error("Error creating table:",v)}})}catch(v){console.error("Error creating table:",v)}},c=f=>{if(f.tableName?.message){at.error(f.tableName.message);return}if(f.fields&&Array.isArray(f.fields))for(const m of f.fields){if(m?.columnName?.message){at.error(m.columnName.message);return}if(m?.columnType?.message){at.error(m.columnType.message);return}}if(f.foreignKeys&&Array.isArray(f.foreignKeys))for(const m of f.foreignKeys){if(m?.columnName?.message){at.error(m.columnName.message);return}if(m?.referencedTable?.message){at.error(m.referencedTable.message);return}if(m?.referencedColumn?.message){at.error(m.referencedColumn.message);return}}at.error("Please check the form for errors")},d=()=>{s.reset(),e()};return console.log(s.getValues()),h.jsx(qv,{title:"Create a new table",open:t("add-table"),onOpenChange:f=>{f||d()},children:h.jsx(C1,{...s,children:h.jsxs("form",{onSubmit:s.handleSubmit(l,c),className:"space-y-6",children:[h.jsx(TU,{}),h.jsx(_U,{}),h.jsx(WL,{onCancel:d,isLoading:r})]})})})},mT=["shift","alt","meta","mod","ctrl","control"],H8={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Ca(e){return(H8[e.trim()]||e.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function pT(e){return mT.includes(e)}function cp(e,t=","){return e.toLowerCase().split(t)}function up(e,t="+",n=">",r=!1,s){let l=[],c=!1;e=e.trim(),e.includes(n)?(c=!0,l=e.toLocaleLowerCase().split(n).map(m=>Ca(m))):l=e.toLocaleLowerCase().split(t).map(m=>Ca(m));const d={alt:l.includes("alt"),ctrl:l.includes("ctrl")||l.includes("control"),shift:l.includes("shift"),meta:l.includes("meta"),mod:l.includes("mod"),useKey:r},f=l.filter(m=>!mT.includes(m));return{...d,keys:f,description:s,isSequence:c,hotkey:e}}typeof document<"u"&&(document.addEventListener("keydown",e=>{e.code!==void 0&&gT([Ca(e.code)])}),document.addEventListener("keyup",e=>{e.code!==void 0&&vT([Ca(e.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{Fo.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{Fo.clear()},0)}));const Fo=new Set;function Yv(e){return Array.isArray(e)}function q8(e,t=","){return(Yv(e)?e:e.split(t)).every(n=>Fo.has(n.trim().toLowerCase()))}function gT(e){const t=Array.isArray(e)?e:[e];Fo.has("meta")&&Fo.forEach(n=>!pT(n)&&Fo.delete(n.toLowerCase())),t.forEach(n=>Fo.add(n.toLowerCase()))}function vT(e){const t=Array.isArray(e)?e:[e];e==="meta"?Fo.clear():t.forEach(n=>Fo.delete(n.toLowerCase()))}function Y8(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function G8(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}const K8=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"];function Z8(e){return yT(e,K8)}function yT(e,t=!1){const{target:n,composed:r}=e;let s,l;return W8(n)&&r?(s=e.composedPath()[0]&&e.composedPath()[0].tagName,l=e.composedPath()[0]&&e.composedPath()[0].role):(s=n&&n.tagName,l=n&&n.role),Yv(t)?!!(s&&t&&t.some(c=>c.toLowerCase()===s.toLowerCase()||c===l)):!!(s&&t&&t)}function W8(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function Q8(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(n=>t.includes(n))||e.includes("*"):!0}const X8=(e,t,n=!1)=>{const{alt:r,meta:s,mod:l,shift:c,ctrl:d,keys:f,useKey:m}=t,{code:v,key:p,ctrlKey:x,metaKey:S,shiftKey:_,altKey:w}=e,C=Ca(v);if(m&&f?.length===1&&f.includes(p))return!0;if(!f?.includes(C)&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(C))return!1;if(!n){if(r!==w&&C!=="alt"||c!==_&&C!=="shift")return!1;if(l){if(!S&&!x)return!1}else if(s!==S&&C!=="meta"&&C!=="os"||d!==x&&C!=="ctrl"&&C!=="control")return!1}return f&&f.length===1&&f.includes(C)?!0:f?q8(f):!f},J8=b.createContext(void 0),eB=()=>b.useContext(J8);function bT(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce((n,r)=>n&&bT(e[r],t[r]),!0):e===t}const tB=b.createContext({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),nB=()=>b.useContext(tB);function rB(e){const t=b.useRef(void 0);return bT(t.current,e)||(t.current=e),t.current}const Bw=e=>{e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},oB=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Na(e,t,n,r){const s=b.useRef(null),l=b.useRef(!1),c=Array.isArray(n)?Array.isArray(r)?void 0:r:n,d=Yv(e)?e.join(c?.delimiter):e,f=Array.isArray(n)?n:Array.isArray(r)?r:void 0,m=b.useCallback(t,f??[]),v=b.useRef(m);f?v.current=m:v.current=t;const p=rB(c),{activeScopes:x}=nB(),S=eB();return oB(()=>{if(p?.enabled===!1||!Q8(x,p?.scopes))return;let _=[],w;const C=(R,j=!1)=>{if(!(Z8(R)&&!yT(R,p?.enableOnFormTags))){if(s.current!==null){const A=s.current.getRootNode();if((A instanceof Document||A instanceof ShadowRoot)&&A.activeElement!==s.current&&!s.current.contains(A.activeElement)){Bw(R);return}}R.target?.isContentEditable&&!p?.enableOnContentEditable||cp(d,p?.delimiter).forEach(A=>{if(A.includes(p?.splitKey??"+")&&A.includes(p?.sequenceSplitKey??">")){console.warn(`Hotkey ${A} contains both ${p?.splitKey??"+"} and ${p?.sequenceSplitKey??">"} which is not supported.`);return}const D=up(A,p?.splitKey,p?.sequenceSplitKey,p?.useKey,p?.description);if(D.isSequence){w=setTimeout(()=>{_=[]},p?.sequenceTimeoutMs??1e3);const L=D.useKey?R.key:Ca(R.code);if(pT(L.toLowerCase()))return;_.push(L);const B=D.keys?.[_.length-1];if(L!==B){_=[],w&&clearTimeout(w);return}_.length===D.keys?.length&&(v.current(R,D),w&&clearTimeout(w),_=[])}else if(X8(R,D,p?.ignoreModifiers)||D.keys?.includes("*")){if(p?.ignoreEventWhen?.(R)||j&&l.current)return;if(Y8(R,D,p?.preventDefault),!G8(R,D,p?.enabled)){Bw(R);return}v.current(R,D),j||(l.current=!0)}})}},T=R=>{R.code!==void 0&&(gT(Ca(R.code)),(p?.keydown===void 0&&p?.keyup!==!0||p?.keydown)&&C(R))},N=R=>{R.code!==void 0&&(vT(Ca(R.code)),l.current=!1,p?.keyup&&C(R,!0))},M=s.current||c?.document||document;return M.addEventListener("keyup",N,c?.eventListenerOptions),M.addEventListener("keydown",T,c?.eventListenerOptions),S&&cp(d,p?.delimiter).forEach(R=>S.addHotkey(up(R,p?.splitKey,p?.sequenceSplitKey,p?.useKey,p?.description))),()=>{M.removeEventListener("keyup",N,c?.eventListenerOptions),M.removeEventListener("keydown",T,c?.eventListenerOptions),S&&cp(d,p?.delimiter).forEach(R=>S.removeHotkey(up(R,p?.splitKey,p?.sequenceSplitKey,p?.useKey,p?.description))),_=[],w&&clearTimeout(w)}},[d,p,x]),s}function aB(){const[,e]=Ae(we.ACTIVE_TABLE),[,t]=Ae(we.ACTIVE_TAB),[,n]=Ae(we.TABLE_STATE_KEYS.ORDER),[,r]=Ae(we.TABLE_STATE_KEYS.SORT),[,s]=Ae(we.TABLE_STATE_KEYS.FILTERS),[,l]=Ae(we.COLUMN_NAME),[,c]=Ae(we.REFERENCED_TABLE_STATE_KEYS.ACTIVE_TABLE),[,d]=Ae(we.REFERENCED_TABLE_STATE_KEYS.PAGE),[,f]=Ae(we.REFERENCED_TABLE_STATE_KEYS.LIMIT.toString()),[,m]=Ae(we.REFERENCED_TABLE_STATE_KEYS.SORT.toString()),[,v]=Ae(we.REFERENCED_TABLE_STATE_KEYS.ORDER.toString()),[,p]=Ae(we.REFERENCED_TABLE_STATE_KEYS.FILTERS);return{navigateToTable:b.useCallback(S=>{t("table"),e(S),n(null),r(null),s(null),l(null),c(null),d(null),f(null),m(null),v(null),p(null)},[])}}function sB(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var l;const c=f=>f===null?null:JSON.parse(f,void 0),d=(l=n.getItem(s))!=null?l:null;return d instanceof Promise?d.then(c):c(d)},setItem:(s,l)=>n.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>n.removeItem(s)}}const yg=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return yg(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return yg(r)(n)}}}},iB=(e,t)=>(n,r,s)=>{let l={storage:sB(()=>localStorage),partialize:w=>w,version:0,merge:(w,C)=>({...C,...w}),...t},c=!1;const d=new Set,f=new Set;let m=l.storage;if(!m)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...w)},r,s);const v=()=>{const w=l.partialize({...r()});return m.setItem(l.name,{state:w,version:l.version})},p=s.setState;s.setState=(w,C)=>(p(w,C),v());const x=e((...w)=>(n(...w),v()),r,s);s.getInitialState=()=>x;let S;const _=()=>{var w,C;if(!m)return;c=!1,d.forEach(N=>{var M;return N((M=r())!=null?M:x)});const T=((C=l.onRehydrateStorage)==null?void 0:C.call(l,(w=r())!=null?w:x))||void 0;return yg(m.getItem.bind(m))(l.name).then(N=>{if(N)if(typeof N.version=="number"&&N.version!==l.version){if(l.migrate){const M=l.migrate(N.state,N.version);return M instanceof Promise?M.then(R=>[!0,R]):[!0,M]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,N.state];return[!1,void 0]}).then(N=>{var M;const[R,j]=N;if(S=l.merge(j,(M=r())!=null?M:x),n(S,!0),R)return v()}).then(()=>{T?.(S,void 0),S=r(),c=!0,f.forEach(N=>N(S))}).catch(N=>{T?.(void 0,N)})};return s.persist={setOptions:w=>{l={...l,...w},w.storage&&(m=w.storage)},clearStorage:()=>{m?.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>_(),hasHydrated:()=>c,onHydrate:w=>(d.add(w),()=>{d.delete(w)}),onFinishHydration:w=>(f.add(w),()=>{f.delete(w)})},l.skipHydration||_(),S||x},lB=iB,Cs=Rv()(lB(e=>({sidebar:{width:400,isOpen:!0,isPinned:!0},theme:"system",setTheme:t=>e({theme:t}),toggleTheme:()=>e(t=>({theme:t.theme==="dark"?"light":"dark"})),setSidebarWidth:t=>e(n=>({sidebar:{...n.sidebar,width:Math.max(200,Math.min(500,t))}})),setSidebarOpen:t=>e(n=>({sidebar:{...n.sidebar,isOpen:t}})),setSidebarPinned:t=>e(n=>({sidebar:{...n.sidebar,isPinned:t}})),toggleSidebarOpen:()=>e(t=>({sidebar:{...t.sidebar,isOpen:!t.sidebar.isOpen}})),toggleSidebarPinned:()=>e(t=>({sidebar:{...t.sidebar,isPinned:!t.sidebar.isPinned}}))}),{name:"db-studio-personal-preferences"}));function cB(){const[e]=Ae(we.ACTIVE_TABLE),{navigateToTable:t}=aB(),{openSheet:n}=jr(),{toggleSidebarOpen:r,toggleSidebarPinned:s,sidebar:l}=Cs(),{tablesList:c,isLoadingTablesList:d}=Vv(),[f,m]=b.useState(!1),[v,p]=b.useState("all"),[x,S]=b.useState(""),_=b.useRef(null),w=D=>{m(D),D||(p("all"),S(""))},C=(D,L)=>{m(!1),D(),L&&at.success(L)},T=b.useCallback(()=>{p("tables"),S(""),setTimeout(()=>_.current?.focus(),0)},[]),N=b.useCallback(()=>{p("all"),S(""),setTimeout(()=>_.current?.focus(),0)},[]),M=D=>{if(v==="all"&&D===">"){T();return}if(v==="all"&&(D.toLowerCase()==="table "||D.toLowerCase()==="tables ")){T();return}S(D)},R=D=>{D.key==="Backspace"&&x===""&&v==="tables"&&(D.preventDefault(),N()),D.key==="Escape"&&v==="tables"&&(D.preventDefault(),D.stopPropagation(),N())},j=D=>{C(()=>{t(D)},`Navigated to ${D}`)};Na("ctrl+k, meta+k",()=>m(D=>!D));const A=v==="all"?"Search commands... (type > for tables)":"Search tables...";return h.jsxs(lU,{open:f,onOpenChange:w,children:[h.jsxs("div",{className:"flex items-center border-b border-input px-2 gap-2 w-full",children:[v==="tables"&&h.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1.5 h-8! rounded-md bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary transition-all hover:bg-primary/20 shrink-0",children:[h.jsx(bw,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Tables"}),h.jsx(mF,{className:"h-3 w-3 opacity-60"})]}),h.jsx(Lv,{ref:_,placeholder:A,value:x,onValueChange:M,onKeyDown:R,className:"border-0 px-0"})]}),h.jsxs(Fv,{children:[h.jsx(Iv,{children:v==="tables"?"No tables found.":"No results found."}),v==="tables"&&!d&&c&&h.jsx(Vr,{heading:"Tables",children:c.length===0?h.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No tables in database"}):c.map(D=>h.jsxs(it,{value:D.tableName,onSelect:()=>j(D.tableName),children:[h.jsx(vw,{className:"mr-2 h-4 w-4 text-primary"}),h.jsxs("div",{className:"flex flex-1 items-center justify-between",children:[h.jsx("span",{className:"font-medium",children:D.tableName}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:[D.rowCount," ",D.rowCount===1?"row":"rows"]})]})]},D.tableName))}),v==="all"&&h.jsxs(h.Fragment,{children:[h.jsx(Vr,{heading:"Quick Access",children:h.jsxs(it,{onSelect:T,className:"group",children:[h.jsx(bw,{className:"mr-2 h-4 w-4 text-primary"}),h.jsxs("div",{className:"flex flex-1 items-center justify-between",children:[h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Search Tables"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Navigate to any table quickly"})]}),h.jsx("kbd",{className:"hidden rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground group-hover:inline-block",children:">"})]})]})}),h.jsx(ns,{}),h.jsxs(Vr,{heading:"AI Assistant",children:[h.jsxs(it,{onSelect:()=>C(()=>{at.info("AI SQL Generator - Coming Soon!",{description:"Generate SQL queries with natural language"})}),children:[h.jsx(uI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Generate SQL with AI"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Create queries using natural language"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("AI Table Designer - Coming Soon!",{description:"Design your database schema with AI assistance"})}),children:[h.jsx(CI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"AI Table Designer"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Design tables with intelligent suggestions"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Schema Explainer - Coming Soon!",{description:"Get AI-powered explanations of your database structure"})}),children:[h.jsx(lF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Explain Schema"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Understand your database structure with AI"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("AI Query Optimizer - Coming Soon!",{description:"Optimize your queries for better performance"})}),children:[h.jsx(NI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Optimize Query"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Get performance optimization suggestions"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("AI Chat - Coming Soon!",{description:"Chat with AI about your database"})}),children:[h.jsx(KF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Chat with AI Assistant"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Ask questions about your database"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Smart Suggestions - Coming Soon!",{description:"Get AI-powered recommendations for your schema"})}),children:[h.jsx(BF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Get Schema Suggestions"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Improve your database design with AI insights"})]})]})]}),h.jsx(ns,{}),h.jsxs(Vr,{heading:"Database Actions",children:[h.jsxs(it,{onSelect:()=>C(()=>n("add-table")),children:[h.jsx(yw,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Create New Table"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Design and create a new database table"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>n("add-record"),"Opening add row form"),disabled:!e,children:[h.jsx(yw,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Add New Row"}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Insert a new record to ",e||"selected table"]})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{window.location.reload()},"Refreshing database..."),children:[h.jsx(aI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Refresh Database"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Reload all tables and data"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Export Feature - Coming Soon!",{description:"Export your data to CSV, JSON, or SQL"})}),children:[h.jsx(MF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Export Data"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Download table data as CSV, JSON, or SQL"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Import Feature - Coming Soon!",{description:"Import data from CSV, JSON, or SQL files"})}),children:[h.jsx(bI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Import Data"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Upload and import data from files"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Backup Feature - Coming Soon!",{description:"Create a complete backup of your database"})}),children:[h.jsx(TF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Backup Database"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Create a full database backup"})]})]})]}),h.jsx(ns,{}),h.jsxs(Vr,{heading:"Data Operations",children:[h.jsxs(it,{onSelect:()=>C(()=>{at.info("Advanced Search - Coming Soon!",{description:"Search across all tables"})}),children:[h.jsx(iI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Search Records"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Search across all tables and columns"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Filter Builder - Coming Soon!",{description:"Build complex filters for your data"})}),disabled:!e,children:[h.jsx(zF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Filter Data"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Apply advanced filters to current table"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Sort Options - Coming Soon!",{description:"Sort data by multiple columns"})}),disabled:!e,children:[h.jsx(sF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Sort Data"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Sort by multiple columns"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Bulk Edit - Coming Soon!",{description:"Edit multiple records at once"})}),disabled:!e,children:[h.jsx(fI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Bulk Edit"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Update multiple records simultaneously"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Bulk Delete - Coming Soon!",{description:"Delete multiple records at once"})}),children:[h.jsx(pI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Bulk Delete"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Remove multiple records at once"})]})]})]}),h.jsx(ns,{}),h.jsxs(Vr,{heading:"SQL & Schema",children:[h.jsxs(it,{onSelect:()=>C(()=>{at.info("SQL Editor - Coming Soon!",{description:"Run custom SQL queries"})}),children:[h.jsx(_F,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"SQL Editor"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Write and execute custom queries"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Query History - Coming Soon!",{description:"View your recent queries"})}),children:[h.jsx(DF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Query History"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Access previously executed queries"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Schema Viewer - Coming Soon!",{description:"Visualize your database structure"})}),children:[h.jsx(LF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"View Schema Diagram"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Visualize table relationships"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Generate SQL - Coming Soon!",{description:"Generate SQL for current table"})}),disabled:!e,children:[h.jsx(xF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Generate Table SQL"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Get CREATE TABLE statement"})]})]})]}),h.jsx(ns,{}),h.jsxs(Vr,{heading:"Access & Security",children:[h.jsxs(it,{onSelect:()=>C(()=>{at.info("Permissions - Coming Soon!",{description:"Manage database permissions"})}),children:[h.jsx(YF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Manage Permissions"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Control user access and privileges"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Users - Coming Soon!",{description:"Manage database users"})}),children:[h.jsx(SI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"User Management"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Add and manage database users"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Audit Log - Coming Soon!",{description:"View database activity logs"})}),children:[h.jsx(AF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Audit Log"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Track all database changes"})]})]})]}),h.jsx(ns,{}),h.jsxs(Vr,{heading:"View & Settings",children:[h.jsxs(it,{onSelect:()=>C(r,"Sidebar toggled"),children:[h.jsx(WF,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("span",{children:[l.isOpen?"Hide":"Show"," Sidebar"]}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Toggle sidebar visibility"})]})]}),h.jsxs(it,{onSelect:()=>C(s,"Sidebar pin toggled"),children:[l.isPinned?h.jsx(XF,{className:"mr-2 h-4 w-4"}):h.jsx(eI,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("span",{children:[l.isPinned?"Unpin":"Pin"," Sidebar"]}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Keep sidebar always visible"})]})]}),h.jsxs(it,{onSelect:()=>C(()=>{at.info("Settings - Coming Soon!",{description:"Customize your DB Studio experience"})}),children:[h.jsx(E2,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:"Settings & Preferences"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:"Configure application settings"})]})]})]}),!d&&c&&c.length>0&&h.jsxs(h.Fragment,{children:[h.jsx(ns,{}),h.jsxs(Vr,{heading:"Recent Tables",children:[c.slice(0,5).map(D=>h.jsxs(it,{onSelect:()=>j(D.tableName),children:[h.jsx(vw,{className:"mr-2 h-4 w-4"}),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{children:D.tableName}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:[D.rowCount," ",D.rowCount===1?"row":"rows"]})]})]},D.tableName)),c.length>5&&h.jsx(it,{onSelect:T,className:"text-muted-foreground",children:h.jsxs("span",{className:"text-xs",children:["+",c.length-5," more tables — press"," ",h.jsx("kbd",{className:"rounded border bg-muted px-1 py-0.5 font-mono text-[10px]",children:">"})," ","to see all"]})})]})]})]})]})]})}const uB=()=>{const[e,t]=Ae(we.ACTIVE_TAB);return h.jsx("div",{className:"flex h-full items-center",children:T$.map(({id:n,label:r})=>h.jsx(ze,{variant:"ghost",onClick:()=>t(n.toLowerCase()),className:fe("flex-1 px-4 border-l-0 border-y-0 border-r border-zinc-800 h-full rounded-none",e===n?"bg-zinc-900 text-white":"text-zinc-400"),children:r},n))})},dB=()=>{const{sidebar:{isOpen:e,isPinned:t},setSidebarOpen:n,setSidebarPinned:r}=Cs(),s=()=>{n(!e),r(!t)};return h.jsx(ze,{variant:"ghost",onClick:s,className:"size-14! aspect-square border-l-0 border-y-0 border-r border-zinc-800 rounded-none",children:e?h.jsx(NV,{className:"size-5"}):h.jsx(uV,{className:"size-5"})})},fB=()=>h.jsxs("div",{className:"border-b border-zinc-800 w-full flex items-center justify-between bg-black h-14",children:[h.jsxs("div",{className:"flex items-center h-full",children:[h.jsx(dB,{}),h.jsx(uB,{})]}),h.jsx("div",{className:"flex items-center h-full",children:h.jsx(ze,{variant:"ghost",className:"border-r-0 border-y-0 border-l border-zinc-800 rounded-none h-full w-12",asChild:!0,children:h.jsx("a",{href:N$.GITHUB,target:"_blank",rel:"noopener noreferrer",children:h.jsx(VI,{className:"size-5"})})})})]});function xa(e,t){return typeof e=="function"?e(t):e}function dr(e,t){return n=>{t.setState(r=>({...r,[e]:xa(n,r[e])}))}}function pf(e){return e instanceof Function}function hB(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function mB(e,t){const n=[],r=s=>{s.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function Ie(e,t,n){let r=[],s;return l=>{let c;n.key&&n.debug&&(c=Date.now());const d=e(l);if(!(d.length!==r.length||d.some((v,p)=>r[p]!==v)))return s;r=d;let m;if(n.key&&n.debug&&(m=Date.now()),s=t(...d),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const v=Math.round((Date.now()-c)*100)/100,p=Math.round((Date.now()-m)*100)/100,x=p/16,S=(_,w)=>{for(_=String(_);_.length<w;)_=" "+_;return _};console.info(`%c⏱ ${S(p,5)} /${S(v,5)} ms`,`
76
+ font-size: .6rem;
77
+ font-weight: bold;
78
+ color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n?.key)}return s}}function Ve(e,t,n,r){return{debug:()=>{var s;return(s=e?.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function pB(e,t,n,r){const s=()=>{var c;return(c=l.getValue())!=null?c:e.options.renderFallbackValue},l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:Ie(()=>[e,n,t,l],(c,d,f,m)=>({table:c,column:d,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),Ve(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function gB(e,t,n,r){var s,l;const d={...e._getDefaultColumnDef(),...t},f=d.accessorKey;let m=(s=(l=d.id)!=null?l:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,v;if(d.accessorFn?v=d.accessorFn:f&&(f.includes(".")?v=x=>{let S=x;for(const w of f.split(".")){var _;S=(_=S)==null?void 0:_[w]}return S}:v=x=>x[d.accessorKey]),!m)throw new Error;let p={id:`${String(m)}`,accessorFn:v,parent:r,depth:n,columnDef:d,columns:[],getFlatColumns:Ie(()=>[!0],()=>{var x;return[p,...(x=p.columns)==null?void 0:x.flatMap(S=>S.getFlatColumns())]},Ve(e.options,"debugColumns")),getLeafColumns:Ie(()=>[e._getOrderColumnsFn()],x=>{var S;if((S=p.columns)!=null&&S.length){let _=p.columns.flatMap(w=>w.getLeafColumns());return x(_)}return[p]},Ve(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(p,e);return p}const xn="debugHeaders";function Hw(e,t,n){var r;let l={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const c=[],d=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(d),c.push(f)};return d(l),c},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(l,e)}),l}const vB={createTable:e=>{e.getHeaderGroups=Ie(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var l,c;const d=(l=r?.map(p=>n.find(x=>x.id===p)).filter(Boolean))!=null?l:[],f=(c=s?.map(p=>n.find(x=>x.id===p)).filter(Boolean))!=null?c:[],m=n.filter(p=>!(r!=null&&r.includes(p.id))&&!(s!=null&&s.includes(p.id)));return ed(t,[...d,...m,...f],e)},Ve(e.options,xn)),e.getCenterHeaderGroups=Ie(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id))),ed(t,n,e,"center")),Ve(e.options,xn)),e.getLeftHeaderGroups=Ie(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const l=(s=r?.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return ed(t,l,e,"left")},Ve(e.options,xn)),e.getRightHeaderGroups=Ie(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const l=(s=r?.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return ed(t,l,e,"right")},Ve(e.options,xn)),e.getFooterGroups=Ie(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ve(e.options,xn)),e.getLeftFooterGroups=Ie(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ve(e.options,xn)),e.getCenterFooterGroups=Ie(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ve(e.options,xn)),e.getRightFooterGroups=Ie(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ve(e.options,xn)),e.getFlatHeaders=Ie(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ve(e.options,xn)),e.getLeftFlatHeaders=Ie(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ve(e.options,xn)),e.getCenterFlatHeaders=Ie(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ve(e.options,xn)),e.getRightFlatHeaders=Ie(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ve(e.options,xn)),e.getCenterLeafHeaders=Ie(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ve(e.options,xn)),e.getLeftLeafHeaders=Ie(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ve(e.options,xn)),e.getRightLeafHeaders=Ie(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ve(e.options,xn)),e.getLeafHeaders=Ie(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,l,c,d,f,m;return[...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[],...(f=(m=r[0])==null?void 0:m.headers)!=null?f:[]].map(v=>v.getLeafHeaders()).flat()},Ve(e.options,xn))}};function ed(e,t,n,r){var s,l;let c=0;const d=function(x,S){S===void 0&&(S=1),c=Math.max(c,S),x.filter(_=>_.getIsVisible()).forEach(_=>{var w;(w=_.columns)!=null&&w.length&&d(_.columns,S+1)},0)};d(e);let f=[];const m=(x,S)=>{const _={depth:S,id:[r,`${S}`].filter(Boolean).join("_"),headers:[]},w=[];x.forEach(C=>{const T=[...w].reverse()[0],N=C.column.depth===_.depth;let M,R=!1;if(N&&C.column.parent?M=C.column.parent:(M=C.column,R=!0),T&&T?.column===M)T.subHeaders.push(C);else{const j=Hw(n,M,{id:[r,S,M.id,C?.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${w.filter(A=>A.column===M).length}`:void 0,depth:S,index:w.length});j.subHeaders.push(C),w.push(j)}_.headers.push(C),C.headerGroup=_}),f.push(_),S>0&&m(w,S-1)},v=t.map((x,S)=>Hw(n,x,{depth:c,index:S}));m(v,c-1),f.reverse();const p=x=>x.filter(_=>_.column.getIsVisible()).map(_=>{let w=0,C=0,T=[0];_.subHeaders&&_.subHeaders.length?(T=[],p(_.subHeaders).forEach(M=>{let{colSpan:R,rowSpan:j}=M;w+=R,T.push(j)})):w=1;const N=Math.min(...T);return C=C+N,_.colSpan=w,_.rowSpan=C,{colSpan:w,rowSpan:C}});return p((s=(l=f[0])==null?void 0:l.headers)!=null?s:[]),f}const yB=(e,t,n,r,s,l,c)=>{let d={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(d._valuesCache.hasOwnProperty(f))return d._valuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return d._valuesCache[f]=m.accessorFn(d.original,r),d._valuesCache[f]},getUniqueValues:f=>{if(d._uniqueValuesCache.hasOwnProperty(f))return d._uniqueValuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[f]=m.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[f]):(d._uniqueValuesCache[f]=[d.getValue(f)],d._uniqueValuesCache[f])},renderValue:f=>{var m;return(m=d.getValue(f))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>mB(d.subRows,f=>f.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let f=[],m=d;for(;;){const v=m.getParentRow();if(!v)break;f.push(v),m=v}return f.reverse()},getAllCells:Ie(()=>[e.getAllLeafColumns()],f=>f.map(m=>pB(e,d,m,m.id)),Ve(e.options,"debugRows")),_getAllCellsByColumnId:Ie(()=>[d.getAllCells()],f=>f.reduce((m,v)=>(m[v.column.id]=v,m),{}),Ve(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const m=e._features[f];m==null||m.createRow==null||m.createRow(d,e)}return d},bB={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},xT=(e,t,n)=>{var r,s;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};xT.autoRemove=e=>Yr(e);const ST=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};ST.autoRemove=e=>Yr(e);const wT=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};wT.autoRemove=e=>Yr(e);const CT=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};CT.autoRemove=e=>Yr(e);const _T=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});_T.autoRemove=e=>Yr(e)||!(e!=null&&e.length);const ET=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});ET.autoRemove=e=>Yr(e)||!(e!=null&&e.length);const TT=(e,t,n)=>e.getValue(t)===n;TT.autoRemove=e=>Yr(e);const NT=(e,t,n)=>e.getValue(t)==n;NT.autoRemove=e=>Yr(e);const Gv=(e,t,n)=>{let[r,s]=n;const l=e.getValue(t);return l>=r&&l<=s};Gv.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(l>c){const d=l;l=c,c=d}return[l,c]};Gv.autoRemove=e=>Yr(e)||Yr(e[0])&&Yr(e[1]);const Lo={includesString:xT,includesStringSensitive:ST,equalsString:wT,arrIncludes:CT,arrIncludesAll:_T,arrIncludesSome:ET,equals:TT,weakEquals:NT,inNumberRange:Gv};function Yr(e){return e==null||e===""}const xB={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:dr("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?Lo.includesString:typeof r=="number"?Lo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Lo.equals:Array.isArray(r)?Lo.arrIncludes:Lo.weakEquals},e.getFilterFn=()=>{var n,r;return pf(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Lo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),l=r?.find(v=>v.id===e.id),c=xa(n,l?l.value:void 0);if(qw(s,c,e)){var d;return(d=r?.filter(v=>v.id!==e.id))!=null?d:[]}const f={id:e.id,value:c};if(l){var m;return(m=r?.map(v=>v.id===e.id?f:v))!=null?m:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var l;return(l=xa(t,s))==null?void 0:l.filter(c=>{const d=n.find(f=>f.id===c.id);if(d){const f=d.getFilterFn();if(qw(f,c.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function qw(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const SB=(e,t,n)=>n.reduce((r,s)=>{const l=s.getValue(e);return r+(typeof l=="number"?l:0)},0),wB=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},CB=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},_B=(e,t,n)=>{let r,s;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},EB=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},TB=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!hB(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((l,c)=>l-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},NB=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),RB=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,MB=(e,t)=>t.length,dp={sum:SB,min:wB,max:CB,extent:_B,mean:EB,median:TB,unique:NB,uniqueCount:RB,count:MB},OB={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:dr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return dp.sum;if(Object.prototype.toString.call(r)==="[object Date]")return dp.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return pf(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:dp[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function AB(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(l=>!t.includes(l.id));return n==="remove"?r:[...t.map(l=>e.find(c=>c.id===l)).filter(Boolean),...r]}const jB={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:dr("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ie(n=>[ec(t,n)],n=>n.findIndex(r=>r.id===e.id),Ve(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=ec(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=ec(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ie(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let l=[];if(!(t!=null&&t.length))l=s;else{const c=[...t],d=[...s];for(;d.length&&c.length;){const f=c.shift(),m=d.findIndex(v=>v.id===f);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return AB(l,n,r)},Ve(e.options,"debugTable"))}},fp=()=>({left:[],right:[]}),DB={getInitialState:e=>({columnPinning:fp(),...e}),getDefaultOptions:e=>({onColumnPinningChange:dr("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var l,c;if(n==="right"){var d,f;return{left:((d=s?.left)!=null?d:[]).filter(p=>!(r!=null&&r.includes(p))),right:[...((f=s?.right)!=null?f:[]).filter(p=>!(r!=null&&r.includes(p))),...r]}}if(n==="left"){var m,v;return{left:[...((m=s?.left)!=null?m:[]).filter(p=>!(r!=null&&r.includes(p))),...r],right:((v=s?.right)!=null?v:[]).filter(p=>!(r!=null&&r.includes(p)))}}return{left:((l=s?.left)!=null?l:[]).filter(p=>!(r!=null&&r.includes(p))),right:((c=s?.right)!=null?c:[]).filter(p=>!(r!=null&&r.includes(p)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,l,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((l=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(d=>d.id),{left:r,right:s}=t.getState().columnPinning,l=n.some(d=>r?.includes(d)),c=n.some(d=>s?.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ie(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const l=[...r??[],...s??[]];return n.filter(c=>!l.includes(c.column.id))},Ve(t.options,"debugRows")),e.getLeftVisibleCells=Ie(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),Ve(t.options,"debugRows")),e.getRightVisibleCells=Ie(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),Ve(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?fp():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:fp())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,l;return!!((s=r.left)!=null&&s.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=Ie(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Ve(e.options,"debugColumns")),e.getRightLeafColumns=Ie(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),Ve(e.options,"debugColumns")),e.getCenterLeafColumns=Ie(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(l=>!s.includes(l.id))},Ve(e.options,"debugColumns"))}};function kB(e){return e||(typeof document<"u"?document:null)}const td={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},hp=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),zB={getDefaultColumnDef:()=>td,getInitialState:e=>({columnSizing:{},columnSizingInfo:hp(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:dr("columnSizing",e),onColumnSizingInfoChange:dr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:td.minSize,(r=l??e.columnDef.size)!=null?r:td.size),(s=e.columnDef.maxSize)!=null?s:td.maxSize)},e.getStart=Ie(n=>[n,ec(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,l)=>s+l.getSize(),0),Ve(t.options,"debugColumns")),e.getAfter=Ie(n=>[n,ec(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,l)=>s+l.getSize(),0),Ve(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var l;n+=(l=s.column.getSize())!=null?l:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r?.getCanResize();return l=>{if(!r||!s||(l.persist==null||l.persist(),mp(l)&&l.touches&&l.touches.length>1))return;const c=e.getSize(),d=e?e.getLeafHeaders().map(T=>[T.column.id,T.column.getSize()]):[[r.id,r.getSize()]],f=mp(l)?Math.round(l.touches[0].clientX):l.clientX,m={},v=(T,N)=>{typeof N=="number"&&(t.setColumnSizingInfo(M=>{var R,j;const A=t.options.columnResizeDirection==="rtl"?-1:1,D=(N-((R=M?.startOffset)!=null?R:0))*A,L=Math.max(D/((j=M?.startSize)!=null?j:0),-.999999);return M.columnSizingStart.forEach(B=>{let[ne,J]=B;m[ne]=Math.round(Math.max(J+J*L,0)*100)/100}),{...M,deltaOffset:D,deltaPercentage:L}}),(t.options.columnResizeMode==="onChange"||T==="end")&&t.setColumnSizing(M=>({...M,...m})))},p=T=>v("move",T),x=T=>{v("end",T),t.setColumnSizingInfo(N=>({...N,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},S=kB(n),_={moveHandler:T=>p(T.clientX),upHandler:T=>{S?.removeEventListener("mousemove",_.moveHandler),S?.removeEventListener("mouseup",_.upHandler),x(T.clientX)}},w={moveHandler:T=>(T.cancelable&&(T.preventDefault(),T.stopPropagation()),p(T.touches[0].clientX),!1),upHandler:T=>{var N;S?.removeEventListener("touchmove",w.moveHandler),S?.removeEventListener("touchend",w.upHandler),T.cancelable&&(T.preventDefault(),T.stopPropagation()),x((N=T.touches[0])==null?void 0:N.clientX)}},C=PB()?{passive:!1}:!1;mp(l)?(S?.addEventListener("touchmove",w.moveHandler,C),S?.addEventListener("touchend",w.upHandler,C)):(S?.addEventListener("mousemove",_.moveHandler,C),S?.addEventListener("mouseup",_.upHandler,C)),t.setColumnSizingInfo(T=>({...T,startOffset:f,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?hp():(n=e.initialState.columnSizingInfo)!=null?n:hp())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let nd=null;function PB(){if(typeof nd=="boolean")return nd;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return nd=e,nd}function mp(e){return e.type==="touchstart"}const LB={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:dr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(l=>l.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ie(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ve(t.options,"debugRows")),e.getVisibleCells=Ie(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],Ve(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>Ie(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),Ve(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function ec(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const FB={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},IB={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:dr("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Lo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return pf(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Lo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},VB={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:dr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,l;e.setExpanded(r?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const c=l.split(".");r=Math.max(r,c.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const l=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(d=>{c[d]=!0}):c=r,n=(s=n)!=null?s:!l,!l&&n)return{...c,[e.id]:!0};if(l&&!n){const{[e.id]:d,...f}=c;return f}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},bg=0,xg=10,pp=()=>({pageIndex:bg,pageSize:xg}),$B={getInitialState:e=>({...e,pagination:{...pp(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:dr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=l=>xa(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?pp():(s=e.initialState.pagination)!=null?s:pp())},e.setPageIndex=r=>{e.setPagination(s=>{let l=xa(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,c)),{...s,pageIndex:l}})},e.resetPageIndex=r=>{var s,l;e.setPageIndex(r?bg:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:bg)},e.resetPageSize=r=>{var s,l;e.setPageSize(r?xg:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:xg)},e.setPageSize=r=>{e.setPagination(s=>{const l=Math.max(1,xa(r,s.pageSize)),c=s.pageSize*s.pageIndex,d=Math.floor(c/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(s=>{var l;let c=xa(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=Ie(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((l,c)=>c)),s},Ve(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},gp=()=>({top:[],bottom:[]}),UB={getInitialState:e=>({rowPinning:gp(),...e}),getDefaultOptions:e=>({onRowPinningChange:dr("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const l=r?e.getLeafRows().map(f=>{let{id:m}=f;return m}):[],c=s?e.getParentRows().map(f=>{let{id:m}=f;return m}):[],d=new Set([...c,e.id,...l]);t.setRowPinning(f=>{var m,v;if(n==="bottom"){var p,x;return{top:((p=f?.top)!=null?p:[]).filter(w=>!(d!=null&&d.has(w))),bottom:[...((x=f?.bottom)!=null?x:[]).filter(w=>!(d!=null&&d.has(w))),...Array.from(d)]}}if(n==="top"){var S,_;return{top:[...((S=f?.top)!=null?S:[]).filter(w=>!(d!=null&&d.has(w))),...Array.from(d)],bottom:((_=f?.bottom)!=null?_:[]).filter(w=>!(d!=null&&d.has(w)))}}return{top:((m=f?.top)!=null?m:[]).filter(w=>!(d!=null&&d.has(w))),bottom:((v=f?.bottom)!=null?v:[]).filter(w=>!(d!=null&&d.has(w)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,l=n.some(d=>r?.includes(d)),c=n.some(d=>s?.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const l=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:d}=c;return d});return(r=l?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?gp():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:gp())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,l;return!!((s=r.top)!=null&&s.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(c=>{const d=e.getRow(c,!0);return d.getIsAllParentsExpanded()?d:null}):(n??[]).map(c=>t.find(d=>d.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=Ie(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ve(e.options,"debugRows")),e.getBottomRows=Ie(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ve(e.options,"debugRows")),e.getCenterRows=Ie(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(l=>!s.has(l.id))},Ve(e.options,"debugRows"))}},BB={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:dr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):s.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(l=>{Sg(s,l.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ie(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?vp(e,n):{rows:[],flatRows:[],rowsById:{}},Ve(e.options,"debugTable")),e.getFilteredSelectedRowModel=Ie(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?vp(e,n):{rows:[],flatRows:[],rowsById:{}},Ve(e.options,"debugTable")),e.getGroupedSelectedRowModel=Ie(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?vp(e,n):{rows:[],flatRows:[],rowsById:{}},Ve(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(l=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return l;const d={...l};return Sg(d,e.id,n,(c=r?.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Kv(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return wg(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return wg(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},Sg=(e,t,n,r,s)=>{var l;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(l=c.subRows)!=null&&l.length&&c.getCanSelectSubRows()&&c.subRows.forEach(d=>Sg(e,d.id,n,r,s))};function vp(e,t){const n=e.getState().rowSelection,r=[],s={},l=function(c,d){return c.map(f=>{var m;const v=Kv(f,n);if(v&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:l(f.subRows)}),v)return f}).filter(Boolean)};return{rows:l(t.rows),flatRows:r,rowsById:s}}function Kv(e,t){var n;return(n=t[e.id])!=null?n:!1}function wg(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!s)&&(c.getCanSelect()&&(Kv(c,t)?l=!0:s=!1),c.subRows&&c.subRows.length)){const d=wg(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const Cg=/([0-9]+)/gm,HB=(e,t,n)=>RT(Ra(e.getValue(n)).toLowerCase(),Ra(t.getValue(n)).toLowerCase()),qB=(e,t,n)=>RT(Ra(e.getValue(n)),Ra(t.getValue(n))),YB=(e,t,n)=>Zv(Ra(e.getValue(n)).toLowerCase(),Ra(t.getValue(n)).toLowerCase()),GB=(e,t,n)=>Zv(Ra(e.getValue(n)),Ra(t.getValue(n))),KB=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},ZB=(e,t,n)=>Zv(e.getValue(n),t.getValue(n));function Zv(e,t){return e===t?0:e>t?1:-1}function Ra(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function RT(e,t){const n=e.split(Cg).filter(Boolean),r=t.split(Cg).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),l=r.shift(),c=parseInt(s,10),d=parseInt(l,10),f=[c,d].sort();if(isNaN(f[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(f[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}return n.length-r.length}const ql={alphanumeric:HB,alphanumericCaseSensitive:qB,text:YB,textCaseSensitive:GB,datetime:KB,basic:ZB},WB={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:dr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const l=s?.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return ql.datetime;if(typeof l=="string"&&(r=!0,l.split(Cg).length>1))return ql.alphanumeric}return r?ql.text:ql.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return pf(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:ql[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),l=typeof n<"u"&&n!==null;t.setSorting(c=>{const d=c?.find(S=>S.id===e.id),f=c?.findIndex(S=>S.id===e.id);let m=[],v,p=l?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?d?v="toggle":v="add":c!=null&&c.length&&f!==c.length-1?v="replace":d?v="toggle":v="replace",v==="toggle"&&(l||s||(v="remove")),v==="add"){var x;m=[...c,{id:e.id,desc:p}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else v==="toggle"?m=c.map(S=>S.id===e.id?{...S,desc:p}:S):v==="remove"?m=c.filter(S=>S.id!==e.id):m=[{id:e.id,desc:p}];return m})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":l},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},QB=[vB,LB,jB,DB,bB,xB,FB,IB,WB,OB,VB,$B,UB,BB,zB];function XB(e){var t,n;const r=[...QB,...(t=e._features)!=null?t:[]];let s={_features:r};const l=s._features.reduce((x,S)=>Object.assign(x,S.getDefaultOptions==null?void 0:S.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(l,x):{...l,...x};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var S;f=(S=x.getInitialState==null?void 0:x.getInitialState(f))!=null?S:f});const m=[];let v=!1;const p={_features:r,options:{...l,...e},initialState:f,_queue:x=>{m.push(x),v||(v=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();v=!1}).catch(S=>setTimeout(()=>{throw S})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const S=xa(x,s.options);s.options=c(S)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,S,_)=>{var w;return(w=s.options.getRowId==null?void 0:s.options.getRowId(x,S,_))!=null?w:`${_?[_.id,S].join("."):S}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,S)=>{let _=(S?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!_&&(_=s.getCoreRowModel().rowsById[x],!_))throw new Error;return _},_getDefaultColumnDef:Ie(()=>[s.options.defaultColumn],x=>{var S;return x=(S=x)!=null?S:{},{header:_=>{const w=_.header.column.columnDef;return w.accessorKey?w.accessorKey:w.accessorFn?w.id:null},cell:_=>{var w,C;return(w=(C=_.renderValue())==null||C.toString==null?void 0:C.toString())!=null?w:null},...s._features.reduce((_,w)=>Object.assign(_,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...x}},Ve(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:Ie(()=>[s._getColumnDefs()],x=>{const S=function(_,w,C){return C===void 0&&(C=0),_.map(T=>{const N=gB(s,T,C,w),M=T;return N.columns=M.columns?S(M.columns,N,C+1):[],N})};return S(x)},Ve(e,"debugColumns")),getAllFlatColumns:Ie(()=>[s.getAllColumns()],x=>x.flatMap(S=>S.getFlatColumns()),Ve(e,"debugColumns")),_getAllFlatColumnsById:Ie(()=>[s.getAllFlatColumns()],x=>x.reduce((S,_)=>(S[_.id]=_,S),{}),Ve(e,"debugColumns")),getAllLeafColumns:Ie(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,S)=>{let _=x.flatMap(w=>w.getLeafColumns());return S(_)},Ve(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,p);for(let x=0;x<s._features.length;x++){const S=s._features[x];S==null||S.createTable==null||S.createTable(s)}return s}function MT(){return e=>Ie(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,l,c){l===void 0&&(l=0);const d=[];for(let m=0;m<s.length;m++){const v=yB(e,e._getRowId(s[m],m,c),s[m],m,l,void 0,c?.id);if(n.flatRows.push(v),n.rowsById[v.id]=v,d.push(v),e.options.getSubRows){var f;v.originalSubRows=e.options.getSubRows(s[m],m),(f=v.originalSubRows)!=null&&f.length&&(v.subRows=r(v.originalSubRows,l+1,v))}}return d};return n.rows=r(t),n},Ve(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function JB(){return e=>Ie(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],l=r.filter(f=>{var m;return(m=e.getColumn(f.id))==null?void 0:m.getCanSort()}),c={};l.forEach(f=>{const m=e.getColumn(f.id);m&&(c[f.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=f=>{const m=f.map(v=>({...v}));return m.sort((v,p)=>{for(let S=0;S<l.length;S+=1){var x;const _=l[S],w=c[_.id],C=w.sortUndefined,T=(x=_?.desc)!=null?x:!1;let N=0;if(C){const M=v.getValue(_.id),R=p.getValue(_.id),j=M===void 0,A=R===void 0;if(j||A){if(C==="first")return j?-1:1;if(C==="last")return j?1:-1;N=j&&A?0:j?C:-C}}if(N===0&&(N=w.sortingFn(v,p,_.id)),N!==0)return T&&(N*=-1),w.invertSorting&&(N*=-1),N}return v.index-p.index}),m.forEach(v=>{var p;s.push(v),(p=v.subRows)!=null&&p.length&&(v.subRows=d(v.subRows))}),m};return{rows:d(n.rows),flatRows:s,rowsById:n.rowsById}},Ve(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function cc(e,t){return e?e9(e)?b.createElement(e,t):e:null}function e9(e){return t9(e)||typeof e=="function"||n9(e)}function t9(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function n9(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function OT(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=b.useState(()=>({current:XB(t)})),[r,s]=b.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}const r9=()=>{const{openSheet:e}=jr();return h.jsx(ze,{type:"button",variant:"default",className:"h-8! border-l-0 border-y-0 border-r border-zinc-800 rounded-none",onClick:()=>e("add-record"),"aria-label":"Add a new record to the table",children:"Add Record"})},rd=(e,t)=>`${e.id??JSON.stringify(e)}-${t}`,po=Rv()((e,t)=>({updates:new Map,setUpdate:(n,r,s,l)=>{e(c=>{const d=new Map(c.updates),f=rd(n,r);return s===l?d.delete(f):d.set(f,{rowData:n,columnName:r,newValue:s,originalValue:l}),console.log("setUpdate",{rowData:n,columnName:r,newValue:s,originalValue:l}),{updates:d}})},clearUpdates:()=>e({updates:new Map}),clearUpdate:(n,r)=>{e(s=>{const l=new Map(s.updates);return l.delete(rd(n,r)),{updates:l}})},getUpdates:()=>Array.from(t().updates.values()),getUpdate:(n,r)=>t().updates.get(rd(n,r))??null,hasUpdate:(n,r)=>t().updates.has(rd(n,r)),hasAnyUpdates:()=>t().updates.size>0,getUpdateCount:()=>t().updates.size})),AT=()=>{const e=Yi(),[t]=Ae(we.ACTIVE_TABLE),{clearUpdates:n,getUpdateCount:r}=po(),{mutateAsync:s,isPending:l}=hf({mutationFn:async c=>{if(!t)throw new Error("No active table selected");const d={tableName:t,updates:c.map(v=>(console.log(`Update for ${v.columnName}:`,typeof v.newValue,v.newValue),{rowData:v.rowData,columnName:v.columnName,value:v.newValue}))};console.log("Sending update payload:",d);const f=await fetch(`${Ss}/records`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),m=await f.json();if(!f.ok||!m.success)throw new Error(m.message||m.detail||"Failed to update records");return m},onSuccess:async c=>{const d=r();at.success(c.message||`${d} ${d===1?"change":"changes"} saved successfully`),n(),await Promise.all([e.invalidateQueries({queryKey:[we.CACHE_KEYS.TABLE_DATA,t],exact:!1})])},onError:c=>{console.error("Update error:",c),at.error("Failed to save changes",{description:c instanceof Error?c.message:"Unknown error occurred"})}});return{updateCell:s,isUpdatingCell:l}},o9=()=>{const{getUpdateCount:e,clearUpdates:t}=po(),{isUpdatingCell:n}=AT(),r=b.useCallback(()=>{t()},[t]);return e()===0?null:h.jsx(ze,{type:"button",variant:"secondary",className:"h-8! border-l-0 border-y-0 border-r border-zinc-800 rounded-none",onClick:r,"aria-label":"Clear changes to the table",disabled:n,children:"Clear Changes"})},a9=()=>{const e=Yi(),[t]=Ae(we.ACTIVE_TABLE),{tableCols:n}=Bo(),{mutateAsync:r,isPending:s,reset:l}=hf({mutationFn:async({rowData:f,force:m=!1})=>{if(!t)throw new Error("No active table selected");if(!n||n.length===0)throw new Error("No table columns found");return await s9(t,n,f,m)},onSuccess:async f=>{f.success&&(at.success(f.message||"Records deleted successfully"),await Promise.all([e.invalidateQueries({queryKey:[we.CACHE_KEYS.TABLE_DATA,t],exact:!1}),e.invalidateQueries({queryKey:[we.CACHE_KEYS.TABLES_LIST]})]))},onError:f=>{console.error("Delete error:",f),at.error("Failed to delete records",{description:f instanceof Error?f.message:"Unknown error occurred"})}});return{deleteCells:async f=>r({rowData:f,force:!1}),forceDeleteCells:async f=>r({rowData:f,force:!0}),isDeletingCells:s,resetDeleteResult:l}},s9=async(e,t,n,r)=>{const s=r?"/records/force":"/records",l=t.find(v=>v.isPrimaryKey);if(!l)throw new Error("No primary key found for this table");const c=n.map(v=>({columnName:l.columnName,value:v[l.columnName]})),d={tableName:e,primaryKeys:c},f=await fetch(`${Ss}${s}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),m=await f.json();if(m.fkViolation)return m;if(!f.ok||!m.success)throw new Error(m.message||"Failed to delete records");return m},i9=({isOpenFkDialog:e,handleDialogClose:t,relatedRecords:n,handleCancelForceDelete:r,handleForceDelete:s,isDeletingCells:l})=>h.jsx(rT,{open:e,onOpenChange:t,children:h.jsxs(oT,{className:"max-w-2xl z-500",children:[h.jsxs(aT,{children:[h.jsx(sT,{children:"Cannot Delete - Foreign Key Constraint"}),h.jsx(iT,{children:"The selected records cannot be deleted because they are referenced by records in other tables. You can either cancel the operation or force delete, which will also delete all related records."})]}),h.jsx(l9,{relatedRecords:n}),h.jsxs(oU,{className:"gap-2",children:[h.jsx(ze,{variant:"outline",onClick:r,disabled:l,children:"Cancel"}),h.jsx(ze,{variant:"destructive",onClick:s,disabled:l,children:l?"Deleting...":"Force Delete All"})]})]})}),l9=({relatedRecords:e})=>h.jsx("div",{className:"space-y-4 max-h-64 overflow-y-auto",children:e.map((t,n)=>h.jsxs("div",{className:"border border-zinc-700 rounded-md p-3",children:[h.jsxs("div",{className:"font-medium text-sm mb-2",children:["Table: ",h.jsx("span",{className:"text-primary",children:t.tableName}),h.jsxs("span",{className:"text-muted-foreground ml-2",children:["(",t.records.length," record",t.records.length!==1?"s":"",")"]})]}),h.jsxs("div",{className:"text-xs text-muted-foreground mb-2",children:["References column: ",t.columnName]}),h.jsx("div",{className:"bg-zinc-900 rounded p-2 text-xs overflow-x-auto",children:h.jsxs("pre",{className:"whitespace-pre-wrap",children:[JSON.stringify(t.records.slice(0,5),null,2),t.records.length>5&&h.jsxs("div",{className:"text-muted-foreground mt-2",children:["... and ",t.records.length-5," more"]})]})})]},`${t.tableName}-${t.columnName}-${n}`))}),c9=({selectedRows:e,setRowSelection:t})=>{const{deleteCells:n,forceDeleteCells:r,isDeletingCells:s,resetDeleteResult:l}=a9(),[c,d]=b.useState([]),[f,m]=b.useState(!1),[v,p]=b.useState([]),x=b.useCallback(async()=>{const C=e.map(N=>N.original),T=await n(C);console.log(T),T.fkViolation&&T.relatedRecords?(d(C),p(T.relatedRecords),m(!0)):T.success&&t({})},[n,e,t]),S=async()=>{if(c.length===0)return;const C=await r(c);console.log(C),C?.success&&(m(!1),d([]),p([]),l(),t({}))},_=b.useCallback(()=>{m(!1),d([]),p([]),l()},[l]),w=C=>{s||(C?m(C):_())};return e?.length===0?null:h.jsxs(h.Fragment,{children:[h.jsxs(ze,{type:"button",variant:"destructive",className:"h-8! border-l-0 border-y-0 border-r border-zinc-800 text-white rounded-none",onClick:x,"aria-label":"Delete the selected record",disabled:s,children:["Delete Record",e?.length>1&&h.jsx("span",{className:"ml-1.5 px-1.5 text-[10px] bg-white/20 border border-white/20 rounded",children:e?.length})]}),h.jsx(i9,{isOpenFkDialog:f,handleDialogClose:w,relatedRecords:v,handleCancelForceDelete:_,handleForceDelete:S,isDeletingCells:s})]})};function Zr({className:e,...t}){return h.jsx("kbd",{"data-slot":"kbd",className:fe("bg-muted text-muted-foreground border [[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-xs px-1 font-sans text-[0.625rem] font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none",e),...t})}const u9=()=>{const[e,t]=Ae(we.TABLE_STATE_KEYS.FILTERS,Di(C=>C).withDefault([]).withOptions({history:"push"})),{tableCols:n}=Bo(),[r,s]=b.useState(!1),[l,c]=b.useState([]),d=()=>{const C=n?.[0]?.columnName??"";c([...l,{columnName:C,operator:"=",value:""}])},f=C=>{c(l.filter((T,N)=>N!==C))},m=(C,T)=>{c(l.map((N,M)=>M===C?{...N,columnName:T}:N))},v=(C,T)=>{c(l.map((N,M)=>M===C?{...N,value:T}:N))},p=(C,T)=>{c(l.map((N,M)=>M===C?{...N,operator:T}:N))},x=()=>{c([]),t([]),s(!1)},S=()=>{const C=l.filter(T=>T.columnName&&T.operator&&T.value!=="");t(C),s(!1)},_=e.length>0,w=C=>{C&&c(e),s(C)};return h.jsxs(za,{open:r,onOpenChange:w,children:[h.jsx(Gi,{asChild:!0,children:h.jsx(ze,{type:"button",variant:"ghost",className:"size-8! aspect-square border-l-0 border-y-0 border-r border-zinc-800 rounded-none","aria-label":"Filter table data","data-active":_,children:h.jsx(R2,{className:"size-4"})})}),h.jsxs(Pa,{className:"w-md space-y-2",align:"start",children:[h.jsx("div",{className:"flex items-center gap-4",children:h.jsxs(ze,{variant:"outline",size:"lg",className:"text-sm",onClick:d,children:["Add filter",l&&l.length>0&&h.jsx(Zr,{className:"text-xs font-normal text-white bg-primary/10 border border-primary/90 px-1.5 py-0.5",children:l.length})]})}),h.jsx("div",{className:"flex flex-col gap-4",children:l.length>0?l.map((C,T)=>h.jsxs("div",{className:"flex-1 flex h-9 gap-2",children:[h.jsxs(kn,{value:C.columnName,onValueChange:N=>m(T,N),children:[h.jsx(Pn,{className:"w-full flex-1",children:h.jsx(zn,{placeholder:"Select column"})}),h.jsx(Ln,{children:n?.map(N=>h.jsx(He,{value:N.columnName,children:N.columnName},N.columnName))})]}),h.jsxs(kn,{value:C.operator,onValueChange:N=>p(T,N),children:[h.jsx(Pn,{children:h.jsx(zn,{placeholder:"Op"})}),h.jsxs(Ln,{children:[h.jsx(He,{value:"=",children:"="}),h.jsx(He,{value:"!=",children:"!="}),h.jsx(He,{value:">",children:">"}),h.jsx(He,{value:">=",children:">="}),h.jsx(He,{value:"<",children:"<"}),h.jsx(He,{value:"<=",children:"<="}),h.jsx(He,{value:"is",children:"is"}),h.jsx(He,{value:"is not",children:"is not"}),h.jsx(He,{value:"like",children:"like"}),h.jsx(He,{value:"not like",children:"not like"}),h.jsx(He,{value:"ilike",children:"ilike"}),h.jsx(He,{value:"not ilike",children:"not ilike"})]})]}),h.jsx(wn,{type:"text",placeholder:"Value",value:C.value,onChange:N=>v(T,N.target.value)}),h.jsx(ze,{variant:"ghost",size:"icon",className:"text-xs",onClick:()=>f(T),children:h.jsx(Hi,{className:"size-4"})})]},T)):h.jsx("div",{className:"flex-1 flex h-9 gap-2 items-center justify-center",children:h.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"No filters applied"})})}),h.jsxs("div",{className:"gap-2 flex justify-end",children:[h.jsx(ze,{variant:"outline",size:"lg",className:"text-sm",onClick:x,children:"Reset"}),h.jsx(ze,{variant:"default",size:"lg",className:"text-sm",onClick:S,children:"Apply"})]})]})]})},gf=(e=!1)=>{const[t]=Ae(e?we.REFERENCED_TABLE_STATE_KEYS.ACTIVE_TABLE:we.ACTIVE_TABLE),[n]=Ae(e?we.REFERENCED_TABLE_STATE_KEYS.PAGE:we.TABLE_STATE_KEYS.PAGE),[r]=Ae(e?we.REFERENCED_TABLE_STATE_KEYS.LIMIT.toString():we.TABLE_STATE_KEYS.LIMIT),[s]=Ae(we.REFERENCED_TABLE_STATE_KEYS.SORT,Di(S=>S).withDefault([]).withOptions({history:"push"})),[l]=Ae(we.TABLE_STATE_KEYS.SORT),[c]=Ae(we.TABLE_STATE_KEYS.ORDER),[d]=Ae(e?we.REFERENCED_TABLE_STATE_KEYS.FILTERS:we.TABLE_STATE_KEYS.FILTERS,Di(S=>S).withDefault([]).withOptions({history:"push"})),{data:f,isLoading:m,isRefetching:v,refetch:p,error:x}=Dv({queryKey:[we.CACHE_KEYS.TABLE_DATA,t,n,r,e?JSON.stringify(s):l,c,JSON.stringify(d)],queryFn:async()=>{const S=we.CACHE_KEYS.TABLE_DEFAULT_PAGE.toString(),_=we.CACHE_KEYS.TABLE_DEFAULT_LIMIT.toString(),w=new URLSearchParams;w.set("page",n?.toString()||S),w.set("pageSize",r?.toString()||_),e?s&&s.length>0&&w.set("sort",JSON.stringify(s)):(l&&w.set("sort",l),c&&w.set("order",c)),d&&d.length>0&&w.set("filters",JSON.stringify(d));try{const C=await fetch(`${Ss}/tables/${t}/data?${w.toString()}`);if(console.log("queryParams",w.toString()),!C.ok)throw new Error("Failed to fetch table data");const T=await C.json();return console.log("useTableData",T),T}catch(C){throw console.error("Error fetching table data:",C),C}},enabled:!!t});return{tableData:f,isLoadingTableData:m,isRefetchingTableData:v,errorTableData:x,refetchTableData:p}},d9=()=>{const{refetchTableData:e,isRefetchingTableData:t}=gf(),{refetchTableCols:n,isRefetchingTableCols:r}=Bo(),s=b.useCallback(()=>{Promise.all([e(),n()])},[e,n]);return h.jsx(ze,{type:"button",variant:"ghost",className:"size-8! aspect-square border-l-0 border-y-0 border-r border-zinc-800 rounded-none",onClick:s,"aria-label":"Refetch table data and columns",disabled:t||r,children:h.jsx(yV,{className:"size-4"})})},f9=({setRowSelection:e})=>{const{getUpdates:t,getUpdateCount:n}=po(),{updateCell:r,isUpdatingCell:s}=AT(),l=b.useCallback(async()=>{const d=t();if(d.length!==0){console.log("Saving updates:",d);try{await r(d),e({})}catch(f){console.error("Failed to save updates:",f)}}},[t,r,e]);if(n()===0)return null;const c=n();return h.jsxs(ze,{type:"button",variant:"default",className:"h-8! border-l-0 border-y-0 border-r border-zinc-800 rounded-none bg-green-700 text-white hover:bg-green-800",onClick:l,"aria-label":"Save changes to the table",disabled:s,children:["Save Changes",c>0&&h.jsx("span",{className:"ml-1.5 px-1.5 text-[10px] bg-white/20 border border-white/20 rounded",children:c})]})},h9=()=>h.jsx(ze,{type:"button",variant:"ghost",className:"size-8! aspect-square border-r-0 border-y-0 border-l border-zinc-800 rounded-none","aria-label":"Open settings menu",children:h.jsx(CV,{className:"size-4"})}),Yw=({selectedRows:e,setRowSelection:t})=>h.jsxs("header",{className:"max-h-8 overflow-hidden border-b border-zinc-800 w-full flex items-center justify-between bg-black sticky top-0 left-0 right-0 z-0",children:[h.jsxs("div",{className:"flex items-center ",children:[h.jsx(d9,{}),h.jsx(u9,{}),h.jsx(r9,{}),h.jsx(f9,{setRowSelection:t}),h.jsx(o9,{}),h.jsx(c9,{selectedRows:e,setRowSelection:t})]}),h.jsx("div",{className:"flex items-center",children:h.jsx(h9,{})})]});function Ki({table:e,cell:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c,className:d,onClick:f,onKeyDown:m,...v}){const{getUpdate:p}=po(),x=e.options.meta,S=t.row.original,_=!!p(S,r),w=b.useCallback(A=>{s||(A.preventDefault(),f?.(A),l?x?.onCellEditingStart?.(n,r):x?.onCellClick?.(n,r,A))},[x,n,r,s,l,f]),C=b.useCallback(A=>{s||x?.onCellContextMenu?.(n,r,A)},[x,n,r,s]),T=b.useCallback(A=>{s||x?.onCellMouseDown?.(n,r,A)},[x,n,r,s]),N=b.useCallback(A=>{s||x?.onCellMouseEnter?.(n,r,A)},[x,n,r,s]),M=b.useCallback(()=>{s||x?.onCellMouseUp?.()},[x,s]),R=b.useCallback(A=>{s||(A.preventDefault(),x?.onCellDoubleClick?.(n,r))},[x,n,r,s]),j=b.useCallback(A=>{if(m?.(A),!A.defaultPrevented&&!(A.key==="ArrowUp"||A.key==="ArrowDown"||A.key==="ArrowLeft"||A.key==="ArrowRight"||A.key==="Home"||A.key==="End"||A.key==="PageUp"||A.key==="PageDown"||A.key==="Tab")&&l&&!s){if(A.key==="F2"||A.key==="Enter"){A.preventDefault(),A.stopPropagation(),x?.onCellEditingStart?.(n,r);return}if(A.key===" "){A.preventDefault(),A.stopPropagation(),x?.onCellEditingStart?.(n,r);return}A.key.length===1&&!A.ctrlKey&&!A.metaKey&&(A.preventDefault(),A.stopPropagation(),x?.onCellEditingStart?.(n,r))}},[m,l,s,x,n,r]);return h.jsx("div",{role:"button","data-slot":"grid-cell-wrapper","data-editing":s?"":void 0,"data-focused":l?"":void 0,"data-selected":c?"":void 0,"data-has-update":_?"":void 0,tabIndex:l&&!s?0:-1,className:fe("size-full px-2 py-1.5 text-left text-sm outline-none has-data-[slot=checkbox]:pt-2.5","**:data-[slot=grid-cell-content]:line-clamp-1",{"ring-1 ring-ring ring-inset":l,"bg-primary/10":c&&!s,"cursor-default":!s,"ring-2 ring-primary":_},d),onClick:w,onContextMenu:C,onDoubleClick:R,onMouseDown:T,onMouseEnter:N,onMouseUp:M,onKeyDown:j,...v})}const jT=6048e5,m9=864e5,Gw=Symbol.for("constructDateFrom");function Qt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Gw in e?e[Gw](t):e instanceof Date?new e.constructor(t):new Date(t)}function bt(e,t){return Qt(t||e,e)}function DT(e,t,n){const r=bt(e,n?.in);return isNaN(t)?Qt(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function kT(e,t,n){const r=bt(e,n?.in);if(isNaN(t))return Qt(e,NaN);if(!t)return r;const s=r.getDate(),l=Qt(e,r.getTime());l.setMonth(r.getMonth()+t+1,0);const c=l.getDate();return s>=c?l:(r.setFullYear(l.getFullYear(),l.getMonth(),s),r)}let p9={};function Tc(){return p9}function ki(e,t){const n=Tc(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=bt(e,t?.in),l=s.getDay(),c=(l<r?7:0)+l-r;return s.setDate(s.getDate()-c),s.setHours(0,0,0,0),s}function uc(e,t){return ki(e,{...t,weekStartsOn:1})}function zT(e,t){const n=bt(e,t?.in),r=n.getFullYear(),s=Qt(n,0);s.setFullYear(r+1,0,4),s.setHours(0,0,0,0);const l=uc(s),c=Qt(n,0);c.setFullYear(r,0,4),c.setHours(0,0,0,0);const d=uc(c);return n.getTime()>=l.getTime()?r+1:n.getTime()>=d.getTime()?r:r-1}function Kw(e){const t=bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Zi(e,...t){const n=Qt.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function dc(e,t){const n=bt(e,t?.in);return n.setHours(0,0,0,0),n}function Wv(e,t,n){const[r,s]=Zi(n?.in,e,t),l=dc(r),c=dc(s),d=+l-Kw(l),f=+c-Kw(c);return Math.round((d-f)/m9)}function g9(e,t){const n=zT(e,t),r=Qt(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),uc(r)}function v9(e,t,n){return DT(e,t*7,n)}function y9(e,t,n){return kT(e,t*12,n)}function b9(e,t){let n,r=t?.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Qt.bind(null,s));const l=bt(s,r);(!n||n<l||isNaN(+l))&&(n=l)}),Qt(r,n||NaN)}function x9(e,t){let n,r=t?.in;return e.forEach(s=>{!r&&typeof s=="object"&&(r=Qt.bind(null,s));const l=bt(s,r);(!n||n>l||isNaN(+l))&&(n=l)}),Qt(r,n||NaN)}function S9(e,t,n){const[r,s]=Zi(n?.in,e,t);return+dc(r)==+dc(s)}function PT(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function w9(e){return!(!PT(e)&&typeof e!="number"||isNaN(+bt(e)))}function LT(e,t,n){const[r,s]=Zi(n?.in,e,t),l=r.getFullYear()-s.getFullYear(),c=r.getMonth()-s.getMonth();return l*12+c}function C9(e,t){const n=bt(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function FT(e,t){const[n,r]=Zi(e,t.start,t.end);return{start:n,end:r}}function _9(e,t){const{start:n,end:r}=FT(t?.in,e);let s=+n>+r;const l=s?+n:+r,c=s?r:n;c.setHours(0,0,0,0),c.setDate(1);let d=1;const f=[];for(;+c<=l;)f.push(Qt(n,c)),c.setMonth(c.getMonth()+d);return s?f.reverse():f}function E9(e,t){const n=bt(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function T9(e,t){const n=bt(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function IT(e,t){const n=bt(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function N9(e,t){const{start:n,end:r}=FT(t?.in,e);let s=+n>+r;const l=s?+n:+r,c=s?r:n;c.setHours(0,0,0,0),c.setMonth(0,1);let d=1;const f=[];for(;+c<=l;)f.push(Qt(n,c)),c.setFullYear(c.getFullYear()+d);return s?f.reverse():f}function VT(e,t){const n=Tc(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=bt(e,t?.in),l=s.getDay(),c=(l<r?-7:0)+6-(l-r);return s.setDate(s.getDate()+c),s.setHours(23,59,59,999),s}function R9(e,t){return VT(e,{...t,weekStartsOn:1})}const M9={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"}},O9=(e,t,n)=>{let r;const s=M9[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function yp(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const A9={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},j9={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},D9={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},k9={date:yp({formats:A9,defaultWidth:"full"}),time:yp({formats:j9,defaultWidth:"full"}),dateTime:yp({formats:D9,defaultWidth:"full"})},z9={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},P9=(e,t,n,r)=>z9[e];function Yl(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=n?.width?String(n.width):c;s=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=n?.width?String(n.width):e.defaultWidth;s=e.values[d]||e.values[c]}const l=e.argumentCallback?e.argumentCallback(t):t;return s[l]}}const L9={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},F9={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},I9={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"]},V9={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"]},$9={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"}},U9={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"}},B9=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},H9={ordinalNumber:B9,era:Yl({values:L9,defaultWidth:"wide"}),quarter:Yl({values:F9,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yl({values:I9,defaultWidth:"wide"}),day:Yl({values:V9,defaultWidth:"wide"}),dayPeriod:Yl({values:$9,defaultWidth:"wide",formattingValues:U9,defaultFormattingWidth:"wide"})};function Gl(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],l=t.match(s);if(!l)return null;const c=l[0],d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],f=Array.isArray(d)?Y9(d,p=>p.test(c)):q9(d,p=>p.test(c));let m;m=e.valueCallback?e.valueCallback(f):f,m=n.valueCallback?n.valueCallback(m):m;const v=t.slice(c.length);return{value:m,rest:v}}}function q9(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Y9(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function G9(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],l=t.match(e.parsePattern);if(!l)return null;let c=e.valueCallback?e.valueCallback(l[0]):l[0];c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}const K9=/^(\d+)(th|st|nd|rd)?/i,Z9=/\d+/i,W9={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},Q9={any:[/^b/i,/^(a|c)/i]},X9={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},J9={any:[/1/i,/2/i,/3/i,/4/i]},e7={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},t7={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]},n7={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},r7={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]},o7={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},a7={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}},s7={ordinalNumber:G9({matchPattern:K9,parsePattern:Z9,valueCallback:e=>parseInt(e,10)}),era:Gl({matchPatterns:W9,defaultMatchWidth:"wide",parsePatterns:Q9,defaultParseWidth:"any"}),quarter:Gl({matchPatterns:X9,defaultMatchWidth:"wide",parsePatterns:J9,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Gl({matchPatterns:e7,defaultMatchWidth:"wide",parsePatterns:t7,defaultParseWidth:"any"}),day:Gl({matchPatterns:n7,defaultMatchWidth:"wide",parsePatterns:r7,defaultParseWidth:"any"}),dayPeriod:Gl({matchPatterns:o7,defaultMatchWidth:"any",parsePatterns:a7,defaultParseWidth:"any"})},Si={code:"en-US",formatDistance:O9,formatLong:k9,formatRelative:P9,localize:H9,match:s7,options:{weekStartsOn:0,firstWeekContainsDate:1}};function i7(e,t){const n=bt(e,t?.in);return Wv(n,IT(n))+1}function Qv(e,t){const n=bt(e,t?.in),r=+uc(n)-+g9(n);return Math.round(r/jT)+1}function $T(e,t){const n=bt(e,t?.in),r=n.getFullYear(),s=Tc(),l=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,c=Qt(t?.in||e,0);c.setFullYear(r+1,0,l),c.setHours(0,0,0,0);const d=ki(c,t),f=Qt(t?.in||e,0);f.setFullYear(r,0,l),f.setHours(0,0,0,0);const m=ki(f,t);return+n>=+d?r+1:+n>=+m?r:r-1}function l7(e,t){const n=Tc(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=$T(e,t),l=Qt(t?.in||e,0);return l.setFullYear(s,0,r),l.setHours(0,0,0,0),ki(l,t)}function Xv(e,t){const n=bt(e,t?.in),r=+ki(n,t)-+l7(n,t);return Math.round(r/jT)+1}function pt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ya={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return pt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):pt(n+1,2)},d(e,t){return pt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return pt(e.getHours()%12||12,t.length)},H(e,t){return pt(e.getHours(),t.length)},m(e,t){return pt(e.getMinutes(),t.length)},s(e,t){return pt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return pt(s,t.length)}},mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zw={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return ya.y(e,t)},Y:function(e,t,n,r){const s=$T(e,r),l=s>0?s:1-s;if(t==="YY"){const c=l%100;return pt(c,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):pt(l,t.length)},R:function(e,t){const n=zT(e);return pt(n,t.length)},u:function(e,t){const n=e.getFullYear();return pt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return pt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return pt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return ya.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return pt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=Xv(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):pt(s,t.length)},I:function(e,t,n){const r=Qv(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):pt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ya.d(e,t)},D:function(e,t,n){const r=i7(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):pt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),l=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return pt(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),l=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return pt(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return pt(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=mi.noon:r===0?s=mi.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=mi.evening:r>=12?s=mi.afternoon:r>=4?s=mi.morning:s=mi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return ya.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ya.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):pt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):pt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ya.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ya.s(e,t)},S:function(e,t){return ya.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Qw(r);case"XXXX":case"XX":return rs(r);case"XXXXX":case"XXX":default:return rs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Qw(r);case"xxxx":case"xx":return rs(r);case"xxxxx":case"xxx":default:return rs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ww(r,":");case"OOOO":default:return"GMT"+rs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ww(r,":");case"zzzz":default:return"GMT"+rs(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return pt(r,t.length)},T:function(e,t,n){return pt(+e,t.length)}};function Ww(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),l=r%60;return l===0?n+String(s):n+String(s)+t+pt(l,2)}function Qw(e,t){return e%60===0?(e>0?"-":"+")+pt(Math.abs(e)/60,2):rs(e,t)}function rs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=pt(Math.trunc(r/60),2),l=pt(r%60,2);return n+s+t+l}const Xw=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},UT=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},c7=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Xw(e,t);let l;switch(r){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",Xw(r,t)).replace("{{time}}",UT(s,t))},u7={p:UT,P:c7},d7=/^D+$/,f7=/^Y+$/,h7=["D","DD","YY","YYYY"];function m7(e){return d7.test(e)}function p7(e){return f7.test(e)}function g7(e,t,n){const r=v7(e,t,n);if(console.warn(r),h7.includes(e))throw new RangeError(r)}function v7(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const y7=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,b7=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,x7=/^'([^]*?)'?$/,S7=/''/g,w7=/[a-zA-Z]/;function _i(e,t,n){const r=Tc(),s=n?.locale??r.locale??Si,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,d=bt(e,n?.in);if(!w9(d))throw new RangeError("Invalid time value");let f=t.match(b7).map(v=>{const p=v[0];if(p==="p"||p==="P"){const x=u7[p];return x(v,s.formatLong)}return v}).join("").match(y7).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const p=v[0];if(p==="'")return{isToken:!1,value:C7(v)};if(Zw[p])return{isToken:!0,value:v};if(p.match(w7))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(f=s.localize.preprocessor(d,f));const m={firstWeekContainsDate:l,weekStartsOn:c,locale:s};return f.map(v=>{if(!v.isToken)return v.value;const p=v.value;(!n?.useAdditionalWeekYearTokens&&p7(p)||!n?.useAdditionalDayOfYearTokens&&m7(p))&&g7(p,t,String(e));const x=Zw[p[0]];return x(d,p,s.localize,m)}).join("")}function C7(e){const t=e.match(x7);return t?t[1].replace(S7,"'"):e}function _7(e,t){const n=bt(e,t?.in),r=n.getFullYear(),s=n.getMonth(),l=Qt(n,0);return l.setFullYear(r,s+1,0),l.setHours(0,0,0,0),l.getDate()}function E7(e,t){return bt(e,t?.in).getMonth()}function T7(e,t){return bt(e,t?.in).getFullYear()}function N7(e,t){return+bt(e)>+bt(t)}function R7(e,t){return+bt(e)<+bt(t)}function M7(e,t,n){const[r,s]=Zi(n?.in,e,t);return r.getFullYear()===s.getFullYear()&&r.getMonth()===s.getMonth()}function O7(e,t,n){const[r,s]=Zi(n?.in,e,t);return r.getFullYear()===s.getFullYear()}function A7(e,t,n){const r=bt(e,n?.in),s=r.getFullYear(),l=r.getDate(),c=Qt(e,0);c.setFullYear(s,t,15),c.setHours(0,0,0,0);const d=_7(c);return r.setMonth(t,Math.min(l,d)),r}function j7(e,t,n){const r=bt(e,n?.in);return isNaN(+r)?Qt(e,NaN):(r.setFullYear(t),r)}function D7(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const k7={},Ql={};function ss(e,t){try{const r=(k7[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return r in Ql?Ql[r]:Jw(r,r.split(":"))}catch{if(e in Ql)return Ql[e];const n=e?.match(z7);return n?Jw(e,n.slice(1)):NaN}}const z7=/([+-]\d\d):?(\d\d)?/;function Jw(e,t){const n=+(t[0]||0),r=+(t[1]||0),s=+(t[2]||0)/60;return Ql[e]=n*60+r>0?n*60+r+s:n*60-r-s}class so extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ss(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),BT(this),_g(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new so(...n,t):new so(Date.now(),t)}withTimeZone(t){return new so(+this,t)}getTimezoneOffset(){const t=-ss(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),_g(this),+this}[Symbol.for("constructDateFrom")](t){return new so(+new Date(t),this.timeZone)}}const e1=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!e1.test(e))return;const t=e.replace(e1,"$1UTC");so.prototype[t]&&(e.startsWith("get")?so.prototype[e]=function(){return this.internal[t]()}:(so.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),P7(this),+this},so.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),_g(this),+this}))});function _g(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ss(e.timeZone,e)*60))}function P7(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),BT(e)}function BT(e){const t=ss(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const s=-new Date(+e).getTimezoneOffset(),l=-new Date(+r).getTimezoneOffset(),c=s-l,d=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();c&&d&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+c);const f=s-n;f&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const m=new Date(+e);m.setUTCSeconds(0);const v=s>0?m.getSeconds():(m.getSeconds()-60)%60,p=Math.round(-(ss(e.timeZone,e)*60))%60;(p||v)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+p),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+p+v));const x=ss(e.timeZone,e),S=x>0?Math.floor(x):Math.ceil(x),w=-new Date(+e).getTimezoneOffset()-S,C=S!==n,T=w-f;if(C&&T){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+T);const N=ss(e.timeZone,e),M=N>0?Math.floor(N):Math.ceil(N),R=S-M;R&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+R),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+R))}}class Cn extends so{static tz(t,...n){return n.length?new Cn(...n,t):new Cn(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),s=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+s}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,s]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${r} ${n} ${s}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,s]=this.tzComponents();return`${t} GMT${n}${r}${s} (${D7(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),s=String(Math.abs(t)%60).padStart(2,"0");return[n,r,s]}withTimeZone(t){return new Cn(+this,t)}[Symbol.for("constructDateFrom")](t){return new Cn(+new Date(t),this.timeZone)}}const t1=5,L7=4;function F7(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,s=t.addDays(e,-r+1),l=t.addDays(s,t1*7-1);return t.getMonth(e)===t.getMonth(l)?t1:L7}function HT(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function I7(e,t){const n=HT(e,t),r=F7(e,t);return t.addDays(n,r*7-1)}const qT={...Si,labels:{labelDayButton:(e,t,n,r)=>{let s;r&&typeof r.format=="function"?s=r.format.bind(r):s=(c,d)=>_i(c,d,{locale:Si,...n});let l=s(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(s,l)=>_i(s,l,{locale:Si,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let s;r&&typeof r.format=="function"?s=r.format.bind(r):s=(c,d)=>_i(c,d,{locale:Si,...n});let l=s(e,"PPPP");return t?.today&&(l=`Today, ${l}`),l},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(s,l)=>_i(s,l,{locale:Si,...t}),r(e,"cccc")}}};class fr{constructor(t,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Cn.tz(this.options.timeZone):new this.Date,this.newDate=(r,s,l)=>this.overrides?.newDate?this.overrides.newDate(r,s,l):this.options.timeZone?new Cn(r,s,l,this.options.timeZone):new Date(r,s,l),this.addDays=(r,s)=>this.overrides?.addDays?this.overrides.addDays(r,s):DT(r,s),this.addMonths=(r,s)=>this.overrides?.addMonths?this.overrides.addMonths(r,s):kT(r,s),this.addWeeks=(r,s)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,s):v9(r,s),this.addYears=(r,s)=>this.overrides?.addYears?this.overrides.addYears(r,s):y9(r,s),this.differenceInCalendarDays=(r,s)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,s):Wv(r,s),this.differenceInCalendarMonths=(r,s)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,s):LT(r,s),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):_9(r),this.eachYearOfInterval=r=>{const s=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):N9(r),l=new Set(s.map(d=>this.getYear(d)));if(l.size===s.length)return s;const c=[];return l.forEach(d=>{c.push(new Date(d,0,1))}),c},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):I7(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):R9(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):C9(r),this.endOfWeek=(r,s)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,s):VT(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):T9(r),this.format=(r,s,l)=>{const c=this.overrides?.format?this.overrides.format(r,s,this.options):_i(r,s,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(c):c},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):Qv(r),this.getMonth=(r,s)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):E7(r,this.options),this.getYear=(r,s)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):T7(r,this.options),this.getWeek=(r,s)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):Xv(r,this.options),this.isAfter=(r,s)=>this.overrides?.isAfter?this.overrides.isAfter(r,s):N7(r,s),this.isBefore=(r,s)=>this.overrides?.isBefore?this.overrides.isBefore(r,s):R7(r,s),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):PT(r),this.isSameDay=(r,s)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,s):S9(r,s),this.isSameMonth=(r,s)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,s):M7(r,s),this.isSameYear=(r,s)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,s):O7(r,s),this.max=r=>this.overrides?.max?this.overrides.max(r):b9(r),this.min=r=>this.overrides?.min?this.overrides.min(r):x9(r),this.setMonth=(r,s)=>this.overrides?.setMonth?this.overrides.setMonth(r,s):A7(r,s),this.setYear=(r,s)=>this.overrides?.setYear?this.overrides.setYear(r,s):j7(r,s),this.startOfBroadcastWeek=(r,s)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):HT(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):dc(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):uc(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):E9(r),this.startOfWeek=(r,s)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):ki(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):IT(r),this.options={locale:qT,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let s=0;s<10;s++)r[s.toString()]=n.format(s);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&fr.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:s}=this.options,l=n?.code;if(l&&fr.yearFirstLocales.has(l))try{return new Intl.DateTimeFormat(l,{month:"long",year:"numeric",timeZone:r,numberingSystem:s}).format(t)}catch{}const c=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,c)}}fr.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 go=new fr;class YT{constructor(t,n,r=go){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class V7{constructor(t,n){this.date=t,this.weeks=n}}class $7{constructor(t,n){this.days=n,this.weekNumber=t}}function U7(e){return I.createElement("button",{...e})}function B7(e){return I.createElement("span",{...e})}function H7(e){const{size:t=24,orientation:n="left",className:r}=e;return I.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&I.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&I.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&I.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&I.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function q7(e){const{day:t,modifiers:n,...r}=e;return I.createElement("td",{...r})}function Y7(e){const{day:t,modifiers:n,...r}=e,s=I.useRef(null);return I.useEffect(()=>{n.focused&&s.current?.focus()},[n.focused]),I.createElement("button",{ref:s,...r})}var Oe;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Oe||(Oe={}));var Dt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Dt||(Dt={}));var qr;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(qr||(qr={}));var sr;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(sr||(sr={}));function G7(e){const{options:t,className:n,components:r,classNames:s,...l}=e,c=[s[Oe.Dropdown],n].join(" "),d=t?.find(({value:f})=>f===l.value);return I.createElement("span",{"data-disabled":l.disabled,className:s[Oe.DropdownRoot]},I.createElement(r.Select,{className:c,...l},t?.map(({value:f,label:m,disabled:v})=>I.createElement(r.Option,{key:f,value:f,disabled:v},m))),I.createElement("span",{className:s[Oe.CaptionLabel],"aria-hidden":!0},d?.label,I.createElement(r.Chevron,{orientation:"down",size:18,className:s[Oe.Chevron]})))}function K7(e){return I.createElement("div",{...e})}function Z7(e){return I.createElement("div",{...e})}function W7(e){const{calendarMonth:t,displayIndex:n,...r}=e;return I.createElement("div",{...r},e.children)}function Q7(e){const{calendarMonth:t,displayIndex:n,...r}=e;return I.createElement("div",{...r})}function X7(e){return I.createElement("table",{...e})}function J7(e){return I.createElement("div",{...e})}const GT=b.createContext(void 0);function Nc(){const e=b.useContext(GT);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function eH(e){const{components:t}=Nc();return I.createElement(t.Dropdown,{...e})}function tH(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:s,...l}=e,{components:c,classNames:d,labels:{labelPrevious:f,labelNext:m}}=Nc(),v=b.useCallback(x=>{s&&n?.(x)},[s,n]),p=b.useCallback(x=>{r&&t?.(x)},[r,t]);return I.createElement("nav",{...l},I.createElement(c.PreviousMonthButton,{type:"button",className:d[Oe.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":f(r),onClick:p},I.createElement(c.Chevron,{disabled:r?void 0:!0,className:d[Oe.Chevron],orientation:"left"})),I.createElement(c.NextMonthButton,{type:"button",className:d[Oe.NextMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":m(s),onClick:v},I.createElement(c.Chevron,{disabled:s?void 0:!0,orientation:"right",className:d[Oe.Chevron]})))}function nH(e){const{components:t}=Nc();return I.createElement(t.Button,{...e})}function rH(e){return I.createElement("option",{...e})}function oH(e){const{components:t}=Nc();return I.createElement(t.Button,{...e})}function aH(e){const{rootRef:t,...n}=e;return I.createElement("div",{...n,ref:t})}function sH(e){return I.createElement("select",{...e})}function iH(e){const{week:t,...n}=e;return I.createElement("tr",{...n})}function lH(e){return I.createElement("th",{...e})}function cH(e){return I.createElement("thead",{"aria-hidden":!0},I.createElement("tr",{...e}))}function uH(e){const{week:t,...n}=e;return I.createElement("th",{...n})}function dH(e){return I.createElement("th",{...e})}function fH(e){return I.createElement("tbody",{...e})}function hH(e){const{components:t}=Nc();return I.createElement(t.Dropdown,{...e})}const mH=Object.freeze(Object.defineProperty({__proto__:null,Button:U7,CaptionLabel:B7,Chevron:H7,Day:q7,DayButton:Y7,Dropdown:G7,DropdownNav:K7,Footer:Z7,Month:W7,MonthCaption:Q7,MonthGrid:X7,Months:J7,MonthsDropdown:eH,Nav:tH,NextMonthButton:nH,Option:rH,PreviousMonthButton:oH,Root:aH,Select:sH,Week:iH,WeekNumber:uH,WeekNumberHeader:dH,Weekday:lH,Weekdays:cH,Weeks:fH,YearsDropdown:hH},Symbol.toStringTag,{value:"Module"}));function Io(e,t,n=!1,r=go){let{from:s,to:l}=e;const{differenceInCalendarDays:c,isSameDay:d}=r;return s&&l?(c(l,s)<0&&([s,l]=[l,s]),c(t,s)>=(n?1:0)&&c(l,t)>=(n?1:0)):!n&&l?d(l,t):!n&&s?d(s,t):!1}function Jv(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function vf(e){return!!(e&&typeof e=="object"&&"from"in e)}function ey(e){return!!(e&&typeof e=="object"&&"after"in e)}function ty(e){return!!(e&&typeof e=="object"&&"before"in e)}function KT(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function ZT(e,t){return Array.isArray(e)&&e.every(t.isDate)}function Vo(e,t,n=go){const r=Array.isArray(t)?t:[t],{isSameDay:s,differenceInCalendarDays:l,isAfter:c}=n;return r.some(d=>{if(typeof d=="boolean")return d;if(n.isDate(d))return s(e,d);if(ZT(d,n))return d.some(f=>s(e,f));if(vf(d))return Io(d,e,!1,n);if(KT(d))return Array.isArray(d.dayOfWeek)?d.dayOfWeek.includes(e.getDay()):d.dayOfWeek===e.getDay();if(Jv(d)){const f=l(d.before,e),m=l(d.after,e),v=f>0,p=m<0;return c(d.before,d.after)?p&&v:v||p}return ey(d)?l(e,d.after)>0:ty(d)?l(d.before,e)>0:typeof d=="function"?d(e):!1})}function pH(e,t,n,r,s){const{disabled:l,hidden:c,modifiers:d,showOutsideDays:f,broadcastCalendar:m,today:v=s.today()}=t,{isSameDay:p,isSameMonth:x,startOfMonth:S,isBefore:_,endOfMonth:w,isAfter:C}=s,T=n&&S(n),N=r&&w(r),M={[Dt.focused]:[],[Dt.outside]:[],[Dt.disabled]:[],[Dt.hidden]:[],[Dt.today]:[]},R={};for(const j of e){const{date:A,displayMonth:D}=j,L=!!(D&&!x(A,D)),B=!!(T&&_(A,T)),ne=!!(N&&C(A,N)),J=!!(l&&Vo(A,l,s)),ie=!!(c&&Vo(A,c,s))||B||ne||!m&&!f&&L||m&&f===!1&&L,ue=p(A,v);L&&M.outside.push(j),J&&M.disabled.push(j),ie&&M.hidden.push(j),ue&&M.today.push(j),d&&Object.keys(d).forEach(ae=>{const pe=d?.[ae];pe&&Vo(A,pe,s)&&(R[ae]?R[ae].push(j):R[ae]=[j])})}return j=>{const A={[Dt.focused]:!1,[Dt.disabled]:!1,[Dt.hidden]:!1,[Dt.outside]:!1,[Dt.today]:!1},D={};for(const L in M){const B=M[L];A[L]=B.some(ne=>ne===j)}for(const L in R)D[L]=R[L].some(B=>B===j);return{...A,...D}}}function gH(e,t,n={}){return Object.entries(e).filter(([,s])=>s===!0).reduce((s,[l])=>(n[l]?s.push(n[l]):t[Dt[l]]?s.push(t[Dt[l]]):t[qr[l]]&&s.push(t[qr[l]]),s),[t[Oe.Day]])}function vH(e){return{...mH,...e}}function yH(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function ny(){const e={};for(const t in Oe)e[Oe[t]]=`rdp-${Oe[t]}`;for(const t in Dt)e[Dt[t]]=`rdp-${Dt[t]}`;for(const t in qr)e[qr[t]]=`rdp-${qr[t]}`;for(const t in sr)e[sr[t]]=`rdp-${sr[t]}`;return e}function WT(e,t,n){return(n??new fr(t)).formatMonthYear(e)}const bH=WT;function xH(e,t,n){return(n??new fr(t)).format(e,"d")}function SH(e,t=go){return t.format(e,"LLLL")}function wH(e,t,n){return(n??new fr(t)).format(e,"cccccc")}function CH(e,t=go){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function _H(){return""}function QT(e,t=go){return t.format(e,"yyyy")}const EH=QT,TH=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:WT,formatDay:xH,formatMonthCaption:bH,formatMonthDropdown:SH,formatWeekNumber:CH,formatWeekNumberHeader:_H,formatWeekdayName:wH,formatYearCaption:EH,formatYearDropdown:QT},Symbol.toStringTag,{value:"Module"}));function NH(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...TH,...e}}function ry(e,t,n,r){let s=(r??new fr(n)).format(e,"PPPP");return t.today&&(s=`Today, ${s}`),t.selected&&(s=`${s}, selected`),s}const RH=ry;function oy(e,t,n){return(n??new fr(t)).formatMonthYear(e)}const MH=oy;function XT(e,t,n,r){let s=(r??new fr(n)).format(e,"PPPP");return t?.today&&(s=`Today, ${s}`),s}function JT(e){return"Choose the Month"}function eN(){return""}const OH="Go to the Next Month";function tN(e,t){return OH}function nN(e){return"Go to the Previous Month"}function rN(e,t,n){return(n??new fr(t)).format(e,"cccc")}function oN(e,t){return`Week ${e}`}function aN(e){return"Week Number"}function sN(e){return"Choose the Year"}const AH=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:MH,labelDay:RH,labelDayButton:ry,labelGrid:oy,labelGridcell:XT,labelMonthDropdown:JT,labelNav:eN,labelNext:tN,labelPrevious:nN,labelWeekNumber:oN,labelWeekNumberHeader:aN,labelWeekday:rN,labelYearDropdown:sN},Symbol.toStringTag,{value:"Module"})),Fr=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function jH(e,t){const n=t.locale?.labels??{};return{...AH,...e??{},labelDayButton:Fr(ry,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:Fr(JT,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Fr(tN,e?.labelNext,n.labelNext),labelPrevious:Fr(nN,e?.labelPrevious,n.labelPrevious),labelWeekNumber:Fr(oN,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Fr(sN,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:Fr(oy,e?.labelGrid,n.labelGrid),labelGridcell:Fr(XT,e?.labelGridcell,n.labelGridcell),labelNav:Fr(eN,e?.labelNav,n.labelNav),labelWeekNumberHeader:Fr(aN,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Fr(rN,e?.labelWeekday,n.labelWeekday)}}function DH(e,t,n,r,s){const{startOfMonth:l,startOfYear:c,endOfYear:d,eachMonthOfInterval:f,getMonth:m}=s;return f({start:c(e),end:d(e)}).map(x=>{const S=r.formatMonthDropdown(x,s),_=m(x),w=t&&x<l(t)||n&&x>l(n)||!1;return{value:_,label:S,disabled:w}})}function kH(e,t={},n={}){let r={...t?.[Oe.Day]};return Object.entries(e).filter(([,s])=>s===!0).forEach(([s])=>{r={...r,...n?.[s]}}),r}function zH(e,t,n,r){const s=r??e.today(),l=n?e.startOfBroadcastWeek(s,e):t?e.startOfISOWeek(s):e.startOfWeek(s),c=[];for(let d=0;d<7;d++){const f=e.addDays(l,d);c.push(f)}return c}function PH(e,t,n,r,s=!1){if(!e||!t)return;const{startOfYear:l,endOfYear:c,eachYearOfInterval:d,getYear:f}=r,m=l(e),v=c(t),p=d({start:m,end:v});return s&&p.reverse(),p.map(x=>{const S=n.formatYearDropdown(x,r);return{value:f(x),label:S,disabled:!1}})}function LH(e,t={}){const{weekStartsOn:n,locale:r}=t,s=n??r?.options?.weekStartsOn??0,l=d=>{const f=typeof d=="number"||typeof d=="string"?new Date(d):d;return new Cn(f.getFullYear(),f.getMonth(),f.getDate(),12,0,0,e)},c=d=>{const f=l(d);return new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0)};return{today:()=>l(Cn.tz(e)),newDate:(d,f,m)=>new Cn(d,f,m,12,0,0,e),startOfDay:d=>l(d),startOfWeek:(d,f)=>{const m=l(d),v=f?.weekStartsOn??s,p=(m.getDay()-v+7)%7;return m.setDate(m.getDate()-p),m},startOfISOWeek:d=>{const f=l(d),m=(f.getDay()-1+7)%7;return f.setDate(f.getDate()-m),f},startOfMonth:d=>{const f=l(d);return f.setDate(1),f},startOfYear:d=>{const f=l(d);return f.setMonth(0,1),f},endOfWeek:(d,f)=>{const m=l(d),x=(((f?.weekStartsOn??s)+6)%7-m.getDay()+7)%7;return m.setDate(m.getDate()+x),m},endOfISOWeek:d=>{const f=l(d),m=(7-f.getDay())%7;return f.setDate(f.getDate()+m),f},endOfMonth:d=>{const f=l(d);return f.setMonth(f.getMonth()+1,0),f},endOfYear:d=>{const f=l(d);return f.setMonth(11,31),f},eachMonthOfInterval:d=>{const f=l(d.start),m=l(d.end),v=[],p=new Cn(f.getFullYear(),f.getMonth(),1,12,0,0,e),x=m.getFullYear()*12+m.getMonth();for(;p.getFullYear()*12+p.getMonth()<=x;)v.push(new Cn(p,e)),p.setMonth(p.getMonth()+1,1);return v},addDays:(d,f)=>{const m=l(d);return m.setDate(m.getDate()+f),m},addWeeks:(d,f)=>{const m=l(d);return m.setDate(m.getDate()+f*7),m},addMonths:(d,f)=>{const m=l(d);return m.setMonth(m.getMonth()+f),m},addYears:(d,f)=>{const m=l(d);return m.setFullYear(m.getFullYear()+f),m},eachYearOfInterval:d=>{const f=l(d.start),m=l(d.end),v=[],p=new Cn(f.getFullYear(),0,1,12,0,0,e);for(;p.getFullYear()<=m.getFullYear();)v.push(new Cn(p,e)),p.setFullYear(p.getFullYear()+1,0,1);return v},getWeek:(d,f)=>{const m=c(d);return Xv(m,{weekStartsOn:f?.weekStartsOn??s,firstWeekContainsDate:f?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1})},getISOWeek:d=>{const f=c(d);return Qv(f)},differenceInCalendarDays:(d,f)=>{const m=c(d),v=c(f);return Wv(m,v)},differenceInCalendarMonths:(d,f)=>{const m=c(d),v=c(f);return LT(m,v)}}}const Rc=e=>e instanceof HTMLElement?e:null,bp=e=>[...e.querySelectorAll("[data-animated-month]")??[]],FH=e=>Rc(e.querySelector("[data-animated-month]")),xp=e=>Rc(e.querySelector("[data-animated-caption]")),Sp=e=>Rc(e.querySelector("[data-animated-weeks]")),IH=e=>Rc(e.querySelector("[data-animated-nav]")),VH=e=>Rc(e.querySelector("[data-animated-weekdays]"));function $H(e,t,{classNames:n,months:r,focused:s,dateLib:l}){const c=b.useRef(null),d=b.useRef(r),f=b.useRef(!1);b.useLayoutEffect(()=>{const m=d.current;if(d.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||m.length===0||r.length!==m.length)return;const v=l.isSameMonth(r[0].date,m[0].date),p=l.isAfter(r[0].date,m[0].date),x=p?n[sr.caption_after_enter]:n[sr.caption_before_enter],S=p?n[sr.weeks_after_enter]:n[sr.weeks_before_enter],_=c.current,w=e.current.cloneNode(!0);if(w instanceof HTMLElement?(bp(w).forEach(M=>{if(!(M instanceof HTMLElement))return;const R=FH(M);R&&M.contains(R)&&M.removeChild(R);const j=xp(M);j&&j.classList.remove(x);const A=Sp(M);A&&A.classList.remove(S)}),c.current=w):c.current=null,f.current||v||s)return;const C=_ instanceof HTMLElement?bp(_):[],T=bp(e.current);if(T?.every(N=>N instanceof HTMLElement)&&C&&C.every(N=>N instanceof HTMLElement)){f.current=!0,e.current.style.isolation="isolate";const N=IH(e.current);N&&(N.style.zIndex="1"),T.forEach((M,R)=>{const j=C[R];if(!j)return;M.style.position="relative",M.style.overflow="hidden";const A=xp(M);A&&A.classList.add(x);const D=Sp(M);D&&D.classList.add(S);const L=()=>{f.current=!1,e.current&&(e.current.style.isolation=""),N&&(N.style.zIndex=""),A&&A.classList.remove(x),D&&D.classList.remove(S),M.style.position="",M.style.overflow="",M.contains(j)&&M.removeChild(j)};j.style.pointerEvents="none",j.style.position="absolute",j.style.overflow="hidden",j.setAttribute("aria-hidden","true");const B=VH(j);B&&(B.style.opacity="0");const ne=xp(j);ne&&(ne.classList.add(p?n[sr.caption_before_exit]:n[sr.caption_after_exit]),ne.addEventListener("animationend",L));const J=Sp(j);J&&J.classList.add(p?n[sr.weeks_before_exit]:n[sr.weeks_after_exit]),M.insertBefore(j,M.firstChild)})}})}function UH(e,t,n,r){const s=e[0],l=e[e.length-1],{ISOWeek:c,fixedWeeks:d,broadcastCalendar:f}=n??{},{addDays:m,differenceInCalendarDays:v,differenceInCalendarMonths:p,endOfBroadcastWeek:x,endOfISOWeek:S,endOfMonth:_,endOfWeek:w,isAfter:C,startOfBroadcastWeek:T,startOfISOWeek:N,startOfWeek:M}=r,R=f?T(s,r):c?N(s):M(s),j=f?x(l):c?S(_(l)):w(_(l)),A=t&&(f?x(t):c?S(t):w(t)),D=A&&C(j,A)?A:j,L=v(D,R),B=p(l,s)+1,ne=[];for(let ue=0;ue<=L;ue++){const ae=m(R,ue);ne.push(ae)}const ie=(f?35:42)*B;if(d&&ne.length<ie){const ue=ie-ne.length;for(let ae=0;ae<ue;ae++){const pe=m(ne[ne.length-1],1);ne.push(pe)}}return ne}function BH(e){const t=[];return e.reduce((n,r)=>{const s=r.weeks.reduce((l,c)=>l.concat(c.days.slice()),t.slice());return n.concat(s.slice())},t.slice())}function HH(e,t,n,r){const{numberOfMonths:s=1}=n,l=[];for(let c=0;c<s;c++){const d=r.addMonths(e,c);if(t&&d>t)break;l.push(d)}return l}function n1(e,t,n,r){const{month:s,defaultMonth:l,today:c=r.today(),numberOfMonths:d=1}=e;let f=s||l||c;const{differenceInCalendarMonths:m,addMonths:v,startOfMonth:p}=r;if(n&&m(n,f)<d-1){const x=-1*(d-1);f=v(n,x)}return t&&m(f,t)<0&&(f=t),p(f)}function qH(e,t,n,r){const{addDays:s,endOfBroadcastWeek:l,endOfISOWeek:c,endOfMonth:d,endOfWeek:f,getISOWeek:m,getWeek:v,startOfBroadcastWeek:p,startOfISOWeek:x,startOfWeek:S}=r,_=e.reduce((w,C)=>{const T=n.broadcastCalendar?p(C,r):n.ISOWeek?x(C):S(C),N=n.broadcastCalendar?l(C):n.ISOWeek?c(d(C)):f(d(C)),M=t.filter(D=>D>=T&&D<=N),R=n.broadcastCalendar?35:42;if(n.fixedWeeks&&M.length<R){const D=t.filter(L=>{const B=R-M.length;return L>N&&L<=s(N,B)});M.push(...D)}const j=M.reduce((D,L)=>{const B=n.ISOWeek?m(L):v(L),ne=D.find(ie=>ie.weekNumber===B),J=new YT(L,C,r);return ne?ne.days.push(J):D.push(new $7(B,[J])),D},[]),A=new V7(C,j);return w.push(A),w},[]);return n.reverseMonths?_.reverse():_}function YH(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:s,startOfDay:l,startOfMonth:c,endOfMonth:d,addYears:f,endOfYear:m,newDate:v,today:p}=t,{fromYear:x,toYear:S,fromMonth:_,toMonth:w}=e;!n&&_&&(n=_),!n&&x&&(n=t.newDate(x,0,1)),!r&&w&&(r=w),!r&&S&&(r=v(S,11,31));const C=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=c(n):x?n=v(x,0,1):!n&&C&&(n=s(f(e.today??p(),-100))),r?r=d(r):S?r=v(S,11,31):!r&&C&&(r=m(e.today??p())),[n&&l(n),r&&l(r)]}function GH(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:l=1}=n,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:f}=r,m=s?l:1,v=c(e);if(!t)return d(v,m);if(!(f(t,e)<l))return d(v,m)}function KH(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:s,numberOfMonths:l}=n,{startOfMonth:c,addMonths:d,differenceInCalendarMonths:f}=r,m=s?l??1:1,v=c(e);if(!t)return d(v,-m);if(!(f(v,t)<=0))return d(v,-m)}function ZH(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function yf(e,t){const[n,r]=b.useState(e);return[t===void 0?n:t,r]}function WH(e,t){const[n,r]=YH(e,t),{startOfMonth:s,endOfMonth:l}=t,c=n1(e,n,r,t),[d,f]=yf(c,e.month?c:void 0);b.useEffect(()=>{const R=n1(e,n,r,t);f(R)},[e.timeZone]);const{months:m,weeks:v,days:p,previousMonth:x,nextMonth:S}=b.useMemo(()=>{const R=HH(d,r,{numberOfMonths:e.numberOfMonths},t),j=UH(R,e.endMonth?l(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),A=qH(R,j,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),D=ZH(A),L=BH(A),B=KH(d,n,e,t),ne=GH(d,r,e,t);return{months:A,weeks:D,days:L,previousMonth:B,nextMonth:ne}},[t,d.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:_,onMonthChange:w}=e,C=R=>v.some(j=>j.days.some(A=>A.isEqualTo(R))),T=R=>{if(_)return;let j=s(R);n&&j<s(n)&&(j=s(n)),r&&j>s(r)&&(j=s(r)),f(j),w?.(j)};return{months:m,weeks:v,days:p,navStart:n,navEnd:r,previousMonth:x,nextMonth:S,goToMonth:T,goToDay:R=>{C(R)||T(R.date)}}}var ro;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(ro||(ro={}));function r1(e){return!e[Dt.disabled]&&!e[Dt.hidden]&&!e[Dt.outside]}function QH(e,t,n,r){let s,l=-1;for(const c of e){const d=t(c);r1(d)&&(d[Dt.focused]&&l<ro.FocusedModifier?(s=c,l=ro.FocusedModifier):r?.isEqualTo(c)&&l<ro.LastFocused?(s=c,l=ro.LastFocused):n(c.date)&&l<ro.Selected?(s=c,l=ro.Selected):d[Dt.today]&&l<ro.Today&&(s=c,l=ro.Today))}return s||(s=e.find(c=>r1(t(c)))),s}function XH(e,t,n,r,s,l,c){const{ISOWeek:d,broadcastCalendar:f}=l,{addDays:m,addMonths:v,addWeeks:p,addYears:x,endOfBroadcastWeek:S,endOfISOWeek:_,endOfWeek:w,max:C,min:T,startOfBroadcastWeek:N,startOfISOWeek:M,startOfWeek:R}=c;let A={day:m,week:p,month:v,year:x,startOfWeek:D=>f?N(D,c):d?M(D):R(D),endOfWeek:D=>f?S(D):d?_(D):w(D)}[e](n,t==="after"?1:-1);return t==="before"&&r?A=C([r,A]):t==="after"&&s&&(A=T([s,A])),A}function iN(e,t,n,r,s,l,c,d=0){if(d>365)return;const f=XH(e,t,n.date,r,s,l,c),m=!!(l.disabled&&Vo(f,l.disabled,c)),v=!!(l.hidden&&Vo(f,l.hidden,c)),p=f,x=new YT(f,p,c);return!m&&!v?x:iN(e,t,x,r,s,l,c,d+1)}function JH(e,t,n,r,s){const{autoFocus:l}=e,[c,d]=b.useState(),f=QH(t.days,n,r||(()=>!1),c),[m,v]=b.useState(l?f:void 0);return{isFocusTarget:w=>!!f?.isEqualTo(w),setFocused:v,focused:m,blur:()=>{d(m),v(void 0)},moveFocus:(w,C)=>{if(!m)return;const T=iN(w,C,m,t.navStart,t.navEnd,e,s);T&&(e.disableNavigation&&!t.days.some(M=>M.isEqualTo(T))||(t.goToDay(T),v(T)))}}}function eq(e,t){const{selected:n,required:r,onSelect:s}=e,[l,c]=yf(n,s?n:void 0),d=s?n:l,{isSameDay:f}=t,m=S=>d?.some(_=>f(_,S))??!1,{min:v,max:p}=e;return{selected:d,select:(S,_,w)=>{let C=[...d??[]];if(m(S)){if(d?.length===v||r&&d?.length===1)return;C=d?.filter(T=>!f(T,S))}else d?.length===p?C=[S]:C=[...C,S];return s||c(C),s?.(C,S,_,w),C},isSelected:m}}function tq(e,t,n=0,r=0,s=!1,l=go){const{from:c,to:d}=t||{},{isSameDay:f,isAfter:m,isBefore:v}=l;let p;if(!c&&!d)p={from:e,to:n>0?void 0:e};else if(c&&!d)f(c,e)?n===0?p={from:c,to:e}:s?p={from:c,to:void 0}:p=void 0:v(e,c)?p={from:e,to:c}:p={from:c,to:e};else if(c&&d)if(f(c,e)&&f(d,e))s?p={from:c,to:d}:p=void 0;else if(f(c,e))p={from:c,to:n>0?void 0:e};else if(f(d,e))p={from:e,to:n>0?void 0:e};else if(v(e,c))p={from:e,to:d};else if(m(e,c))p={from:c,to:e};else if(m(e,d))p={from:c,to:e};else throw new Error("Invalid range");if(p?.from&&p?.to){const x=l.differenceInCalendarDays(p.to,p.from);r>0&&x>r?p={from:e,to:void 0}:n>1&&x<n&&(p={from:e,to:void 0})}return p}function nq(e,t,n=go){const r=Array.isArray(t)?t:[t];let s=e.from;const l=n.differenceInCalendarDays(e.to,e.from),c=Math.min(l,6);for(let d=0;d<=c;d++){if(r.includes(s.getDay()))return!0;s=n.addDays(s,1)}return!1}function o1(e,t,n=go){return Io(e,t.from,!1,n)||Io(e,t.to,!1,n)||Io(t,e.from,!1,n)||Io(t,e.to,!1,n)}function rq(e,t,n=go){const r=Array.isArray(t)?t:[t];if(r.filter(d=>typeof d!="function").some(d=>typeof d=="boolean"?d:n.isDate(d)?Io(e,d,!1,n):ZT(d,n)?d.some(f=>Io(e,f,!1,n)):vf(d)?d.from&&d.to?o1(e,{from:d.from,to:d.to},n):!1:KT(d)?nq(e,d.dayOfWeek,n):Jv(d)?n.isAfter(d.before,d.after)?o1(e,{from:n.addDays(d.after,1),to:n.addDays(d.before,-1)},n):Vo(e.from,d,n)||Vo(e.to,d,n):ey(d)||ty(d)?Vo(e.from,d,n)||Vo(e.to,d,n):!1))return!0;const c=r.filter(d=>typeof d=="function");if(c.length){let d=e.from;const f=n.differenceInCalendarDays(e.to,e.from);for(let m=0;m<=f;m++){if(c.some(v=>v(d)))return!0;d=n.addDays(d,1)}}return!1}function oq(e,t){const{disabled:n,excludeDisabled:r,selected:s,required:l,onSelect:c}=e,[d,f]=yf(s,c?s:void 0),m=c?s:d;return{selected:m,select:(x,S,_)=>{const{min:w,max:C}=e,T=x?tq(x,m,w,C,l,t):void 0;return r&&n&&T?.from&&T.to&&rq({from:T.from,to:T.to},n,t)&&(T.from=x,T.to=void 0),c||f(T),c?.(T,x,S,_),T},isSelected:x=>m&&Io(m,x,!1,t)}}function aq(e,t){const{selected:n,required:r,onSelect:s}=e,[l,c]=yf(n,s?n:void 0),d=s?n:l,{isSameDay:f}=t;return{selected:d,select:(p,x,S)=>{let _=p;return!r&&d&&d&&f(p,d)&&(_=void 0),s||c(_),s?.(_,p,x,S),_},isSelected:p=>d?f(d,p):!1}}function sq(e,t){const n=aq(e,t),r=eq(e,t),s=oq(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return s;default:return}}function Er(e,t){return e instanceof Cn&&e.timeZone===t?e:new Cn(e,t)}function pi(e,t,n){return Er(e,t)}function a1(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?pi(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?pi(r,t):r):vf(e)?{...e,from:e.from?Er(e.from,t):e.from,to:e.to?Er(e.to,t):e.to}:Jv(e)?{before:pi(e.before,t),after:pi(e.after,t)}:ey(e)?{after:pi(e.after,t)}:ty(e)?{before:pi(e.before,t)}:e}function wp(e,t,n){return e&&(Array.isArray(e)?e.map(r=>a1(r,t)):a1(e,t))}function iq(e){let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=Er(t.today,n)),t.month&&(t.month=Er(t.month,n)),t.defaultMonth&&(t.defaultMonth=Er(t.defaultMonth,n)),t.startMonth&&(t.startMonth=Er(t.startMonth,n)),t.endMonth&&(t.endMonth=Er(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=Er(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(Le=>Er(Le,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?Er(t.selected.from,n):t.selected.from,to:t.selected.to?Er(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=wp(t.disabled,n)),t.hidden!==void 0&&(t.hidden=wp(t.hidden,n)),t.modifiers)){const Le={};Object.keys(t.modifiers).forEach(Xe=>{Le[Xe]=wp(t.modifiers?.[Xe],n)}),t.modifiers=Le}const{components:r,formatters:s,labels:l,dateLib:c,locale:d,classNames:f}=b.useMemo(()=>{const Le={...qT,...t.locale},Xe=t.broadcastCalendar?1:t.weekStartsOn,Pe=t.noonSafe&&t.timeZone?LH(t.timeZone,{weekStartsOn:Xe,locale:Le}):void 0,We=t.dateLib&&Pe?{...Pe,...t.dateLib}:t.dateLib??Pe,Mt=new fr({locale:Le,weekStartsOn:Xe,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},We);return{dateLib:Mt,components:vH(t.components),formatters:NH(t.formatters),labels:jH(t.labels,Mt.options),locale:Le,classNames:{...ny(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:c.today()});const{captionLayout:m,mode:v,navLayout:p,numberOfMonths:x=1,onDayBlur:S,onDayClick:_,onDayFocus:w,onDayKeyDown:C,onDayMouseEnter:T,onDayMouseLeave:N,onNextClick:M,onPrevClick:R,showWeekNumber:j,styles:A}=t,{formatCaption:D,formatDay:L,formatMonthDropdown:B,formatWeekNumber:ne,formatWeekNumberHeader:J,formatWeekdayName:ie,formatYearDropdown:ue}=s,ae=WH(t,c),{days:pe,months:k,navStart:Y,navEnd:H,previousMonth:ee,nextMonth:ve,goToMonth:z}=ae,P=pH(pe,t,Y,H,c),{isSelected:U,select:W,selected:oe}=sq(t,c)??{},{blur:he,focused:X,isFocusTarget:ye,moveFocus:_e,setFocused:De}=JH(t,ae,P,U??(()=>!1),c),{labelDayButton:qe,labelGridcell:Ge,labelGrid:Lt,labelMonthDropdown:Rt,labelNav:En,labelPrevious:Fn,labelNext:Tn,labelWeekday:Ho,labelWeekNumber:on,labelWeekNumberHeader:V,labelYearDropdown:G}=l,te=b.useMemo(()=>zH(c,t.ISOWeek,t.broadcastCalendar,t.today),[c,t.ISOWeek,t.broadcastCalendar,t.today]),xe=v!==void 0||_!==void 0,me=b.useCallback(()=>{ee&&(z(ee),R?.(ee))},[ee,z,R]),ge=b.useCallback(()=>{ve&&(z(ve),M?.(ve))},[z,ve,M]),Te=b.useCallback((Le,Xe)=>Pe=>{Pe.preventDefault(),Pe.stopPropagation(),De(Le),!Xe.disabled&&(W?.(Le.date,Xe,Pe),_?.(Le.date,Xe,Pe))},[W,_,De]),tt=b.useCallback((Le,Xe)=>Pe=>{De(Le),w?.(Le.date,Xe,Pe)},[w,De]),nt=b.useCallback((Le,Xe)=>Pe=>{he(),S?.(Le.date,Xe,Pe)},[he,S]),Ht=b.useCallback((Le,Xe)=>Pe=>{const We={ArrowLeft:[Pe.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Pe.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Pe.shiftKey?"year":"week","after"],ArrowUp:[Pe.shiftKey?"year":"week","before"],PageUp:[Pe.shiftKey?"year":"month","before"],PageDown:[Pe.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(We[Pe.key]){Pe.preventDefault(),Pe.stopPropagation();const[Mt,Se]=We[Pe.key];_e(Mt,Se)}C?.(Le.date,Xe,Pe)},[_e,C,t.dir]),yn=b.useCallback((Le,Xe)=>Pe=>{T?.(Le.date,Xe,Pe)},[T]),Nn=b.useCallback((Le,Xe)=>Pe=>{N?.(Le.date,Xe,Pe)},[N]),hr=b.useCallback(Le=>Xe=>{const Pe=Number(Xe.target.value),We=c.setMonth(c.startOfMonth(Le),Pe);z(We)},[c,z]),Xn=b.useCallback(Le=>Xe=>{const Pe=Number(Xe.target.value),We=c.setYear(c.startOfMonth(Le),Pe);z(We)},[c,z]),{className:Ft,style:Rn}=b.useMemo(()=>({className:[f[Oe.Root],t.className].filter(Boolean).join(" "),style:{...A?.[Oe.Root],...t.style}}),[f,t.className,t.style,A]),It=yH(t),qo=b.useRef(null);$H(qo,!!t.animate,{classNames:f,months:k,focused:X,dateLib:c});const Qr={dayPickerProps:t,selected:oe,select:W,isSelected:U,months:k,nextMonth:ve,previousMonth:ee,goToMonth:z,getModifiers:P,components:r,classNames:f,styles:A,labels:l,formatters:s};return I.createElement(GT.Provider,{value:Qr},I.createElement(r.Root,{rootRef:t.animate?qo:void 0,className:Ft,style:Rn,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...It},I.createElement(r.Months,{className:f[Oe.Months],style:A?.[Oe.Months]},!t.hideNavigation&&!p&&I.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[Oe.Nav],style:A?.[Oe.Nav],"aria-label":En(),onPreviousClick:me,onNextClick:ge,previousMonth:ee,nextMonth:ve}),k.map((Le,Xe)=>I.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:f[Oe.Month],style:A?.[Oe.Month],key:Xe,displayIndex:Xe,calendarMonth:Le},p==="around"&&!t.hideNavigation&&Xe===0&&I.createElement(r.PreviousMonthButton,{type:"button",className:f[Oe.PreviousMonthButton],tabIndex:ee?void 0:-1,"aria-disabled":ee?void 0:!0,"aria-label":Fn(ee),onClick:me,"data-animated-button":t.animate?"true":void 0},I.createElement(r.Chevron,{disabled:ee?void 0:!0,className:f[Oe.Chevron],orientation:t.dir==="rtl"?"right":"left"})),I.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:f[Oe.MonthCaption],style:A?.[Oe.MonthCaption],calendarMonth:Le,displayIndex:Xe},m?.startsWith("dropdown")?I.createElement(r.DropdownNav,{className:f[Oe.Dropdowns],style:A?.[Oe.Dropdowns]},(()=>{const Pe=m==="dropdown"||m==="dropdown-months"?I.createElement(r.MonthsDropdown,{key:"month",className:f[Oe.MonthsDropdown],"aria-label":Rt(),classNames:f,components:r,disabled:!!t.disableNavigation,onChange:hr(Le.date),options:DH(Le.date,Y,H,s,c),style:A?.[Oe.Dropdown],value:c.getMonth(Le.date)}):I.createElement("span",{key:"month"},B(Le.date,c)),We=m==="dropdown"||m==="dropdown-years"?I.createElement(r.YearsDropdown,{key:"year",className:f[Oe.YearsDropdown],"aria-label":G(c.options),classNames:f,components:r,disabled:!!t.disableNavigation,onChange:Xn(Le.date),options:PH(Y,H,s,c,!!t.reverseYears),style:A?.[Oe.Dropdown],value:c.getYear(Le.date)}):I.createElement("span",{key:"year"},ue(Le.date,c));return c.getMonthYearOrder()==="year-first"?[We,Pe]:[Pe,We]})(),I.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"}},D(Le.date,c.options,c))):I.createElement(r.CaptionLabel,{className:f[Oe.CaptionLabel],role:"status","aria-live":"polite"},D(Le.date,c.options,c))),p==="around"&&!t.hideNavigation&&Xe===x-1&&I.createElement(r.NextMonthButton,{type:"button",className:f[Oe.NextMonthButton],tabIndex:ve?void 0:-1,"aria-disabled":ve?void 0:!0,"aria-label":Tn(ve),onClick:ge,"data-animated-button":t.animate?"true":void 0},I.createElement(r.Chevron,{disabled:ve?void 0:!0,className:f[Oe.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Xe===x-1&&p==="after"&&!t.hideNavigation&&I.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:f[Oe.Nav],style:A?.[Oe.Nav],"aria-label":En(),onPreviousClick:me,onNextClick:ge,previousMonth:ee,nextMonth:ve}),I.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":v==="multiple"||v==="range","aria-label":Lt(Le.date,c.options,c)||void 0,className:f[Oe.MonthGrid],style:A?.[Oe.MonthGrid]},!t.hideWeekdays&&I.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:f[Oe.Weekdays],style:A?.[Oe.Weekdays]},j&&I.createElement(r.WeekNumberHeader,{"aria-label":V(c.options),className:f[Oe.WeekNumberHeader],style:A?.[Oe.WeekNumberHeader],scope:"col"},J()),te.map(Pe=>I.createElement(r.Weekday,{"aria-label":Ho(Pe,c.options,c),className:f[Oe.Weekday],key:String(Pe),style:A?.[Oe.Weekday],scope:"col"},ie(Pe,c.options,c)))),I.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:f[Oe.Weeks],style:A?.[Oe.Weeks]},Le.weeks.map(Pe=>I.createElement(r.Week,{className:f[Oe.Week],key:Pe.weekNumber,style:A?.[Oe.Week],week:Pe},j&&I.createElement(r.WeekNumber,{week:Pe,style:A?.[Oe.WeekNumber],"aria-label":on(Pe.weekNumber,{locale:d}),className:f[Oe.WeekNumber],scope:"row",role:"rowheader"},ne(Pe.weekNumber,c)),Pe.days.map(We=>{const{date:Mt}=We,Se=P(We);if(Se[Dt.focused]=!Se.hidden&&!!X?.isEqualTo(We),Se[qr.selected]=U?.(Mt)||Se.selected,vf(oe)){const{from:mr,to:xt}=oe;Se[qr.range_start]=!!(mr&&xt&&c.isSameDay(Mt,mr)),Se[qr.range_end]=!!(mr&&xt&&c.isSameDay(Mt,xt)),Se[qr.range_middle]=Io(oe,Mt,!0,c)}const wt=kH(Se,A,t.modifiersStyles),qt=gH(Se,f,t.modifiersClassNames),an=!xe&&!Se.hidden?Ge(Mt,Se,c.options,c):void 0;return I.createElement(r.Day,{key:`${We.isoDate}_${We.displayMonthId}`,day:We,modifiers:Se,className:qt.join(" "),style:wt,role:"gridcell","aria-selected":Se.selected||void 0,"aria-label":an,"data-day":We.isoDate,"data-month":We.outside?We.dateMonthId:void 0,"data-selected":Se.selected||void 0,"data-disabled":Se.disabled||void 0,"data-hidden":Se.hidden||void 0,"data-outside":We.outside||void 0,"data-focused":Se.focused||void 0,"data-today":Se.today||void 0},!Se.hidden&&xe?I.createElement(r.DayButton,{className:f[Oe.DayButton],style:A?.[Oe.DayButton],type:"button",day:We,modifiers:Se,disabled:!Se.focused&&Se.disabled||void 0,"aria-disabled":Se.focused&&Se.disabled||void 0,tabIndex:ye(We)?0:-1,"aria-label":qe(Mt,Se,c.options,c),onClick:Te(We,Se),onBlur:nt(We,Se),onFocus:tt(We,Se),onKeyDown:Ht(We,Se),onMouseEnter:yn(We,Se),onMouseLeave:Nn(We,Se)},L(Mt,c.options,c)):!Se.hidden&&L(We.date,c.options,c))})))))))),t.footer&&I.createElement(r.Footer,{className:f[Oe.Footer],style:A?.[Oe.Footer],role:"status","aria-live":"polite"},t.footer)))}function lq({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:r="label",buttonVariant:s="ghost",formatters:l,components:c,...d}){const f=ny();return h.jsx(iq,{showOutsideDays:n,className:fe("p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(6)] 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`,e),captionLayout:r,formatters:{formatMonthDropdown:m=>m.toLocaleString("default",{month:"short"}),...l},classNames:{root:fe("w-fit",f.root),months:fe("flex gap-4 flex-col md:flex-row relative",f.months),month:fe("flex flex-col w-full gap-4",f.month),nav:fe("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",f.nav),button_previous:fe(og({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_previous),button_next:fe(og({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_next),month_caption:fe("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",f.month_caption),dropdowns:fe("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",f.dropdowns),dropdown_root:fe("relative cn-calendar-dropdown-root rounded-(--cell-radius)",f.dropdown_root),dropdown:fe("absolute bg-popover inset-0 opacity-0",f.dropdown),caption_label:fe("select-none font-medium",r==="label"?"text-sm":"cn-calendar-caption-label 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:fe("flex",f.weekdays),weekday:fe("text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none",f.weekday),week:fe("flex w-full mt-2",f.week),week_number_header:fe("select-none w-(--cell-size)",f.week_number_header),week_number:fe("text-[0.8rem] select-none text-muted-foreground",f.week_number),day:fe("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:fe("rounded-l-(--cell-radius) bg-muted elative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate",f.range_start),range_middle:fe("rounded-none",f.range_middle),range_end:fe("rounded-r-(--cell-radius) bg-muted relative after:bg-muted-200 after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate",f.range_end),today:fe("bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none",f.today),outside:fe("text-muted-foreground aria-selected:text-muted-foreground",f.outside),disabled:fe("text-muted-foreground opacity-50",f.disabled),hidden:fe("invisible",f.hidden),...t},components:{Root:({className:m,rootRef:v,...p})=>h.jsx("div",{"data-slot":"calendar",ref:v,className:fe(m),...p}),Chevron:({className:m,orientation:v,...p})=>v==="left"?h.jsx(T2,{className:fe("size-4",m),...p}):v==="right"?h.jsx(Ev,{className:fe("size-4",m),...p}):h.jsx(_v,{className:fe("size-4",m),...p}),DayButton:cq,WeekNumber:({children:m,...v})=>h.jsx("td",{...v,children:h.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:m})}),...c},...d})}function cq({className:e,day:t,modifiers:n,...r}){const s=ny(),l=b.useRef(null);return b.useEffect(()=>{n.focused&&l.current?.focus()},[n.focused]),h.jsx(ze,{ref:l,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:fe("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",s.day,e),...r})}function lN({value:e,onChange:t,placeholder:n="Pick a date",className:r,disabled:s,startYear:l=1980,endYear:c=new Date().getFullYear()+10,icon:d=!0,isFormatted:f=!0}){const[m,v]=b.useState(!1),p=(S,_)=>{const w={target:{value:String(S)}};_(w)},x=S=>{t?.(S),v(!1)};return h.jsxs(za,{open:m,onOpenChange:v,children:[h.jsx(Gi,{asChild:!0,children:h.jsxs(ze,{variant:"outline",className:fe("w-full justify-start text-left font-normal",!e&&"text-muted-foreground",r),disabled:s,children:[d&&h.jsx(uF,{className:"mr-2 size-4 shrink-0"}),h.jsx("span",{className:"flex-1",children:e&&e instanceof Date&&!Number.isNaN(e.getTime())?f?_i(e,"dd/MM/yyyy"):e.toISOString():n})]})}),h.jsx(Pa,{className:"w-auto p-0",align:"start",children:h.jsx(lq,{captionLayout:"dropdown",classNames:{month_caption:"mx-0"},components:{Dropdown:S=>h.jsxs(kn,{onValueChange:_=>{S.onChange&&p(_,S.onChange)},value:String(S.value),children:[h.jsx(Pn,{className:"h-8 w-fit font-medium first:grow",children:h.jsx(zn,{})}),h.jsx(Ln,{className:"max-h-[min(26rem,var(--radix-select-content-available-height))]",children:S.options?.map(_=>h.jsx(He,{disabled:_.disabled,value:String(_.value),children:_.label},_.value))})]}),DropdownNav:S=>h.jsx("div",{className:"flex w-full items-center gap-2",children:S.children})},defaultMonth:e||new Date,hideNavigation:!0,mode:"single",onSelect:x,selected:e,startMonth:new Date(l,0),endMonth:new Date(c,11)})})]})}const cd=b.memo(({cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c})=>{const{setUpdate:d,clearUpdate:f,getUpdate:m}=po(),v=e.getValue(),[p,x]=b.useState(()=>v??""),[S,_]=b.useState(!1),w=b.useRef(null),C=b.useRef(null),T=t.options.meta,N=e.row.original,M=r,R=m(N,M),j=R?R.newValue:v??"",A=b.useCallback(()=>{console.log("onSave",{editorValue:p,initialValue:v,columnName:M,rowData:N}),d(N,M,p,v),T?.onCellEditingStop?.(),_(!1)},[T,p,v,M,N,d]),D=b.useCallback(()=>{console.log("onCancel",p,v),x(v??""),f(N,M),T?.onCellEditingStop?.(),_(!1)},[T,v,M,N,f,p]),L=b.useCallback(ae=>{const pe=ae.target.value;console.log("onChange",pe,M,p,v),x(pe)},[M,p,v]),B=b.useCallback(ae=>{_(ae),ae||(p!==v&&d(N,M,p,v),T?.onCellEditingStop?.())},[T,p,v,M,N,d]),ne=b.useCallback(ae=>{if(ae.preventDefault(),w.current){w.current.focus();const pe=w.current.value.length;w.current.setSelectionRange(pe,pe)}},[]),J=b.useCallback(ae=>{s&&!S&&(ae.key==="Escape"?(ae.preventDefault(),T?.onCellEditingStop?.()):ae.key==="Tab"&&(ae.preventDefault(),T?.onCellEditingStop?.({direction:ae.shiftKey?"left":"right"})))},[s,S,T]),ie=b.useCallback(ae=>{ae.key==="Escape"?(ae.preventDefault(),console.log("onTextareaKeyDown",ae.key,p,v),D()):ae.key==="Enter"&&(ae.ctrlKey||ae.metaKey)&&(ae.preventDefault(),console.log("onTextareaKeyDown",ae.key,p,v),A()),ae.stopPropagation()},[D,A,p,v]),ue=b.useCallback(()=>{p!==v&&d(N,M,p,v),T?.onCellEditingStop?.(),_(!1)},[T,p,v,M,N,d]);return b.useEffect(()=>{s&&!S?(x(j),_(!0)):!s&&S&&_(!1)},[s,S,j]),b.useEffect(()=>{l&&!s&&!T?.isScrolling&&C.current&&C.current.focus()},[l,s,T?.isScrolling]),Na("enter",()=>A()),Na("esc",()=>D()),h.jsxs(za,{open:S,onOpenChange:B,children:[h.jsx(lT,{asChild:!0,children:h.jsx(Ki,{ref:C,cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c,onKeyDown:J,children:h.jsx("span",{"data-slot":"grid-cell-content",children:j})})}),h.jsxs(Pa,{"data-grid-cell-editor":"",align:"start",side:"bottom",sideOffset:0,className:"w-[400px] rounded-none p-0 gap-0",onOpenAutoFocus:ne,children:[h.jsx(Jl,{ref:w,value:p,onChange:L,onKeyDown:ie,onBlur:ue,className:"min-h-[150px] resize-none rounded-none border-0 shadow-none focus-visible:ring-0",placeholder:"Enter text..."}),h.jsxs("div",{className:"flex flex-col border-t",children:[h.jsxs(ze,{variant:"ghost",size:"sm",className:"rounded-none justify-start text-xs py-4 px-2",children:[h.jsx(Zr,{className:"text-xs font-normal",children:"⌘↵"}),h.jsx("span",{className:"ml-1 text-xs",children:"Save Changes"})]}),h.jsxs(ze,{variant:"ghost",size:"sm",className:"rounded-none justify-start text-xs py-4 px-2",children:[h.jsx(Zr,{className:"text-xs font-normal",children:"esc"}),h.jsx("span",{className:"ml-1 text-xs",children:"Cancel Changes"})]})]})]})]})});cd.displayName="TableTextCell";const cN=b.memo(({cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c})=>{const{setUpdate:d,clearUpdate:f}=po(),m=e.getValue(),[v,p]=b.useState(()=>m),[x,S]=b.useState(!1),_=b.useRef(null),w=b.useRef(null),C=t.options.meta,T=e.row.original,N=r,M=b.useCallback(()=>{console.log("onSave",{value:v,initialValue:m,columnName:N,rowData:T}),d(T,N,v,m),S(!1),C?.onCellEditingStop?.()},[C,v,m,N,T,d]),R=b.useCallback(()=>{console.log("onCancel",v,m),p(m),f(T,N),S(!1),C?.onCellEditingStop?.()},[C,m,N,T,f,v]),j=b.useCallback(B=>{const ne=B.target.value;console.log("onChange",ne,N,v,m),p(Number(ne)),d(T,N,Number(ne),m)},[N,v,m,T,d]),A=b.useCallback(B=>{s&&!x&&(B.key==="Escape"?(B.preventDefault(),C?.onCellEditingStop?.()):B.key==="Tab"&&(B.preventDefault(),v!==m&&d(T,N,v,m),C?.onCellEditingStop?.({direction:B.shiftKey?"left":"right"})))},[s,x,C,v,m,N,T,d]),D=b.useCallback(B=>{B.key==="Escape"?(B.preventDefault(),console.log("onTextInputKeyDown",B.key,v,m),R()):B.key==="Enter"&&(B.ctrlKey||B.metaKey)&&(B.preventDefault(),console.log("onTextInputKeyDown",B.key,v,m),M()),B.stopPropagation()},[R,M,v,m]),L=b.useCallback(()=>{v!==m&&d(T,N,v,m),S(!1),C?.onCellEditingStop?.()},[C,v,m,N,T,d]);return s&&!x&&S(!0),b.useEffect(()=>{l&&!s&&!C?.isScrolling&&w.current&&w.current.focus()},[l,s,C?.isScrolling]),Na("enter",()=>M()),Na("esc",()=>R()),h.jsx(Ki,{ref:w,cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c,onKeyDown:A,children:h.jsx(wn,{type:"number",ref:_,value:v||"",onChange:B=>j(B),onKeyDown:B=>D(B),onBlur:L,className:"size-full rounded-none border-none p-0 shadow-none hover:bg-transparent! focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden"})})});cN.displayName="TableNumberCell";const uN=b.memo(({cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c})=>{const{setUpdate:d,clearUpdate:f,getUpdate:m}=po(),v=e.getValue(),[p,x]=b.useState(!1),S=b.useRef(null),_=b.useRef(null),w=b.useRef(s),C=t.options.meta;b.useEffect(()=>{w.current=s},[s]);const T=e.row.original,N=r,M=m(T,N),R=M?M.newValue:v,j=b.useMemo(()=>R==null?"null":R?"true":"false",[R]),A=b.useCallback(J=>{let ie;J==="null"?ie=null:ie=J==="true",d(T,N,ie,v),x(!1),C?.onCellEditingStop?.()},[N,T,v,d,C]),D=b.useCallback(()=>{f(T,N),x(!1),C?.onCellEditingStop?.()},[T,N,f,C]),L=b.useCallback(J=>{x(J),!J&&s&&C?.onCellEditingStop?.()},[s,C]),B=b.useCallback(J=>{s&&!p&&(J.key==="Escape"?(J.preventDefault(),D()):J.key==="Tab"&&(J.preventDefault(),D(),C?.onCellEditingStop?.({direction:J.shiftKey?"left":"right"})))},[s,p,C,D]);b.useEffect(()=>{if(s){const J=setTimeout(()=>{w.current&&(x(!0),setTimeout(()=>{w.current&&_.current?.click()},0))},0);return()=>{clearTimeout(J),x(!1)}}},[s]),b.useEffect(()=>{l&&!s&&!C?.isScrolling&&S.current&&S.current.focus()},[l,s,C?.isScrolling]);const ne=R==null?"NULL":R?"true":"false";return h.jsx(Ki,{ref:S,cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c,onKeyDown:B,className:"p-0!",children:s?h.jsxs(kn,{value:j,onValueChange:A,open:p,onOpenChange:L,children:[h.jsx(Pn,{ref:_,className:"size-full px-2 py-1.5 rounded-none border-none p-0 shadow-none hover:bg-transparent! focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden",children:h.jsx(zn,{})}),h.jsxs(Ln,{"data-grid-cell-editor":"",alignOffset:-8,sideOffset:-8,className:"min-w-[calc(var(--radix-select-trigger-width)+16px)]",onEscapeKeyDown:D,onPointerDownOutside:J=>{J.preventDefault(),x(!1),C?.onCellEditingStop?.()},children:[h.jsx(He,{value:"true",children:"true"}),h.jsx(He,{value:"false",children:"false"}),h.jsx(He,{value:"null",children:"NULL"})]})]}):h.jsx("span",{className:"flex items-center size-full px-2 py-1.5",children:ne})})});uN.displayName="TableBooleanCell";const dN=b.memo(({cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c})=>{const{setUpdate:d,clearUpdate:f,getUpdate:m}=po(),v=e.getValue(),[p,x]=b.useState(!1),S=b.useRef(null),_=b.useRef(null),w=b.useRef(s),C=t.options.meta,T=e.column.columnDef.meta?.enumValues;b.useEffect(()=>{w.current=s},[s]);const N=e.row.original,M=r,R=m(N,M),j=R?R.newValue:v,A=b.useCallback(J=>{d(N,M,J==="null"?null:J,v),x(!1),C?.onCellEditingStop?.()},[M,N,v,d,C]),D=b.useCallback(()=>{f(N,M),x(!1),C?.onCellEditingStop?.()},[N,M,f,C]),L=b.useCallback(J=>{x(J),!J&&s&&C?.onCellEditingStop?.()},[s,C]),B=b.useCallback(J=>{s&&!p&&(J.key==="Escape"?(J.preventDefault(),D()):J.key==="Tab"&&(J.preventDefault(),D(),C?.onCellEditingStop?.({direction:J.shiftKey?"left":"right"})))},[s,p,C,D]);b.useEffect(()=>{if(s){const J=setTimeout(()=>{w.current&&(x(!0),setTimeout(()=>{w.current&&_.current?.click()},0))},0);return()=>{clearTimeout(J),x(!1)}}},[s]),b.useEffect(()=>{l&&!s&&!C?.isScrolling&&S.current&&S.current.focus()},[l,s,C?.isScrolling]);const ne=j??"NULL";return h.jsx(Ki,{ref:S,cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c,onKeyDown:B,className:"p-0!",children:s?h.jsxs(kn,{value:j===null?"null":j,onValueChange:A,open:p,onOpenChange:L,children:[h.jsx(Pn,{ref:_,className:"size-full px-2 py-1.5 rounded-none border-none p-0 shadow-none hover:bg-transparent! focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden",children:h.jsx(zn,{})}),h.jsxs(Ln,{"data-grid-cell-editor":"",alignOffset:-8,sideOffset:-8,className:"min-w-[calc(var(--radix-select-trigger-width)+16px)]",onEscapeKeyDown:D,onPointerDownOutside:J=>{J.preventDefault(),x(!1),C?.onCellEditingStop?.()},children:[T?.map(J=>h.jsx(He,{value:J,children:J},J)),h.jsx(He,{value:"null",children:"NULL"})]})]}):h.jsx("span",{className:"flex items-center size-full px-2 py-1.5 truncate",children:ne})})});dN.displayName="TableEnumCell";const fN=b.memo(({cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c})=>{const{setUpdate:d,clearUpdate:f,getUpdate:m}=po(),v=e.getValue(),p=b.useRef(null),x=t.options.meta,S=e.row.original,_=r,w=m(S,_),C=w?w.newValue:v,T=b.useCallback(R=>{console.log("onDateChange",R,_,v);const j=R?R.toISOString():null;d(S,_,j,v),x?.onCellEditingStop?.()},[_,v,S,d,x]),N=b.useCallback(()=>{console.log("onCancel",C,v),f(S,_),x?.onCellEditingStop?.()},[S,_,f,x,C,v]),M=b.useCallback(R=>{s&&(R.key==="Escape"||R.key==="Tab")&&(R.preventDefault(),N())},[s,N]);return b.useEffect(()=>{l&&!s&&!x?.isScrolling&&p.current&&p.current.focus()},[l,s,x?.isScrolling]),h.jsx(Ki,{ref:p,cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c,onKeyDown:M,className:"p-0!",children:h.jsx(lN,{isFormatted:!1,icon:!1,value:C?new Date(C):void 0,onChange:T,placeholder:"Pick a date",className:"size-full px-2! py-1.5! rounded-none border-none p-0 shadow-none hover:bg-transparent! focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden"})})});fN.displayName="TableDateCell";const hN=b.memo(({cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c})=>{const{setUpdate:d,clearUpdate:f,getUpdate:m}=po(),v=e.getValue();let p;if(typeof v=="string")try{p=JSON.parse(v),console.warn(`TableJsonCell ${r}: initialValue was a string, parsed it to object`,p)}catch(k){console.error(`TableJsonCell ${r}: Failed to parse initialValue string`,v,k),p={}}else p=v;b.useEffect(()=>{console.log(`TableJsonCell ${r} initialValue:`,typeof p,p)},[p,r]);const[x,S]=b.useState(()=>JSON.stringify(p,null,2)??""),[_,w]=b.useState(!1),C=b.useRef(null),T=b.useRef(null),N=t.options.meta,M=e.row.original,R=r,j=m(M,R),A=j?j.newValue:p,D=JSON.stringify(A),L=b.useCallback(()=>{console.log("onSave",{editorValue:x,initialValue:p,columnName:R,rowData:M});try{const k=JSON.parse(x);console.log("Parsed value:",typeof k,k),console.log("Initial value:",typeof p,p),d(M,R,k,p)}catch(k){console.error("Invalid JSON:",k);return}N?.onCellEditingStop?.(),w(!1)},[N,x,p,R,M,d]),B=b.useCallback(()=>{console.log("onCancel",x,p),S(JSON.stringify(p,null,2)??""),f(M,R),N?.onCellEditingStop?.(),w(!1)},[N,p,R,M,f,x]),ne=b.useCallback(k=>{const Y=k.target.value;console.log("onChange",Y,R,x,p),S(Y)},[R,x,p]),J=b.useCallback(k=>{if(w(k),!k){try{const Y=JSON.parse(x);JSON.stringify(Y)!==JSON.stringify(p)&&d(M,R,Y,p)}catch(Y){console.error("Invalid JSON on close:",Y)}N?.onCellEditingStop?.()}},[N,x,p,R,M,d]),ie=b.useCallback(k=>{if(k.preventDefault(),C.current){C.current.focus();const Y=C.current.value.length;C.current.setSelectionRange(Y,Y)}},[]),ue=b.useCallback(k=>{s&&!_&&(k.key==="Escape"?(k.preventDefault(),N?.onCellEditingStop?.()):k.key==="Tab"&&(k.preventDefault(),N?.onCellEditingStop?.({direction:k.shiftKey?"left":"right"})))},[s,_,N]),ae=b.useCallback(k=>{k.key==="Escape"?(k.preventDefault(),console.log("onTextareaKeyDown",k.key,x,p),B()):k.key==="Enter"&&(k.ctrlKey||k.metaKey)&&(k.preventDefault(),console.log("onTextareaKeyDown",k.key,x,p),L()),k.stopPropagation()},[B,L,x,p]),pe=b.useCallback(()=>{try{const k=JSON.parse(x);JSON.stringify(k)!==JSON.stringify(p)&&d(M,R,k,p)}catch(k){console.error("Invalid JSON on blur:",k)}N?.onCellEditingStop?.(),w(!1)},[N,x,p,R,M,d]);return b.useEffect(()=>{s&&!_?(S(JSON.stringify(A,null,2)),w(!0)):!s&&_&&w(!1)},[s,_,A]),b.useEffect(()=>{l&&!s&&!N?.isScrolling&&T.current&&T.current.focus()},[l,s,N?.isScrolling]),Na("enter",()=>L()),Na("esc",()=>B()),h.jsxs(za,{open:_,onOpenChange:J,children:[h.jsx(lT,{asChild:!0,children:h.jsx(Ki,{ref:T,cell:e,table:t,rowIndex:n,columnId:r,isEditing:s,isFocused:l,isSelected:c,onKeyDown:ue,children:h.jsx("span",{"data-slot":"grid-cell-content",children:D})})}),h.jsxs(Pa,{"data-grid-cell-editor":"",align:"start",side:"bottom",sideOffset:0,className:"w-[400px] rounded-none p-0 gap-0",onOpenAutoFocus:ie,children:[h.jsx(Jl,{ref:C,value:x,onChange:ne,onKeyDown:ae,onBlur:pe,className:"min-h-[150px] resize-none rounded-none border-0 shadow-none focus-visible:ring-0",placeholder:"Enter JSON..."}),h.jsxs("div",{className:"flex flex-col border-t",children:[h.jsxs(ze,{variant:"ghost",size:"sm",className:"rounded-none justify-start text-xs py-4 px-2",children:[h.jsx(Zr,{className:"text-xs font-normal",children:"⌘↵"}),h.jsx("span",{className:"ml-1 text-xs",children:"Save Changes"})]}),h.jsxs(ze,{variant:"ghost",size:"sm",className:"rounded-none justify-start text-xs py-4 px-2",children:[h.jsx(Zr,{className:"text-xs font-normal",children:"esc"}),h.jsx("span",{className:"ml-1 text-xs",children:"Cancel Changes"})]})]})]})]})});hN.displayName="TableJsonCell";const uq=({cell:e,table:t})=>{const n=t.options.meta,r=e.row.index,l=t.getRowModel().rows.findIndex(x=>x.original===e.row.original),c=l>=0?l:r,d=e.column.id,f=n?.focusedCell?.rowIndex===c&&n?.focusedCell?.columnId===d,m=n?.editingCell?.rowIndex===c&&n?.editingCell?.columnId===d,v=n?.getIsCellSelected?.(c,d)??!1;switch(e.column.columnDef.meta?.variant){case"text":return h.jsx(cd,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v});case"boolean":return h.jsx(uN,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v});case"number":return h.jsx(cN,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v});case"enum":return h.jsx(dN,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v});case"date":return h.jsx(fN,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v});case"json":return h.jsx(hN,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v});case"array":return h.jsx(cd,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v});default:return h.jsx(cd,{cell:e,table:t,rowIndex:c,columnId:d,isEditing:m,isFocused:f,isSelected:v})}};function gi(e,t,n){let r=n.initialDeps??[],s,l=!0;function c(){var d,f,m;let v;n.key&&((d=n.debug)!=null&&d.call(n))&&(v=Date.now());const p=e();if(!(p.length!==r.length||p.some((_,w)=>r[w]!==_)))return s;r=p;let S;if(n.key&&((f=n.debug)!=null&&f.call(n))&&(S=Date.now()),s=t(...p),n.key&&((m=n.debug)!=null&&m.call(n))){const _=Math.round((Date.now()-v)*100)/100,w=Math.round((Date.now()-S)*100)/100,C=w/16,T=(N,M)=>{for(N=String(N);N.length<M;)N=" "+N;return N};console.info(`%c⏱ ${T(w,5)} /${T(_,5)} ms`,`
79
+ font-size: .6rem;
80
+ font-weight: bold;
81
+ color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(l&&n.skipInitialOnChange)&&n.onChange(s),l=!1,s}return c.updateDeps=d=>{r=d},c}function s1(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const dq=(e,t)=>Math.abs(e-t)<1.01,fq=(e,t,n)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,s),n)}},i1=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},hq=e=>e,mq=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=t;s<=n;s++)r.push(s);return r},pq=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const s=c=>{const{width:d,height:f}=c;t({width:Math.round(d),height:Math.round(f)})};if(s(i1(n)),!r.ResizeObserver)return()=>{};const l=new r.ResizeObserver(c=>{const d=()=>{const f=c[0];if(f?.borderBoxSize){const m=f.borderBoxSize[0];if(m){s({width:m.inlineSize,height:m.blockSize});return}}s(i1(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(d):d()});return l.observe(n,{box:"border-box"}),()=>{l.unobserve(n)}},l1={passive:!0},c1=typeof window>"u"?!0:"onscrollend"in window,gq=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let s=0;const l=e.options.useScrollendEvent&&c1?()=>{}:fq(r,()=>{t(s,!1)},e.options.isScrollingResetDelay),c=v=>()=>{const{horizontal:p,isRtl:x}=e.options;s=p?n.scrollLeft*(x&&-1||1):n.scrollTop,l(),t(s,v)},d=c(!0),f=c(!1);f(),n.addEventListener("scroll",d,l1);const m=e.options.useScrollendEvent&&c1;return m&&n.addEventListener("scrollend",f,l1),()=>{n.removeEventListener("scroll",d),m&&n.removeEventListener("scrollend",f)}},vq=(e,t,n)=>{if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},yq=(e,{adjustments:t=0,behavior:n},r)=>{var s,l;const c=e+t;(l=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||l.call(s,{[r.options.horizontal?"left":"top"]:c,behavior:n})};class bq{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,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 r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(s=>{s.forEach(l=>{const c=()=>{this._measureElement(l.target,l)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),n=null},observe:s=>{var l;return(l=r())==null?void 0:l.observe(s,{box:"border-box"})},unobserve:s=>{var l;return(l=r())==null?void 0:l.unobserve(s)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,s])=>{typeof s>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hq,rangeExtractor:mq,onChange:()=>{},measureElement:vq,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 r,s;(s=(r=this.options).onChange)==null||s.call(r,this,n)},this.maybeNotify=gi(()=>(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 r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,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(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=l,this.maybeNotify()}))}},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,r)=>{const s=new Map,l=new Map;for(let c=r-1;c>=0;c--){const d=n[c];if(s.has(d.lane))continue;const f=l.get(d.lane);if(f==null||d.end>f.end?l.set(d.lane,d):d.end<f.end&&s.set(d.lane,!0),s.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((c,d)=>c.end===d.end?c.index-d.index:c.end-d.end)[0]:void 0},this.getMeasurementOptions=gi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,s,l,c,d)=>(this.prevLanes!==void 0&&this.prevLanes!==d&&(this.lanesChangedFlag=!0),this.prevLanes=d,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:s,getItemKey:l,enabled:c,lanes:d}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=gi(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:s,getItemKey:l,enabled:c,lanes:d},f)=>{if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));const m=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const v=this.measurementsCache.slice(0,m),p=new Array(d).fill(void 0);for(let x=0;x<m;x++){const S=v[x];S&&(p[S.lane]=x)}for(let x=m;x<n;x++){const S=l(x),_=this.laneAssignments.get(x);let w,C;if(_!==void 0&&this.options.lanes>1){w=_;const R=p[w],j=R!==void 0?v[R]:void 0;C=j?j.end+this.options.gap:r+s}else{const R=this.options.lanes===1?v[x-1]:this.getFurthestMeasurement(v,x);C=R?R.end+this.options.gap:r+s,w=R?R.lane:x%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(x,w)}const T=f.get(S),N=typeof T=="number"?T:this.options.estimateSize(x),M=C+N;v[x]={index:x,start:C,size:N,end:M,key:S,lane:w},p[w]=x}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=gi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,s,l)=>this.range=n.length>0&&r>0?xq({measurements:n,outerSize:r,scrollOffset:s,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=gi(()=>{let n=null,r=null;const s=this.calculateRange();return s&&(n=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,s,l,c)=>l===null||c===null?[]:n({startIndex:l,endIndex:c,overscan:r,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,s=n.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const s=this.indexFromElement(n),l=this.measurementsCache[s];if(!l)return;const c=l.key,d=this.elementsCache.get(c);d!==n&&(d&&this.observer.unobserve(d),this.observer.observe(n),this.elementsCache.set(c,n)),n.isConnected&&this.resizeItem(s,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const s=this.measurementsCache[n];if(!s)return;const l=this.itemSizeCache.get(s.key)??s.size,c=r-l;c!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,c,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=c,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(n,void 0)},this.getVirtualItems=gi(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const s=[];for(let l=0,c=n.length;l<c;l++){const d=n[l],f=r[d];s.push(f)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return s1(r[mN(0,r.length-1,s=>s1(r[s]).start,n)])},this.getOffsetForAlignment=(n,r,s=0)=>{const l=this.getSize(),c=this.getScrollOffset();r==="auto"&&(r=n>=c+l?"end":"start"),r==="center"?n+=(s-l)/2:r==="end"&&(n-=l);const d=this.getTotalSize()+this.options.scrollMargin-l;return Math.max(Math.min(d,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const s=this.measurementsCache[n];if(!s)return;const l=this.getSize(),c=this.getScrollOffset();if(r==="auto")if(s.end>=c+l-this.options.scrollPaddingEnd)r="end";else if(s.start<=c+this.options.scrollPaddingStart)r="start";else return[c,r];const d=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(d,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(n,{align:r="auto",behavior:s}={})=>{s==="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));let l=0;const c=10,d=m=>{if(!this.targetWindow)return;const v=this.getOffsetForIndex(n,m);if(!v){console.warn("Failed to get offset for index:",n);return}const[p,x]=v;this._scrollToOffset(p,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const S=this.getScrollOffset(),_=this.getOffsetForIndex(n,x);if(!_){console.warn("Failed to get offset for index:",n);return}dq(_[0],S)||f(x)})},f=m=>{this.targetWindow&&(l++,l<c?this.targetWindow.requestAnimationFrame(()=>d(m)):console.warn(`Failed to scroll to index ${n} after ${c} attempts.`))};d(r)},this.scrollBy=(n,{behavior:r}={})=>{r==="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:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((n=r[r.length-1])==null?void 0:n.end)??0;else{const l=Array(this.options.lanes).fill(null);let c=r.length-1;for(;c>=0&&l.some(d=>d===null);){const d=r[c];l[d.lane]===null&&(l[d.lane]=d.end),c--}s=Math.max(...l.filter(d=>d!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:s})=>{this.options.scrollToFn(n,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const mN=(e,t,n,r)=>{for(;e<=t;){const s=(e+t)/2|0,l=n(s);if(l<r)e=s+1;else if(l>r)t=s-1;else return s}return e>0?e-1:0};function xq({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const s=e.length-1,l=f=>e[f].start;if(e.length<=r)return{startIndex:0,endIndex:s};let c=mN(0,s,l,n),d=c;if(r===1)for(;d<s&&e[d].end<n+t;)d++;else if(r>1){const f=Array(r).fill(0);for(;d<s&&f.some(v=>v<n+t);){const v=e[d];f[v.lane]=v.end,d++}const m=Array(r).fill(n+t);for(;c>=0&&m.some(v=>v>=n);){const v=e[c];m[v.lane]=v.start,c--}c=Math.max(0,c-c%r),d=Math.min(s,d+(r-1-d%r))}return{startIndex:c,endIndex:d}}const u1=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Sq(e){const t=b.useReducer(()=>({}),{})[1],n={...e,onChange:(s,l)=>{var c;l?Pi.flushSync(t):t(),(c=e.onChange)==null||c.call(e,s,l)}},[r]=b.useState(()=>new bq(n));return r.setOptions(n),u1(()=>r._didMount(),[]),u1(()=>r._willUpdate()),r}function pN(e){return Sq({observeElementRect:pq,observeElementOffset:gq,scrollToFn:yq,...e})}const wq=({columnVirtualizer:e,row:t,rowVirtualizer:n,virtualPaddingLeft:r,virtualPaddingRight:s,virtualRow:l})=>{const c=t.getVisibleCells(),d=e.getVirtualItems();return h.jsxs("tr",{"data-index":l.index,ref:f=>n.measureElement(f),className:"flex absolute w-fit border-b items-center justify-between text-sm hover:bg-accent/20 data-[state=open]:bg-accent/40 [&_svg]:size-4",style:{transform:`translateY(${l.start}px)`},children:[r?h.jsx("td",{style:{display:"flex",width:r}}):null,d.map(f=>{const m=c[f.index];return h.jsx("td",{className:fe("flex border-r border-zinc-800 h-8"),style:{width:f.index===0?"40px":m.column.getSize()},children:cc(m.column.columnDef.cell,m.getContext())},m.id)}),s?h.jsx("td",{style:{display:"flex",width:s}}):null]},t.id)},Cq=({columnVirtualizer:e,table:t,tableContainerRef:n,virtualPaddingLeft:r,virtualPaddingRight:s})=>{const{rows:l}=t.getRowModel(),c=pN({count:l.length,estimateSize:()=>33,getScrollElement:()=>n.current,measureElement:typeof window<"u"&&navigator.userAgent.indexOf("Firefox")===-1?f=>f?.getBoundingClientRect().height:void 0,overscan:5}),d=c.getVirtualItems();return h.jsx("tbody",{style:{display:"grid",height:`${c.getTotalSize()}px`,position:"relative"},children:d.map(f=>{const m=l[f.index];return h.jsx(wq,{columnVirtualizer:e,row:m,rowVirtualizer:c,virtualPaddingLeft:r,virtualPaddingRight:s,virtualRow:f},m.id)})})},_q=b.memo(Eq,(e,t)=>{const n=e.header.column,r=t.header.column;return!(n.getIsResizing()!==r.getIsResizing()||n.getSize()!==r.getSize()||e.label!==t.label)});function Eq({header:e,table:t,label:n}){const r=t._getDefaultColumnDef(),s=b.useCallback(()=>{t.setColumnSizing(l=>{const c={...l};return delete c[e.column.id],c})},[e.column.id,t]);return h.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} column`,"aria-valuenow":e.column.getSize(),"aria-valuemin":r.minSize,"aria-valuemax":r.maxSize,tabIndex:0,className:fe("after:-translate-x-1/2 -right-px absolute 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:left-1/2 after:h-full after:w-[18px] after:content-[''] hover:bg-primary focus:bg-primary focus:outline-none",e.column.getIsResizing()?"bg-primary":"opacity-0 hover:opacity-100"),onDoubleClick:s,onMouseDown:e.getResizeHandler(),onTouchStart:e.getResizeHandler()})}const Tq=({columnVirtualizer:e,headerGroup:t,virtualPaddingLeft:n,virtualPaddingRight:r,table:s})=>{const[,l]=Ae(we.COLUMN_NAME),[,c]=Ae(we.TABLE_STATE_KEYS.SORT),[,d]=Ae(we.TABLE_STATE_KEYS.ORDER),f=e.getVirtualItems(),m=s.getState().columnSizingInfo.isResizingColumn,v=b.useCallback(p=>x=>{x===null?(l(null),c(null),d(null)):(l(p),c(p),d(x==="desc"?"desc":"asc"))},[l,c,d]);return h.jsxs("tr",{className:fe("flex w-fit bg-black border-b items-center justify-between text-sm data-[state=open]:bg-accent/40 [&_svg]:size-4",m&&"pointer-events-none"),children:[n?h.jsx("th",{style:{display:"flex",width:n}}):null,f.map(p=>{const x=t.headers[p.index],S=x.column.columnDef.meta?.isPrimaryKey,_=x.column.columnDef.meta?.isForeignKey,w=x.column.columnDef.meta?.dataTypeLabel;return h.jsx("th",{className:"h-full flex",style:{display:"flex",width:p.index===0?"40px":x.getSize()},children:h.jsx("div",{className:fe("relative w-full h-full flex items-center justify-between gap-2 text-sm hover:bg-accent/20 data-[state=open]:bg-accent/40 [&_svg]:size-4","border-r border-zinc-800",x.column.getCanSort()?"cursor-pointer select-none":""),children:p.index===0?cc(x.column.columnDef.header,x.getContext()):h.jsxs(h.Fragment,{children:[h.jsxs($v,{children:[h.jsx(Uv,{asChild:!0,children:h.jsxs(ze,{variant:"outline",className:"p-2 border-none w-full h-full bg-transparent! rounded-none justify-between",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[S&&h.jsx($F,{size:20,className:"text-primary"}),_&&h.jsx(wv,{size:20,className:"text-primary"}),cc(x.column.columnDef.header,x.getContext())]}),h.jsxs("div",{className:"flex items-center gap-1",children:[w&&h.jsx("span",{className:"text-xs leading-none text-muted-foreground",children:w}),h.jsx("span",{className:"text-xs leading-none text-muted-foreground",children:{asc:h.jsx(_v,{}),desc:h.jsx(N2,{})}[x.column.getIsSorted()]??null})]})]})}),h.jsxs(Bv,{className:"w-44",align:"start",children:[h.jsxs(cT,{children:[h.jsxs($r,{onClick:()=>v(x.column.id)("asc"),children:[h.jsx(PI,{}),"Sort ascending"]}),h.jsxs($r,{onClick:()=>v(x.column.id)("desc"),children:[h.jsx(kI,{}),"Sort descending"]}),h.jsxs($r,{onClick:()=>v(x.column.id)(null),children:[h.jsx(Hi,{}),"Remove sort"]})]}),h.jsx(hg,{}),h.jsxs($r,{variant:"destructive",children:[h.jsx(O2,{}),"Delete column"]})]})]}),x.column.getCanResize()&&h.jsx(_q,{header:x,table:s,label:x.column.id})]})})},x.id)}),r?h.jsx("th",{style:{display:"flex",width:r}}):null]},t.id)},Nq=({columnVirtualizer:e,table:t,virtualPaddingLeft:n,virtualPaddingRight:r})=>h.jsx("thead",{className:"h-9 grid sticky top-0 z-10",children:t.getHeaderGroups().map(s=>h.jsx(Tq,{columnVirtualizer:e,headerGroup:s,table:t,virtualPaddingLeft:n,virtualPaddingRight:r},s.id))}),Rq=({table:e})=>{const t=e.getVisibleLeafColumns(),n=b.useRef(null),r=pN({count:t.length,estimateSize:d=>t[d].getSize(),getScrollElement:()=>n.current,horizontal:!0,overscan:3}),s=r.getVirtualItems();let l,c;return r&&s?.length&&(l=s[0]?.start??0,c=r.getTotalSize()-(s[s.length-1]?.end??0)),h.jsx("div",{className:"w-full flex-1 overflow-auto",ref:n,style:{position:"relative"},children:h.jsxs("table",{style:{display:"grid"},children:[h.jsx(Nq,{columnVirtualizer:r,table:e,virtualPaddingLeft:l,virtualPaddingRight:c}),h.jsx(Cq,{columnVirtualizer:r,table:e,tableContainerRef:n,virtualPaddingLeft:l,virtualPaddingRight:c})]})})};function Mq({className:e,...t}){return h.jsx("nav",{"aria-label":"pagination","data-slot":"pagination",className:fe("mx-auto flex w-full justify-center",e),...t})}function Oq({className:e,...t}){return h.jsx("ul",{"data-slot":"pagination-content",className:fe("flex flex-row items-center gap-1",e),...t})}function od({...e}){return h.jsx("li",{"data-slot":"pagination-item",...e})}const Aq=()=>{const{sidebar:{isPinned:e,width:t}}=Cs(),[n,r]=Ae(we.TABLE_STATE_KEYS.LIMIT),[s,l]=Ae(we.TABLE_STATE_KEYS.PAGE),{tableData:c}=gf(),d=c?.meta?.total??0,f=c?.meta?.totalPages??0,m=p=>{r(p)},v=p=>{l(p.toString())};return h.jsxs("footer",{className:"fixed bottom-0 left-0 right-0 h-9 border-t border-zinc-800 flex items-center justify-between bg-black px-2 text-white",style:{marginLeft:e?`${t}px`:"0"},children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(jn,{className:"text-xs text-zinc-400 whitespace-nowrap",children:"Rows per page"}),h.jsxs(kn,{value:n?.toString()||"50",onValueChange:p=>{m(p)},children:[h.jsx(Pn,{size:"sm",className:"h-6 text-xs px-2 border-none bg-transparent! shadow-none hover:bg-transparent! gap-2",children:h.jsx(zn,{placeholder:"Select number of results"})}),h.jsx(Ln,{className:"[&_*[role=option]]:ps-2 [&_*[role=option]]:pe-8 [&_*[role=option]>span]:start-auto [&_*[role=option]>span]:end-2 border-zinc-800",children:[5,10,25,50].map(p=>h.jsx(He,{value:p.toString(),children:p},p))})]})]}),h.jsx("div",{className:"flex items-center justify-center text-xs text-zinc-400",children:h.jsxs("p",{className:"whitespace-nowrap","aria-live":"polite",children:[h.jsxs("span",{className:"text-zinc-200",children:[(Number(s)-1)*Number(n)+1,"-",Math.min(Number(s)*Number(n),d)]})," ","of ",h.jsx("span",{className:"text-zinc-200",children:c?.meta?.total.toString()})]})}),h.jsx("div",{className:"flex items-center",children:h.jsx(Mq,{children:h.jsxs(Oq,{className:"gap-0.5",children:[h.jsx(od,{children:h.jsx(ze,{size:"icon-sm",variant:"ghost",className:"h-6 w-6 disabled:opacity-30",onClick:()=>{v(1)},disabled:Number(s)<=1||d===0,"aria-label":"Go to first page",children:h.jsx(HI,{"aria-hidden":"true"})})}),h.jsx(od,{children:h.jsx(ze,{size:"icon-sm",variant:"ghost",className:"h-6 w-6 disabled:opacity-30",onClick:()=>{v(Number(s)-1)},disabled:Number(s)<=1||d===0,"aria-label":"Go to previous page",children:h.jsx(T2,{"aria-hidden":"true"})})}),h.jsx(od,{children:h.jsx(ze,{size:"icon-sm",variant:"ghost",className:"h-6 w-6 disabled:opacity-30",onClick:()=>{v(Number(s)+1)},disabled:Number(s)>=f||d===0,"aria-label":"Go to next page",children:h.jsx(Ev,{"aria-hidden":"true"})})}),h.jsx(od,{children:h.jsx(ze,{size:"icon-sm",variant:"ghost",className:"h-6 w-6 disabled:opacity-30",onClick:()=>{v(f)},disabled:Number(s)>=f||d===0,"aria-label":"Go to last page",children:h.jsx(GI,{"aria-hidden":"true"})})})]})})})]})},jq=()=>({id:"select",accessorKey:"select",header:({table:e})=>h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx(Ad,{checked:e.getIsAllRowsSelected(),onCheckedChange:()=>e.toggleAllRowsSelected()})}),cell:({row:e})=>h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx(Ad,{checked:e.getIsSelected(),onCheckedChange:()=>e.toggleSelected()})}),size:20,enableSorting:!1});function ay({size:e="size-6",className:t,...n}){const r=Array(12).fill(0);return h.jsx("div",{className:fe(e),children:h.jsx("div",{className:fe("relative top-1/2 left-1/2 h-[inherit] w-[inherit]"),children:r.map((s,l)=>h.jsx("div",{className:fe("-left-[10%] -top-[3.9%] absolute h-[8%] w-[24%] animate-spinner rounded-md bg-primary",`bar:nth-child(${l+1})`,t),style:{animationDelay:`-${1.3-l*.1}s`,transform:`rotate(${30*l}deg) translate(146%)`},...n},`spinner-bar-${String(l)}`))})})}const Dq=()=>{const[e]=Ae(we.ACTIVE_TABLE),[t]=Ae(we.COLUMN_NAME),[n]=Ae(we.TABLE_STATE_KEYS.ORDER),{tableData:r,isLoadingTableData:s,errorTableData:l}=gf(),{tableCols:c,isLoadingTableCols:d,errorTableCols:f}=Bo(),[m,v]=b.useState({}),[p,x]=b.useState({}),[S,_]=b.useState(null),[w,C]=b.useState(null),T=b.useMemo(()=>[jq(),...c?.map(A=>({accessorKey:A.columnName,header:A.columnName,meta:{variant:A.enumValues?"enum":A.dataType,isPrimaryKey:A.isPrimaryKey,isForeignKey:A.isForeignKey,referencedTable:A.referencedTable,referencedColumn:A.referencedColumn,enumValues:A.enumValues,dataTypeLabel:A.dataTypeLabel},size:(A.columnName.length+(A.dataTypeLabel?.length||0))*5+100,minSize:100,maxSize:500}))||[]],[c]);b.useEffect(()=>{v({})},[e]);const N=b.useMemo(()=>t&&n?[{id:t,desc:n==="desc"}]:[],[t,n]),M=OT({data:r?.data||[],columns:T,defaultColumn:{cell:uq,size:50,minSize:100,maxSize:500},getCoreRowModel:MT(),getSortedRowModel:JB(),state:{sorting:N,rowSelection:m,columnSizing:p},manualSorting:!1,enableRowSelection:!0,enableMultiRowSelection:!0,enableColumnResizing:!0,columnResizeMode:"onChange",debugTable:!0,onRowSelectionChange:A=>{v(A)},onColumnSizingChange:x,meta:{focusedCell:S,editingCell:w,onCellClick:(A,D)=>{_({rowIndex:A,columnId:D})},onCellDoubleClick:(A,D)=>{C({rowIndex:A,columnId:D})},onCellEditingStart:(A,D)=>{C({rowIndex:A,columnId:D})},onCellEditingStop:()=>{C(null)},onDataUpdate:A=>{console.log("Data update:",A)},getIsCellSelected:()=>!1},onPaginationChange:A=>{console.log(A)},onColumnVisibilityChange:A=>{console.log(A)},onColumnOrderChange:A=>{console.log(A)}}),R=!r?.data||r.data.length===0,j=M.getSelectedRowModel().rows;return s||d?h.jsx("div",{className:"size-full flex items-center justify-center",children:h.jsx(ay,{size:"size-7"})}):l||f?h.jsxs("div",{className:"size-full flex items-center justify-center",children:["Error: ",l?.message||f?.message]}):e?R?h.jsxs("div",{className:"size-full flex flex-col items-center justify-center",children:[h.jsx(Yw,{selectedRows:j,setRowSelection:v}),h.jsx("div",{className:"text-sm text-muted-foreground flex-1 flex items-center justify-center",children:"No data available"})]}):h.jsxs("div",{className:"flex-1 w-full flex flex-col overflow-hidden",children:[h.jsx(Yw,{selectedRows:j,setRowSelection:v}),h.jsx(Rq,{table:M}),h.jsx(Aq,{})]}):h.jsx("div",{className:"size-full flex items-center justify-center",children:"No table selected"})};function ud({delayDuration:e=0,...t}){return h.jsx(nL,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Cp({...e}){return h.jsx(ud,{children:h.jsx(rL,{"data-slot":"tooltip",...e})})}function _p({...e}){return h.jsx(oL,{"data-slot":"tooltip-trigger",...e})}function Ep({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(aL,{children:h.jsxs(sL,{"data-slot":"tooltip-content",sideOffset:t,className:fe("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 **:data-[slot=kbd]:rounded-md bg-foreground text-background z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",e),...r,children:[n,h.jsx(iL,{className:"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 translate-y-[calc(-50%_-_2px)]"})]})})}const kq=({columnName:e,dataTypeLabel:t,columnDefault:n,enumValues:r,isForeignKey:s,referencedTable:l,referencedColumn:c})=>{const[,d]=Ae(we.REFERENCED_TABLE_STATE_KEYS.ACTIVE_TABLE),{control:f}=Bt(),{openSheet:m,setRecordReference:v}=jr(),p=x=>{const S={...x,value:x.value??""};return s?h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex",children:[h.jsx(wn,{id:e,placeholder:n??"",className:"-me-px flex-1 rounded-e-none shadow-none focus-visible:z-10",...S}),h.jsx(ud,{delayDuration:0,children:h.jsxs(Cp,{children:[h.jsx(_p,{asChild:!0,children:h.jsx("button",{"aria-label":"Go to table",className:"inline-flex w-9 items-center justify-center rounded-e-md border border-input bg-background text-muted-foreground/80 text-sm outline-none transition-[color,box-shadow] hover:text-accent-foreground focus:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",type:"button",onClick:()=>{l&&e&&c&&v(l,e,c),m("record-reference"),d(l)},children:h.jsx(wv,{"aria-hidden":"true",className:"size-4",size:16})})}),h.jsx(Ep,{className:"px-2 py-1 text-xs",children:"Go to table"})]})})]}),h.jsxs("span",{className:"text-xs text-muted-foreground",children:["Has a foreign key relation to"," ",h.jsx("button",{type:"button",className:"font-mono text-primary",onClick:()=>{l&&e&&c&&v(l,e,c),m("record-reference"),d(l)},children:l})," ","table"]})]}):t==="int"||t==="bigint"||t==="smallint"||t==="numeric"||t==="float"||t==="double"||t==="money"?h.jsx(wn,{id:e,type:"number",placeholder:n??"0",...S}):t==="boolean"?h.jsxs(kn,{value:x.value,onValueChange:_=>x.onChange(_),children:[h.jsx(Pn,{className:"w-full",children:h.jsx(zn,{placeholder:n??"true"})}),h.jsxs(Ln,{children:[h.jsx(He,{value:"true",children:"true"}),h.jsx(He,{value:"false",children:"false"})]})]}):t==="text"||t==="xml"?h.jsx(Jl,{id:e,placeholder:n??"",rows:4,...S}):t==="json"||t==="jsonb"?h.jsx(Jl,{id:e,placeholder:n??'{"key": "value"}',rows:6,...S}):t==="date"||t==="timestamp"||t==="timestamptz"?h.jsxs("div",{className:"flex",children:[h.jsx(lN,{value:x.value?new Date(x.value):void 0,onChange:_=>x.onChange(_?_.toISOString().split("T")[0]:""),placeholder:n??"Select a date",className:"-me-px flex-1 rounded-e-none shadow-none focus-visible:z-10"}),h.jsx(ud,{delayDuration:0,children:h.jsxs(Cp,{children:[h.jsx(_p,{asChild:!0,children:h.jsx("button",{"aria-label":"Set to now",className:"inline-flex w-7 items-center justify-center rounded-e-md border border-input bg-background text-muted-foreground/80 text-sm outline-none transition-[color,box-shadow] hover:text-accent-foreground focus:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",type:"button",onClick:()=>{const _=new Date().toISOString().split("T")[0];x.onChange(_)},children:h.jsx(wF,{"aria-hidden":"true",className:"size-4",size:16})})}),h.jsx(Ep,{className:"px-2 py-1 text-xs",children:"Set to now"})]})})]}):t==="uuid"?h.jsxs("div",{className:"flex",children:[h.jsx(wn,{id:e,type:"text",placeholder:n??"",pattern:"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",className:"-me-px flex-1 rounded-e-none shadow-none focus-visible:z-10",...S}),h.jsx(ud,{delayDuration:0,children:h.jsxs(Cp,{children:[h.jsx(_p,{asChild:!0,children:h.jsx("button",{"aria-label":"Generate UUID",className:"inline-flex w-9 items-center justify-center rounded-e-md border border-input bg-background text-muted-foreground/80 text-sm outline-none transition-[color,box-shadow] hover:text-accent-foreground focus:z-10 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",type:"button",onClick:()=>{const _=crypto.randomUUID();x.onChange(_)},children:h.jsx(rI,{"aria-hidden":"true",className:"size-4",size:16})})}),h.jsx(Ep,{className:"px-2 py-1 text-xs",children:"Generate UUID"})]})})]}):t==="array"?h.jsx(Jl,{id:e,placeholder:n??'["item1", "item2"]',rows:3,...S}):t==="enum"?r&&r.length>0?h.jsxs(kn,{value:x.value,onValueChange:_=>x.onChange(_),children:[h.jsx(Pn,{className:"w-full",children:h.jsx(zn,{placeholder:n??"Select a value"})}),h.jsx(Ln,{children:r.map(_=>h.jsx(He,{value:_,children:_},_))})]}):h.jsx(wn,{id:e,placeholder:n??"",...S}):t==="interval"?h.jsx(wn,{id:e,type:"text",placeholder:n??"1 day",...S}):t==="bytea"?h.jsx(wn,{id:e,type:"file",...S}):t==="inet"||t==="cidr"||t==="macaddr"||t==="macaddr8"?h.jsx(wn,{id:e,type:"text",placeholder:t==="inet"?"192.168.1.1":t==="cidr"?"192.168.1.0/24":t==="macaddr"?"08:00:2b:01:02:03":"08:00:2b:01:02:03:04:05",...S}):t==="point"||t==="line"||t==="polygon"?h.jsx(wn,{id:e,type:"text",placeholder:t==="point"?"(x,y)":t==="line"?"{A,B,C}":"((x1,y1),(x2,y2),...)",...S}):h.jsx(wn,{id:e,type:"text",placeholder:n??"",...S})};return h.jsx(Mr,{control:f,name:e,render:({field:x})=>h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsxs("div",{className:"col-span-1 flex flex-col gap-1",children:[h.jsx(jn,{htmlFor:e,children:e}),h.jsx("span",{className:"text-xs text-muted-foreground",children:t})]}),h.jsx("div",{className:"col-span-2 w-full",children:p(x)})]})},e)},zq=({tableName:e})=>{const[t,n]=Ae(we.REFERENCED_TABLE_STATE_KEYS.FILTERS,Di(T=>T).withDefault([]).withOptions({history:"push"})),{tableCols:r}=Bo(e),[s,l]=b.useState(!1),[c,d]=b.useState([]),f=()=>{const T=r?.[0]?.columnName??"";d([...c,{columnName:T,operator:"=",value:""}])},m=T=>{d(c.filter((N,M)=>M!==T))},v=(T,N)=>{d(c.map((M,R)=>R===T?{...M,columnName:N}:M))},p=(T,N)=>{d(c.map((M,R)=>R===T?{...M,value:N}:M))},x=(T,N)=>{d(c.map((M,R)=>R===T?{...M,operator:N}:M))},S=()=>{d([]),n([]),l(!1)},_=()=>{const T=c.filter(N=>N.columnName&&N.operator&&N.value!=="");n(T),l(!1)},w=t.length>0,C=T=>{T&&d(t),l(T)};return h.jsxs(za,{open:s,onOpenChange:C,children:[h.jsx(Gi,{asChild:!0,children:h.jsxs(ze,{type:"button",variant:"ghost",className:"border-r border-l-0 border-y-0 border-zinc-800 rounded-none text-xs h-full","aria-label":"Filter table data","data-active":w,children:[h.jsx(R2,{className:"size-4"}),"Filter",w&&h.jsx(Zr,{className:"text-[10px] font-normal text-white bg-primary/10 border border-primary/90 px-1.5 py-0.5",children:t.length})]})}),h.jsxs(Pa,{className:"w-md space-y-2",align:"start",children:[h.jsx("div",{className:"flex items-center gap-4",children:h.jsxs(ze,{variant:"outline",size:"lg",className:"text-sm",onClick:f,children:["Add filter",c&&c.length>0&&h.jsx(Zr,{className:"text-xs font-normal text-white bg-primary/10 border border-primary/90 px-1.5 py-0.5",children:c.length})]})}),h.jsx("div",{className:"flex flex-col gap-4",children:c.length>0?c.map((T,N)=>h.jsxs("div",{className:"flex-1 flex h-9 gap-2",children:[h.jsxs(kn,{value:T.columnName,onValueChange:M=>v(N,M),children:[h.jsx(Pn,{className:"w-full flex-1",children:h.jsx(zn,{placeholder:"Select column"})}),h.jsx(Ln,{children:r?.map(M=>h.jsx(He,{value:M.columnName,children:M.columnName},M.columnName))})]}),h.jsxs(kn,{value:T.operator,onValueChange:M=>x(N,M),children:[h.jsx(Pn,{children:h.jsx(zn,{placeholder:"Op"})}),h.jsxs(Ln,{children:[h.jsx(He,{value:"=",children:"="}),h.jsx(He,{value:"!=",children:"!="}),h.jsx(He,{value:">",children:">"}),h.jsx(He,{value:">=",children:">="}),h.jsx(He,{value:"<",children:"<"}),h.jsx(He,{value:"<=",children:"<="}),h.jsx(He,{value:"is",children:"is"}),h.jsx(He,{value:"is not",children:"is not"}),h.jsx(He,{value:"like",children:"like"}),h.jsx(He,{value:"not like",children:"not like"}),h.jsx(He,{value:"ilike",children:"ilike"}),h.jsx(He,{value:"not ilike",children:"not ilike"})]})]}),h.jsx(wn,{type:"text",placeholder:"Value",value:T.value,onChange:M=>p(N,M.target.value)}),h.jsx(ze,{variant:"ghost",size:"icon",className:"text-xs",onClick:()=>m(N),children:h.jsx(Hi,{className:"size-4"})})]},N)):h.jsx("div",{className:"flex-1 flex h-9 gap-2 items-center justify-center",children:h.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"No filters applied"})})}),h.jsxs("div",{className:"gap-2 flex justify-end",children:[h.jsx(ze,{variant:"outline",size:"lg",className:"text-sm",onClick:S,children:"Reset"}),h.jsx(ze,{variant:"default",size:"lg",className:"text-sm",onClick:_,children:"Apply"})]})]})]})};function Pq({className:e,...t}){return h.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:h.jsx("table",{"data-slot":"table",className:fe("w-full caption-bottom text-xs",e),...t})})}function Lq({className:e,...t}){return h.jsx("thead",{"data-slot":"table-header",className:fe("[&_tr]:border-b",e),...t})}function Fq({className:e,...t}){return h.jsx("tbody",{"data-slot":"table-body",className:fe("[&_tr:last-child]:border-0",e),...t})}function Tp({className:e,...t}){return h.jsx("tr",{"data-slot":"table-row",className:fe("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Iq({className:e,...t}){return h.jsx("th",{"data-slot":"table-head",className:fe("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}function d1({className:e,...t}){return h.jsx("td",{"data-slot":"table-cell",className:fe("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}function Vq({className:e,size:t="default",...n}){return h.jsx(L6,{"data-slot":"switch","data-size":t,className:fe("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-[16.6px] data-[size=default]:w-[28px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:h.jsx(F6,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}const $q=({tableName:e})=>{const{tableCols:t}=Bo(e),[n,r]=Ae(we.REFERENCED_TABLE_STATE_KEYS.SORT,Di(C=>C).withDefault([]).withOptions({history:"push"})),[s,l]=b.useState(!1),[c,d]=b.useState([]),f=()=>{const C=t?.[0]?.columnName??"";d([...c,{columnName:C,direction:"asc"}])},m=C=>{d(c.filter((T,N)=>N!==C))},v=(C,T)=>{d(c.map((N,M)=>M===C?{...N,columnName:T}:N))},p=(C,T)=>{d(c.map((N,M)=>M===C?{...N,direction:T}:N))},x=()=>{d([]),r([]),l(!1)},S=()=>{const C=c.filter(T=>T.columnName);r(C),l(!1)},_=n.length>0,w=C=>{C&&d(n),l(C)};return h.jsxs(za,{open:s,onOpenChange:w,children:[h.jsx(Gi,{asChild:!0,children:h.jsxs(ze,{variant:"ghost",className:"border-r border-l-0 border-y-0 border-zinc-800 rounded-none text-xs h-full",children:[h.jsx(FI,{className:"size-4"}),"Sort",_&&h.jsx(Zr,{className:"text-[10px] font-normal text-white bg-primary/10 border border-primary/90 px-1.5 py-0.5",children:n.length})]})}),h.jsxs(Pa,{className:"w-md space-y-2",align:"start",children:[h.jsx("div",{className:"flex items-center gap-4",children:h.jsxs(ze,{variant:"outline",size:"lg",className:"text-sm",onClick:f,children:["Add sort",c&&c.length>0&&h.jsx(Zr,{className:"text-xs font-normal text-white bg-primary/10 border border-primary/90 px-1.5 py-0.5",children:c.length})]})}),h.jsx("div",{className:"flex flex-col gap-4",children:c.length>0?c.map((C,T)=>h.jsxs("div",{className:"flex-1 flex h-9 gap-2 items-center",children:[h.jsxs(kn,{value:C.columnName,onValueChange:N=>v(T,N),children:[h.jsx(Pn,{className:"w-full flex-1",children:h.jsx(zn,{placeholder:"Select column"})}),h.jsx(Ln,{children:t?.map(N=>h.jsx(He,{value:N.columnName,children:N.columnName},N.columnName))})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(jn,{htmlFor:`sort-direction-${T}`,children:"Asc"}),h.jsx(Vq,{id:`sort-direction-${T}`,checked:C.direction==="desc",onCheckedChange:N=>p(T,N?"desc":"asc")}),h.jsx(jn,{htmlFor:`sort-direction-${T}`,children:"Desc"})]}),h.jsx(ze,{variant:"ghost",size:"icon",className:"text-xs",onClick:()=>m(T),children:h.jsx(Hi,{className:"size-4"})})]},T)):h.jsx("div",{className:"flex-1 flex h-9 gap-2 items-center justify-center",children:h.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"No sorts applied"})})}),h.jsxs("div",{className:"gap-2 flex justify-end",children:[h.jsx(ze,{variant:"outline",size:"lg",className:"text-sm",onClick:x,children:"Reset"}),h.jsx(ze,{variant:"default",size:"lg",className:"text-sm",onClick:S,children:"Apply"})]})]})]})},Uq=({tableName:e,referencedColumn:t,columnName:n})=>{const{setValue:r}=Bt(),{closeSheet:s}=jr(),{tableCols:l,isLoadingTableCols:c}=Bo(e),[d,f]=Ae(we.REFERENCED_TABLE_STATE_KEYS.ACTIVE_TABLE),{tableData:m,isLoadingTableData:v}=gf(!0),[p,x]=Ae(we.REFERENCED_TABLE_STATE_KEYS.PAGE.toString()),[S,_]=Ae(we.REFERENCED_TABLE_STATE_KEYS.LIMIT.toString());b.useEffect(()=>{e&&d!==e&&f(e),e&&!p&&x(we.REFERENCED_TABLE_STATE_KEYS.DEFAULT_PAGE.toString()),e&&!S&&_(we.REFERENCED_TABLE_STATE_KEYS.DEFAULT_LIMIT.toString())},[e,d,p,S,f,x,_]);const w=m?.meta?.totalPages??0,C=R=>{x(R.toString())},T=b.useMemo(()=>l?.map(R=>({id:R.columnName,accessorKey:R.columnName,header:R.columnName,cell:({row:j})=>h.jsx("div",{className:"font-medium max-w-[200px] truncate",children:j.getValue(R.columnName)})}))??[],[l]),N=OT({columns:T??[],data:m?.data??[],getCoreRowModel:MT()}),M=R=>{console.log(R.original[t??""]),r(n??"",R.original[t??""]),s("record-reference")};return c||v?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(ay,{size:"size-8"})}):h.jsxs("div",{children:[h.jsxs("div",{className:"sticky top-0 left-0 right-0 h-8 border-b border-zinc-800 w-full flex items-center justify-between bg-background z-50",children:[h.jsxs("div",{className:"flex items-center h-full",children:[h.jsx(zq,{tableName:e}),h.jsx($q,{tableName:e})]}),h.jsxs("div",{className:"flex items-center h-full",children:[h.jsx(ze,{variant:"ghost",size:"icon",className:"border-l border-r-0 border-y-0 border-zinc-800 rounded-none text-xs h-full aspect-square size-8",onClick:()=>C(Number(p)-1),disabled:Number(p)<=1,children:h.jsx(rF,{className:"size-3"})}),h.jsx(ze,{variant:"ghost",size:"icon",className:"border-r border-l border-y-0 border-zinc-800 rounded-none text-xs h-full aspect-square size-8",onClick:()=>C(Number(p)+1),disabled:Number(p)>=w,children:h.jsx(w2,{className:"size-3"})})]})]}),h.jsxs(Pq,{children:[h.jsx(Lq,{children:N.getHeaderGroups().map(R=>h.jsx(Tp,{className:"hover:bg-transparent text-xs sticky top-0 right-0 left-0",children:R.headers.map(j=>h.jsx(Iq,{className:"border-r border-zinc-800",children:j.isPlaceholder?null:cc(j.column.columnDef.header,j.getContext())},j.id))},R.id))}),h.jsx(Fq,{children:N.getRowModel().rows?.length?N.getRowModel().rows.map(R=>h.jsx(Tp,{className:"text-xs cursor-pointer",onClick:()=>M(R),children:R.getVisibleCells().map(j=>h.jsx(d1,{className:"border-r border-zinc-800",children:cc(j.column.columnDef.cell,j.getContext())},j.id))},R.id)):h.jsx(Tp,{children:h.jsx(d1,{className:"h-24 text-center",colSpan:T.length,children:"No results."})})})]})]})},Bq=()=>{const[,e]=Ae(we.REFERENCED_TABLE_STATE_KEYS.ACTIVE_TABLE),[,t]=Ae(we.REFERENCED_TABLE_STATE_KEYS.PAGE),[,n]=Ae(we.REFERENCED_TABLE_STATE_KEYS.LIMIT.toString()),[,r]=Ae(we.REFERENCED_TABLE_STATE_KEYS.SORT.toString()),[,s]=Ae(we.REFERENCED_TABLE_STATE_KEYS.ORDER.toString()),[,l]=Ae(we.REFERENCED_TABLE_STATE_KEYS.FILTERS,Di(m=>m).withDefault([]).withOptions({history:"push"})),{closeSheet:c,isSheetOpen:d,recordReferenceData:f}=jr();return!f.tableName||!f.referencedColumn?null:h.jsx(qv,{title:`View records in the table ${f.tableName}`,size:"max-w-lg!",contentClassName:"p-0",open:d("record-reference"),onOpenChange:m=>{m||(c("record-reference"),e(null),t(null),n(null),r(null),s(null),l(null))},children:h.jsx(Uq,{tableName:f.tableName,referencedColumn:f.referencedColumn??null,columnName:f.columnName??""})})},Hq=()=>{const e=Yi(),[t]=Ae(we.ACTIVE_TABLE),{closeSheet:n}=jr(),{mutateAsync:r,isPending:s}=hf({mutationFn:async c=>{console.log("payload",c);const d=await fetch(`${Ss}/records`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tableName:t,...c})});if(!d.ok){const f=await d.json();throw new Error(f.message||"Failed to create record")}return d.json()},onSuccess:async c=>{await Promise.all([e.invalidateQueries({queryKey:[we.CACHE_KEYS.TABLE_DATA,t],exact:!1}),e.invalidateQueries({queryKey:[we.CACHE_KEYS.TABLES_LIST]})]),n("add-record"),console.log("Record created successfully:",c)},onError:c=>{console.error("Error creating record:",c)}});return{createRecord:async(c,d)=>at.promise(r(c,d),{loading:"Creating record...",success:f=>f.message||"Record created successfully",error:f=>f.detail||f.message||"Failed to create record"}),isCreatingRecord:s}},qq=()=>{const{closeSheet:e,isSheetOpen:t}=jr(),[n]=Ae(we.ACTIVE_TABLE),{tableCols:r,isLoadingTableCols:s}=Bo(),{createRecord:l,isCreatingRecord:c}=Hq(),d=j1(),f=async p=>{console.log(p),l(p,{onSuccess:()=>{d.reset(),e("add-record")},onError:x=>{console.error("Failed to create record:",x)}})},m=p=>{console.log(p)},v=()=>{d.reset(),e("add-record")};return console.log(r),h.jsx(qv,{title:`Add a new record to the table: ${n}`,open:t("add-record"),onOpenChange:p=>{p||v()},children:h.jsxs(C1,{...d,children:[h.jsxs("form",{onSubmit:d.handleSubmit(f,m),className:"flex flex-col h-full",children:[h.jsx("div",{className:"space-y-6",children:r&&r.length>0&&!s?r.map(p=>h.jsx(kq,{...p},p.columnName)):null}),h.jsxs("div",{className:"flex justify-end gap-2 py-6",children:[h.jsx(AV,{asChild:!0,onClick:v,disabled:c,children:h.jsx(ze,{variant:"outline",size:"lg",children:"Close"})}),h.jsx(ze,{type:"submit",size:"lg",disabled:c,children:"Save"})]})]}),h.jsx(Bq,{})]})})},Yq=()=>{const[e]=Ae(we.ACTIVE_TAB);switch(e){case"table":return h.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsx(Dq,{}),h.jsx(qq,{})]});case"indexes":return h.jsx(vi,{tab:e});case"runner":return h.jsx(vi,{tab:e});case"logs":return h.jsx(vi,{tab:e});case"visualizer":return h.jsx(vi,{tab:e});case"schema":return h.jsx(vi,{tab:e});case"assistant":return h.jsx(vi,{tab:e});default:return h.jsx("main",{className:"flex-1 flex items-center justify-center",children:h.jsx("h1",{children:"Select a table to view"})})}},vi=({tab:e})=>(console.log(e),h.jsx("main",{className:"flex-1 flex items-center justify-center",children:h.jsxs("h1",{children:[e," will be available soon!"]})})),Gq=()=>{const{sidebar:{isPinned:e},toggleSidebarPinned:t}=Cs();return h.jsx("div",{className:"flex items-center justify-between h-9 border-b border-zinc-800",children:h.jsx(ze,{variant:"ghost",size:"lg",onClick:t,className:"size-9 flex items-center justify-center transition hover:bg-transparent!",title:e?"Unpin sidebar":"Pin sidebar",children:e?h.jsx(MV,{className:"size-4"}):h.jsx(mV,{className:"size-4"})})})},Kq=({tableName:e,rowCount:t})=>{const[n,r]=Ae(we.ACTIVE_TAB),[s,l]=Ae(we.ACTIVE_TABLE),[,c]=Ae(we.TABLE_STATE_KEYS.FILTERS),[,d]=Ae(we.COLUMN_NAME),[,f]=Ae(we.TABLE_STATE_KEYS.SORT),[,m]=Ae(we.TABLE_STATE_KEYS.ORDER),v=()=>{n||r("table"),l(e),c(null),d(null),f(null),m(null)};return h.jsx("li",{className:"relative",children:h.jsxs("button",{type:"button",onClick:v,className:fe("w-full flex gap-0.5 px-4 py-1.5 text-sm transition-colors text-left","hover:text-zinc-100 focus:outline-none focus:bg-accent/10 focus:text-zinc-100 justify-start items-center",s===e?"text-white bg-zinc-800/50":"text-zinc-400"),children:[s===e&&h.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-accent"}),h.jsx("span",{className:"flex-1",children:e}),h.jsx(Zr,{children:t}),h.jsxs($v,{children:[h.jsx(Uv,{asChild:!0,children:h.jsx(ze,{variant:"ghost",size:"icon-sm",children:h.jsx(eV,{})})}),h.jsx(Bv,{className:"w-56",align:"start",children:h.jsxs(cT,{children:[h.jsxs($r,{children:[h.jsx(xw,{className:"size-4"}),"Copy name"]}),h.jsxs($r,{children:[h.jsx(xw,{className:"size-4"}),"Copy scheme"]}),h.jsx(hg,{}),h.jsxs($r,{children:[h.jsx(rV,{className:"size-4"}),"Edit table name"]}),h.jsxs(mU,{children:[h.jsxs(pU,{children:[h.jsx(rp,{className:"size-4"}),"Export data"]}),h.jsx(hU,{children:h.jsxs(gU,{children:[h.jsxs($r,{children:[h.jsx(rp,{className:"size-4"}),"Export as CSV"]}),h.jsxs($r,{children:[h.jsx(rp,{className:"size-4"}),"Export as JSON"]}),h.jsxs($r,{children:[h.jsx(aV,{className:"size-4"}),"Export as Excel"]})]})})]}),h.jsx(hg,{}),h.jsxs($r,{variant:"destructive",children:[h.jsx(O2,{className:"size-4"}),"Delete table"]})]})})]})]})})},Zq=()=>{const[e]=Ae(we.SIDEBAR_TABLE_SEARCH,{shallow:!0,defaultValue:""}),{tablesList:t=[],isLoadingTablesList:n,errorTablesList:r}=Vv(),s=t?.filter(l=>l.tableName.toLowerCase().includes(e.toLowerCase()));return n?h.jsx("div",{className:"flex-1 h-full overflow-y-auto pb-3 h-full flex items-center justify-center",children:h.jsx(ay,{size:"size-6"})}):r?h.jsxs("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:["Error: ",r.message]}):h.jsx("div",{className:"flex-1 overflow-y-auto pb-3",children:s&&s.length>0?h.jsx("ul",{children:s?.map(l=>h.jsx(Kq,{tableName:l.tableName,rowCount:l.rowCount},l.tableName))}):e?h.jsx("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables found matching"}):h.jsx("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables available"})})},Wq=()=>{const e=b.useRef(null),[t,n]=Ae(we.SIDEBAR_TABLE_SEARCH,{shallow:!0,defaultValue:""}),{openSheet:r}=jr();return Na("/",s=>{s.preventDefault(),e.current&&e.current.focus()},{preventDefault:!0}),h.jsxs("div",{className:"p-3 space-y-2",children:[h.jsxs(ze,{className:"w-full justify-start h-8",onClick:()=>r("add-table"),children:[h.jsx(gV,{className:"size-4"}),"Add Table"]}),h.jsxs("div",{className:"relative",children:[h.jsx(M2,{className:"absolute left-2 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),h.jsx(wn,{ref:e,placeholder:"Search tables",value:t,onChange:s=>n(s.target.value),className:"rounded-sm h-8 pl-8 pr-8"}),h.jsx(Zr,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]})]})},Qq=({children:e})=>{const{sidebar:{width:t,isOpen:n,isPinned:r},setSidebarWidth:s,setSidebarOpen:l}=Cs(),c=b.useRef(!1),d=b.useRef(0),f=b.useRef(0),m=b.useRef(null),v=b.useRef(null),p=b.useCallback(N=>{c.current&&requestAnimationFrame(()=>{const M=N.clientX-d.current,R=f.current+M;s(R)})},[s]),x=b.useCallback(()=>{c.current=!1,document.body.style.cursor="",document.body.style.userSelect="";const N=document.getElementById("resize-overlay");N&&N.remove()},[]),S=b.useCallback(N=>{N.preventDefault(),c.current=!0,d.current=N.clientX,f.current=t,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const M=document.createElement("div");M.id="resize-overlay",M.style.cssText="position:fixed;inset:0;z-index:9999;cursor:col-resize;",document.body.appendChild(M)},[t]),_=b.useCallback(()=>{r||l(!0)},[r,l]),w=b.useCallback(()=>{r||l(!1)},[r,l]),C=b.useCallback(N=>{r||n||c.current||(N.clientX<=we.HOVER_ZONE?(m.current&&clearTimeout(m.current),m.current=window.setTimeout(()=>{l(!0)},we.HOVER_DELAY)):N.clientX>we.HOVER_ZONE+50&&m.current&&clearTimeout(m.current))},[r,n,l]),T=N=>{r||l(N)};return b.useEffect(()=>(document.addEventListener("mousemove",p),document.addEventListener("mouseup",x),document.addEventListener("mousemove",C),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",x),document.removeEventListener("mousemove",C),m.current&&clearTimeout(m.current)}),[p,x,C]),b.useEffect(()=>{const N=v.current;if(N)return N.addEventListener("mouseenter",_),N.addEventListener("mouseleave",w),()=>{N.removeEventListener("mouseenter",_),N.removeEventListener("mouseleave",w)}},[_,w]),h.jsxs(Tv,{open:n,onOpenChange:T,modal:!1,children:[h.jsx(OV,{className:"sr-only",children:"Open Sidebar"}),h.jsx(Nv,{ref:v,side:"left",showCloseButton:!1,isPinned:r,className:fe("bg-black border-r border-zinc-800 p-0","transition-transform duration-300 ease-out"),style:{width:`${t}px`},children:h.jsxs("div",{className:"relative h-full flex flex-col",children:[e,h.jsx("div",{role:"button",tabIndex:0,onMouseDown:S,className:fe("absolute top-0 right-0 w-2 h-full cursor-col-resize z-50","hover:bg-blue-500/50 transition-colors group"),title:"Drag to resize",children:h.jsx("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 w-2 h-12 bg-blue-500 opacity-0 group-hover:opacity-100 transition-opacity rounded-full"})})]})})]})};function Xq({className:e,children:t,...n}){return h.jsxs(LP,{"data-slot":"scroll-area",className:fe("relative",e),...n,children:[h.jsx(FP,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),h.jsx(Jq,{}),h.jsx(IP,{})]})}function Jq({className:e,orientation:t="vertical",...n}){return h.jsx(hE,{"data-slot":"scroll-area-scrollbar",orientation:t,className:fe("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:h.jsx(vE,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const eY=()=>h.jsxs(Qq,{children:[h.jsx(Gq,{}),h.jsx(Wq,{}),h.jsx(Xq,{className:"flex-1 overflow-y-auto pb-3 block h-full w-full",children:h.jsx(Zq,{})})]});function tY(){const e=Cs(t=>t.theme);b.useEffect(()=>{const t=window.document.documentElement;if(t.classList.remove("light","dark"),e==="system"){const n=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";t.classList.add(n);return}t.classList.add(e)},[e])}function nY(){tY();const{sidebar:{isPinned:e,width:t}}=Cs();return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"bg-zinc-950 w-dvw flex h-dvh max-h-dvh overflow-hidden relative",children:[h.jsx(eY,{}),h.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden ",style:{marginLeft:e?`${t}px`:"0"},children:[h.jsx(fB,{}),h.jsx(Yq,{})]}),h.jsx(cB,{})]}),h.jsx(B8,{})]})}const rY=()=>null;var oY=(e,t,n,r,s,l,c,d)=>{let f=document.documentElement,m=["light","dark"];function v(S){(Array.isArray(e)?e:[e]).forEach(_=>{let w=_==="class",C=w&&l?s.map(T=>l[T]||T):s;w?(f.classList.remove(...C),f.classList.add(l&&l[S]?l[S]:S)):f.setAttribute(_,S)}),p(S)}function p(S){d&&m.includes(S)&&(f.style.colorScheme=S)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)v(r);else try{let S=localStorage.getItem(t)||n,_=c&&S==="system"?x():S;v(_)}catch{}},aY=b.createContext(void 0),sY={setTheme:e=>{},themes:[]},iY=()=>{var e;return(e=b.useContext(aY))!=null?e:sY};b.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:l,value:c,themes:d,nonce:f,scriptProps:m})=>{let v=JSON.stringify([n,t,l,e,d,c,r,s]).slice(1,-1);return b.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${oY.toString()})(${v})`}})});const lY=({...e})=>{const{theme:t="system"}=iY();return h.jsx(uk,{theme:t,className:"toaster group",icons:{success:h.jsx(QI,{className:"size-4 text-emerald-500"}),info:h.jsx(lV,{className:"size-4 text-blue-500"}),warning:h.jsx(jI,{className:"size-4 text-amber-500"}),error:h.jsx(OI,{className:"size-4 text-red-500"}),loading:h.jsx(fV,{className:"size-4 animate-spin text-blue-500"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})};var cY=function(){return null};let Np;const f1=()=>new d$({defaultOptions:{queries:{staleTime:30*1e3,gcTime:300*1e3,retry:1,retryDelay:e=>Math.min(1e3*2**e,3e4),refetchOnWindowFocus:!0,refetchOnMount:!0,refetchOnReconnect:!0},mutations:{retry:1,retryDelay:1e3},dehydrate:{shouldDehydrateQuery:e=>QV(e)||e.state.status==="pending"}}}),uY=()=>typeof window>"u"?f1():(Np||(Np=f1()),Np),dY=({children:e})=>{const t=uY();return h.jsxs(f$,{client:t,children:[e,h.jsx(cY,{initialIsOpen:!1,buttonPosition:"bottom-left"})]})};aO.createRoot(document.getElementById("root")).render(h.jsxs(b.StrictMode,{children:[h.jsx(JM,{fullPageNavigationOnShallowFalseUpdates:!0,defaultOptions:{shallow:!0},children:h.jsx(dY,{children:h.jsx(nY,{})})}),h.jsx(lY,{position:"top-center"}),h.jsx(rY,{})]}));