Files
tablero-cdc/dist/assets/index-ZKG15NE5.js
T

349 lines
678 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function FC(e,t){for(var a=0;a<t.length;a++){const s=t[a];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(s,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>s[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function a(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=a(o);fetch(o.href,c)}})();function q0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ah={exports:{}},bo={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Zy;function YC(){if(Zy)return bo;Zy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:s,key:u,ref:o!==void 0?o:null,props:c}}return bo.Fragment=t,bo.jsx=a,bo.jsxs=a,bo}var eb;function WC(){return eb||(eb=1,ah.exports=YC()),ah.exports}var b=WC(),sh={exports:{}},Ce={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var tb;function XC(){if(tb)return Ce;tb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function S(k){return k===null||typeof k!="object"?null:(k=x&&k[x]||k["@@iterator"],typeof k=="function"?k:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,R={};function T(k,I,D){this.props=k,this.context=I,this.refs=R,this.updater=D||_}T.prototype.isReactComponent={},T.prototype.setState=function(k,I){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,I,"setState")},T.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function A(){}A.prototype=T.prototype;function N(k,I,D){this.props=k,this.context=I,this.refs=R,this.updater=D||_}var L=N.prototype=new A;L.constructor=N,E(L,T.prototype),L.isPureReactComponent=!0;var G=Array.isArray;function V(){}var P={H:null,A:null,T:null,S:null},q=Object.prototype.hasOwnProperty;function re(k,I,D){var Y=D.ref;return{$$typeof:e,type:k,key:I,ref:Y!==void 0?Y:null,props:D}}function me(k,I){return re(k.type,I,k.props)}function ye(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function oe(k){var I={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(D){return I[D]})}var de=/\/+/g;function ge(k,I){return typeof k=="object"&&k!==null&&k.key!=null?oe(""+k.key):I.toString(36)}function fe(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(V,V):(k.status="pending",k.then(function(I){k.status==="pending"&&(k.status="fulfilled",k.value=I)},function(I){k.status==="pending"&&(k.status="rejected",k.reason=I)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function j(k,I,D,Y,Q){var ne=typeof k;(ne==="undefined"||ne==="boolean")&&(k=null);var te=!1;if(k===null)te=!0;else switch(ne){case"bigint":case"string":case"number":te=!0;break;case"object":switch(k.$$typeof){case e:case t:te=!0;break;case v:return te=k._init,j(te(k._payload),I,D,Y,Q)}}if(te)return Q=Q(k),te=Y===""?"."+ge(k,0):Y,G(Q)?(D="",te!=null&&(D=te.replace(de,"$&/")+"/"),j(Q,I,D,"",function(Te){return Te})):Q!=null&&(ye(Q)&&(Q=me(Q,D+(Q.key==null||k&&k.key===Q.key?"":(""+Q.key).replace(de,"$&/")+"/")+te)),I.push(Q)),1;te=0;var se=Y===""?".":Y+":";if(G(k))for(var ie=0;ie<k.length;ie++)Y=k[ie],ne=se+ge(Y,ie),te+=j(Y,I,D,ne,Q);else if(ie=S(k),typeof ie=="function")for(k=ie.call(k),ie=0;!(Y=k.next()).done;)Y=Y.value,ne=se+ge(Y,ie++),te+=j(Y,I,D,ne,Q);else if(ne==="object"){if(typeof k.then=="function")return j(fe(k),I,D,Y,Q);throw I=String(k),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return te}function F(k,I,D){if(k==null)return k;var Y=[],Q=0;return j(k,Y,"","",function(ne){return I.call(D,ne,Q++)}),Y}function J(k){if(k._status===-1){var I=k._result;I=I(),I.then(function(D){(k._status===0||k._status===-1)&&(k._status=1,k._result=D)},function(D){(k._status===0||k._status===-1)&&(k._status=2,k._result=D)}),k._status===-1&&(k._status=0,k._result=I)}if(k._status===1)return k._result.default;throw k._result}var ee=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},H={map:F,forEach:function(k,I,D){F(k,function(){I.apply(this,arguments)},D)},count:function(k){var I=0;return F(k,function(){I++}),I},toArray:function(k){return F(k,function(I){return I})||[]},only:function(k){if(!ye(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ce.Activity=g,Ce.Children=H,Ce.Component=T,Ce.Fragment=a,Ce.Profiler=o,Ce.PureComponent=N,Ce.StrictMode=s,Ce.Suspense=h,Ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,Ce.__COMPILER_RUNTIME={__proto__:null,c:function(k){return P.H.useMemoCache(k)}},Ce.cache=function(k){return function(){return k.apply(null,arguments)}},Ce.cacheSignal=function(){return null},Ce.cloneElement=function(k,I,D){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var Y=E({},k.props),Q=k.key;if(I!=null)for(ne in I.key!==void 0&&(Q=""+I.key),I)!q.call(I,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&I.ref===void 0||(Y[ne]=I[ne]);var ne=arguments.length-2;if(ne===1)Y.children=D;else if(1<ne){for(var te=Array(ne),se=0;se<ne;se++)te[se]=arguments[se+2];Y.children=te}return re(k.type,Q,Y)},Ce.createContext=function(k){return k={$$typeof:u,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:c,_context:k},k},Ce.createElement=function(k,I,D){var Y,Q={},ne=null;if(I!=null)for(Y in I.key!==void 0&&(ne=""+I.key),I)q.call(I,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(Q[Y]=I[Y]);var te=arguments.length-2;if(te===1)Q.children=D;else if(1<te){for(var se=Array(te),ie=0;ie<te;ie++)se[ie]=arguments[ie+2];Q.children=se}if(k&&k.defaultProps)for(Y in te=k.defaultProps,te)Q[Y]===void 0&&(Q[Y]=te[Y]);return re(k,ne,Q)},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(k){return{$$typeof:d,render:k}},Ce.isValidElement=ye,Ce.lazy=function(k){return{$$typeof:v,_payload:{_status:-1,_result:k},_init:J}},Ce.memo=function(k,I){return{$$typeof:p,type:k,compare:I===void 0?null:I}},Ce.startTransition=function(k){var I=P.T,D={};P.T=D;try{var Y=k(),Q=P.S;Q!==null&&Q(D,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(V,ee)}catch(ne){ee(ne)}finally{I!==null&&D.types!==null&&(I.types=D.types),P.T=I}},Ce.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},Ce.use=function(k){return P.H.use(k)},Ce.useActionState=function(k,I,D){return P.H.useActionState(k,I,D)},Ce.useCallback=function(k,I){return P.H.useCallback(k,I)},Ce.useContext=function(k){return P.H.useContext(k)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(k,I){return P.H.useDeferredValue(k,I)},Ce.useEffect=function(k,I){return P.H.useEffect(k,I)},Ce.useEffectEvent=function(k){return P.H.useEffectEvent(k)},Ce.useId=function(){return P.H.useId()},Ce.useImperativeHandle=function(k,I,D){return P.H.useImperativeHandle(k,I,D)},Ce.useInsertionEffect=function(k,I){return P.H.useInsertionEffect(k,I)},Ce.useLayoutEffect=function(k,I){return P.H.useLayoutEffect(k,I)},Ce.useMemo=function(k,I){return P.H.useMemo(k,I)},Ce.useOptimistic=function(k,I){return P.H.useOptimistic(k,I)},Ce.useReducer=function(k,I,D){return P.H.useReducer(k,I,D)},Ce.useRef=function(k){return P.H.useRef(k)},Ce.useState=function(k){return P.H.useState(k)},Ce.useSyncExternalStore=function(k,I,D){return P.H.useSyncExternalStore(k,I,D)},Ce.useTransition=function(){return P.H.useTransition()},Ce.version="19.2.6",Ce}var nb;function bu(){return nb||(nb=1,sh.exports=XC()),sh.exports}var y=bu();const ae=q0(y),hm=FC({__proto__:null,default:ae},[y]);var ih={exports:{}},wo={},oh={exports:{}},lh={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var rb;function JC(){return rb||(rb=1,(function(e){function t(j,F){var J=j.length;j.push(F);e:for(;0<J;){var ee=J-1>>>1,H=j[ee];if(0<o(H,F))j[ee]=F,j[J]=H,J=ee;else break e}}function a(j){return j.length===0?null:j[0]}function s(j){if(j.length===0)return null;var F=j[0],J=j.pop();if(J!==F){j[0]=J;e:for(var ee=0,H=j.length,k=H>>>1;ee<k;){var I=2*(ee+1)-1,D=j[I],Y=I+1,Q=j[Y];if(0>o(D,J))Y<H&&0>o(Q,D)?(j[ee]=Q,j[Y]=J,ee=Y):(j[ee]=D,j[I]=J,ee=I);else if(Y<H&&0>o(Q,J))j[ee]=Q,j[Y]=J,ee=Y;else break e}}return F}function o(j,F){var J=j.sortIndex-F.sortIndex;return J!==0?J:j.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],v=1,g=null,x=3,S=!1,_=!1,E=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function L(j){for(var F=a(p);F!==null;){if(F.callback===null)s(p);else if(F.startTime<=j)s(p),F.sortIndex=F.expirationTime,t(h,F);else break;F=a(p)}}function G(j){if(E=!1,L(j),!_)if(a(h)!==null)_=!0,V||(V=!0,oe());else{var F=a(p);F!==null&&fe(G,F.startTime-j)}}var V=!1,P=-1,q=5,re=-1;function me(){return R?!0:!(e.unstable_now()-re<q)}function ye(){if(R=!1,V){var j=e.unstable_now();re=j;var F=!0;try{e:{_=!1,E&&(E=!1,A(P),P=-1),S=!0;var J=x;try{t:{for(L(j),g=a(h);g!==null&&!(g.expirationTime>j&&me());){var ee=g.callback;if(typeof ee=="function"){g.callback=null,x=g.priorityLevel;var H=ee(g.expirationTime<=j);if(j=e.unstable_now(),typeof H=="function"){g.callback=H,L(j),F=!0;break t}g===a(h)&&s(h),L(j)}else s(h);g=a(h)}if(g!==null)F=!0;else{var k=a(p);k!==null&&fe(G,k.startTime-j),F=!1}}break e}finally{g=null,x=J,S=!1}F=void 0}}finally{F?oe():V=!1}}}var oe;if(typeof N=="function")oe=function(){N(ye)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,ge=de.port2;de.port1.onmessage=ye,oe=function(){ge.postMessage(null)}}else oe=function(){T(ye,0)};function fe(j,F){P=T(function(){j(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(j){switch(x){case 1:case 2:case 3:var F=3;break;default:F=x}var J=x;x=F;try{return j()}finally{x=J}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(j,F){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var J=x;x=j;try{return F()}finally{x=J}},e.unstable_scheduleCallback=function(j,F,J){var ee=e.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ee+J:ee):J=ee,j){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=J+H,j={id:v++,callback:F,priorityLevel:j,startTime:J,expirationTime:H,sortIndex:-1},J>ee?(j.sortIndex=J,t(p,j),a(h)===null&&j===a(p)&&(E?(A(P),P=-1):E=!0,fe(G,J-ee))):(j.sortIndex=H,t(h,j),_||S||(_=!0,V||(V=!0,oe()))),j},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(j){var F=x;return function(){var J=x;x=F;try{return j.apply(this,arguments)}finally{x=J}}}})(lh)),lh}var ab;function QC(){return ab||(ab=1,oh.exports=JC()),oh.exports}var ch={exports:{}},jt={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var sb;function ZC(){if(sb)return jt;sb=1;var e=bu();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,p,v){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:v}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,jt.createPortal=function(h,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(h,p,null,v)},jt.flushSync=function(h){var p=u.T,v=s.p;try{if(u.T=null,s.p=2,h)return h()}finally{u.T=p,s.p=v,s.d.f()}},jt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(h,p))},jt.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},jt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?s.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:S}):v==="script"&&s.d.X(h,{crossOrigin:g,integrity:x,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},jt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);s.d.M(h,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(h)},jt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin);s.d.L(h,v,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},jt.preloadModule=function(h,p){if(typeof h=="string")if(p){var v=d(p.as,p.crossOrigin);s.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(h)},jt.requestFormReset=function(h){s.d.r(h)},jt.unstable_batchedUpdates=function(h,p){return h(p)},jt.useFormState=function(h,p,v){return u.H.useFormState(h,p,v)},jt.useFormStatus=function(){return u.H.useHostTransitionStatus()},jt.version="19.2.6",jt}var ib;function G0(){if(ib)return ch.exports;ib=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(),ch.exports=ZC(),ch.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ob;function eT(){if(ob)return wo;ob=1;var e=QC(),t=bu(),a=G0();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var r=n,i=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(i=r.return),n=r.return;while(n)}return r.tag===3?i:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function d(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(s(188))}function p(n){var r=n.alternate;if(!r){if(r=c(n),r===null)throw Error(s(188));return r!==n?null:n}for(var i=n,l=r;;){var f=i.return;if(f===null)break;var m=f.alternate;if(m===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===i)return h(f),n;if(m===l)return h(f),r;m=m.sibling}throw Error(s(188))}if(i.return!==l.return)i=f,l=m;else{for(var w=!1,C=f.child;C;){if(C===i){w=!0,i=f,l=m;break}if(C===l){w=!0,l=f,i=m;break}C=C.sibling}if(!w){for(C=m.child;C;){if(C===i){w=!0,i=m,l=f;break}if(C===l){w=!0,l=m,i=f;break}C=C.sibling}if(!w)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?n:r}function v(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=v(n),r!==null)return r;n=n.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),N=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),ye=Symbol.iterator;function oe(n){return n===null||typeof n!="object"?null:(n=ye&&n[ye]||n["@@iterator"],typeof n=="function"?n:null)}var de=Symbol.for("react.client.reference");function ge(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===de?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case E:return"Fragment";case T:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case V:return"SuspenseList";case re:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case _:return"Portal";case N:return n.displayName||"Context";case A:return(n._context.displayName||"Context")+".Consumer";case L:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case P:return r=n.displayName||null,r!==null?r:ge(n.type)||"Memo";case q:r=n._payload,n=n._init;try{return ge(n(r))}catch{}}return null}var fe=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},ee=[],H=-1;function k(n){return{current:n}}function I(n){0>H||(n.current=ee[H],ee[H]=null,H--)}function D(n,r){H++,ee[H]=n.current,n.current=r}var Y=k(null),Q=k(null),ne=k(null),te=k(null);function se(n,r){switch(D(ne,r),D(Q,n),D(Y,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?Sy(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=Sy(r),n=_y(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}I(Y),D(Y,n)}function ie(){I(Y),I(Q),I(ne)}function Te(n){n.memoizedState!==null&&D(te,n);var r=Y.current,i=_y(r,n.type);r!==i&&(D(Q,n),D(Y,i))}function Re(n){Q.current===n&&(I(Y),I(Q)),te.current===n&&(I(te),po._currentValue=J)}var Ee,rt;function Fe(n){if(Ee===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);Ee=r&&r[1]||"",rt=-1<i.stack.indexOf(`
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Ee+n+rt}var Cn=!1;function un(n,r){if(!n||Cn)return"";Cn=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(K){var $=K}Reflect.construct(n,[],Z)}else{try{Z.call()}catch(K){$=K}n.call(Z.prototype)}}else{try{throw Error()}catch(K){$=K}(Z=n())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(K){if(K&&$&&typeof K.stack=="string")return[K.stack,$.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),w=m[0],C=m[1];if(w&&C){var O=w.split(`
`),B=C.split(`
`);for(f=l=0;l<O.length&&!O[l].includes("DetermineComponentFrameRoot");)l++;for(;f<B.length&&!B[f].includes("DetermineComponentFrameRoot");)f++;if(l===O.length||f===B.length)for(l=O.length-1,f=B.length-1;1<=l&&0<=f&&O[l]!==B[f];)f--;for(;1<=l&&0<=f;l--,f--)if(O[l]!==B[f]){if(l!==1||f!==1)do if(l--,f--,0>f||O[l]!==B[f]){var W=`
`+O[l].replace(" at new "," at ");return n.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",n.displayName)),W}while(1<=l&&0<=f);break}}}finally{Cn=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?Fe(i):""}function Jt(n,r){switch(n.tag){case 26:case 27:case 5:return Fe(n.type);case 16:return Fe("Lazy");case 13:return n.child!==r&&r!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return un(n.type,!1);case 11:return un(n.type.render,!1);case 1:return un(n.type,!0);case 31:return Fe("Activity");default:return""}}function _a(n){try{var r="",i=null;do r+=Jt(n,i),i=n,n=n.return;while(n);return r}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var vt=Object.prototype.hasOwnProperty,Ci=e.unstable_scheduleCallback,Ti=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,Pr=e.unstable_requestPaint,Dt=e.unstable_now,Vu=e.unstable_getCurrentPriorityLevel,Ea=e.unstable_ImmediatePriority,sl=e.unstable_UserBlockingPriority,Ca=e.unstable_NormalPriority,Ri=e.unstable_LowPriority,ar=e.unstable_IdlePriority,il=e.log,zr=e.unstable_setDisableYieldValue,Ta=null,Lt=null;function Tn(n){if(typeof il=="function"&&zr(n),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(Ta,n)}catch{}}var kt=Math.clz32?Math.clz32:In,Ku=Math.log,Ai=Math.LN2;function In(n){return n>>>=0,n===0?32:31-(Ku(n)/Ai|0)|0}var ls=256,cs=262144,Ra=4194304;function $n(n){var r=n&42;if(r!==0)return r;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function _e(n,r,i){var l=n.pendingLanes;if(l===0)return 0;var f=0,m=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var C=l&134217727;return C!==0?(l=C&~m,l!==0?f=$n(l):(w&=C,w!==0?f=$n(w):i||(i=C&~n,i!==0&&(f=$n(i))))):(C=l&~m,C!==0?f=$n(C):w!==0?f=$n(w):i||(i=l&~n,i!==0&&(f=$n(i)))),f===0?0:r!==0&&r!==f&&(r&m)===0&&(m=f&-f,i=r&-r,m>=i||m===32&&(i&4194048)!==0)?r:f}function Ze(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function yt(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Ot(){var n=Ra;return Ra<<=1,(Ra&62914560)===0&&(Ra=4194304),n}function Br(n){for(var r=[],i=0;31>i;i++)r.push(n);return r}function tt(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function zt(n,r,i,l,f,m){var w=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var C=n.entanglements,O=n.expirationTimes,B=n.hiddenUpdates;for(i=w&~i;0<i;){var W=31-kt(i),Z=1<<W;C[W]=0,O[W]=-1;var $=B[W];if($!==null)for(B[W]=null,W=0;W<$.length;W++){var K=$[W];K!==null&&(K.lane&=-536870913)}i&=~Z}l!==0&&Aa(n,l,0),m!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=m&~(w&~r))}function Aa(n,r,i){n.pendingLanes|=r,n.suspendedLanes&=~r;var l=31-kt(r);n.entangledLanes|=r,n.entanglements[l]=n.entanglements[l]|1073741824|i&261930}function Bt(n,r){var i=n.entangledLanes|=r;for(n=n.entanglements;i;){var l=31-kt(i),f=1<<l;f&r|n[l]&r&&(n[l]|=r),i&=~f}}function It(n,r){var i=r&-r;return i=(i&42)!==0?1:us(i),(i&(n.suspendedLanes|r))!==0?0:i}function us(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Rn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Fu(){var n=F.p;return n!==0?n:(n=window.event,n===void 0?32:Ky(n.type))}function lp(n,r){var i=F.p;try{return F.p=n,r()}finally{F.p=i}}var Ir=Math.random().toString(36).slice(2),_t="__reactFiber$"+Ir,$t="__reactProps$"+Ir,ds="__reactContainer$"+Ir,Yu="__reactEvents$"+Ir,UE="__reactListeners$"+Ir,PE="__reactHandles$"+Ir,cp="__reactResources$"+Ir,Ni="__reactMarker$"+Ir;function Wu(n){delete n[_t],delete n[$t],delete n[Yu],delete n[UE],delete n[PE]}function fs(n){var r=n[_t];if(r)return r;for(var i=n.parentNode;i;){if(r=i[ds]||i[_t]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(n=ky(n);n!==null;){if(i=n[_t])return i;n=ky(n)}return r}n=i,i=n.parentNode}return null}function hs(n){if(n=n[_t]||n[ds]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function ki(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function ms(n){var r=n[cp];return r||(r=n[cp]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function bt(n){n[Ni]=!0}var up=new Set,dp={};function Na(n,r){ps(n,r),ps(n+"Capture",r)}function ps(n,r){for(dp[n]=r,n=0;n<r.length;n++)up.add(r[n])}var zE=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]*$"),fp={},hp={};function BE(n){return vt.call(hp,n)?!0:vt.call(fp,n)?!1:zE.test(n)?hp[n]=!0:(fp[n]=!0,!1)}function ol(n,r,i){if(BE(r))if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+i)}}function ll(n,r,i){if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+i)}}function sr(n,r,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(r,i,""+l)}}function dn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function mp(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function IE(n,r,i){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,m=l.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return f.call(this)},set:function(w){i=""+w,m.call(this,w)}}),Object.defineProperty(n,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function Xu(n){if(!n._valueTracker){var r=mp(n)?"checked":"value";n._valueTracker=IE(n,r,""+n[r])}}function pp(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return n&&(l=mp(n)?n.checked?"true":"false":n.value),n=l,n!==i?(r.setValue(n),!0):!1}function cl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var $E=/[\n"\\]/g;function fn(n){return n.replace($E,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ju(n,r,i,l,f,m,w,C){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),r!=null?w==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+dn(r)):n.value!==""+dn(r)&&(n.value=""+dn(r)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),r!=null?Qu(n,w,dn(r)):i!=null?Qu(n,w,dn(i)):l!=null&&n.removeAttribute("value"),f==null&&m!=null&&(n.defaultChecked=!!m),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.name=""+dn(C):n.removeAttribute("name")}function gp(n,r,i,l,f,m,w,C){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(n.type=m),r!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){Xu(n);return}i=i!=null?""+dn(i):"",r=r!=null?""+dn(r):i,C||r===n.value||(n.value=r),n.defaultValue=r}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=C?n.checked:!!l,n.defaultChecked=!!l,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),Xu(n)}function Qu(n,r,i){r==="number"&&cl(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function gs(n,r,i,l){if(n=n.options,r){r={};for(var f=0;f<i.length;f++)r["$"+i[f]]=!0;for(i=0;i<n.length;i++)f=r.hasOwnProperty("$"+n[i].value),n[i].selected!==f&&(n[i].selected=f),f&&l&&(n[i].defaultSelected=!0)}else{for(i=""+dn(i),r=null,f=0;f<n.length;f++){if(n[f].value===i){n[f].selected=!0,l&&(n[f].defaultSelected=!0);return}r!==null||n[f].disabled||(r=n[f])}r!==null&&(r.selected=!0)}}function vp(n,r,i){if(r!=null&&(r=""+dn(r),r!==n.value&&(n.value=r),i==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=i!=null?""+dn(i):""}function yp(n,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(s(92));if(fe(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i==null&&(i=""),r=i}i=dn(r),n.defaultValue=i,l=n.textContent,l===i&&l!==""&&l!==null&&(n.value=l),Xu(n)}function vs(n,r){if(r){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=r;return}}n.textContent=r}var HE=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 bp(n,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":l?n.setProperty(r,i):typeof i!="number"||i===0||HE.has(r)?r==="float"?n.cssFloat=i:n[r]=(""+i).trim():n[r]=i+"px"}function wp(n,r,i){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="");for(var f in r)l=r[f],r.hasOwnProperty(f)&&i[f]!==l&&bp(n,f,l)}else for(var m in r)r.hasOwnProperty(m)&&bp(n,m,r[m])}function Zu(n){if(n.indexOf("-")===-1)return!1;switch(n){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 qE=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"]]),GE=/^[\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 ul(n){return GE.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ir(){}var ed=null;function td(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var ys=null,bs=null;function xp(n){var r=hs(n);if(r&&(n=r.stateNode)){var i=n[$t]||null;e:switch(n=r.stateNode,r.type){case"input":if(Ju(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+fn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==n&&l.form===n.form){var f=l[$t]||null;if(!f)throw Error(s(90));Ju(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===n.form&&pp(l)}break e;case"textarea":vp(n,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&gs(n,!!i.multiple,r,!1)}}}var nd=!1;function Sp(n,r,i){if(nd)return n(r,i);nd=!0;try{var l=n(r);return l}finally{if(nd=!1,(ys!==null||bs!==null)&&(Jl(),ys&&(r=ys,n=bs,bs=ys=null,xp(r),n)))for(r=0;r<n.length;r++)xp(n[r])}}function Oi(n,r){var i=n.stateNode;if(i===null)return null;var l=i[$t]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var or=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rd=!1;if(or)try{var ji={};Object.defineProperty(ji,"passive",{get:function(){rd=!0}}),window.addEventListener("test",ji,ji),window.removeEventListener("test",ji,ji)}catch{rd=!1}var $r=null,ad=null,dl=null;function _p(){if(dl)return dl;var n,r=ad,i=r.length,l,f="value"in $r?$r.value:$r.textContent,m=f.length;for(n=0;n<i&&r[n]===f[n];n++);var w=i-n;for(l=1;l<=w&&r[i-l]===f[m-l];l++);return dl=f.slice(n,1<l?1-l:void 0)}function fl(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function hl(){return!0}function Ep(){return!1}function Ht(n){function r(i,l,f,m,w){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=m,this.target=w,this.currentTarget=null;for(var C in n)n.hasOwnProperty(C)&&(i=n[C],this[C]=i?i(m):m[C]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?hl:Ep,this.isPropagationStopped=Ep,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=hl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=hl)},persist:function(){},isPersistent:hl}),r}var ka={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ml=Ht(ka),Mi=g({},ka,{view:0,detail:0}),VE=Ht(Mi),sd,id,Di,pl=g({},Mi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ld,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Di&&(Di&&n.type==="mousemove"?(sd=n.screenX-Di.screenX,id=n.screenY-Di.screenY):id=sd=0,Di=n),sd)},movementY:function(n){return"movementY"in n?n.movementY:id}}),Cp=Ht(pl),KE=g({},pl,{dataTransfer:0}),FE=Ht(KE),YE=g({},Mi,{relatedTarget:0}),od=Ht(YE),WE=g({},ka,{animationName:0,elapsedTime:0,pseudoElement:0}),XE=Ht(WE),JE=g({},ka,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),QE=Ht(JE),ZE=g({},ka,{data:0}),Tp=Ht(ZE),e1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},t1={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"},n1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r1(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=n1[n])?!!r[n]:!1}function ld(){return r1}var a1=g({},Mi,{key:function(n){if(n.key){var r=e1[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=fl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?t1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ld,charCode:function(n){return n.type==="keypress"?fl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?fl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),s1=Ht(a1),i1=g({},pl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rp=Ht(i1),o1=g({},Mi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ld}),l1=Ht(o1),c1=g({},ka,{propertyName:0,elapsedTime:0,pseudoElement:0}),u1=Ht(c1),d1=g({},pl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),f1=Ht(d1),h1=g({},ka,{newState:0,oldState:0}),m1=Ht(h1),p1=[9,13,27,32],cd=or&&"CompositionEvent"in window,Li=null;or&&"documentMode"in document&&(Li=document.documentMode);var g1=or&&"TextEvent"in window&&!Li,Ap=or&&(!cd||Li&&8<Li&&11>=Li),Np=" ",kp=!1;function Op(n,r){switch(n){case"keyup":return p1.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ws=!1;function v1(n,r){switch(n){case"compositionend":return jp(r);case"keypress":return r.which!==32?null:(kp=!0,Np);case"textInput":return n=r.data,n===Np&&kp?null:n;default:return null}}function y1(n,r){if(ws)return n==="compositionend"||!cd&&Op(n,r)?(n=_p(),dl=ad=$r=null,ws=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ap&&r.locale!=="ko"?null:r.data;default:return null}}var b1={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 Mp(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!b1[n.type]:r==="textarea"}function Dp(n,r,i,l){ys?bs?bs.push(l):bs=[l]:ys=l,r=ac(r,"onChange"),0<r.length&&(i=new ml("onChange","change",null,i,l),n.push({event:i,listeners:r}))}var Ui=null,Pi=null;function w1(n){gy(n,0)}function gl(n){var r=ki(n);if(pp(r))return n}function Lp(n,r){if(n==="change")return r}var Up=!1;if(or){var ud;if(or){var dd="oninput"in document;if(!dd){var Pp=document.createElement("div");Pp.setAttribute("oninput","return;"),dd=typeof Pp.oninput=="function"}ud=dd}else ud=!1;Up=ud&&(!document.documentMode||9<document.documentMode)}function zp(){Ui&&(Ui.detachEvent("onpropertychange",Bp),Pi=Ui=null)}function Bp(n){if(n.propertyName==="value"&&gl(Pi)){var r=[];Dp(r,Pi,n,td(n)),Sp(w1,r)}}function x1(n,r,i){n==="focusin"?(zp(),Ui=r,Pi=i,Ui.attachEvent("onpropertychange",Bp)):n==="focusout"&&zp()}function S1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return gl(Pi)}function _1(n,r){if(n==="click")return gl(r)}function E1(n,r){if(n==="input"||n==="change")return gl(r)}function C1(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var Qt=typeof Object.is=="function"?Object.is:C1;function zi(n,r){if(Qt(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!vt.call(r,f)||!Qt(n[f],r[f]))return!1}return!0}function Ip(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function $p(n,r){var i=Ip(n);n=0;for(var l;i;){if(i.nodeType===3){if(l=n+i.textContent.length,n<=r&&l>=r)return{node:i,offset:r-n};n=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ip(i)}}function Hp(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Hp(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function qp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=cl(n.document);r instanceof n.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)n=r.contentWindow;else break;r=cl(n.document)}return r}function fd(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var T1=or&&"documentMode"in document&&11>=document.documentMode,xs=null,hd=null,Bi=null,md=!1;function Gp(n,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;md||xs==null||xs!==cl(l)||(l=xs,"selectionStart"in l&&fd(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Bi&&zi(Bi,l)||(Bi=l,l=ac(hd,"onSelect"),0<l.length&&(r=new ml("onSelect","select",null,r,i),n.push({event:r,listeners:l}),r.target=xs)))}function Oa(n,r){var i={};return i[n.toLowerCase()]=r.toLowerCase(),i["Webkit"+n]="webkit"+r,i["Moz"+n]="moz"+r,i}var Ss={animationend:Oa("Animation","AnimationEnd"),animationiteration:Oa("Animation","AnimationIteration"),animationstart:Oa("Animation","AnimationStart"),transitionrun:Oa("Transition","TransitionRun"),transitionstart:Oa("Transition","TransitionStart"),transitioncancel:Oa("Transition","TransitionCancel"),transitionend:Oa("Transition","TransitionEnd")},pd={},Vp={};or&&(Vp=document.createElement("div").style,"AnimationEvent"in window||(delete Ss.animationend.animation,delete Ss.animationiteration.animation,delete Ss.animationstart.animation),"TransitionEvent"in window||delete Ss.transitionend.transition);function ja(n){if(pd[n])return pd[n];if(!Ss[n])return n;var r=Ss[n],i;for(i in r)if(r.hasOwnProperty(i)&&i in Vp)return pd[n]=r[i];return n}var Kp=ja("animationend"),Fp=ja("animationiteration"),Yp=ja("animationstart"),R1=ja("transitionrun"),A1=ja("transitionstart"),N1=ja("transitioncancel"),Wp=ja("transitionend"),Xp=new Map,gd="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(" ");gd.push("scrollEnd");function An(n,r){Xp.set(n,r),Na(r,[n])}var vl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},hn=[],_s=0,vd=0;function yl(){for(var n=_s,r=vd=_s=0;r<n;){var i=hn[r];hn[r++]=null;var l=hn[r];hn[r++]=null;var f=hn[r];hn[r++]=null;var m=hn[r];if(hn[r++]=null,l!==null&&f!==null){var w=l.pending;w===null?f.next=f:(f.next=w.next,w.next=f),l.pending=f}m!==0&&Jp(i,f,m)}}function bl(n,r,i,l){hn[_s++]=n,hn[_s++]=r,hn[_s++]=i,hn[_s++]=l,vd|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function yd(n,r,i,l){return bl(n,r,i,l),wl(n)}function Ma(n,r){return bl(n,null,null,r),wl(n)}function Jp(n,r,i){n.lanes|=i;var l=n.alternate;l!==null&&(l.lanes|=i);for(var f=!1,m=n.return;m!==null;)m.childLanes|=i,l=m.alternate,l!==null&&(l.childLanes|=i),m.tag===22&&(n=m.stateNode,n===null||n._visibility&1||(f=!0)),n=m,m=m.return;return n.tag===3?(m=n.stateNode,f&&r!==null&&(f=31-kt(i),n=m.hiddenUpdates,l=n[f],l===null?n[f]=[r]:l.push(r),r.lane=i|536870912),m):null}function wl(n){if(50<oo)throw oo=0,Af=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var Es={};function k1(n,r,i,l){this.tag=n,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=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(n,r,i,l){return new k1(n,r,i,l)}function bd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function lr(n,r){var i=n.alternate;return i===null?(i=Zt(n.tag,r,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=r,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,r=n.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Qp(n,r){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,r=i.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function xl(n,r,i,l,f,m){var w=0;if(l=n,typeof n=="function")bd(n)&&(w=1);else if(typeof n=="string")w=LC(n,i,Y.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case re:return n=Zt(31,i,r,f),n.elementType=re,n.lanes=m,n;case E:return Da(i.children,f,m,r);case R:w=8,f|=24;break;case T:return n=Zt(12,i,r,f|2),n.elementType=T,n.lanes=m,n;case G:return n=Zt(13,i,r,f),n.elementType=G,n.lanes=m,n;case V:return n=Zt(19,i,r,f),n.elementType=V,n.lanes=m,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case N:w=10;break e;case A:w=9;break e;case L:w=11;break e;case P:w=14;break e;case q:w=16,l=null;break e}w=29,i=Error(s(130,n===null?"null":typeof n,"")),l=null}return r=Zt(w,i,r,f),r.elementType=n,r.type=l,r.lanes=m,r}function Da(n,r,i,l){return n=Zt(7,n,l,r),n.lanes=i,n}function wd(n,r,i){return n=Zt(6,n,null,r),n.lanes=i,n}function Zp(n){var r=Zt(18,null,null,0);return r.stateNode=n,r}function xd(n,r,i){return r=Zt(4,n.children!==null?n.children:[],n.key,r),r.lanes=i,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var eg=new WeakMap;function mn(n,r){if(typeof n=="object"&&n!==null){var i=eg.get(n);return i!==void 0?i:(r={value:n,source:r,stack:_a(r)},eg.set(n,r),r)}return{value:n,source:r,stack:_a(r)}}var Cs=[],Ts=0,Sl=null,Ii=0,pn=[],gn=0,Hr=null,Hn=1,qn="";function cr(n,r){Cs[Ts++]=Ii,Cs[Ts++]=Sl,Sl=n,Ii=r}function tg(n,r,i){pn[gn++]=Hn,pn[gn++]=qn,pn[gn++]=Hr,Hr=n;var l=Hn;n=qn;var f=32-kt(l)-1;l&=~(1<<f),i+=1;var m=32-kt(r)+f;if(30<m){var w=f-f%5;m=(l&(1<<w)-1).toString(32),l>>=w,f-=w,Hn=1<<32-kt(r)+f|i<<f|l,qn=m+n}else Hn=1<<m|i<<f|l,qn=n}function Sd(n){n.return!==null&&(cr(n,1),tg(n,1,0))}function _d(n){for(;n===Sl;)Sl=Cs[--Ts],Cs[Ts]=null,Ii=Cs[--Ts],Cs[Ts]=null;for(;n===Hr;)Hr=pn[--gn],pn[gn]=null,qn=pn[--gn],pn[gn]=null,Hn=pn[--gn],pn[gn]=null}function ng(n,r){pn[gn++]=Hn,pn[gn++]=qn,pn[gn++]=Hr,Hn=r.id,qn=r.overflow,Hr=n}var Et=null,Je=null,Pe=!1,qr=null,vn=!1,Ed=Error(s(519));function Gr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw $i(mn(r,n)),Ed}function rg(n){var r=n.stateNode,i=n.type,l=n.memoizedProps;switch(r[_t]=n,r[$t]=l,i){case"dialog":Me("cancel",r),Me("close",r);break;case"iframe":case"object":case"embed":Me("load",r);break;case"video":case"audio":for(i=0;i<co.length;i++)Me(co[i],r);break;case"source":Me("error",r);break;case"img":case"image":case"link":Me("error",r),Me("load",r);break;case"details":Me("toggle",r);break;case"input":Me("invalid",r),gp(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Me("invalid",r);break;case"textarea":Me("invalid",r),yp(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||wy(r.textContent,i)?(l.popover!=null&&(Me("beforetoggle",r),Me("toggle",r)),l.onScroll!=null&&Me("scroll",r),l.onScrollEnd!=null&&Me("scrollend",r),l.onClick!=null&&(r.onclick=ir),r=!0):r=!1,r||Gr(n,!0)}function ag(n){for(Et=n.return;Et;)switch(Et.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:Et=Et.return}}function Rs(n){if(n!==Et)return!1;if(!Pe)return ag(n),Pe=!0,!1;var r=n.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||qf(n.type,n.memoizedProps)),i=!i),i&&Je&&Gr(n),ag(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Je=Ny(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Je=Ny(n)}else r===27?(r=Je,aa(n.type)?(n=Yf,Yf=null,Je=n):Je=r):Je=Et?bn(n.stateNode.nextSibling):null;return!0}function La(){Je=Et=null,Pe=!1}function Cd(){var n=qr;return n!==null&&(Kt===null?Kt=n:Kt.push.apply(Kt,n),qr=null),n}function $i(n){qr===null?qr=[n]:qr.push(n)}var Td=k(null),Ua=null,ur=null;function Vr(n,r,i){D(Td,r._currentValue),r._currentValue=i}function dr(n){n._currentValue=Td.current,I(Td)}function Rd(n,r,i){for(;n!==null;){var l=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),n===i)break;n=n.return}}function Ad(n,r,i,l){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var m=f.dependencies;if(m!==null){var w=f.child;m=m.firstContext;e:for(;m!==null;){var C=m;m=f;for(var O=0;O<r.length;O++)if(C.context===r[O]){m.lanes|=i,C=m.alternate,C!==null&&(C.lanes|=i),Rd(m.return,i,n),l||(w=null);break e}m=C.next}}else if(f.tag===18){if(w=f.return,w===null)throw Error(s(341));w.lanes|=i,m=w.alternate,m!==null&&(m.lanes|=i),Rd(w,i,n),w=null}else w=f.child;if(w!==null)w.return=f;else for(w=f;w!==null;){if(w===n){w=null;break}if(f=w.sibling,f!==null){f.return=w.return,w=f;break}w=w.return}f=w}}function As(n,r,i,l){n=null;for(var f=r,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var w=f.alternate;if(w===null)throw Error(s(387));if(w=w.memoizedProps,w!==null){var C=f.type;Qt(f.pendingProps.value,w.value)||(n!==null?n.push(C):n=[C])}}else if(f===te.current){if(w=f.alternate,w===null)throw Error(s(387));w.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(po):n=[po])}f=f.return}n!==null&&Ad(r,n,i,l),r.flags|=262144}function _l(n){for(n=n.firstContext;n!==null;){if(!Qt(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Pa(n){Ua=n,ur=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ct(n){return sg(Ua,n)}function El(n,r){return Ua===null&&Pa(n),sg(n,r)}function sg(n,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},ur===null){if(n===null)throw Error(s(308));ur=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else ur=ur.next=r;return i}var O1=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(i,l){n.push(l)}};this.abort=function(){r.aborted=!0,n.forEach(function(i){return i()})}},j1=e.unstable_scheduleCallback,M1=e.unstable_NormalPriority,ct={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nd(){return{controller:new O1,data:new Map,refCount:0}}function Hi(n){n.refCount--,n.refCount===0&&j1(M1,function(){n.controller.abort()})}var qi=null,kd=0,Ns=0,ks=null;function D1(n,r){if(qi===null){var i=qi=[];kd=0,Ns=Df(),ks={status:"pending",value:void 0,then:function(l){i.push(l)}}}return kd++,r.then(ig,ig),r}function ig(){if(--kd===0&&qi!==null){ks!==null&&(ks.status="fulfilled");var n=qi;qi=null,Ns=0,ks=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function L1(n,r){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return n.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<i.length;f++)(0,i[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var og=j.S;j.S=function(n,r){Gv=Dt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&D1(n,r),og!==null&&og(n,r)};var za=k(null);function Od(){var n=za.current;return n!==null?n:Ye.pooledCache}function Cl(n,r){r===null?D(za,za.current):D(za,r.pool)}function lg(){var n=Od();return n===null?null:{parent:ct._currentValue,pool:n}}var Os=Error(s(460)),jd=Error(s(474)),Tl=Error(s(542)),Rl={then:function(){}};function cg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function ug(n,r,i){switch(i=n[i],i===void 0?n.push(r):i!==r&&(r.then(ir,ir),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,fg(n),n;default:if(typeof r.status=="string")r.then(ir,ir);else{if(n=Ye,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,fg(n),n}throw Ia=r,Os}}function Ba(n){try{var r=n._init;return r(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ia=i,Os):i}}var Ia=null;function dg(){if(Ia===null)throw Error(s(459));var n=Ia;return Ia=null,n}function fg(n){if(n===Os||n===Tl)throw Error(s(483))}var js=null,Gi=0;function Al(n){var r=Gi;return Gi+=1,js===null&&(js=[]),ug(js,n,r)}function Vi(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Nl(n,r){throw r.$$typeof===x?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function hg(n){function r(U,M){if(n){var z=U.deletions;z===null?(U.deletions=[M],U.flags|=16):z.push(M)}}function i(U,M){if(!n)return null;for(;M!==null;)r(U,M),M=M.sibling;return null}function l(U){for(var M=new Map;U!==null;)U.key!==null?M.set(U.key,U):M.set(U.index,U),U=U.sibling;return M}function f(U,M){return U=lr(U,M),U.index=0,U.sibling=null,U}function m(U,M,z){return U.index=z,n?(z=U.alternate,z!==null?(z=z.index,z<M?(U.flags|=67108866,M):z):(U.flags|=67108866,M)):(U.flags|=1048576,M)}function w(U){return n&&U.alternate===null&&(U.flags|=67108866),U}function C(U,M,z,X){return M===null||M.tag!==6?(M=wd(z,U.mode,X),M.return=U,M):(M=f(M,z),M.return=U,M)}function O(U,M,z,X){var we=z.type;return we===E?W(U,M,z.props.children,X,z.key):M!==null&&(M.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===q&&Ba(we)===M.type)?(M=f(M,z.props),Vi(M,z),M.return=U,M):(M=xl(z.type,z.key,z.props,null,U.mode,X),Vi(M,z),M.return=U,M)}function B(U,M,z,X){return M===null||M.tag!==4||M.stateNode.containerInfo!==z.containerInfo||M.stateNode.implementation!==z.implementation?(M=xd(z,U.mode,X),M.return=U,M):(M=f(M,z.children||[]),M.return=U,M)}function W(U,M,z,X,we){return M===null||M.tag!==7?(M=Da(z,U.mode,X,we),M.return=U,M):(M=f(M,z),M.return=U,M)}function Z(U,M,z){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=wd(""+M,U.mode,z),M.return=U,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case S:return z=xl(M.type,M.key,M.props,null,U.mode,z),Vi(z,M),z.return=U,z;case _:return M=xd(M,U.mode,z),M.return=U,M;case q:return M=Ba(M),Z(U,M,z)}if(fe(M)||oe(M))return M=Da(M,U.mode,z,null),M.return=U,M;if(typeof M.then=="function")return Z(U,Al(M),z);if(M.$$typeof===N)return Z(U,El(U,M),z);Nl(U,M)}return null}function $(U,M,z,X){var we=M!==null?M.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return we!==null?null:C(U,M,""+z,X);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case S:return z.key===we?O(U,M,z,X):null;case _:return z.key===we?B(U,M,z,X):null;case q:return z=Ba(z),$(U,M,z,X)}if(fe(z)||oe(z))return we!==null?null:W(U,M,z,X,null);if(typeof z.then=="function")return $(U,M,Al(z),X);if(z.$$typeof===N)return $(U,M,El(U,z),X);Nl(U,z)}return null}function K(U,M,z,X,we){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return U=U.get(z)||null,C(M,U,""+X,we);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case S:return U=U.get(X.key===null?z:X.key)||null,O(M,U,X,we);case _:return U=U.get(X.key===null?z:X.key)||null,B(M,U,X,we);case q:return X=Ba(X),K(U,M,z,X,we)}if(fe(X)||oe(X))return U=U.get(z)||null,W(M,U,X,we,null);if(typeof X.then=="function")return K(U,M,z,Al(X),we);if(X.$$typeof===N)return K(U,M,z,El(M,X),we);Nl(M,X)}return null}function he(U,M,z,X){for(var we=null,ze=null,ve=M,Ne=M=0,Ue=null;ve!==null&&Ne<z.length;Ne++){ve.index>Ne?(Ue=ve,ve=null):Ue=ve.sibling;var Be=$(U,ve,z[Ne],X);if(Be===null){ve===null&&(ve=Ue);break}n&&ve&&Be.alternate===null&&r(U,ve),M=m(Be,M,Ne),ze===null?we=Be:ze.sibling=Be,ze=Be,ve=Ue}if(Ne===z.length)return i(U,ve),Pe&&cr(U,Ne),we;if(ve===null){for(;Ne<z.length;Ne++)ve=Z(U,z[Ne],X),ve!==null&&(M=m(ve,M,Ne),ze===null?we=ve:ze.sibling=ve,ze=ve);return Pe&&cr(U,Ne),we}for(ve=l(ve);Ne<z.length;Ne++)Ue=K(ve,U,Ne,z[Ne],X),Ue!==null&&(n&&Ue.alternate!==null&&ve.delete(Ue.key===null?Ne:Ue.key),M=m(Ue,M,Ne),ze===null?we=Ue:ze.sibling=Ue,ze=Ue);return n&&ve.forEach(function(ca){return r(U,ca)}),Pe&&cr(U,Ne),we}function xe(U,M,z,X){if(z==null)throw Error(s(151));for(var we=null,ze=null,ve=M,Ne=M=0,Ue=null,Be=z.next();ve!==null&&!Be.done;Ne++,Be=z.next()){ve.index>Ne?(Ue=ve,ve=null):Ue=ve.sibling;var ca=$(U,ve,Be.value,X);if(ca===null){ve===null&&(ve=Ue);break}n&&ve&&ca.alternate===null&&r(U,ve),M=m(ca,M,Ne),ze===null?we=ca:ze.sibling=ca,ze=ca,ve=Ue}if(Be.done)return i(U,ve),Pe&&cr(U,Ne),we;if(ve===null){for(;!Be.done;Ne++,Be=z.next())Be=Z(U,Be.value,X),Be!==null&&(M=m(Be,M,Ne),ze===null?we=Be:ze.sibling=Be,ze=Be);return Pe&&cr(U,Ne),we}for(ve=l(ve);!Be.done;Ne++,Be=z.next())Be=K(ve,U,Ne,Be.value,X),Be!==null&&(n&&Be.alternate!==null&&ve.delete(Be.key===null?Ne:Be.key),M=m(Be,M,Ne),ze===null?we=Be:ze.sibling=Be,ze=Be);return n&&ve.forEach(function(KC){return r(U,KC)}),Pe&&cr(U,Ne),we}function Ke(U,M,z,X){if(typeof z=="object"&&z!==null&&z.type===E&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case S:e:{for(var we=z.key;M!==null;){if(M.key===we){if(we=z.type,we===E){if(M.tag===7){i(U,M.sibling),X=f(M,z.props.children),X.return=U,U=X;break e}}else if(M.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===q&&Ba(we)===M.type){i(U,M.sibling),X=f(M,z.props),Vi(X,z),X.return=U,U=X;break e}i(U,M);break}else r(U,M);M=M.sibling}z.type===E?(X=Da(z.props.children,U.mode,X,z.key),X.return=U,U=X):(X=xl(z.type,z.key,z.props,null,U.mode,X),Vi(X,z),X.return=U,U=X)}return w(U);case _:e:{for(we=z.key;M!==null;){if(M.key===we)if(M.tag===4&&M.stateNode.containerInfo===z.containerInfo&&M.stateNode.implementation===z.implementation){i(U,M.sibling),X=f(M,z.children||[]),X.return=U,U=X;break e}else{i(U,M);break}else r(U,M);M=M.sibling}X=xd(z,U.mode,X),X.return=U,U=X}return w(U);case q:return z=Ba(z),Ke(U,M,z,X)}if(fe(z))return he(U,M,z,X);if(oe(z)){if(we=oe(z),typeof we!="function")throw Error(s(150));return z=we.call(z),xe(U,M,z,X)}if(typeof z.then=="function")return Ke(U,M,Al(z),X);if(z.$$typeof===N)return Ke(U,M,El(U,z),X);Nl(U,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,M!==null&&M.tag===6?(i(U,M.sibling),X=f(M,z),X.return=U,U=X):(i(U,M),X=wd(z,U.mode,X),X.return=U,U=X),w(U)):i(U,M)}return function(U,M,z,X){try{Gi=0;var we=Ke(U,M,z,X);return js=null,we}catch(ve){if(ve===Os||ve===Tl)throw ve;var ze=Zt(29,ve,null,U.mode);return ze.lanes=X,ze.return=U,ze}finally{}}}var $a=hg(!0),mg=hg(!1),Kr=!1;function Md(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dd(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Fr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Yr(n,r,i){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(Ie&2)!==0){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=wl(n),Jp(n,null,i),r}return bl(n,l,r,i),wl(n)}function Ki(n,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,Bt(n,i)}}function Ld(n,r){var i=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?f=m=w:m=m.next=w,i=i.next}while(i!==null);m===null?f=m=r:m=m.next=r}else f=m=r;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=r:n.next=r,i.lastBaseUpdate=r}var Ud=!1;function Fi(){if(Ud){var n=ks;if(n!==null)throw n}}function Yi(n,r,i,l){Ud=!1;var f=n.updateQueue;Kr=!1;var m=f.firstBaseUpdate,w=f.lastBaseUpdate,C=f.shared.pending;if(C!==null){f.shared.pending=null;var O=C,B=O.next;O.next=null,w===null?m=B:w.next=B,w=O;var W=n.alternate;W!==null&&(W=W.updateQueue,C=W.lastBaseUpdate,C!==w&&(C===null?W.firstBaseUpdate=B:C.next=B,W.lastBaseUpdate=O))}if(m!==null){var Z=f.baseState;w=0,W=B=O=null,C=m;do{var $=C.lane&-536870913,K=$!==C.lane;if(K?(Le&$)===$:(l&$)===$){$!==0&&$===Ns&&(Ud=!0),W!==null&&(W=W.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var he=n,xe=C;$=r;var Ke=i;switch(xe.tag){case 1:if(he=xe.payload,typeof he=="function"){Z=he.call(Ke,Z,$);break e}Z=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=xe.payload,$=typeof he=="function"?he.call(Ke,Z,$):he,$==null)break e;Z=g({},Z,$);break e;case 2:Kr=!0}}$=C.callback,$!==null&&(n.flags|=64,K&&(n.flags|=8192),K=f.callbacks,K===null?f.callbacks=[$]:K.push($))}else K={lane:$,tag:C.tag,payload:C.payload,callback:C.callback,next:null},W===null?(B=W=K,O=Z):W=W.next=K,w|=$;if(C=C.next,C===null){if(C=f.shared.pending,C===null)break;K=C,C=K.next,K.next=null,f.lastBaseUpdate=K,f.shared.pending=null}}while(!0);W===null&&(O=Z),f.baseState=O,f.firstBaseUpdate=B,f.lastBaseUpdate=W,m===null&&(f.shared.lanes=0),Zr|=w,n.lanes=w,n.memoizedState=Z}}function pg(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function gg(n,r){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)pg(i[n],r)}var Ms=k(null),kl=k(0);function vg(n,r){n=wr,D(kl,n),D(Ms,r),wr=n|r.baseLanes}function Pd(){D(kl,wr),D(Ms,Ms.current)}function zd(){wr=kl.current,I(Ms),I(kl)}var en=k(null),yn=null;function Wr(n){var r=n.alternate;D(ot,ot.current&1),D(en,n),yn===null&&(r===null||Ms.current!==null||r.memoizedState!==null)&&(yn=n)}function Bd(n){D(ot,ot.current),D(en,n),yn===null&&(yn=n)}function yg(n){n.tag===22?(D(ot,ot.current),D(en,n),yn===null&&(yn=n)):Xr()}function Xr(){D(ot,ot.current),D(en,en.current)}function tn(n){I(en),yn===n&&(yn=null),I(ot)}var ot=k(0);function Ol(n){for(var r=n;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Kf(i)||Ff(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var fr=0,Ae=null,Ge=null,ut=null,jl=!1,Ds=!1,Ha=!1,Ml=0,Wi=0,Ls=null,U1=0;function at(){throw Error(s(321))}function Id(n,r){if(r===null)return!1;for(var i=0;i<r.length&&i<n.length;i++)if(!Qt(n[i],r[i]))return!1;return!0}function $d(n,r,i,l,f,m){return fr=m,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,j.H=n===null||n.memoizedState===null?tv:nf,Ha=!1,m=i(l,f),Ha=!1,Ds&&(m=wg(r,i,l,f)),bg(n),m}function bg(n){j.H=Qi;var r=Ge!==null&&Ge.next!==null;if(fr=0,ut=Ge=Ae=null,jl=!1,Wi=0,Ls=null,r)throw Error(s(300));n===null||dt||(n=n.dependencies,n!==null&&_l(n)&&(dt=!0))}function wg(n,r,i,l){Ae=n;var f=0;do{if(Ds&&(Ls=null),Wi=0,Ds=!1,25<=f)throw Error(s(301));if(f+=1,ut=Ge=null,n.updateQueue!=null){var m=n.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}j.H=nv,m=r(i,l)}while(Ds);return m}function P1(){var n=j.H,r=n.useState()[0];return r=typeof r.then=="function"?Xi(r):r,n=n.useState()[0],(Ge!==null?Ge.memoizedState:null)!==n&&(Ae.flags|=1024),r}function Hd(){var n=Ml!==0;return Ml=0,n}function qd(n,r,i){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~i}function Gd(n){if(jl){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}jl=!1}fr=0,ut=Ge=Ae=null,Ds=!1,Wi=Ml=0,Ls=null}function Ut(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Ae.memoizedState=ut=n:ut=ut.next=n,ut}function lt(){if(Ge===null){var n=Ae.alternate;n=n!==null?n.memoizedState:null}else n=Ge.next;var r=ut===null?Ae.memoizedState:ut.next;if(r!==null)ut=r,Ge=n;else{if(n===null)throw Ae.alternate===null?Error(s(467)):Error(s(310));Ge=n,n={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},ut===null?Ae.memoizedState=ut=n:ut=ut.next=n}return ut}function Dl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xi(n){var r=Wi;return Wi+=1,Ls===null&&(Ls=[]),n=ug(Ls,n,r),r=Ae,(ut===null?r.memoizedState:ut.next)===null&&(r=r.alternate,j.H=r===null||r.memoizedState===null?tv:nf),n}function Ll(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Xi(n);if(n.$$typeof===N)return Ct(n)}throw Error(s(438,String(n)))}function Vd(n){var r=null,i=Ae.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=Ae.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=Dl(),Ae.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(n),l=0;l<n;l++)i[l]=me;return r.index++,i}function hr(n,r){return typeof r=="function"?r(n):r}function Ul(n){var r=lt();return Kd(r,Ge,n)}function Kd(n,r,i){var l=n.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var f=n.baseQueue,m=l.pending;if(m!==null){if(f!==null){var w=f.next;f.next=m.next,m.next=w}r.baseQueue=f=m,l.pending=null}if(m=n.baseState,f===null)n.memoizedState=m;else{r=f.next;var C=w=null,O=null,B=r,W=!1;do{var Z=B.lane&-536870913;if(Z!==B.lane?(Le&Z)===Z:(fr&Z)===Z){var $=B.revertLane;if($===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),Z===Ns&&(W=!0);else if((fr&$)===$){B=B.next,$===Ns&&(W=!0);continue}else Z={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},O===null?(C=O=Z,w=m):O=O.next=Z,Ae.lanes|=$,Zr|=$;Z=B.action,Ha&&i(m,Z),m=B.hasEagerState?B.eagerState:i(m,Z)}else $={lane:Z,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},O===null?(C=O=$,w=m):O=O.next=$,Ae.lanes|=Z,Zr|=Z;B=B.next}while(B!==null&&B!==r);if(O===null?w=m:O.next=C,!Qt(m,n.memoizedState)&&(dt=!0,W&&(i=ks,i!==null)))throw i;n.memoizedState=m,n.baseState=w,n.baseQueue=O,l.lastRenderedState=m}return f===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function Fd(n){var r=lt(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var l=i.dispatch,f=i.pending,m=r.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do m=n(m,w.action),w=w.next;while(w!==f);Qt(m,r.memoizedState)||(dt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),i.lastRenderedState=m}return[m,l]}function xg(n,r,i){var l=Ae,f=lt(),m=Pe;if(m){if(i===void 0)throw Error(s(407));i=i()}else i=r();var w=!Qt((Ge||f).memoizedState,i);if(w&&(f.memoizedState=i,dt=!0),f=f.queue,Xd(Eg.bind(null,l,f,n),[n]),f.getSnapshot!==r||w||ut!==null&&ut.memoizedState.tag&1){if(l.flags|=2048,Us(9,{destroy:void 0},_g.bind(null,l,f,i,r),null),Ye===null)throw Error(s(349));m||(fr&127)!==0||Sg(l,r,i)}return i}function Sg(n,r,i){n.flags|=16384,n={getSnapshot:r,value:i},r=Ae.updateQueue,r===null?(r=Dl(),Ae.updateQueue=r,r.stores=[n]):(i=r.stores,i===null?r.stores=[n]:i.push(n))}function _g(n,r,i,l){r.value=i,r.getSnapshot=l,Cg(r)&&Tg(n)}function Eg(n,r,i){return i(function(){Cg(r)&&Tg(n)})}function Cg(n){var r=n.getSnapshot;n=n.value;try{var i=r();return!Qt(n,i)}catch{return!0}}function Tg(n){var r=Ma(n,2);r!==null&&Ft(r,n,2)}function Yd(n){var r=Ut();if(typeof n=="function"){var i=n;if(n=i(),Ha){Tn(!0);try{i()}finally{Tn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:n},r}function Rg(n,r,i,l){return n.baseState=i,Kd(n,Ge,typeof l=="function"?l:hr)}function z1(n,r,i,l,f){if(Bl(n))throw Error(s(485));if(n=r.action,n!==null){var m={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){m.listeners.push(w)}};j.T!==null?i(!0):m.isTransition=!1,l(m),i=r.pending,i===null?(m.next=r.pending=m,Ag(r,m)):(m.next=i.next,r.pending=i.next=m)}}function Ag(n,r){var i=r.action,l=r.payload,f=n.state;if(r.isTransition){var m=j.T,w={};j.T=w;try{var C=i(f,l),O=j.S;O!==null&&O(w,C),Ng(n,r,C)}catch(B){Wd(n,r,B)}finally{m!==null&&w.types!==null&&(m.types=w.types),j.T=m}}else try{m=i(f,l),Ng(n,r,m)}catch(B){Wd(n,r,B)}}function Ng(n,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){kg(n,r,l)},function(l){return Wd(n,r,l)}):kg(n,r,i)}function kg(n,r,i){r.status="fulfilled",r.value=i,Og(r),n.state=i,r=n.pending,r!==null&&(i=r.next,i===r?n.pending=null:(i=i.next,r.next=i,Ag(n,i)))}function Wd(n,r,i){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,Og(r),r=r.next;while(r!==l)}n.action=null}function Og(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function jg(n,r){return r}function Mg(n,r){if(Pe){var i=Ye.formState;if(i!==null){e:{var l=Ae;if(Pe){if(Je){t:{for(var f=Je,m=vn;f.nodeType!==8;){if(!m){f=null;break t}if(f=bn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Je=bn(f.nextSibling),l=f.data==="F!";break e}}Gr(l)}l=!1}l&&(r=i[0])}}return i=Ut(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jg,lastRenderedState:r},i.queue=l,i=Qg.bind(null,Ae,l),l.dispatch=i,l=Yd(!1),m=tf.bind(null,Ae,!1,l.queue),l=Ut(),f={state:r,dispatch:null,action:n,pending:null},l.queue=f,i=z1.bind(null,Ae,f,m,i),f.dispatch=i,l.memoizedState=n,[r,i,!1]}function Dg(n){var r=lt();return Lg(r,Ge,n)}function Lg(n,r,i){if(r=Kd(n,r,jg)[0],n=Ul(hr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=Xi(r)}catch(w){throw w===Os?Tl:w}else l=r;r=lt();var f=r.queue,m=f.dispatch;return i!==r.memoizedState&&(Ae.flags|=2048,Us(9,{destroy:void 0},B1.bind(null,f,i),null)),[l,m,n]}function B1(n,r){n.action=r}function Ug(n){var r=lt(),i=Ge;if(i!==null)return Lg(r,i,n);lt(),r=r.memoizedState,i=lt();var l=i.queue.dispatch;return i.memoizedState=n,[r,l,!1]}function Us(n,r,i,l){return n={tag:n,create:i,deps:l,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=Dl(),Ae.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=n.next=n:(l=i.next,i.next=n,n.next=l,r.lastEffect=n),n}function Pg(){return lt().memoizedState}function Pl(n,r,i,l){var f=Ut();Ae.flags|=n,f.memoizedState=Us(1|r,{destroy:void 0},i,l===void 0?null:l)}function zl(n,r,i,l){var f=lt();l=l===void 0?null:l;var m=f.memoizedState.inst;Ge!==null&&l!==null&&Id(l,Ge.memoizedState.deps)?f.memoizedState=Us(r,m,i,l):(Ae.flags|=n,f.memoizedState=Us(1|r,m,i,l))}function zg(n,r){Pl(8390656,8,n,r)}function Xd(n,r){zl(2048,8,n,r)}function I1(n){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=Dl(),Ae.updateQueue=r,r.events=[n];else{var i=r.events;i===null?r.events=[n]:i.push(n)}}function Bg(n){var r=lt().memoizedState;return I1({ref:r,nextImpl:n}),function(){if((Ie&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Ig(n,r){return zl(4,2,n,r)}function $g(n,r){return zl(4,4,n,r)}function Hg(n,r){if(typeof r=="function"){n=n();var i=r(n);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function qg(n,r,i){i=i!=null?i.concat([n]):null,zl(4,4,Hg.bind(null,r,n),i)}function Jd(){}function Gg(n,r){var i=lt();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&Id(r,l[1])?l[0]:(i.memoizedState=[n,r],n)}function Vg(n,r){var i=lt();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&Id(r,l[1]))return l[0];if(l=n(),Ha){Tn(!0);try{n()}finally{Tn(!1)}}return i.memoizedState=[l,r],l}function Qd(n,r,i){return i===void 0||(fr&1073741824)!==0&&(Le&261930)===0?n.memoizedState=r:(n.memoizedState=i,n=Kv(),Ae.lanes|=n,Zr|=n,i)}function Kg(n,r,i,l){return Qt(i,r)?i:Ms.current!==null?(n=Qd(n,i,l),Qt(n,r)||(dt=!0),n):(fr&42)===0||(fr&1073741824)!==0&&(Le&261930)===0?(dt=!0,n.memoizedState=i):(n=Kv(),Ae.lanes|=n,Zr|=n,r)}function Fg(n,r,i,l,f){var m=F.p;F.p=m!==0&&8>m?m:8;var w=j.T,C={};j.T=C,tf(n,!1,r,i);try{var O=f(),B=j.S;if(B!==null&&B(C,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var W=L1(O,l);Ji(n,r,W,an(n))}else Ji(n,r,l,an(n))}catch(Z){Ji(n,r,{then:function(){},status:"rejected",reason:Z},an())}finally{F.p=m,w!==null&&C.types!==null&&(w.types=C.types),j.T=w}}function $1(){}function Zd(n,r,i,l){if(n.tag!==5)throw Error(s(476));var f=Yg(n).queue;Fg(n,f,r,J,i===null?$1:function(){return Wg(n),i(l)})}function Yg(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:J},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hr,lastRenderedState:i},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function Wg(n){var r=Yg(n);r.next===null&&(r=n.alternate.memoizedState),Ji(n,r.next.queue,{},an())}function ef(){return Ct(po)}function Xg(){return lt().memoizedState}function Jg(){return lt().memoizedState}function H1(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var i=an();n=Fr(i);var l=Yr(r,n,i);l!==null&&(Ft(l,r,i),Ki(l,r,i)),r={cache:Nd()},n.payload=r;return}r=r.return}}function q1(n,r,i){var l=an();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bl(n)?Zg(r,i):(i=yd(n,r,i,l),i!==null&&(Ft(i,n,l),ev(i,r,l)))}function Qg(n,r,i){var l=an();Ji(n,r,i,l)}function Ji(n,r,i,l){var f={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Bl(n))Zg(r,f);else{var m=n.alternate;if(n.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var w=r.lastRenderedState,C=m(w,i);if(f.hasEagerState=!0,f.eagerState=C,Qt(C,w))return bl(n,r,f,0),Ye===null&&yl(),!1}catch{}finally{}if(i=yd(n,r,f,l),i!==null)return Ft(i,n,l),ev(i,r,l),!0}return!1}function tf(n,r,i,l){if(l={lane:2,revertLane:Df(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Bl(n)){if(r)throw Error(s(479))}else r=yd(n,i,l,2),r!==null&&Ft(r,n,2)}function Bl(n){var r=n.alternate;return n===Ae||r!==null&&r===Ae}function Zg(n,r){Ds=jl=!0;var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}function ev(n,r,i){if((i&4194048)!==0){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,Bt(n,i)}}var Qi={readContext:Ct,use:Ll,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Qi.useEffectEvent=at;var tv={readContext:Ct,use:Ll,useCallback:function(n,r){return Ut().memoizedState=[n,r===void 0?null:r],n},useContext:Ct,useEffect:zg,useImperativeHandle:function(n,r,i){i=i!=null?i.concat([n]):null,Pl(4194308,4,Hg.bind(null,r,n),i)},useLayoutEffect:function(n,r){return Pl(4194308,4,n,r)},useInsertionEffect:function(n,r){Pl(4,2,n,r)},useMemo:function(n,r){var i=Ut();r=r===void 0?null:r;var l=n();if(Ha){Tn(!0);try{n()}finally{Tn(!1)}}return i.memoizedState=[l,r],l},useReducer:function(n,r,i){var l=Ut();if(i!==void 0){var f=i(r);if(Ha){Tn(!0);try{i(r)}finally{Tn(!1)}}}else f=r;return l.memoizedState=l.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},l.queue=n,n=n.dispatch=q1.bind(null,Ae,n),[l.memoizedState,n]},useRef:function(n){var r=Ut();return n={current:n},r.memoizedState=n},useState:function(n){n=Yd(n);var r=n.queue,i=Qg.bind(null,Ae,r);return r.dispatch=i,[n.memoizedState,i]},useDebugValue:Jd,useDeferredValue:function(n,r){var i=Ut();return Qd(i,n,r)},useTransition:function(){var n=Yd(!1);return n=Fg.bind(null,Ae,n.queue,!0,!1),Ut().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,i){var l=Ae,f=Ut();if(Pe){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),Ye===null)throw Error(s(349));(Le&127)!==0||Sg(l,r,i)}f.memoizedState=i;var m={value:i,getSnapshot:r};return f.queue=m,zg(Eg.bind(null,l,m,n),[n]),l.flags|=2048,Us(9,{destroy:void 0},_g.bind(null,l,m,i,r),null),i},useId:function(){var n=Ut(),r=Ye.identifierPrefix;if(Pe){var i=qn,l=Hn;i=(l&~(1<<32-kt(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=Ml++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=U1++,r="_"+r+"r_"+i.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:ef,useFormState:Mg,useActionState:Mg,useOptimistic:function(n){var r=Ut();r.memoizedState=r.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=tf.bind(null,Ae,!0,i),i.dispatch=r,[n,r]},useMemoCache:Vd,useCacheRefresh:function(){return Ut().memoizedState=H1.bind(null,Ae)},useEffectEvent:function(n){var r=Ut(),i={impl:n};return r.memoizedState=i,function(){if((Ie&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},nf={readContext:Ct,use:Ll,useCallback:Gg,useContext:Ct,useEffect:Xd,useImperativeHandle:qg,useInsertionEffect:Ig,useLayoutEffect:$g,useMemo:Vg,useReducer:Ul,useRef:Pg,useState:function(){return Ul(hr)},useDebugValue:Jd,useDeferredValue:function(n,r){var i=lt();return Kg(i,Ge.memoizedState,n,r)},useTransition:function(){var n=Ul(hr)[0],r=lt().memoizedState;return[typeof n=="boolean"?n:Xi(n),r]},useSyncExternalStore:xg,useId:Xg,useHostTransitionStatus:ef,useFormState:Dg,useActionState:Dg,useOptimistic:function(n,r){var i=lt();return Rg(i,Ge,n,r)},useMemoCache:Vd,useCacheRefresh:Jg};nf.useEffectEvent=Bg;var nv={readContext:Ct,use:Ll,useCallback:Gg,useContext:Ct,useEffect:Xd,useImperativeHandle:qg,useInsertionEffect:Ig,useLayoutEffect:$g,useMemo:Vg,useReducer:Fd,useRef:Pg,useState:function(){return Fd(hr)},useDebugValue:Jd,useDeferredValue:function(n,r){var i=lt();return Ge===null?Qd(i,n,r):Kg(i,Ge.memoizedState,n,r)},useTransition:function(){var n=Fd(hr)[0],r=lt().memoizedState;return[typeof n=="boolean"?n:Xi(n),r]},useSyncExternalStore:xg,useId:Xg,useHostTransitionStatus:ef,useFormState:Ug,useActionState:Ug,useOptimistic:function(n,r){var i=lt();return Ge!==null?Rg(i,Ge,n,r):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:Vd,useCacheRefresh:Jg};nv.useEffectEvent=Bg;function rf(n,r,i,l){r=n.memoizedState,i=i(l,r),i=i==null?r:g({},r,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var af={enqueueSetState:function(n,r,i){n=n._reactInternals;var l=an(),f=Fr(l);f.payload=r,i!=null&&(f.callback=i),r=Yr(n,f,l),r!==null&&(Ft(r,n,l),Ki(r,n,l))},enqueueReplaceState:function(n,r,i){n=n._reactInternals;var l=an(),f=Fr(l);f.tag=1,f.payload=r,i!=null&&(f.callback=i),r=Yr(n,f,l),r!==null&&(Ft(r,n,l),Ki(r,n,l))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var i=an(),l=Fr(i);l.tag=2,r!=null&&(l.callback=r),r=Yr(n,l,i),r!==null&&(Ft(r,n,i),Ki(r,n,i))}};function rv(n,r,i,l,f,m,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,m,w):r.prototype&&r.prototype.isPureReactComponent?!zi(i,l)||!zi(f,m):!0}function av(n,r,i,l){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==n&&af.enqueueReplaceState(r,r.state,null)}function qa(n,r){var i=r;if("ref"in r){i={};for(var l in r)l!=="ref"&&(i[l]=r[l])}if(n=n.defaultProps){i===r&&(i=g({},i));for(var f in n)i[f]===void 0&&(i[f]=n[f])}return i}function sv(n){vl(n)}function iv(n){console.error(n)}function ov(n){vl(n)}function Il(n,r){try{var i=n.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function lv(n,r,i){try{var l=n.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function sf(n,r,i){return i=Fr(i),i.tag=3,i.payload={element:null},i.callback=function(){Il(n,r)},i}function cv(n){return n=Fr(n),n.tag=3,n}function uv(n,r,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var m=l.value;n.payload=function(){return f(m)},n.callback=function(){lv(r,i,l)}}var w=i.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){lv(r,i,l),typeof f!="function"&&(ea===null?ea=new Set([this]):ea.add(this));var C=l.stack;this.componentDidCatch(l.value,{componentStack:C!==null?C:""})})}function G1(n,r,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=i.alternate,r!==null&&As(r,i,f,!0),i=en.current,i!==null){switch(i.tag){case 31:case 13:return yn===null?Ql():i.alternate===null&&st===0&&(st=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===Rl?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Of(n,l,f)),!1;case 22:return i.flags|=65536,l===Rl?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Of(n,l,f)),!1}throw Error(s(435,i.tag))}return Of(n,l,f),Ql(),!1}if(Pe)return r=en.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==Ed&&(n=Error(s(422),{cause:l}),$i(mn(n,i)))):(l!==Ed&&(r=Error(s(423),{cause:l}),$i(mn(r,i))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,l=mn(l,i),f=sf(n.stateNode,l,f),Ld(n,f),st!==4&&(st=2)),!1;var m=Error(s(520),{cause:l});if(m=mn(m,i),io===null?io=[m]:io.push(m),st!==4&&(st=2),r===null)return!0;l=mn(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,n=f&-f,i.lanes|=n,n=sf(i.stateNode,l,n),Ld(i,n),!1;case 1:if(r=i.type,m=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ea===null||!ea.has(m))))return i.flags|=65536,f&=-f,i.lanes|=f,f=cv(f),uv(f,n,i,l),Ld(i,f),!1}i=i.return}while(i!==null);return!1}var of=Error(s(461)),dt=!1;function Tt(n,r,i,l){r.child=n===null?mg(r,null,i,l):$a(r,n.child,i,l)}function dv(n,r,i,l,f){i=i.render;var m=r.ref;if("ref"in l){var w={};for(var C in l)C!=="ref"&&(w[C]=l[C])}else w=l;return Pa(r),l=$d(n,r,i,w,m,f),C=Hd(),n!==null&&!dt?(qd(n,r,f),mr(n,r,f)):(Pe&&C&&Sd(r),r.flags|=1,Tt(n,r,l,f),r.child)}function fv(n,r,i,l,f){if(n===null){var m=i.type;return typeof m=="function"&&!bd(m)&&m.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=m,hv(n,r,m,l,f)):(n=xl(i.type,null,l,r,r.mode,f),n.ref=r.ref,n.return=r,r.child=n)}if(m=n.child,!pf(n,f)){var w=m.memoizedProps;if(i=i.compare,i=i!==null?i:zi,i(w,l)&&n.ref===r.ref)return mr(n,r,f)}return r.flags|=1,n=lr(m,l),n.ref=r.ref,n.return=r,r.child=n}function hv(n,r,i,l,f){if(n!==null){var m=n.memoizedProps;if(zi(m,l)&&n.ref===r.ref)if(dt=!1,r.pendingProps=l=m,pf(n,f))(n.flags&131072)!==0&&(dt=!0);else return r.lanes=n.lanes,mr(n,r,f)}return lf(n,r,i,l,f)}function mv(n,r,i,l){var f=l.children,m=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|i:i,n!==null){for(l=r.child=n.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~m}else l=0,r.child=null;return pv(n,r,m,i,l)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&Cl(r,m!==null?m.cachePool:null),m!==null?vg(r,m):Pd(),yg(r);else return l=r.lanes=536870912,pv(n,r,m!==null?m.baseLanes|i:i,i,l)}else m!==null?(Cl(r,m.cachePool),vg(r,m),Xr(),r.memoizedState=null):(n!==null&&Cl(r,null),Pd(),Xr());return Tt(n,r,f,i),r.child}function Zi(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function pv(n,r,i,l,f){var m=Od();return m=m===null?null:{parent:ct._currentValue,pool:m},r.memoizedState={baseLanes:i,cachePool:m},n!==null&&Cl(r,null),Pd(),yg(r),n!==null&&As(n,r,l,!0),r.childLanes=f,null}function $l(n,r){return r=ql({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function gv(n,r,i){return $a(r,n.child,null,i),n=$l(r,r.pendingProps),n.flags|=2,tn(r),r.memoizedState=null,n}function V1(n,r,i){var l=r.pendingProps,f=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(Pe){if(l.mode==="hidden")return n=$l(r,l),r.lanes=536870912,Zi(null,n);if(Bd(r),(n=Je)?(n=Ay(n,vn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Hr!==null?{id:Hn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},i=Zp(n),i.return=r,r.child=i,Et=r,Je=null)):n=null,n===null)throw Gr(r);return r.lanes=536870912,null}return $l(r,l)}var m=n.memoizedState;if(m!==null){var w=m.dehydrated;if(Bd(r),f)if(r.flags&256)r.flags&=-257,r=gv(n,r,i);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(dt||As(n,r,i,!1),f=(i&n.childLanes)!==0,dt||f){if(l=Ye,l!==null&&(w=It(l,i),w!==0&&w!==m.retryLane))throw m.retryLane=w,Ma(n,w),Ft(l,n,w),of;Ql(),r=gv(n,r,i)}else n=m.treeContext,Je=bn(w.nextSibling),Et=r,Pe=!0,qr=null,vn=!1,n!==null&&ng(r,n),r=$l(r,l),r.flags|=4096;return r}return n=lr(n.child,{mode:l.mode,children:l.children}),n.ref=r.ref,r.child=n,n.return=r,n}function Hl(n,r){var i=r.ref;if(i===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(n===null||n.ref!==i)&&(r.flags|=4194816)}}function lf(n,r,i,l,f){return Pa(r),i=$d(n,r,i,l,void 0,f),l=Hd(),n!==null&&!dt?(qd(n,r,f),mr(n,r,f)):(Pe&&l&&Sd(r),r.flags|=1,Tt(n,r,i,f),r.child)}function vv(n,r,i,l,f,m){return Pa(r),r.updateQueue=null,i=wg(r,l,i,f),bg(n),l=Hd(),n!==null&&!dt?(qd(n,r,m),mr(n,r,m)):(Pe&&l&&Sd(r),r.flags|=1,Tt(n,r,i,m),r.child)}function yv(n,r,i,l,f){if(Pa(r),r.stateNode===null){var m=Es,w=i.contextType;typeof w=="object"&&w!==null&&(m=Ct(w)),m=new i(l,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=af,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=l,m.state=r.memoizedState,m.refs={},Md(r),w=i.contextType,m.context=typeof w=="object"&&w!==null?Ct(w):Es,m.state=r.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(rf(r,i,w,l),m.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(w=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),w!==m.state&&af.enqueueReplaceState(m,m.state,null),Yi(r,l,m,f),Fi(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(n===null){m=r.stateNode;var C=r.memoizedProps,O=qa(i,C);m.props=O;var B=m.context,W=i.contextType;w=Es,typeof W=="object"&&W!==null&&(w=Ct(W));var Z=i.getDerivedStateFromProps;W=typeof Z=="function"||typeof m.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,W||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(C||B!==w)&&av(r,m,l,w),Kr=!1;var $=r.memoizedState;m.state=$,Yi(r,l,m,f),Fi(),B=r.memoizedState,C||$!==B||Kr?(typeof Z=="function"&&(rf(r,i,Z,l),B=r.memoizedState),(O=Kr||rv(r,i,O,l,$,B,w))?(W||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=B),m.props=l,m.state=B,m.context=w,l=O):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{m=r.stateNode,Dd(n,r),w=r.memoizedProps,W=qa(i,w),m.props=W,Z=r.pendingProps,$=m.context,B=i.contextType,O=Es,typeof B=="object"&&B!==null&&(O=Ct(B)),C=i.getDerivedStateFromProps,(B=typeof C=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w!==Z||$!==O)&&av(r,m,l,O),Kr=!1,$=r.memoizedState,m.state=$,Yi(r,l,m,f),Fi();var K=r.memoizedState;w!==Z||$!==K||Kr||n!==null&&n.dependencies!==null&&_l(n.dependencies)?(typeof C=="function"&&(rf(r,i,C,l),K=r.memoizedState),(W=Kr||rv(r,i,W,l,$,K,O)||n!==null&&n.dependencies!==null&&_l(n.dependencies))?(B||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,K,O),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,K,O)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||w===n.memoizedProps&&$===n.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&$===n.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=K),m.props=l,m.state=K,m.context=O,l=W):(typeof m.componentDidUpdate!="function"||w===n.memoizedProps&&$===n.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&$===n.memoizedState||(r.flags|=1024),l=!1)}return m=l,Hl(n,r),l=(r.flags&128)!==0,m||l?(m=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,n!==null&&l?(r.child=$a(r,n.child,null,f),r.child=$a(r,null,i,f)):Tt(n,r,i,f),r.memoizedState=m.state,n=r.child):n=mr(n,r,f),n}function bv(n,r,i,l){return La(),r.flags|=256,Tt(n,r,i,l),r.child}var cf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uf(n){return{baseLanes:n,cachePool:lg()}}function df(n,r,i){return n=n!==null?n.childLanes&~i:0,r&&(n|=rn),n}function wv(n,r,i){var l=r.pendingProps,f=!1,m=(r.flags&128)!==0,w;if((w=m)||(w=n!==null&&n.memoizedState===null?!1:(ot.current&2)!==0),w&&(f=!0,r.flags&=-129),w=(r.flags&32)!==0,r.flags&=-33,n===null){if(Pe){if(f?Wr(r):Xr(),(n=Je)?(n=Ay(n,vn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Hr!==null?{id:Hn,overflow:qn}:null,retryLane:536870912,hydrationErrors:null},i=Zp(n),i.return=r,r.child=i,Et=r,Je=null)):n=null,n===null)throw Gr(r);return Ff(n)?r.lanes=32:r.lanes=536870912,null}var C=l.children;return l=l.fallback,f?(Xr(),f=r.mode,C=ql({mode:"hidden",children:C},f),l=Da(l,f,i,null),C.return=r,l.return=r,C.sibling=l,r.child=C,l=r.child,l.memoizedState=uf(i),l.childLanes=df(n,w,i),r.memoizedState=cf,Zi(null,l)):(Wr(r),ff(r,C))}var O=n.memoizedState;if(O!==null&&(C=O.dehydrated,C!==null)){if(m)r.flags&256?(Wr(r),r.flags&=-257,r=hf(n,r,i)):r.memoizedState!==null?(Xr(),r.child=n.child,r.flags|=128,r=null):(Xr(),C=l.fallback,f=r.mode,l=ql({mode:"visible",children:l.children},f),C=Da(C,f,i,null),C.flags|=2,l.return=r,C.return=r,l.sibling=C,r.child=l,$a(r,n.child,null,i),l=r.child,l.memoizedState=uf(i),l.childLanes=df(n,w,i),r.memoizedState=cf,r=Zi(null,l));else if(Wr(r),Ff(C)){if(w=C.nextSibling&&C.nextSibling.dataset,w)var B=w.dgst;w=B,l=Error(s(419)),l.stack="",l.digest=w,$i({value:l,source:null,stack:null}),r=hf(n,r,i)}else if(dt||As(n,r,i,!1),w=(i&n.childLanes)!==0,dt||w){if(w=Ye,w!==null&&(l=It(w,i),l!==0&&l!==O.retryLane))throw O.retryLane=l,Ma(n,l),Ft(w,n,l),of;Kf(C)||Ql(),r=hf(n,r,i)}else Kf(C)?(r.flags|=192,r.child=n.child,r=null):(n=O.treeContext,Je=bn(C.nextSibling),Et=r,Pe=!0,qr=null,vn=!1,n!==null&&ng(r,n),r=ff(r,l.children),r.flags|=4096);return r}return f?(Xr(),C=l.fallback,f=r.mode,O=n.child,B=O.sibling,l=lr(O,{mode:"hidden",children:l.children}),l.subtreeFlags=O.subtreeFlags&65011712,B!==null?C=lr(B,C):(C=Da(C,f,i,null),C.flags|=2),C.return=r,l.return=r,l.sibling=C,r.child=l,Zi(null,l),l=r.child,C=n.child.memoizedState,C===null?C=uf(i):(f=C.cachePool,f!==null?(O=ct._currentValue,f=f.parent!==O?{parent:O,pool:O}:f):f=lg(),C={baseLanes:C.baseLanes|i,cachePool:f}),l.memoizedState=C,l.childLanes=df(n,w,i),r.memoizedState=cf,Zi(n.child,l)):(Wr(r),i=n.child,n=i.sibling,i=lr(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,n!==null&&(w=r.deletions,w===null?(r.deletions=[n],r.flags|=16):w.push(n)),r.child=i,r.memoizedState=null,i)}function ff(n,r){return r=ql({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function ql(n,r){return n=Zt(22,n,null,r),n.lanes=0,n}function hf(n,r,i){return $a(r,n.child,null,i),n=ff(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function xv(n,r,i){n.lanes|=r;var l=n.alternate;l!==null&&(l.lanes|=r),Rd(n.return,r,i)}function mf(n,r,i,l,f,m){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f,treeForkCount:m}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=l,w.tail=i,w.tailMode=f,w.treeForkCount=m)}function Sv(n,r,i){var l=r.pendingProps,f=l.revealOrder,m=l.tail;l=l.children;var w=ot.current,C=(w&2)!==0;if(C?(w=w&1|2,r.flags|=128):w&=1,D(ot,w),Tt(n,r,l,i),l=Pe?Ii:0,!C&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&xv(n,i,r);else if(n.tag===19)xv(n,i,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(f){case"forwards":for(i=r.child,f=null;i!==null;)n=i.alternate,n!==null&&Ol(n)===null&&(f=i),i=i.sibling;i=f,i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null),mf(r,!1,f,i,m,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=r.child,r.child=null;f!==null;){if(n=f.alternate,n!==null&&Ol(n)===null){r.child=f;break}n=f.sibling,f.sibling=i,i=f,f=n}mf(r,!0,i,null,m,l);break;case"together":mf(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function mr(n,r,i){if(n!==null&&(r.dependencies=n.dependencies),Zr|=r.lanes,(i&r.childLanes)===0)if(n!==null){if(As(n,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,i=lr(n,n.pendingProps),r.child=i,i.return=r;n.sibling!==null;)n=n.sibling,i=i.sibling=lr(n,n.pendingProps),i.return=r;i.sibling=null}return r.child}function pf(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&_l(n)))}function K1(n,r,i){switch(r.tag){case 3:se(r,r.stateNode.containerInfo),Vr(r,ct,n.memoizedState.cache),La();break;case 27:case 5:Te(r);break;case 4:se(r,r.stateNode.containerInfo);break;case 10:Vr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Bd(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(Wr(r),r.flags|=128,null):(i&r.child.childLanes)!==0?wv(n,r,i):(Wr(r),n=mr(n,r,i),n!==null?n.sibling:null);Wr(r);break;case 19:var f=(n.flags&128)!==0;if(l=(i&r.childLanes)!==0,l||(As(n,r,i,!1),l=(i&r.childLanes)!==0),f){if(l)return Sv(n,r,i);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),D(ot,ot.current),l)break;return null;case 22:return r.lanes=0,mv(n,r,i,r.pendingProps);case 24:Vr(r,ct,n.memoizedState.cache)}return mr(n,r,i)}function _v(n,r,i){if(n!==null)if(n.memoizedProps!==r.pendingProps)dt=!0;else{if(!pf(n,i)&&(r.flags&128)===0)return dt=!1,K1(n,r,i);dt=(n.flags&131072)!==0}else dt=!1,Pe&&(r.flags&1048576)!==0&&tg(r,Ii,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(n=Ba(r.elementType),r.type=n,typeof n=="function")bd(n)?(l=qa(n,l),r.tag=1,r=yv(null,r,n,l,i)):(r.tag=0,r=lf(null,r,n,l,i));else{if(n!=null){var f=n.$$typeof;if(f===L){r.tag=11,r=dv(null,r,n,l,i);break e}else if(f===P){r.tag=14,r=fv(null,r,n,l,i);break e}}throw r=ge(n)||n,Error(s(306,r,""))}}return r;case 0:return lf(n,r,r.type,r.pendingProps,i);case 1:return l=r.type,f=qa(l,r.pendingProps),yv(n,r,l,f,i);case 3:e:{if(se(r,r.stateNode.containerInfo),n===null)throw Error(s(387));l=r.pendingProps;var m=r.memoizedState;f=m.element,Dd(n,r),Yi(r,l,null,i);var w=r.memoizedState;if(l=w.cache,Vr(r,ct,l),l!==m.cache&&Ad(r,[ct],i,!0),Fi(),l=w.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:w.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=bv(n,r,l,i);break e}else if(l!==f){f=mn(Error(s(424)),r),$i(f),r=bv(n,r,l,i);break e}else{switch(n=r.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Je=bn(n.firstChild),Et=r,Pe=!0,qr=null,vn=!0,i=mg(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(La(),l===f){r=mr(n,r,i);break e}Tt(n,r,l,i)}r=r.child}return r;case 26:return Hl(n,r),n===null?(i=Dy(r.type,null,r.pendingProps,null))?r.memoizedState=i:Pe||(i=r.type,n=r.pendingProps,l=sc(ne.current).createElement(i),l[_t]=r,l[$t]=n,Rt(l,i,n),bt(l),r.stateNode=l):r.memoizedState=Dy(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Te(r),n===null&&Pe&&(l=r.stateNode=Oy(r.type,r.pendingProps,ne.current),Et=r,vn=!0,f=Je,aa(r.type)?(Yf=f,Je=bn(l.firstChild)):Je=f),Tt(n,r,r.pendingProps.children,i),Hl(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Pe&&((f=l=Je)&&(l=SC(l,r.type,r.pendingProps,vn),l!==null?(r.stateNode=l,Et=r,Je=bn(l.firstChild),vn=!1,f=!0):f=!1),f||Gr(r)),Te(r),f=r.type,m=r.pendingProps,w=n!==null?n.memoizedProps:null,l=m.children,qf(f,m)?l=null:w!==null&&qf(f,w)&&(r.flags|=32),r.memoizedState!==null&&(f=$d(n,r,P1,null,null,i),po._currentValue=f),Hl(n,r),Tt(n,r,l,i),r.child;case 6:return n===null&&Pe&&((n=i=Je)&&(i=_C(i,r.pendingProps,vn),i!==null?(r.stateNode=i,Et=r,Je=null,n=!0):n=!1),n||Gr(r)),null;case 13:return wv(n,r,i);case 4:return se(r,r.stateNode.containerInfo),l=r.pendingProps,n===null?r.child=$a(r,null,l,i):Tt(n,r,l,i),r.child;case 11:return dv(n,r,r.type,r.pendingProps,i);case 7:return Tt(n,r,r.pendingProps,i),r.child;case 8:return Tt(n,r,r.pendingProps.children,i),r.child;case 12:return Tt(n,r,r.pendingProps.children,i),r.child;case 10:return l=r.pendingProps,Vr(r,r.type,l.value),Tt(n,r,l.children,i),r.child;case 9:return f=r.type._context,l=r.pendingProps.children,Pa(r),f=Ct(f),l=l(f),r.flags|=1,Tt(n,r,l,i),r.child;case 14:return fv(n,r,r.type,r.pendingProps,i);case 15:return hv(n,r,r.type,r.pendingProps,i);case 19:return Sv(n,r,i);case 31:return V1(n,r,i);case 22:return mv(n,r,i,r.pendingProps);case 24:return Pa(r),l=Ct(ct),n===null?(f=Od(),f===null&&(f=Ye,m=Nd(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=i),f=m),r.memoizedState={parent:l,cache:f},Md(r),Vr(r,ct,f)):((n.lanes&i)!==0&&(Dd(n,r),Yi(r,null,null,i),Fi()),f=n.memoizedState,m=r.memoizedState,f.parent!==l?(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Vr(r,ct,l)):(l=m.cache,Vr(r,ct,l),l!==f.cache&&Ad(r,[ct],i,!0))),Tt(n,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function pr(n){n.flags|=4}function gf(n,r,i,l,f){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(f&335544128)===f)if(n.stateNode.complete)n.flags|=8192;else if(Xv())n.flags|=8192;else throw Ia=Rl,jd}else n.flags&=-16777217}function Ev(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!By(r))if(Xv())n.flags|=8192;else throw Ia=Rl,jd}function Gl(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ot():536870912,n.lanes|=r,Is|=r)}function eo(n,r){if(!Pe)switch(n.tailMode){case"hidden":r=n.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null}}function Qe(n){var r=n.alternate!==null&&n.alternate.child===n.child,i=0,l=0;if(r)for(var f=n.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=l,n.childLanes=i,r}function F1(n,r,i){var l=r.pendingProps;switch(_d(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(r),null;case 1:return Qe(r),null;case 3:return i=r.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),dr(ct),ie(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(Rs(r)?pr(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Cd())),Qe(r),null;case 26:var f=r.type,m=r.memoizedState;return n===null?(pr(r),m!==null?(Qe(r),Ev(r,m)):(Qe(r),gf(r,f,null,l,i))):m?m!==n.memoizedState?(pr(r),Qe(r),Ev(r,m)):(Qe(r),r.flags&=-16777217):(n=n.memoizedProps,n!==l&&pr(r),Qe(r),gf(r,f,n,l,i)),null;case 27:if(Re(r),i=ne.current,f=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&pr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Qe(r),null}n=Y.current,Rs(r)?rg(r):(n=Oy(f,l,i),r.stateNode=n,pr(r))}return Qe(r),null;case 5:if(Re(r),f=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&pr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Qe(r),null}if(m=Y.current,Rs(r))rg(r);else{var w=sc(ne.current);switch(m){case 1:m=w.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=w.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=w.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof l.is=="string"?w.createElement("select",{is:l.is}):w.createElement("select"),l.multiple?m.multiple=!0:l.size&&(m.size=l.size);break;default:m=typeof l.is=="string"?w.createElement(f,{is:l.is}):w.createElement(f)}}m[_t]=r,m[$t]=l;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)m.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=m;e:switch(Rt(m,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&pr(r)}}return Qe(r),gf(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,i),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==l&&pr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(n=ne.current,Rs(r)){if(n=r.stateNode,i=r.memoizedProps,l=null,f=Et,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}n[_t]=r,n=!!(n.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||wy(n.nodeValue,i)),n||Gr(r,!0)}else n=sc(n).createTextNode(l),n[_t]=r,r.stateNode=n}return Qe(r),null;case 31:if(i=r.memoizedState,n===null||n.memoizedState!==null){if(l=Rs(r),i!==null){if(n===null){if(!l)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[_t]=r}else La(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Qe(r),n=!1}else i=Cd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return r.flags&256?(tn(r),r):(tn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Qe(r),null;case 13:if(l=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=Rs(r),l!==null&&l.dehydrated!==null){if(n===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[_t]=r}else La(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Qe(r),f=!1}else f=Cd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(tn(r),r):(tn(r),null)}return tn(r),(r.flags&128)!==0?(r.lanes=i,r):(i=l!==null,n=n!==null&&n.memoizedState!==null,i&&(l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048)),i!==n&&i&&(r.child.flags|=8192),Gl(r,r.updateQueue),Qe(r),null);case 4:return ie(),n===null&&zf(r.stateNode.containerInfo),Qe(r),null;case 10:return dr(r.type),Qe(r),null;case 19:if(I(ot),l=r.memoizedState,l===null)return Qe(r),null;if(f=(r.flags&128)!==0,m=l.rendering,m===null)if(f)eo(l,!1);else{if(st!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(m=Ol(n),m!==null){for(r.flags|=128,eo(l,!1),n=m.updateQueue,r.updateQueue=n,Gl(r,n),r.subtreeFlags=0,n=i,i=r.child;i!==null;)Qp(i,n),i=i.sibling;return D(ot,ot.current&1|2),Pe&&cr(r,l.treeForkCount),r.child}n=n.sibling}l.tail!==null&&Dt()>Wl&&(r.flags|=128,f=!0,eo(l,!1),r.lanes=4194304)}else{if(!f)if(n=Ol(m),n!==null){if(r.flags|=128,f=!0,n=n.updateQueue,r.updateQueue=n,Gl(r,n),eo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!m.alternate&&!Pe)return Qe(r),null}else 2*Dt()-l.renderingStartTime>Wl&&i!==536870912&&(r.flags|=128,f=!0,eo(l,!1),r.lanes=4194304);l.isBackwards?(m.sibling=r.child,r.child=m):(n=l.last,n!==null?n.sibling=m:r.child=m,l.last=m)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=Dt(),n.sibling=null,i=ot.current,D(ot,f?i&1|2:i&1),Pe&&cr(r,l.treeForkCount),n):(Qe(r),null);case 22:case 23:return tn(r),zd(),l=r.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(i&536870912)!==0&&(r.flags&128)===0&&(Qe(r),r.subtreeFlags&6&&(r.flags|=8192)):Qe(r),i=r.updateQueue,i!==null&&Gl(r,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),n!==null&&I(za),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),dr(ct),Qe(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function Y1(n,r){switch(_d(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return dr(ct),ie(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return Re(r),null;case 31:if(r.memoizedState!==null){if(tn(r),r.alternate===null)throw Error(s(340));La()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(tn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));La()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return I(ot),null;case 4:return ie(),null;case 10:return dr(r.type),null;case 22:case 23:return tn(r),zd(),n!==null&&I(za),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return dr(ct),null;case 25:return null;default:return null}}function Cv(n,r){switch(_d(r),r.tag){case 3:dr(ct),ie();break;case 26:case 27:case 5:Re(r);break;case 4:ie();break;case 31:r.memoizedState!==null&&tn(r);break;case 13:tn(r);break;case 19:I(ot);break;case 10:dr(r.type);break;case 22:case 23:tn(r),zd(),n!==null&&I(za);break;case 24:dr(ct)}}function to(n,r){try{var i=r.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&n)===n){l=void 0;var m=i.create,w=i.inst;l=m(),w.destroy=l}i=i.next}while(i!==f)}}catch(C){He(r,r.return,C)}}function Jr(n,r,i){try{var l=r.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var m=f.next;l=m;do{if((l.tag&n)===n){var w=l.inst,C=w.destroy;if(C!==void 0){w.destroy=void 0,f=r;var O=i,B=C;try{B()}catch(W){He(f,O,W)}}}l=l.next}while(l!==m)}}catch(W){He(r,r.return,W)}}function Tv(n){var r=n.updateQueue;if(r!==null){var i=n.stateNode;try{gg(r,i)}catch(l){He(n,n.return,l)}}}function Rv(n,r,i){i.props=qa(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(l){He(n,r,l)}}function no(n,r){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof i=="function"?n.refCleanup=i(l):i.current=l}}catch(f){He(n,r,f)}}function Gn(n,r){var i=n.ref,l=n.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){He(n,r,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){He(n,r,f)}else i.current=null}function Av(n){var r=n.type,i=n.memoizedProps,l=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){He(n,n.return,f)}}function vf(n,r,i){try{var l=n.stateNode;gC(l,n.type,i,r),l[$t]=r}catch(f){He(n,n.return,f)}}function Nv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&aa(n.type)||n.tag===4}function yf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Nv(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&aa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function bf(n,r,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(n),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=ir));else if(l!==4&&(l===27&&aa(n.type)&&(i=n.stateNode,r=null),n=n.child,n!==null))for(bf(n,r,i),n=n.sibling;n!==null;)bf(n,r,i),n=n.sibling}function Vl(n,r,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?i.insertBefore(n,r):i.appendChild(n);else if(l!==4&&(l===27&&aa(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(Vl(n,r,i),n=n.sibling;n!==null;)Vl(n,r,i),n=n.sibling}function kv(n){var r=n.stateNode,i=n.memoizedProps;try{for(var l=n.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);Rt(r,l,i),r[_t]=n,r[$t]=i}catch(m){He(n,n.return,m)}}var gr=!1,ft=!1,wf=!1,Ov=typeof WeakSet=="function"?WeakSet:Set,wt=null;function W1(n,r){if(n=n.containerInfo,$f=fc,n=qp(n),fd(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var f=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var w=0,C=-1,O=-1,B=0,W=0,Z=n,$=null;t:for(;;){for(var K;Z!==i||f!==0&&Z.nodeType!==3||(C=w+f),Z!==m||l!==0&&Z.nodeType!==3||(O=w+l),Z.nodeType===3&&(w+=Z.nodeValue.length),(K=Z.firstChild)!==null;)$=Z,Z=K;for(;;){if(Z===n)break t;if($===i&&++B===f&&(C=w),$===m&&++W===l&&(O=w),(K=Z.nextSibling)!==null)break;Z=$,$=Z.parentNode}Z=K}i=C===-1||O===-1?null:{start:C,end:O}}else i=null}i=i||{start:0,end:0}}else i=null;for(Hf={focusedElem:n,selectionRange:i},fc=!1,wt=r;wt!==null;)if(r=wt,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,wt=n;else for(;wt!==null;){switch(r=wt,m=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(i=0;i<n.length;i++)f=n[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&m!==null){n=void 0,i=r,f=m.memoizedProps,m=m.memoizedState,l=i.stateNode;try{var he=qa(i.type,f);n=l.getSnapshotBeforeUpdate(he,m),l.__reactInternalSnapshotBeforeUpdate=n}catch(xe){He(i,i.return,xe)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,i=n.nodeType,i===9)Vf(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Vf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=r.sibling,n!==null){n.return=r.return,wt=n;break}wt=r.return}}function jv(n,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:yr(n,i),l&4&&to(5,i);break;case 1:if(yr(n,i),l&4)if(n=i.stateNode,r===null)try{n.componentDidMount()}catch(w){He(i,i.return,w)}else{var f=qa(i.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(f,r,n.__reactInternalSnapshotBeforeUpdate)}catch(w){He(i,i.return,w)}}l&64&&Tv(i),l&512&&no(i,i.return);break;case 3:if(yr(n,i),l&64&&(n=i.updateQueue,n!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{gg(n,r)}catch(w){He(i,i.return,w)}}break;case 27:r===null&&l&4&&kv(i);case 26:case 5:yr(n,i),r===null&&l&4&&Av(i),l&512&&no(i,i.return);break;case 12:yr(n,i);break;case 31:yr(n,i),l&4&&Lv(n,i);break;case 13:yr(n,i),l&4&&Uv(n,i),l&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=aC.bind(null,i),EC(n,i))));break;case 22:if(l=i.memoizedState!==null||gr,!l){r=r!==null&&r.memoizedState!==null||ft,f=gr;var m=ft;gr=l,(ft=r)&&!m?br(n,i,(i.subtreeFlags&8772)!==0):yr(n,i),gr=f,ft=m}break;case 30:break;default:yr(n,i)}}function Mv(n){var r=n.alternate;r!==null&&(n.alternate=null,Mv(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Wu(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var et=null,qt=!1;function vr(n,r,i){for(i=i.child;i!==null;)Dv(n,r,i),i=i.sibling}function Dv(n,r,i){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Ta,i)}catch{}switch(i.tag){case 26:ft||Gn(i,r),vr(n,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ft||Gn(i,r);var l=et,f=qt;aa(i.type)&&(et=i.stateNode,qt=!1),vr(n,r,i),fo(i.stateNode),et=l,qt=f;break;case 5:ft||Gn(i,r);case 6:if(l=et,f=qt,et=null,vr(n,r,i),et=l,qt=f,et!==null)if(qt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(i.stateNode)}catch(m){He(i,r,m)}else try{et.removeChild(i.stateNode)}catch(m){He(i,r,m)}break;case 18:et!==null&&(qt?(n=et,Ty(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),Ys(n)):Ty(et,i.stateNode));break;case 4:l=et,f=qt,et=i.stateNode.containerInfo,qt=!0,vr(n,r,i),et=l,qt=f;break;case 0:case 11:case 14:case 15:Jr(2,i,r),ft||Jr(4,i,r),vr(n,r,i);break;case 1:ft||(Gn(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Rv(i,r,l)),vr(n,r,i);break;case 21:vr(n,r,i);break;case 22:ft=(l=ft)||i.memoizedState!==null,vr(n,r,i),ft=l;break;default:vr(n,r,i)}}function Lv(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{Ys(n)}catch(i){He(r,r.return,i)}}}function Uv(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Ys(n)}catch(i){He(r,r.return,i)}}function X1(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new Ov),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new Ov),r;default:throw Error(s(435,n.tag))}}function Kl(n,r){var i=X1(n);r.forEach(function(l){if(!i.has(l)){i.add(l);var f=sC.bind(null,n,l);l.then(f,f)}})}function Gt(n,r){var i=r.deletions;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l],m=n,w=r,C=w;e:for(;C!==null;){switch(C.tag){case 27:if(aa(C.type)){et=C.stateNode,qt=!1;break e}break;case 5:et=C.stateNode,qt=!1;break e;case 3:case 4:et=C.stateNode.containerInfo,qt=!0;break e}C=C.return}if(et===null)throw Error(s(160));Dv(m,w,f),et=null,qt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Pv(r,n),r=r.sibling}var Nn=null;function Pv(n,r){var i=n.alternate,l=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Gt(r,n),Vt(n),l&4&&(Jr(3,n,n.return),to(3,n),Jr(5,n,n.return));break;case 1:Gt(r,n),Vt(n),l&512&&(ft||i===null||Gn(i,i.return)),l&64&&gr&&(n=n.updateQueue,n!==null&&(l=n.callbacks,l!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var f=Nn;if(Gt(r,n),Vt(n),l&512&&(ft||i===null||Gn(i,i.return)),l&4){var m=i!==null?i.memoizedState:null;if(l=n.memoizedState,i===null)if(l===null)if(n.stateNode===null){e:{l=n.type,i=n.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Ni]||m[_t]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(l),f.head.insertBefore(m,f.querySelector("head > title"))),Rt(m,l,i),m[_t]=n,bt(m),l=m;break e;case"link":var w=Py("link","href",f).get(l+(i.href||""));if(w){for(var C=0;C<w.length;C++)if(m=w[C],m.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&m.getAttribute("rel")===(i.rel==null?null:i.rel)&&m.getAttribute("title")===(i.title==null?null:i.title)&&m.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(C,1);break t}}m=f.createElement(l),Rt(m,l,i),f.head.appendChild(m);break;case"meta":if(w=Py("meta","content",f).get(l+(i.content||""))){for(C=0;C<w.length;C++)if(m=w[C],m.getAttribute("content")===(i.content==null?null:""+i.content)&&m.getAttribute("name")===(i.name==null?null:i.name)&&m.getAttribute("property")===(i.property==null?null:i.property)&&m.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&m.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(C,1);break t}}m=f.createElement(l),Rt(m,l,i),f.head.appendChild(m);break;default:throw Error(s(468,l))}m[_t]=n,bt(m),l=m}n.stateNode=l}else zy(f,n.type,n.stateNode);else n.stateNode=Uy(f,l,n.memoizedProps);else m!==l?(m===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):m.count--,l===null?zy(f,n.type,n.stateNode):Uy(f,l,n.memoizedProps)):l===null&&n.stateNode!==null&&vf(n,n.memoizedProps,i.memoizedProps)}break;case 27:Gt(r,n),Vt(n),l&512&&(ft||i===null||Gn(i,i.return)),i!==null&&l&4&&vf(n,n.memoizedProps,i.memoizedProps);break;case 5:if(Gt(r,n),Vt(n),l&512&&(ft||i===null||Gn(i,i.return)),n.flags&32){f=n.stateNode;try{vs(f,"")}catch(he){He(n,n.return,he)}}l&4&&n.stateNode!=null&&(f=n.memoizedProps,vf(n,f,i!==null?i.memoizedProps:f)),l&1024&&(wf=!0);break;case 6:if(Gt(r,n),Vt(n),l&4){if(n.stateNode===null)throw Error(s(162));l=n.memoizedProps,i=n.stateNode;try{i.nodeValue=l}catch(he){He(n,n.return,he)}}break;case 3:if(lc=null,f=Nn,Nn=ic(r.containerInfo),Gt(r,n),Nn=f,Vt(n),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ys(r.containerInfo)}catch(he){He(n,n.return,he)}wf&&(wf=!1,zv(n));break;case 4:l=Nn,Nn=ic(n.stateNode.containerInfo),Gt(r,n),Vt(n),Nn=l;break;case 12:Gt(r,n),Vt(n);break;case 31:Gt(r,n),Vt(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Kl(n,l)));break;case 13:Gt(r,n),Vt(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Yl=Dt()),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Kl(n,l)));break;case 22:f=n.memoizedState!==null;var O=i!==null&&i.memoizedState!==null,B=gr,W=ft;if(gr=B||f,ft=W||O,Gt(r,n),ft=W,gr=B,Vt(n),l&8192)e:for(r=n.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(i===null||O||gr||ft||Ga(n)),i=null,r=n;;){if(r.tag===5||r.tag===26){if(i===null){O=i=r;try{if(m=O.stateNode,f)w=m.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{C=O.stateNode;var Z=O.memoizedProps.style,$=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;C.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(he){He(O,O.return,he)}}}else if(r.tag===6){if(i===null){O=r;try{O.stateNode.nodeValue=f?"":O.memoizedProps}catch(he){He(O,O.return,he)}}}else if(r.tag===18){if(i===null){O=r;try{var K=O.stateNode;f?Ry(K,!0):Ry(O.stateNode,!1)}catch(he){He(O,O.return,he)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=n.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,Kl(n,i))));break;case 19:Gt(r,n),Vt(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,Kl(n,l)));break;case 30:break;case 21:break;default:Gt(r,n),Vt(n)}}function Vt(n){var r=n.flags;if(r&2){try{for(var i,l=n.return;l!==null;){if(Nv(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var f=i.stateNode,m=yf(n);Vl(n,m,f);break;case 5:var w=i.stateNode;i.flags&32&&(vs(w,""),i.flags&=-33);var C=yf(n);Vl(n,C,w);break;case 3:case 4:var O=i.stateNode.containerInfo,B=yf(n);bf(n,B,O);break;default:throw Error(s(161))}}catch(W){He(n,n.return,W)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function zv(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;zv(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function yr(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)jv(n,r.alternate,r),r=r.sibling}function Ga(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Jr(4,r,r.return),Ga(r);break;case 1:Gn(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&Rv(r,r.return,i),Ga(r);break;case 27:fo(r.stateNode);case 26:case 5:Gn(r,r.return),Ga(r);break;case 22:r.memoizedState===null&&Ga(r);break;case 30:Ga(r);break;default:Ga(r)}n=n.sibling}}function br(n,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,f=n,m=r,w=m.flags;switch(m.tag){case 0:case 11:case 15:br(f,m,i),to(4,m);break;case 1:if(br(f,m,i),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(B){He(l,l.return,B)}if(l=m,f=l.updateQueue,f!==null){var C=l.stateNode;try{var O=f.shared.hiddenCallbacks;if(O!==null)for(f.shared.hiddenCallbacks=null,f=0;f<O.length;f++)pg(O[f],C)}catch(B){He(l,l.return,B)}}i&&w&64&&Tv(m),no(m,m.return);break;case 27:kv(m);case 26:case 5:br(f,m,i),i&&l===null&&w&4&&Av(m),no(m,m.return);break;case 12:br(f,m,i);break;case 31:br(f,m,i),i&&w&4&&Lv(f,m);break;case 13:br(f,m,i),i&&w&4&&Uv(f,m);break;case 22:m.memoizedState===null&&br(f,m,i),no(m,m.return);break;case 30:break;default:br(f,m,i)}r=r.sibling}}function xf(n,r){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&Hi(i))}function Sf(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Hi(n))}function kn(n,r,i,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Bv(n,r,i,l),r=r.sibling}function Bv(n,r,i,l){var f=r.flags;switch(r.tag){case 0:case 11:case 15:kn(n,r,i,l),f&2048&&to(9,r);break;case 1:kn(n,r,i,l);break;case 3:kn(n,r,i,l),f&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&Hi(n)));break;case 12:if(f&2048){kn(n,r,i,l),n=r.stateNode;try{var m=r.memoizedProps,w=m.id,C=m.onPostCommit;typeof C=="function"&&C(w,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(O){He(r,r.return,O)}}else kn(n,r,i,l);break;case 31:kn(n,r,i,l);break;case 13:kn(n,r,i,l);break;case 23:break;case 22:m=r.stateNode,w=r.alternate,r.memoizedState!==null?m._visibility&2?kn(n,r,i,l):ro(n,r):m._visibility&2?kn(n,r,i,l):(m._visibility|=2,Ps(n,r,i,l,(r.subtreeFlags&10256)!==0||!1)),f&2048&&xf(w,r);break;case 24:kn(n,r,i,l),f&2048&&Sf(r.alternate,r);break;default:kn(n,r,i,l)}}function Ps(n,r,i,l,f){for(f=f&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=n,w=r,C=i,O=l,B=w.flags;switch(w.tag){case 0:case 11:case 15:Ps(m,w,C,O,f),to(8,w);break;case 23:break;case 22:var W=w.stateNode;w.memoizedState!==null?W._visibility&2?Ps(m,w,C,O,f):ro(m,w):(W._visibility|=2,Ps(m,w,C,O,f)),f&&B&2048&&xf(w.alternate,w);break;case 24:Ps(m,w,C,O,f),f&&B&2048&&Sf(w.alternate,w);break;default:Ps(m,w,C,O,f)}r=r.sibling}}function ro(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=n,l=r,f=l.flags;switch(l.tag){case 22:ro(i,l),f&2048&&xf(l.alternate,l);break;case 24:ro(i,l),f&2048&&Sf(l.alternate,l);break;default:ro(i,l)}r=r.sibling}}var ao=8192;function zs(n,r,i){if(n.subtreeFlags&ao)for(n=n.child;n!==null;)Iv(n,r,i),n=n.sibling}function Iv(n,r,i){switch(n.tag){case 26:zs(n,r,i),n.flags&ao&&n.memoizedState!==null&&UC(i,Nn,n.memoizedState,n.memoizedProps);break;case 5:zs(n,r,i);break;case 3:case 4:var l=Nn;Nn=ic(n.stateNode.containerInfo),zs(n,r,i),Nn=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=ao,ao=16777216,zs(n,r,i),ao=l):zs(n,r,i));break;default:zs(n,r,i)}}function $v(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function so(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];wt=l,qv(l,n)}$v(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Hv(n),n=n.sibling}function Hv(n){switch(n.tag){case 0:case 11:case 15:so(n),n.flags&2048&&Jr(9,n,n.return);break;case 3:so(n);break;case 12:so(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Fl(n)):so(n);break;default:so(n)}}function Fl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];wt=l,qv(l,n)}$v(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Jr(8,r,r.return),Fl(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,Fl(r));break;default:Fl(r)}n=n.sibling}}function qv(n,r){for(;wt!==null;){var i=wt;switch(i.tag){case 0:case 11:case 15:Jr(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Hi(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,wt=l;else e:for(i=n;wt!==null;){l=wt;var f=l.sibling,m=l.return;if(Mv(l),l===i){wt=null;break e}if(f!==null){f.return=m,wt=f;break e}wt=m}}}var J1={getCacheForType:function(n){var r=Ct(ct),i=r.data.get(n);return i===void 0&&(i=n(),r.data.set(n,i)),i},cacheSignal:function(){return Ct(ct).controller.signal}},Q1=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ye=null,je=null,Le=0,$e=0,nn=null,Qr=!1,Bs=!1,_f=!1,wr=0,st=0,Zr=0,Va=0,Ef=0,rn=0,Is=0,io=null,Kt=null,Cf=!1,Yl=0,Gv=0,Wl=1/0,Xl=null,ea=null,mt=0,ta=null,$s=null,xr=0,Tf=0,Rf=null,Vv=null,oo=0,Af=null;function an(){return(Ie&2)!==0&&Le!==0?Le&-Le:j.T!==null?Df():Fu()}function Kv(){if(rn===0)if((Le&536870912)===0||Pe){var n=cs;cs<<=1,(cs&3932160)===0&&(cs=262144),rn=n}else rn=536870912;return n=en.current,n!==null&&(n.flags|=32),rn}function Ft(n,r,i){(n===Ye&&($e===2||$e===9)||n.cancelPendingCommit!==null)&&(Hs(n,0),na(n,Le,rn,!1)),tt(n,i),((Ie&2)===0||n!==Ye)&&(n===Ye&&((Ie&2)===0&&(Va|=i),st===4&&na(n,Le,rn,!1)),Vn(n))}function Fv(n,r,i){if((Ie&6)!==0)throw Error(s(327));var l=!i&&(r&127)===0&&(r&n.expiredLanes)===0||Ze(n,r),f=l?tC(n,r):kf(n,r,!0),m=l;do{if(f===0){Bs&&!l&&na(n,r,0,!1);break}else{if(i=n.current.alternate,m&&!Z1(i)){f=kf(n,r,!1),m=!1;continue}if(f===2){if(m=r,n.errorRecoveryDisabledLanes&m)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){r=w;e:{var C=n;f=io;var O=C.current.memoizedState.isDehydrated;if(O&&(Hs(C,w).flags|=256),w=kf(C,w,!1),w!==2){if(_f&&!O){C.errorRecoveryDisabledLanes|=m,Va|=m,f=4;break e}m=Kt,Kt=f,m!==null&&(Kt===null?Kt=m:Kt.push.apply(Kt,m))}f=w}if(m=!1,f!==2)continue}}if(f===1){Hs(n,0),na(n,r,0,!0);break}e:{switch(l=n,m=f,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:na(l,r,rn,!Qr);break e;case 2:Kt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=Yl+300-Dt(),10<f)){if(na(l,r,rn,!Qr),_e(l,0,!0)!==0)break e;xr=r,l.timeoutHandle=Ey(Yv.bind(null,l,i,Kt,Xl,Cf,r,rn,Va,Is,Qr,m,"Throttled",-0,0),f);break e}Yv(l,i,Kt,Xl,Cf,r,rn,Va,Is,Qr,m,null,-0,0)}}break}while(!0);Vn(n)}function Yv(n,r,i,l,f,m,w,C,O,B,W,Z,$,K){if(n.timeoutHandle=-1,Z=r.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ir},Iv(r,m,Z);var he=(m&62914560)===m?Yl-Dt():(m&4194048)===m?Gv-Dt():0;if(he=PC(Z,he),he!==null){xr=m,n.cancelPendingCommit=he(ny.bind(null,n,r,m,i,l,f,w,C,O,W,Z,null,$,K)),na(n,m,w,!B);return}}ny(n,r,m,i,l,f,w,C,O)}function Z1(n){for(var r=n;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],m=f.getSnapshot;f=f.value;try{if(!Qt(m(),f))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function na(n,r,i,l){r&=~Ef,r&=~Va,n.suspendedLanes|=r,n.pingedLanes&=~r,l&&(n.warmLanes|=r),l=n.expirationTimes;for(var f=r;0<f;){var m=31-kt(f),w=1<<m;l[m]=-1,f&=~w}i!==0&&Aa(n,i,r)}function Jl(){return(Ie&6)===0?(lo(0),!1):!0}function Nf(){if(je!==null){if($e===0)var n=je.return;else n=je,ur=Ua=null,Gd(n),js=null,Gi=0,n=je;for(;n!==null;)Cv(n.alternate,n),n=n.return;je=null}}function Hs(n,r){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,bC(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),xr=0,Nf(),Ye=n,je=i=lr(n.current,null),Le=r,$e=0,nn=null,Qr=!1,Bs=Ze(n,r),_f=!1,Is=rn=Ef=Va=Zr=st=0,Kt=io=null,Cf=!1,(r&8)!==0&&(r|=r&32);var l=n.entangledLanes;if(l!==0)for(n=n.entanglements,l&=r;0<l;){var f=31-kt(l),m=1<<f;r|=n[f],l&=~m}return wr=r,yl(),i}function Wv(n,r){Ae=null,j.H=Qi,r===Os||r===Tl?(r=dg(),$e=3):r===jd?(r=dg(),$e=4):$e=r===of?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,nn=r,je===null&&(st=1,Il(n,mn(r,n.current)))}function Xv(){var n=en.current;return n===null?!0:(Le&4194048)===Le?yn===null:(Le&62914560)===Le||(Le&536870912)!==0?n===yn:!1}function Jv(){var n=j.H;return j.H=Qi,n===null?Qi:n}function Qv(){var n=j.A;return j.A=J1,n}function Ql(){st=4,Qr||(Le&4194048)!==Le&&en.current!==null||(Bs=!0),(Zr&134217727)===0&&(Va&134217727)===0||Ye===null||na(Ye,Le,rn,!1)}function kf(n,r,i){var l=Ie;Ie|=2;var f=Jv(),m=Qv();(Ye!==n||Le!==r)&&(Xl=null,Hs(n,r)),r=!1;var w=st;e:do try{if($e!==0&&je!==null){var C=je,O=nn;switch($e){case 8:Nf(),w=6;break e;case 3:case 2:case 9:case 6:en.current===null&&(r=!0);var B=$e;if($e=0,nn=null,qs(n,C,O,B),i&&Bs){w=0;break e}break;default:B=$e,$e=0,nn=null,qs(n,C,O,B)}}eC(),w=st;break}catch(W){Wv(n,W)}while(!0);return r&&n.shellSuspendCounter++,ur=Ua=null,Ie=l,j.H=f,j.A=m,je===null&&(Ye=null,Le=0,yl()),w}function eC(){for(;je!==null;)Zv(je)}function tC(n,r){var i=Ie;Ie|=2;var l=Jv(),f=Qv();Ye!==n||Le!==r?(Xl=null,Wl=Dt()+500,Hs(n,r)):Bs=Ze(n,r);e:do try{if($e!==0&&je!==null){r=je;var m=nn;t:switch($e){case 1:$e=0,nn=null,qs(n,r,m,1);break;case 2:case 9:if(cg(m)){$e=0,nn=null,ey(r);break}r=function(){$e!==2&&$e!==9||Ye!==n||($e=7),Vn(n)},m.then(r,r);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:cg(m)?($e=0,nn=null,ey(r)):($e=0,nn=null,qs(n,r,m,7));break;case 5:var w=null;switch(je.tag){case 26:w=je.memoizedState;case 5:case 27:var C=je;if(w?By(w):C.stateNode.complete){$e=0,nn=null;var O=C.sibling;if(O!==null)je=O;else{var B=C.return;B!==null?(je=B,Zl(B)):je=null}break t}}$e=0,nn=null,qs(n,r,m,5);break;case 6:$e=0,nn=null,qs(n,r,m,6);break;case 8:Nf(),st=6;break e;default:throw Error(s(462))}}nC();break}catch(W){Wv(n,W)}while(!0);return ur=Ua=null,j.H=l,j.A=f,Ie=i,je!==null?0:(Ye=null,Le=0,yl(),st)}function nC(){for(;je!==null&&!Mt();)Zv(je)}function Zv(n){var r=_v(n.alternate,n,wr);n.memoizedProps=n.pendingProps,r===null?Zl(n):je=r}function ey(n){var r=n,i=r.alternate;switch(r.tag){case 15:case 0:r=vv(i,r,r.pendingProps,r.type,void 0,Le);break;case 11:r=vv(i,r,r.pendingProps,r.type.render,r.ref,Le);break;case 5:Gd(r);default:Cv(i,r),r=je=Qp(r,wr),r=_v(i,r,wr)}n.memoizedProps=n.pendingProps,r===null?Zl(n):je=r}function qs(n,r,i,l){ur=Ua=null,Gd(r),js=null,Gi=0;var f=r.return;try{if(G1(n,f,r,i,Le)){st=1,Il(n,mn(i,n.current)),je=null;return}}catch(m){if(f!==null)throw je=f,m;st=1,Il(n,mn(i,n.current)),je=null;return}r.flags&32768?(Pe||l===1?n=!0:Bs||(Le&536870912)!==0?n=!1:(Qr=n=!0,(l===2||l===9||l===3||l===6)&&(l=en.current,l!==null&&l.tag===13&&(l.flags|=16384))),ty(r,n)):Zl(r)}function Zl(n){var r=n;do{if((r.flags&32768)!==0){ty(r,Qr);return}n=r.return;var i=F1(r.alternate,r,wr);if(i!==null){je=i;return}if(r=r.sibling,r!==null){je=r;return}je=r=n}while(r!==null);st===0&&(st=5)}function ty(n,r){do{var i=Y1(n.alternate,n);if(i!==null){i.flags&=32767,je=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(n=n.sibling,n!==null)){je=n;return}je=n=i}while(n!==null);st=6,je=null}function ny(n,r,i,l,f,m,w,C,O){n.cancelPendingCommit=null;do ec();while(mt!==0);if((Ie&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=vd,zt(n,i,m,w,C,O),n===Ye&&(je=Ye=null,Le=0),$s=r,ta=n,xr=i,Tf=m,Rf=f,Vv=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,iC(Ca,function(){return oy(),null})):(n.callbackNode=null,n.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=j.T,j.T=null,f=F.p,F.p=2,w=Ie,Ie|=4;try{W1(n,r,i)}finally{Ie=w,F.p=f,j.T=l}}mt=1,ry(),ay(),sy()}}function ry(){if(mt===1){mt=0;var n=ta,r=$s,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=j.T,j.T=null;var l=F.p;F.p=2;var f=Ie;Ie|=4;try{Pv(r,n);var m=Hf,w=qp(n.containerInfo),C=m.focusedElem,O=m.selectionRange;if(w!==C&&C&&C.ownerDocument&&Hp(C.ownerDocument.documentElement,C)){if(O!==null&&fd(C)){var B=O.start,W=O.end;if(W===void 0&&(W=B),"selectionStart"in C)C.selectionStart=B,C.selectionEnd=Math.min(W,C.value.length);else{var Z=C.ownerDocument||document,$=Z&&Z.defaultView||window;if($.getSelection){var K=$.getSelection(),he=C.textContent.length,xe=Math.min(O.start,he),Ke=O.end===void 0?xe:Math.min(O.end,he);!K.extend&&xe>Ke&&(w=Ke,Ke=xe,xe=w);var U=$p(C,xe),M=$p(C,Ke);if(U&&M&&(K.rangeCount!==1||K.anchorNode!==U.node||K.anchorOffset!==U.offset||K.focusNode!==M.node||K.focusOffset!==M.offset)){var z=Z.createRange();z.setStart(U.node,U.offset),K.removeAllRanges(),xe>Ke?(K.addRange(z),K.extend(M.node,M.offset)):(z.setEnd(M.node,M.offset),K.addRange(z))}}}}for(Z=[],K=C;K=K.parentNode;)K.nodeType===1&&Z.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<Z.length;C++){var X=Z[C];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}fc=!!$f,Hf=$f=null}finally{Ie=f,F.p=l,j.T=i}}n.current=r,mt=2}}function ay(){if(mt===2){mt=0;var n=ta,r=$s,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=j.T,j.T=null;var l=F.p;F.p=2;var f=Ie;Ie|=4;try{jv(n,r.alternate,r)}finally{Ie=f,F.p=l,j.T=i}}mt=3}}function sy(){if(mt===4||mt===3){mt=0,Pr();var n=ta,r=$s,i=xr,l=Vv;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?mt=5:(mt=0,$s=ta=null,iy(n,n.pendingLanes));var f=n.pendingLanes;if(f===0&&(ea=null),Rn(i),r=r.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Ta,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=j.T,f=F.p,F.p=2,j.T=null;try{for(var m=n.onRecoverableError,w=0;w<l.length;w++){var C=l[w];m(C.value,{componentStack:C.stack})}}finally{j.T=r,F.p=f}}(xr&3)!==0&&ec(),Vn(n),f=n.pendingLanes,(i&261930)!==0&&(f&42)!==0?n===Af?oo++:(oo=0,Af=n):oo=0,lo(0)}}function iy(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,Hi(r)))}function ec(){return ry(),ay(),sy(),oy()}function oy(){if(mt!==5)return!1;var n=ta,r=Tf;Tf=0;var i=Rn(xr),l=j.T,f=F.p;try{F.p=32>i?32:i,j.T=null,i=Rf,Rf=null;var m=ta,w=xr;if(mt=0,$s=ta=null,xr=0,(Ie&6)!==0)throw Error(s(331));var C=Ie;if(Ie|=4,Hv(m.current),Bv(m,m.current,w,i),Ie=C,lo(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Ta,m)}catch{}return!0}finally{F.p=f,j.T=l,iy(n,r)}}function ly(n,r,i){r=mn(i,r),r=sf(n.stateNode,r,2),n=Yr(n,r,2),n!==null&&(tt(n,2),Vn(n))}function He(n,r,i){if(n.tag===3)ly(n,n,i);else for(;r!==null;){if(r.tag===3){ly(r,n,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ea===null||!ea.has(l))){n=mn(i,n),i=cv(2),l=Yr(r,i,2),l!==null&&(uv(i,l,r,n),tt(l,2),Vn(l));break}}r=r.return}}function Of(n,r,i){var l=n.pingCache;if(l===null){l=n.pingCache=new Q1;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(i)||(_f=!0,f.add(i),n=rC.bind(null,n,r,i),r.then(n,n))}function rC(n,r,i){var l=n.pingCache;l!==null&&l.delete(r),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,Ye===n&&(Le&i)===i&&(st===4||st===3&&(Le&62914560)===Le&&300>Dt()-Yl?(Ie&2)===0&&Hs(n,0):Ef|=i,Is===Le&&(Is=0)),Vn(n)}function cy(n,r){r===0&&(r=Ot()),n=Ma(n,r),n!==null&&(tt(n,r),Vn(n))}function aC(n){var r=n.memoizedState,i=0;r!==null&&(i=r.retryLane),cy(n,i)}function sC(n,r){var i=0;switch(n.tag){case 31:case 13:var l=n.stateNode,f=n.memoizedState;f!==null&&(i=f.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),cy(n,i)}function iC(n,r){return Ci(n,r)}var tc=null,Gs=null,jf=!1,nc=!1,Mf=!1,ra=0;function Vn(n){n!==Gs&&n.next===null&&(Gs===null?tc=Gs=n:Gs=Gs.next=n),nc=!0,jf||(jf=!0,lC())}function lo(n,r){if(!Mf&&nc){Mf=!0;do for(var i=!1,l=tc;l!==null;){if(n!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var w=l.suspendedLanes,C=l.pingedLanes;m=(1<<31-kt(42|n)+1)-1,m&=f&~(w&~C),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,hy(l,m))}else m=Le,m=_e(l,l===Ye?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Ze(l,m)||(i=!0,hy(l,m));l=l.next}while(i);Mf=!1}}function oC(){uy()}function uy(){nc=jf=!1;var n=0;ra!==0&&yC()&&(n=ra);for(var r=Dt(),i=null,l=tc;l!==null;){var f=l.next,m=dy(l,r);m===0?(l.next=null,i===null?tc=f:i.next=f,f===null&&(Gs=i)):(i=l,(n!==0||(m&3)!==0)&&(nc=!0)),l=f}mt!==0&&mt!==5||lo(n),ra!==0&&(ra=0)}function dy(n,r){for(var i=n.suspendedLanes,l=n.pingedLanes,f=n.expirationTimes,m=n.pendingLanes&-62914561;0<m;){var w=31-kt(m),C=1<<w,O=f[w];O===-1?((C&i)===0||(C&l)!==0)&&(f[w]=yt(C,r)):O<=r&&(n.expiredLanes|=C),m&=~C}if(r=Ye,i=Le,i=_e(n,n===r?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,i===0||n===r&&($e===2||$e===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&Ti(l),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||Ze(n,i)){if(r=i&-i,r===n.callbackPriority)return r;switch(l!==null&&Ti(l),Rn(i)){case 2:case 8:i=sl;break;case 32:i=Ca;break;case 268435456:i=ar;break;default:i=Ca}return l=fy.bind(null,n),i=Ci(i,l),n.callbackPriority=r,n.callbackNode=i,r}return l!==null&&l!==null&&Ti(l),n.callbackPriority=2,n.callbackNode=null,2}function fy(n,r){if(mt!==0&&mt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(ec()&&n.callbackNode!==i)return null;var l=Le;return l=_e(n,n===Ye?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(Fv(n,l,r),dy(n,Dt()),n.callbackNode!=null&&n.callbackNode===i?fy.bind(null,n):null)}function hy(n,r){if(ec())return null;Fv(n,r,!0)}function lC(){wC(function(){(Ie&6)!==0?Ci(Ea,oC):uy()})}function Df(){if(ra===0){var n=Ns;n===0&&(n=ls,ls<<=1,(ls&261888)===0&&(ls=256)),ra=n}return ra}function my(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:ul(""+n)}function py(n,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,n.id&&i.setAttribute("form",n.id),r.parentNode.insertBefore(i,r),n=new FormData(n),i.parentNode.removeChild(i),n}function cC(n,r,i,l,f){if(r==="submit"&&i&&i.stateNode===f){var m=my((f[$t]||null).action),w=l.submitter;w&&(r=(r=w[$t]||null)?my(r.formAction):w.getAttribute("formAction"),r!==null&&(m=r,w=null));var C=new ml("action","action",null,l,f);n.push({event:C,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ra!==0){var O=w?py(f,w):new FormData(f);Zd(i,{pending:!0,data:O,method:f.method,action:m},null,O)}}else typeof m=="function"&&(C.preventDefault(),O=w?py(f,w):new FormData(f),Zd(i,{pending:!0,data:O,method:f.method,action:m},m,O))},currentTarget:f}]})}}for(var Lf=0;Lf<gd.length;Lf++){var Uf=gd[Lf],uC=Uf.toLowerCase(),dC=Uf[0].toUpperCase()+Uf.slice(1);An(uC,"on"+dC)}An(Kp,"onAnimationEnd"),An(Fp,"onAnimationIteration"),An(Yp,"onAnimationStart"),An("dblclick","onDoubleClick"),An("focusin","onFocus"),An("focusout","onBlur"),An(R1,"onTransitionRun"),An(A1,"onTransitionStart"),An(N1,"onTransitionCancel"),An(Wp,"onTransitionEnd"),ps("onMouseEnter",["mouseout","mouseover"]),ps("onMouseLeave",["mouseout","mouseover"]),ps("onPointerEnter",["pointerout","pointerover"]),ps("onPointerLeave",["pointerout","pointerover"]),Na("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Na("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Na("onBeforeInput",["compositionend","keypress","textInput","paste"]),Na("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Na("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Na("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="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(" "),fC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(co));function gy(n,r){r=(r&4)!==0;for(var i=0;i<n.length;i++){var l=n[i],f=l.event;l=l.listeners;e:{var m=void 0;if(r)for(var w=l.length-1;0<=w;w--){var C=l[w],O=C.instance,B=C.currentTarget;if(C=C.listener,O!==m&&f.isPropagationStopped())break e;m=C,f.currentTarget=B;try{m(f)}catch(W){vl(W)}f.currentTarget=null,m=O}else for(w=0;w<l.length;w++){if(C=l[w],O=C.instance,B=C.currentTarget,C=C.listener,O!==m&&f.isPropagationStopped())break e;m=C,f.currentTarget=B;try{m(f)}catch(W){vl(W)}f.currentTarget=null,m=O}}}}function Me(n,r){var i=r[Yu];i===void 0&&(i=r[Yu]=new Set);var l=n+"__bubble";i.has(l)||(vy(r,n,2,!1),i.add(l))}function Pf(n,r,i){var l=0;r&&(l|=4),vy(i,n,l,r)}var rc="_reactListening"+Math.random().toString(36).slice(2);function zf(n){if(!n[rc]){n[rc]=!0,up.forEach(function(i){i!=="selectionchange"&&(fC.has(i)||Pf(i,!1,n),Pf(i,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[rc]||(r[rc]=!0,Pf("selectionchange",!1,r))}}function vy(n,r,i,l){switch(Ky(r)){case 2:var f=IC;break;case 8:f=$C;break;default:f=Zf}i=f.bind(null,r,i,n),f=void 0,!rd||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f!==void 0?n.addEventListener(r,i,{capture:!0,passive:f}):n.addEventListener(r,i,!0):f!==void 0?n.addEventListener(r,i,{passive:f}):n.addEventListener(r,i,!1)}function Bf(n,r,i,l,f){var m=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var w=l.tag;if(w===3||w===4){var C=l.stateNode.containerInfo;if(C===f)break;if(w===4)for(w=l.return;w!==null;){var O=w.tag;if((O===3||O===4)&&w.stateNode.containerInfo===f)return;w=w.return}for(;C!==null;){if(w=fs(C),w===null)return;if(O=w.tag,O===5||O===6||O===26||O===27){l=m=w;continue e}C=C.parentNode}}l=l.return}Sp(function(){var B=m,W=td(i),Z=[];e:{var $=Xp.get(n);if($!==void 0){var K=ml,he=n;switch(n){case"keypress":if(fl(i)===0)break e;case"keydown":case"keyup":K=s1;break;case"focusin":he="focus",K=od;break;case"focusout":he="blur",K=od;break;case"beforeblur":case"afterblur":K=od;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":K=Cp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=FE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=l1;break;case Kp:case Fp:case Yp:K=XE;break;case Wp:K=u1;break;case"scroll":case"scrollend":K=VE;break;case"wheel":K=f1;break;case"copy":case"cut":case"paste":K=QE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Rp;break;case"toggle":case"beforetoggle":K=m1}var xe=(r&4)!==0,Ke=!xe&&(n==="scroll"||n==="scrollend"),U=xe?$!==null?$+"Capture":null:$;xe=[];for(var M=B,z;M!==null;){var X=M;if(z=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||z===null||U===null||(X=Oi(M,U),X!=null&&xe.push(uo(M,X,z))),Ke)break;M=M.return}0<xe.length&&($=new K($,he,null,i,W),Z.push({event:$,listeners:xe}))}}if((r&7)===0){e:{if($=n==="mouseover"||n==="pointerover",K=n==="mouseout"||n==="pointerout",$&&i!==ed&&(he=i.relatedTarget||i.fromElement)&&(fs(he)||he[ds]))break e;if((K||$)&&($=W.window===W?W:($=W.ownerDocument)?$.defaultView||$.parentWindow:window,K?(he=i.relatedTarget||i.toElement,K=B,he=he?fs(he):null,he!==null&&(Ke=c(he),xe=he.tag,he!==Ke||xe!==5&&xe!==27&&xe!==6)&&(he=null)):(K=null,he=B),K!==he)){if(xe=Cp,X="onMouseLeave",U="onMouseEnter",M="mouse",(n==="pointerout"||n==="pointerover")&&(xe=Rp,X="onPointerLeave",U="onPointerEnter",M="pointer"),Ke=K==null?$:ki(K),z=he==null?$:ki(he),$=new xe(X,M+"leave",K,i,W),$.target=Ke,$.relatedTarget=z,X=null,fs(W)===B&&(xe=new xe(U,M+"enter",he,i,W),xe.target=z,xe.relatedTarget=Ke,X=xe),Ke=X,K&&he)t:{for(xe=hC,U=K,M=he,z=0,X=U;X;X=xe(X))z++;X=0;for(var we=M;we;we=xe(we))X++;for(;0<z-X;)U=xe(U),z--;for(;0<X-z;)M=xe(M),X--;for(;z--;){if(U===M||M!==null&&U===M.alternate){xe=U;break t}U=xe(U),M=xe(M)}xe=null}else xe=null;K!==null&&yy(Z,$,K,xe,!1),he!==null&&Ke!==null&&yy(Z,Ke,he,xe,!0)}}e:{if($=B?ki(B):window,K=$.nodeName&&$.nodeName.toLowerCase(),K==="select"||K==="input"&&$.type==="file")var ze=Lp;else if(Mp($))if(Up)ze=E1;else{ze=S1;var ve=x1}else K=$.nodeName,!K||K.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?B&&Zu(B.elementType)&&(ze=Lp):ze=_1;if(ze&&(ze=ze(n,B))){Dp(Z,ze,i,W);break e}ve&&ve(n,$,B),n==="focusout"&&B&&$.type==="number"&&B.memoizedProps.value!=null&&Qu($,"number",$.value)}switch(ve=B?ki(B):window,n){case"focusin":(Mp(ve)||ve.contentEditable==="true")&&(xs=ve,hd=B,Bi=null);break;case"focusout":Bi=hd=xs=null;break;case"mousedown":md=!0;break;case"contextmenu":case"mouseup":case"dragend":md=!1,Gp(Z,i,W);break;case"selectionchange":if(T1)break;case"keydown":case"keyup":Gp(Z,i,W)}var Ne;if(cd)e:{switch(n){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ws?Op(n,i)&&(Ue="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(Ap&&i.locale!=="ko"&&(ws||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ws&&(Ne=_p()):($r=W,ad="value"in $r?$r.value:$r.textContent,ws=!0)),ve=ac(B,Ue),0<ve.length&&(Ue=new Tp(Ue,n,null,i,W),Z.push({event:Ue,listeners:ve}),Ne?Ue.data=Ne:(Ne=jp(i),Ne!==null&&(Ue.data=Ne)))),(Ne=g1?v1(n,i):y1(n,i))&&(Ue=ac(B,"onBeforeInput"),0<Ue.length&&(ve=new Tp("onBeforeInput","beforeinput",null,i,W),Z.push({event:ve,listeners:Ue}),ve.data=Ne)),cC(Z,n,B,i,W)}gy(Z,r)})}function uo(n,r,i){return{instance:n,listener:r,currentTarget:i}}function ac(n,r){for(var i=r+"Capture",l=[];n!==null;){var f=n,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Oi(n,i),f!=null&&l.unshift(uo(n,f,m)),f=Oi(n,r),f!=null&&l.push(uo(n,f,m))),n.tag===3)return l;n=n.return}return[]}function hC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function yy(n,r,i,l,f){for(var m=r._reactName,w=[];i!==null&&i!==l;){var C=i,O=C.alternate,B=C.stateNode;if(C=C.tag,O!==null&&O===l)break;C!==5&&C!==26&&C!==27||B===null||(O=B,f?(B=Oi(i,m),B!=null&&w.unshift(uo(i,B,O))):f||(B=Oi(i,m),B!=null&&w.push(uo(i,B,O)))),i=i.return}w.length!==0&&n.push({event:r,listeners:w})}var mC=/\r\n?/g,pC=/\u0000|\uFFFD/g;function by(n){return(typeof n=="string"?n:""+n).replace(mC,`
`).replace(pC,"")}function wy(n,r){return r=by(r),by(n)===r}function Ve(n,r,i,l,f,m){switch(i){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||vs(n,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&vs(n,""+l);break;case"className":ll(n,"class",l);break;case"tabIndex":ll(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ll(n,i,l);break;case"style":wp(n,l,m);break;case"data":if(r!=="object"){ll(n,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){n.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=ul(""+l),n.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){n.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 m=="function"&&(i==="formAction"?(r!=="input"&&Ve(n,r,"name",f.name,f,null),Ve(n,r,"formEncType",f.formEncType,f,null),Ve(n,r,"formMethod",f.formMethod,f,null),Ve(n,r,"formTarget",f.formTarget,f,null)):(Ve(n,r,"encType",f.encType,f,null),Ve(n,r,"method",f.method,f,null),Ve(n,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=ul(""+l),n.setAttribute(i,l);break;case"onClick":l!=null&&(n.onclick=ir);break;case"onScroll":l!=null&&Me("scroll",n);break;case"onScrollEnd":l!=null&&Me("scrollend",n);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}i=ul(""+l),n.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":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,""+l):n.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":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":l===!0?n.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,l):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(i,l):n.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(i):n.setAttribute(i,l);break;case"popover":Me("beforetoggle",n),Me("toggle",n),ol(n,"popover",l);break;case"xlinkActuate":sr(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":sr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":sr(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":sr(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":sr(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":sr(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":sr(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":sr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":sr(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":ol(n,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=qE.get(i)||i,ol(n,i,l))}}function If(n,r,i,l,f,m){switch(i){case"style":wp(n,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"children":typeof l=="string"?vs(n,l):(typeof l=="number"||typeof l=="bigint")&&vs(n,""+l);break;case"onScroll":l!=null&&Me("scroll",n);break;case"onScrollEnd":l!=null&&Me("scrollend",n);break;case"onClick":l!=null&&(n.onclick=ir);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dp.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),r=i.slice(2,f?i.length-7:void 0),m=n[$t]||null,m=m!=null?m[i]:null,typeof m=="function"&&n.removeEventListener(r,m,f),typeof l=="function")){typeof m!="function"&&m!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(r,l,f);break e}i in n?n[i]=l:l===!0?n.setAttribute(i,""):ol(n,i,l)}}}function Rt(n,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",n),Me("load",n);var l=!1,f=!1,m;for(m in i)if(i.hasOwnProperty(m)){var w=i[m];if(w!=null)switch(m){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ve(n,r,m,w,i,null)}}f&&Ve(n,r,"srcSet",i.srcSet,i,null),l&&Ve(n,r,"src",i.src,i,null);return;case"input":Me("invalid",n);var C=m=w=f=null,O=null,B=null;for(l in i)if(i.hasOwnProperty(l)){var W=i[l];if(W!=null)switch(l){case"name":f=W;break;case"type":w=W;break;case"checked":O=W;break;case"defaultChecked":B=W;break;case"value":m=W;break;case"defaultValue":C=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(s(137,r));break;default:Ve(n,r,l,W,i,null)}}gp(n,m,C,O,B,w,f,!1);return;case"select":Me("invalid",n),l=w=m=null;for(f in i)if(i.hasOwnProperty(f)&&(C=i[f],C!=null))switch(f){case"value":m=C;break;case"defaultValue":w=C;break;case"multiple":l=C;default:Ve(n,r,f,C,i,null)}r=m,i=w,n.multiple=!!l,r!=null?gs(n,!!l,r,!1):i!=null&&gs(n,!!l,i,!0);return;case"textarea":Me("invalid",n),m=f=l=null;for(w in i)if(i.hasOwnProperty(w)&&(C=i[w],C!=null))switch(w){case"value":l=C;break;case"defaultValue":f=C;break;case"children":m=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(s(91));break;default:Ve(n,r,w,C,i,null)}yp(n,l,f,m);return;case"option":for(O in i)if(i.hasOwnProperty(O)&&(l=i[O],l!=null))switch(O){case"selected":n.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ve(n,r,O,l,i,null)}return;case"dialog":Me("beforetoggle",n),Me("toggle",n),Me("cancel",n),Me("close",n);break;case"iframe":case"object":Me("load",n);break;case"video":case"audio":for(l=0;l<co.length;l++)Me(co[l],n);break;case"image":Me("error",n),Me("load",n);break;case"details":Me("toggle",n);break;case"embed":case"source":case"link":Me("error",n),Me("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(B in i)if(i.hasOwnProperty(B)&&(l=i[B],l!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ve(n,r,B,l,i,null)}return;default:if(Zu(r)){for(W in i)i.hasOwnProperty(W)&&(l=i[W],l!==void 0&&If(n,r,W,l,i,void 0));return}}for(C in i)i.hasOwnProperty(C)&&(l=i[C],l!=null&&Ve(n,r,C,l,i,null))}function gC(n,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,w=null,C=null,O=null,B=null,W=null;for(K in i){var Z=i[K];if(i.hasOwnProperty(K)&&Z!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":O=Z;default:l.hasOwnProperty(K)||Ve(n,r,K,null,l,Z)}}for(var $ in l){var K=l[$];if(Z=i[$],l.hasOwnProperty($)&&(K!=null||Z!=null))switch($){case"type":m=K;break;case"name":f=K;break;case"checked":B=K;break;case"defaultChecked":W=K;break;case"value":w=K;break;case"defaultValue":C=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(137,r));break;default:K!==Z&&Ve(n,r,$,K,l,Z)}}Ju(n,w,C,O,B,W,m,f);return;case"select":K=w=C=$=null;for(m in i)if(O=i[m],i.hasOwnProperty(m)&&O!=null)switch(m){case"value":break;case"multiple":K=O;default:l.hasOwnProperty(m)||Ve(n,r,m,null,l,O)}for(f in l)if(m=l[f],O=i[f],l.hasOwnProperty(f)&&(m!=null||O!=null))switch(f){case"value":$=m;break;case"defaultValue":C=m;break;case"multiple":w=m;default:m!==O&&Ve(n,r,f,m,l,O)}r=C,i=w,l=K,$!=null?gs(n,!!i,$,!1):!!l!=!!i&&(r!=null?gs(n,!!i,r,!0):gs(n,!!i,i?[]:"",!1));return;case"textarea":K=$=null;for(C in i)if(f=i[C],i.hasOwnProperty(C)&&f!=null&&!l.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:Ve(n,r,C,null,l,f)}for(w in l)if(f=l[w],m=i[w],l.hasOwnProperty(w)&&(f!=null||m!=null))switch(w){case"value":$=f;break;case"defaultValue":K=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==m&&Ve(n,r,w,f,l,m)}vp(n,$,K);return;case"option":for(var he in i)if($=i[he],i.hasOwnProperty(he)&&$!=null&&!l.hasOwnProperty(he))switch(he){case"selected":n.selected=!1;break;default:Ve(n,r,he,null,l,$)}for(O in l)if($=l[O],K=i[O],l.hasOwnProperty(O)&&$!==K&&($!=null||K!=null))switch(O){case"selected":n.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:Ve(n,r,O,$,l,K)}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 xe in i)$=i[xe],i.hasOwnProperty(xe)&&$!=null&&!l.hasOwnProperty(xe)&&Ve(n,r,xe,null,l,$);for(B in l)if($=l[B],K=i[B],l.hasOwnProperty(B)&&$!==K&&($!=null||K!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(s(137,r));break;default:Ve(n,r,B,$,l,K)}return;default:if(Zu(r)){for(var Ke in i)$=i[Ke],i.hasOwnProperty(Ke)&&$!==void 0&&!l.hasOwnProperty(Ke)&&If(n,r,Ke,void 0,l,$);for(W in l)$=l[W],K=i[W],!l.hasOwnProperty(W)||$===K||$===void 0&&K===void 0||If(n,r,W,$,l,K);return}}for(var U in i)$=i[U],i.hasOwnProperty(U)&&$!=null&&!l.hasOwnProperty(U)&&Ve(n,r,U,null,l,$);for(Z in l)$=l[Z],K=i[Z],!l.hasOwnProperty(Z)||$===K||$==null&&K==null||Ve(n,r,Z,$,l,K)}function xy(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function vC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var f=i[l],m=f.transferSize,w=f.initiatorType,C=f.duration;if(m&&C&&xy(w)){for(w=0,C=f.responseEnd,l+=1;l<i.length;l++){var O=i[l],B=O.startTime;if(B>C)break;var W=O.transferSize,Z=O.initiatorType;W&&xy(Z)&&(O=O.responseEnd,w+=W*(O<C?1:(C-B)/(O-B)))}if(--l,r+=8*(m+w)/(f.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var $f=null,Hf=null;function sc(n){return n.nodeType===9?n:n.ownerDocument}function Sy(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function _y(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function qf(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Gf=null;function yC(){var n=window.event;return n&&n.type==="popstate"?n===Gf?!1:(Gf=n,!0):(Gf=null,!1)}var Ey=typeof setTimeout=="function"?setTimeout:void 0,bC=typeof clearTimeout=="function"?clearTimeout:void 0,Cy=typeof Promise=="function"?Promise:void 0,wC=typeof queueMicrotask=="function"?queueMicrotask:typeof Cy<"u"?function(n){return Cy.resolve(null).then(n).catch(xC)}:Ey;function xC(n){setTimeout(function(){throw n})}function aa(n){return n==="head"}function Ty(n,r){var i=r,l=0;do{var f=i.nextSibling;if(n.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(l===0){n.removeChild(f),Ys(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")fo(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,fo(i);for(var m=i.firstChild;m;){var w=m.nextSibling,C=m.nodeName;m[Ni]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&m.rel.toLowerCase()==="stylesheet"||i.removeChild(m),m=w}}else i==="body"&&fo(n.ownerDocument.body);i=f}while(i);Ys(r)}function Ry(n,r){var i=n;n=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=l}while(i)}function Vf(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Vf(i),Wu(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function SC(n,r,i,l){for(;n.nodeType===1;){var f=i;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[Ni])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(m=n.getAttribute("rel"),m==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(m!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(m=n.getAttribute("src"),(m!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===m)return n}else return n;if(n=bn(n.nextSibling),n===null)break}return null}function _C(n,r,i){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=bn(n.nextSibling),n===null))return null;return n}function Ay(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=bn(n.nextSibling),n===null))return null;return n}function Kf(n){return n.data==="$?"||n.data==="$~"}function Ff(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function EC(n,r){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function bn(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Yf=null;function Ny(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(r===0)return bn(n.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}n=n.nextSibling}return null}function ky(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return n;r--}else i!=="/$"&&i!=="/&"||r++}n=n.previousSibling}return null}function Oy(n,r,i){switch(r=sc(i),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function fo(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Wu(n)}var wn=new Map,jy=new Set;function ic(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Sr=F.d;F.d={f:CC,r:TC,D:RC,C:AC,L:NC,m:kC,X:jC,S:OC,M:MC};function CC(){var n=Sr.f(),r=Jl();return n||r}function TC(n){var r=hs(n);r!==null&&r.tag===5&&r.type==="form"?Wg(r):Sr.r(n)}var Vs=typeof document>"u"?null:document;function My(n,r,i){var l=Vs;if(l&&typeof r=="string"&&r){var f=fn(r);f='link[rel="'+n+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),jy.has(f)||(jy.add(f),n={rel:n,crossOrigin:i,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),Rt(r,"link",n),bt(r),l.head.appendChild(r)))}}function RC(n){Sr.D(n),My("dns-prefetch",n,null)}function AC(n,r){Sr.C(n,r),My("preconnect",n,r)}function NC(n,r,i){Sr.L(n,r,i);var l=Vs;if(l&&n&&r){var f='link[rel="preload"][as="'+fn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+fn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+fn(i.imageSizes)+'"]')):f+='[href="'+fn(n)+'"]';var m=f;switch(r){case"style":m=Ks(n);break;case"script":m=Fs(n)}wn.has(m)||(n=g({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:n,as:r},i),wn.set(m,n),l.querySelector(f)!==null||r==="style"&&l.querySelector(ho(m))||r==="script"&&l.querySelector(mo(m))||(r=l.createElement("link"),Rt(r,"link",n),bt(r),l.head.appendChild(r)))}}function kC(n,r){Sr.m(n,r);var i=Vs;if(i&&n){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+fn(l)+'"][href="'+fn(n)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Fs(n)}if(!wn.has(m)&&(n=g({rel:"modulepreload",href:n},r),wn.set(m,n),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(mo(m)))return}l=i.createElement("link"),Rt(l,"link",n),bt(l),i.head.appendChild(l)}}}function OC(n,r,i){Sr.S(n,r,i);var l=Vs;if(l&&n){var f=ms(l).hoistableStyles,m=Ks(n);r=r||"default";var w=f.get(m);if(!w){var C={loading:0,preload:null};if(w=l.querySelector(ho(m)))C.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":r},i),(i=wn.get(m))&&Wf(n,i);var O=w=l.createElement("link");bt(O),Rt(O,"link",n),O._p=new Promise(function(B,W){O.onload=B,O.onerror=W}),O.addEventListener("load",function(){C.loading|=1}),O.addEventListener("error",function(){C.loading|=2}),C.loading|=4,oc(w,r,l)}w={type:"stylesheet",instance:w,count:1,state:C},f.set(m,w)}}}function jC(n,r){Sr.X(n,r);var i=Vs;if(i&&n){var l=ms(i).hoistableScripts,f=Fs(n),m=l.get(f);m||(m=i.querySelector(mo(f)),m||(n=g({src:n,async:!0},r),(r=wn.get(f))&&Xf(n,r),m=i.createElement("script"),bt(m),Rt(m,"link",n),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function MC(n,r){Sr.M(n,r);var i=Vs;if(i&&n){var l=ms(i).hoistableScripts,f=Fs(n),m=l.get(f);m||(m=i.querySelector(mo(f)),m||(n=g({src:n,async:!0,type:"module"},r),(r=wn.get(f))&&Xf(n,r),m=i.createElement("script"),bt(m),Rt(m,"link",n),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function Dy(n,r,i,l){var f=(f=ne.current)?ic(f):null;if(!f)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=Ks(i.href),i=ms(f).hoistableStyles,l=i.get(r),l||(l={type:"style",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=Ks(i.href);var m=ms(f).hoistableStyles,w=m.get(n);if(w||(f=f.ownerDocument||f,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(n,w),(m=f.querySelector(ho(n)))&&!m._p&&(w.instance=m,w.state.loading=5),wn.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},wn.set(n,i),m||DC(f,n,i,w.state))),r&&l===null)throw Error(s(528,""));return w}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Fs(i),i=ms(f).hoistableScripts,l=i.get(r),l||(l={type:"script",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function Ks(n){return'href="'+fn(n)+'"'}function ho(n){return'link[rel="stylesheet"]['+n+"]"}function Ly(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function DC(n,r,i,l){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=n.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Rt(r,"link",i),bt(r),n.head.appendChild(r))}function Fs(n){return'[src="'+fn(n)+'"]'}function mo(n){return"script[async]"+n}function Uy(n,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=n.querySelector('style[data-href~="'+fn(i.href)+'"]');if(l)return r.instance=l,bt(l),l;var f=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),bt(l),Rt(l,"style",f),oc(l,i.precedence,n),r.instance=l;case"stylesheet":f=Ks(i.href);var m=n.querySelector(ho(f));if(m)return r.state.loading|=4,r.instance=m,bt(m),m;l=Ly(i),(f=wn.get(f))&&Wf(l,f),m=(n.ownerDocument||n).createElement("link"),bt(m);var w=m;return w._p=new Promise(function(C,O){w.onload=C,w.onerror=O}),Rt(m,"link",l),r.state.loading|=4,oc(m,i.precedence,n),r.instance=m;case"script":return m=Fs(i.src),(f=n.querySelector(mo(m)))?(r.instance=f,bt(f),f):(l=i,(f=wn.get(m))&&(l=g({},i),Xf(l,f)),n=n.ownerDocument||n,f=n.createElement("script"),bt(f),Rt(f,"link",l),n.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,oc(l,i.precedence,n));return r.instance}function oc(n,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,m=f,w=0;w<l.length;w++){var C=l[w];if(C.dataset.precedence===r)m=C;else if(m!==f)break}m?m.parentNode.insertBefore(n,m.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(n,r.firstChild))}function Wf(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Xf(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var lc=null;function Py(n,r,i){if(lc===null){var l=new Map,f=lc=new Map;f.set(i,l)}else f=lc,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(n))return l;for(l.set(n,null),i=i.getElementsByTagName(n),f=0;f<i.length;f++){var m=i[f];if(!(m[Ni]||m[_t]||n==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var w=m.getAttribute(r)||"";w=n+w;var C=l.get(w);C?C.push(m):l.set(w,[m])}}return l}function zy(n,r,i){n=n.ownerDocument||n,n.head.insertBefore(i,r==="title"?n.querySelector("head > title"):null)}function LC(n,r,i){if(i===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function By(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function UC(n,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Ks(l.href),m=r.querySelector(ho(f));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=cc.bind(n),r.then(n,n)),i.state.loading|=4,i.instance=m,bt(m);return}m=r.ownerDocument||r,l=Ly(l),(f=wn.get(f))&&Wf(l,f),m=m.createElement("link"),bt(m);var w=m;w._p=new Promise(function(C,O){w.onload=C,w.onerror=O}),Rt(m,"link",l),i.instance=m}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=cc.bind(n),r.addEventListener("load",i),r.addEventListener("error",i))}}var Jf=0;function PC(n,r){return n.stylesheets&&n.count===0&&dc(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var l=setTimeout(function(){if(n.stylesheets&&dc(n,n.stylesheets),n.unsuspend){var m=n.unsuspend;n.unsuspend=null,m()}},6e4+r);0<n.imgBytes&&Jf===0&&(Jf=62500*vC());var f=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&dc(n,n.stylesheets),n.unsuspend)){var m=n.unsuspend;n.unsuspend=null,m()}},(n.imgBytes>Jf?50:800)+r);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function cc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var uc=null;function dc(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,uc=new Map,r.forEach(zC,n),uc=null,cc.call(n))}function zC(n,r){if(!(r.state.loading&4)){var i=uc.get(n);if(i)var l=i.get(null);else{i=new Map,uc.set(n,i);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var w=f[m];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(i.set(w.dataset.precedence,w),l=w)}l&&i.set(null,l)}f=r.instance,w=f.getAttribute("data-precedence"),m=i.get(w)||l,m===l&&i.set(null,f),i.set(w,f),this.count++,l=cc.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),m?m.parentNode.insertBefore(f,m.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),r.state.loading|=4}}var po={$$typeof:N,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function BC(n,r,i,l,f,m,w,C,O){this.tag=1,this.containerInfo=n,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=Br(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Br(0),this.hiddenUpdates=Br(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Iy(n,r,i,l,f,m,w,C,O,B,W,Z){return n=new BC(n,r,i,w,O,B,W,Z,C),r=1,m===!0&&(r|=24),m=Zt(3,null,null,r),n.current=m,m.stateNode=n,r=Nd(),r.refCount++,n.pooledCache=r,r.refCount++,m.memoizedState={element:l,isDehydrated:i,cache:r},Md(m),n}function $y(n){return n?(n=Es,n):Es}function Hy(n,r,i,l,f,m){f=$y(f),l.context===null?l.context=f:l.pendingContext=f,l=Fr(r),l.payload={element:i},m=m===void 0?null:m,m!==null&&(l.callback=m),i=Yr(n,l,r),i!==null&&(Ft(i,n,r),Ki(i,n,r))}function qy(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<r?i:r}}function Qf(n,r){qy(n,r),(n=n.alternate)&&qy(n,r)}function Gy(n){if(n.tag===13||n.tag===31){var r=Ma(n,67108864);r!==null&&Ft(r,n,67108864),Qf(n,67108864)}}function Vy(n){if(n.tag===13||n.tag===31){var r=an();r=us(r);var i=Ma(n,r);i!==null&&Ft(i,n,r),Qf(n,r)}}var fc=!0;function IC(n,r,i,l){var f=j.T;j.T=null;var m=F.p;try{F.p=2,Zf(n,r,i,l)}finally{F.p=m,j.T=f}}function $C(n,r,i,l){var f=j.T;j.T=null;var m=F.p;try{F.p=8,Zf(n,r,i,l)}finally{F.p=m,j.T=f}}function Zf(n,r,i,l){if(fc){var f=eh(l);if(f===null)Bf(n,r,l,hc,i),Fy(n,l);else if(qC(f,n,r,i,l))l.stopPropagation();else if(Fy(n,l),r&4&&-1<HC.indexOf(n)){for(;f!==null;){var m=hs(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var w=$n(m.pendingLanes);if(w!==0){var C=m;for(C.pendingLanes|=2,C.entangledLanes|=2;w;){var O=1<<31-kt(w);C.entanglements[1]|=O,w&=~O}Vn(m),(Ie&6)===0&&(Wl=Dt()+500,lo(0))}}break;case 31:case 13:C=Ma(m,2),C!==null&&Ft(C,m,2),Jl(),Qf(m,2)}if(m=eh(l),m===null&&Bf(n,r,l,hc,i),m===f)break;f=m}f!==null&&l.stopPropagation()}else Bf(n,r,l,null,i)}}function eh(n){return n=td(n),th(n)}var hc=null;function th(n){if(hc=null,n=fs(n),n!==null){var r=c(n);if(r===null)n=null;else{var i=r.tag;if(i===13){if(n=u(r),n!==null)return n;n=null}else if(i===31){if(n=d(r),n!==null)return n;n=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return hc=n,null}function Ky(n){switch(n){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(Vu()){case Ea:return 2;case sl:return 8;case Ca:case Ri:return 32;case ar:return 268435456;default:return 32}default:return 32}}var nh=!1,sa=null,ia=null,oa=null,go=new Map,vo=new Map,la=[],HC="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Fy(n,r){switch(n){case"focusin":case"focusout":sa=null;break;case"dragenter":case"dragleave":ia=null;break;case"mouseover":case"mouseout":oa=null;break;case"pointerover":case"pointerout":go.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":vo.delete(r.pointerId)}}function yo(n,r,i,l,f,m){return n===null||n.nativeEvent!==m?(n={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[f]},r!==null&&(r=hs(r),r!==null&&Gy(r)),n):(n.eventSystemFlags|=l,r=n.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),n)}function qC(n,r,i,l,f){switch(r){case"focusin":return sa=yo(sa,n,r,i,l,f),!0;case"dragenter":return ia=yo(ia,n,r,i,l,f),!0;case"mouseover":return oa=yo(oa,n,r,i,l,f),!0;case"pointerover":var m=f.pointerId;return go.set(m,yo(go.get(m)||null,n,r,i,l,f)),!0;case"gotpointercapture":return m=f.pointerId,vo.set(m,yo(vo.get(m)||null,n,r,i,l,f)),!0}return!1}function Yy(n){var r=fs(n.target);if(r!==null){var i=c(r);if(i!==null){if(r=i.tag,r===13){if(r=u(i),r!==null){n.blockedOn=r,lp(n.priority,function(){Vy(i)});return}}else if(r===31){if(r=d(i),r!==null){n.blockedOn=r,lp(n.priority,function(){Vy(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function mc(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var i=eh(n.nativeEvent);if(i===null){i=n.nativeEvent;var l=new i.constructor(i.type,i);ed=l,i.target.dispatchEvent(l),ed=null}else return r=hs(i),r!==null&&Gy(r),n.blockedOn=i,!1;r.shift()}return!0}function Wy(n,r,i){mc(n)&&i.delete(r)}function GC(){nh=!1,sa!==null&&mc(sa)&&(sa=null),ia!==null&&mc(ia)&&(ia=null),oa!==null&&mc(oa)&&(oa=null),go.forEach(Wy),vo.forEach(Wy)}function pc(n,r){n.blockedOn===r&&(n.blockedOn=null,nh||(nh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,GC)))}var gc=null;function Xy(n){gc!==n&&(gc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gc===n&&(gc=null);for(var r=0;r<n.length;r+=3){var i=n[r],l=n[r+1],f=n[r+2];if(typeof l!="function"){if(th(l||i)===null)continue;break}var m=hs(i);m!==null&&(n.splice(r,3),r-=3,Zd(m,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function Ys(n){function r(O){return pc(O,n)}sa!==null&&pc(sa,n),ia!==null&&pc(ia,n),oa!==null&&pc(oa,n),go.forEach(r),vo.forEach(r);for(var i=0;i<la.length;i++){var l=la[i];l.blockedOn===n&&(l.blockedOn=null)}for(;0<la.length&&(i=la[0],i.blockedOn===null);)Yy(i),i.blockedOn===null&&la.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],m=i[l+1],w=f[$t]||null;if(typeof m=="function")w||Xy(i);else if(w){var C=null;if(m&&m.hasAttribute("formAction")){if(f=m,w=m[$t]||null)C=w.formAction;else if(th(f)!==null)continue}else C=w.action;typeof C=="function"?i[l+1]=C:(i.splice(l,3),l-=3),Xy(i)}}}function Jy(){function n(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(w){return f=w})},focusReset:"manual",scroll:"manual"})}function r(){f!==null&&(f(),f=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),f!==null&&(f(),f=null)}}}function rh(n){this._internalRoot=n}vc.prototype.render=rh.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var i=r.current,l=an();Hy(i,l,n,r,null,null)},vc.prototype.unmount=rh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;Hy(n.current,2,null,n,null,null),Jl(),r[ds]=null}};function vc(n){this._internalRoot=n}vc.prototype.unstable_scheduleHydration=function(n){if(n){var r=Fu();n={blockedOn:null,target:n,priority:r};for(var i=0;i<la.length&&r!==0&&r<la[i].priority;i++);la.splice(i,0,n),i===0&&Yy(n)}};var Qy=t.version;if(Qy!=="19.2.6")throw Error(s(527,Qy,"19.2.6"));F.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=p(r),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var VC={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yc.isDisabled&&yc.supportsFiber)try{Ta=yc.inject(VC),Lt=yc}catch{}}return wo.createRoot=function(n,r){if(!o(n))throw Error(s(299));var i=!1,l="",f=sv,m=iv,w=ov;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError)),r=Iy(n,1,!1,null,null,i,l,null,f,m,w,Jy),n[ds]=r.current,zf(n),new rh(r)},wo.hydrateRoot=function(n,r,i){if(!o(n))throw Error(s(299));var l=!1,f="",m=sv,w=iv,C=ov,O=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError),i.formState!==void 0&&(O=i.formState)),r=Iy(n,1,!0,r,i??null,l,f,O,m,w,C,Jy),r.context=$y(null),i=r.current,l=an(),l=us(l),f=Fr(l),f.callback=null,Yr(i,f,l),i=l,r.current.lanes=i,tt(r,i),Vn(r),n[ds]=r.current,zf(n),new vc(r)},wo.version="19.2.6",wo}var lb;function tT(){if(lb)return ih.exports;lb=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(),ih.exports=eT(),ih.exports}var nT=tT();/**
* react-router v7.15.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var cb="popstate";function ub(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function rT(e={}){function t(s,o){var p;let c=(p=o.state)==null?void 0:p.masked,{pathname:u,search:d,hash:h}=c||s.location;return jh("",{pathname:u,search:d,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",c?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,o){return typeof o=="string"?o:Uo(o)}return sT(t,a,null,e)}function nt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function aT(){return Math.random().toString(36).substring(2,10)}function db(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function jh(e,t,a=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?yi(t):t,state:a,key:t&&t.key||s||aT(),mask:o}}function Uo({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function yi(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function sT(e,t,a,s={}){let{window:o=document.defaultView,v5Compat:c=!1}=s,u=o.history,d="POP",h=null,p=v();p==null&&(p=0,u.replaceState({...u.state,idx:p},""));function v(){return(u.state||{idx:null}).idx}function g(){d="POP";let R=v(),T=R==null?null:R-p;p=R,h&&h({action:d,location:E.location,delta:T})}function x(R,T){d="PUSH";let A=ub(R)?R:jh(E.location,R,T);p=v()+1;let N=db(A,p),L=E.createHref(A.mask||A);try{u.pushState(N,"",L)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;o.location.assign(L)}c&&h&&h({action:d,location:E.location,delta:1})}function S(R,T){d="REPLACE";let A=ub(R)?R:jh(E.location,R,T);p=v();let N=db(A,p),L=E.createHref(A.mask||A);u.replaceState(N,"",L),c&&h&&h({action:d,location:E.location,delta:0})}function _(R){return iT(R)}let E={get action(){return d},get location(){return e(o,u)},listen(R){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(cb,g),h=R,()=>{o.removeEventListener(cb,g),h=null}},createHref(R){return t(o,R)},createURL:_,encodeLocation(R){let T=_(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:x,replace:S,go(R){return u.go(R)}};return E}function iT(e,t=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),nt(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Uo(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function V0(e,t,a="/"){return oT(e,t,a,!1)}function oT(e,t,a,s,o){let c=typeof t=="string"?yi(t):t,u=Ar(c.pathname||"/",a);if(u==null)return null;let d=lT(e),h=null,p=wT(u);for(let v=0;h==null&&v<d.length;++v)h=yT(d[v],p,s);return h}function lT(e){let t=K0(e);return cT(t),t}function K0(e,t=[],a=[],s="",o=!1){let c=(u,d,h=o,p)=>{let v={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&h)return;nt(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let g=Ln([s,v.relativePath]),x=a.concat(v);u.children&&u.children.length>0&&(nt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),K0(u.children,t,x,g,h)),!(u.path==null&&!u.index)&&t.push({path:g,score:gT(g,u.index),routesMeta:x})};return e.forEach((u,d)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))c(u,d);else for(let p of F0(u.path))c(u,d,!0,p)}),t}function F0(e){let t=e.split("/");if(t.length===0)return[];let[a,...s]=t,o=a.endsWith("?"),c=a.replace(/\?$/,"");if(s.length===0)return o?[c,""]:[c];let u=F0(s.join("/")),d=[];return d.push(...u.map(h=>h===""?c:[c,h].join("/"))),o&&d.push(...u),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function cT(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:vT(t.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var uT=/^:[\w-]+$/,dT=3,fT=2,hT=1,mT=10,pT=-2,fb=e=>e==="*";function gT(e,t){let a=e.split("/"),s=a.length;return a.some(fb)&&(s+=pT),t&&(s+=fT),a.filter(o=>!fb(o)).reduce((o,c)=>o+(uT.test(c)?dT:c===""?hT:mT),s)}function vT(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function yT(e,t,a=!1){let{routesMeta:s}=e,o={},c="/",u=[];for(let d=0;d<s.length;++d){let h=s[d],p=d===s.length-1,v=c==="/"?t:t.slice(c.length)||"/",g=eu({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},v),x=h.route;if(!g&&p&&a&&!s[s.length-1].route.index&&(g=eu({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},v)),!g)return null;Object.assign(o,g.params),u.push({params:o,pathname:Ln([c,g.pathname]),pathnameBase:ET(Ln([c,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(c=Ln([c,g.pathnameBase]))}return u}function eu(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=bT(e.path,e.caseSensitive,e.end),o=t.match(a);if(!o)return null;let c=o[0],u=c.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:s.reduce((p,{paramName:v,isOptional:g},x)=>{if(v==="*"){let _=d[x]||"";u=c.slice(0,c.length-_.length).replace(/(.)\/+$/,"$1")}const S=d[x];return g&&!S?p[v]=void 0:p[v]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:u,pattern:e}}function bT(e,t=!1,a=!0){nr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,h,p,v)=>{if(s.push({paramName:d,isOptional:h!=null}),h){let g=v.charAt(p+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function wT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return nr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ar(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}var xT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ST(e,t="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?yi(e):e,c;return a?(a=W0(a),a.startsWith("/")?c=hb(a.substring(1),"/"):c=hb(a,t)):c=t,{pathname:c,search:CT(s),hash:TT(o)}}function hb(e,t){let a=tu(t).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function uh(e,t,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _T(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Y0(e){let t=_T(e);return t.map((a,s)=>s===t.length-1?a.pathname:a.pathnameBase)}function mm(e,t,a,s=!1){let o;typeof e=="string"?o=yi(e):(o={...e},nt(!o.pathname||!o.pathname.includes("?"),uh("?","pathname","search",o)),nt(!o.pathname||!o.pathname.includes("#"),uh("#","pathname","hash",o)),nt(!o.search||!o.search.includes("#"),uh("#","search","hash",o)));let c=e===""||o.pathname==="",u=c?"/":o.pathname,d;if(u==null)d=a;else{let g=t.length-1;if(!s&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),g-=1;o.pathname=x.join("/")}d=g>=0?t[g]:"/"}let h=ST(o,d),p=u&&u!=="/"&&u.endsWith("/"),v=(c||u===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(p||v)&&(h.pathname+="/"),h}var W0=e=>e.replace(/\/\/+/g,"/"),Ln=e=>W0(e.join("/")),tu=e=>e.replace(/\/+$/,""),ET=e=>tu(e).replace(/^\/*/,"/"),CT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,TT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,RT=class{constructor(e,t,a,s=!1){this.status=e,this.statusText=t||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function AT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function NT(e){let t=e.map(a=>a.route.path).filter(Boolean);return Ln(t)||"/"}var X0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function J0(e,t){let a=e;if(typeof a!="string"||!xT.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,o=!1;if(X0)try{let c=new URL(window.location.href),u=a.startsWith("//")?new URL(c.protocol+a):new URL(a),d=Ar(u.pathname,t);u.origin===c.origin&&d!=null?a=d+u.search+u.hash:o=!0}catch{nr(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Q0=["POST","PUT","PATCH","DELETE"];new Set(Q0);var kT=["GET",...Q0];new Set(kT);var bi=y.createContext(null);bi.displayName="DataRouter";var wu=y.createContext(null);wu.displayName="DataRouterState";var Z0=y.createContext(!1);function OT(){return y.useContext(Z0)}var ew=y.createContext({isTransitioning:!1});ew.displayName="ViewTransition";var jT=y.createContext(new Map);jT.displayName="Fetchers";var MT=y.createContext(null);MT.displayName="Await";var En=y.createContext(null);En.displayName="Navigation";var Yo=y.createContext(null);Yo.displayName="Location";var Or=y.createContext({outlet:null,matches:[],isDataRoute:!1});Or.displayName="Route";var pm=y.createContext(null);pm.displayName="RouteError";var tw="REACT_ROUTER_ERROR",DT="REDIRECT",LT="ROUTE_ERROR_RESPONSE";function UT(e){if(e.startsWith(`${tw}:${DT}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function PT(e){if(e.startsWith(`${tw}:${LT}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new RT(t.status,t.statusText,t.data)}catch{}}function zT(e,{relative:t}={}){nt(Wo(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=y.useContext(En),{hash:o,pathname:c,search:u}=Xo(e,{relative:t}),d=c;return a!=="/"&&(d=c==="/"?a:Ln([a,c])),s.createHref({pathname:d,search:u,hash:o})}function Wo(){return y.useContext(Yo)!=null}function jr(){return nt(Wo(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Yo).location}var nw="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function rw(e){y.useContext(En).static||y.useLayoutEffect(e)}function BT(){let{isDataRoute:e}=y.useContext(Or);return e?QT():IT()}function IT(){nt(Wo(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(bi),{basename:t,navigator:a}=y.useContext(En),{matches:s}=y.useContext(Or),{pathname:o}=jr(),c=JSON.stringify(Y0(s)),u=y.useRef(!1);return rw(()=>{u.current=!0}),y.useCallback((h,p={})=>{if(nr(u.current,nw),!u.current)return;if(typeof h=="number"){a.go(h);return}let v=mm(h,JSON.parse(c),o,p.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Ln([t,v.pathname])),(p.replace?a.replace:a.push)(v,p.state,p)},[t,a,c,o,e])}y.createContext(null);function Xo(e,{relative:t}={}){let{matches:a}=y.useContext(Or),{pathname:s}=jr(),o=JSON.stringify(Y0(a));return y.useMemo(()=>mm(e,JSON.parse(o),s,t==="path"),[e,o,s,t])}function $T(e,t){return aw(e,t)}function aw(e,t,a){var R;nt(Wo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=y.useContext(En),{matches:o}=y.useContext(Or),c=o[o.length-1],u=c?c.params:{},d=c?c.pathname:"/",h=c?c.pathnameBase:"/",p=c&&c.route;{let T=p&&p.path||"";iw(d,!p||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=jr(),g;if(t){let T=typeof t=="string"?yi(t):t;nt(h==="/"||((R=T.pathname)==null?void 0:R.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${T.pathname}" was given in the \`location\` prop.`),g=T}else g=v;let x=g.pathname||"/",S=x;if(h!=="/"){let T=h.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(T.length).join("/")}let _=a&&a.state.matches.length?a.state.matches.map(T=>Object.assign(T,{route:a.manifest[T.route.id]||T.route})):V0(e,{pathname:S});nr(p||_!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),nr(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=KT(_&&_.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:Ln([h,s.encodeLocation?s.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?h:Ln([h,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),o,a);return t&&E?y.createElement(Yo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},E):E}function HT(){let e=JT(),t=AT(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:c},"ErrorBoundary")," or"," ",y.createElement("code",{style:c},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),a?y.createElement("pre",{style:o},a):null,u)}var qT=y.createElement(HT,null),sw=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=PT(e.digest);a&&(e=a)}let t=e!==void 0?y.createElement(Or.Provider,{value:this.props.routeContext},y.createElement(pm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(GT,{error:e},t):t}};sw.contextType=Z0;var dh=new WeakMap;function GT({children:e,error:t}){let{basename:a}=y.useContext(En);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=UT(t.digest);if(s){let o=dh.get(t);if(o)throw o;let c=J0(s.location,a);if(X0&&!dh.get(t))if(c.isExternal||s.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw dh.set(t,u),u}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function VT({routeContext:e,match:t,children:a}){let s=y.useContext(bi);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Or.Provider,{value:e},a)}function KT(e,t=[],a){let s=a==null?void 0:a.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,c=s==null?void 0:s.errors;if(c!=null){let v=o.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);nt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let u=!1,d=-1;if(a&&s){u=s.renderFallback;for(let v=0;v<o.length;v++){let g=o[v];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(d=v),g.route.id){let{loaderData:x,errors:S}=s,_=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!S||S[g.route.id]===void 0);if(g.route.lazy||_){a.isStatic&&(u=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let h=a==null?void 0:a.onError,p=s&&h?(v,g)=>{var x,S;h(v,{location:s.location,params:((S=(x=s.matches)==null?void 0:x[0])==null?void 0:S.params)??{},pattern:NT(s.matches),errorInfo:g})}:void 0;return o.reduceRight((v,g,x)=>{let S,_=!1,E=null,R=null;s&&(S=c&&g.route.id?c[g.route.id]:void 0,E=g.route.errorElement||qT,u&&(d<0&&x===0?(iw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,R=null):d===x&&(_=!0,R=g.route.hydrateFallbackElement||null)));let T=t.concat(o.slice(0,x+1)),A=()=>{let N;return S?N=E:_?N=R:g.route.Component?N=y.createElement(g.route.Component,null):g.route.element?N=g.route.element:N=v,y.createElement(VT,{match:g,routeContext:{outlet:v,matches:T,isDataRoute:s!=null},children:N})};return s&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?y.createElement(sw,{location:s.location,revalidation:s.revalidation,component:E,error:S,children:A(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:p}):A()},null)}function gm(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FT(e){let t=y.useContext(bi);return nt(t,gm(e)),t}function YT(e){let t=y.useContext(wu);return nt(t,gm(e)),t}function WT(e){let t=y.useContext(Or);return nt(t,gm(e)),t}function vm(e){let t=WT(e),a=t.matches[t.matches.length-1];return nt(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function XT(){return vm("useRouteId")}function JT(){var s;let e=y.useContext(pm),t=YT("useRouteError"),a=vm("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[a]}function QT(){let{router:e}=FT("useNavigate"),t=vm("useNavigate"),a=y.useRef(!1);return rw(()=>{a.current=!0}),y.useCallback(async(o,c={})=>{nr(a.current,nw),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...c}))},[e,t])}var mb={};function iw(e,t,a){!t&&!mb[e]&&(mb[e]=!0,nr(!1,a))}y.memo(ZT);function ZT({routes:e,manifest:t,future:a,state:s,isStatic:o,onError:c}){return aw(e,void 0,{manifest:t,state:s,isStatic:o,onError:c})}function ow(e){nt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function eR({basename:e="/",children:t=null,location:a,navigationType:s="POP",navigator:o,static:c=!1,useTransitions:u}){nt(!Wo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:d,navigator:o,static:c,useTransitions:u,future:{}}),[d,o,c,u]);typeof a=="string"&&(a=yi(a));let{pathname:p="/",search:v="",hash:g="",state:x=null,key:S="default",mask:_}=a,E=y.useMemo(()=>{let R=Ar(p,d);return R==null?null:{location:{pathname:R,search:v,hash:g,state:x,key:S,mask:_},navigationType:s}},[d,p,v,g,x,S,s,_]);return nr(E!=null,`<Router basename="${d}"> is not able to match the URL "${p}${v}${g}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:y.createElement(En.Provider,{value:h},y.createElement(Yo.Provider,{children:t,value:E}))}function tR({children:e,location:t}){return $T(Mh(e),t)}function Mh(e,t=[]){let a=[];return y.Children.forEach(e,(s,o)=>{if(!y.isValidElement(s))return;let c=[...t,o];if(s.type===y.Fragment){a.push.apply(a,Mh(s.props.children,c));return}nt(s.type===ow,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||c.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Mh(s.props.children,c)),a.push(u)}),a}var Vc="get",Kc="application/x-www-form-urlencoded";function xu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function nR(e){return xu(e)&&e.tagName.toLowerCase()==="button"}function rR(e){return xu(e)&&e.tagName.toLowerCase()==="form"}function aR(e){return xu(e)&&e.tagName.toLowerCase()==="input"}function sR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function iR(e,t){return e.button===0&&(!t||t==="_self")&&!sR(e)}var bc=null;function oR(){if(bc===null)try{new FormData(document.createElement("form"),0),bc=!1}catch{bc=!0}return bc}var lR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fh(e){return e!=null&&!lR.has(e)?(nr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Kc}"`),null):e}function cR(e,t){let a,s,o,c,u;if(rR(e)){let d=e.getAttribute("action");s=d?Ar(d,t):null,a=e.getAttribute("method")||Vc,o=fh(e.getAttribute("enctype"))||Kc,c=new FormData(e)}else if(nR(e)||aR(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(s=h?Ar(h,t):null,a=e.getAttribute("formmethod")||d.getAttribute("method")||Vc,o=fh(e.getAttribute("formenctype"))||fh(d.getAttribute("enctype"))||Kc,c=new FormData(d,e),!oR()){let{name:p,type:v,value:g}=e;if(v==="image"){let x=p?`${p}.`:"";c.append(`${x}x`,"0"),c.append(`${x}y`,"0")}else p&&c.append(p,g)}}else{if(xu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Vc,s=null,o=Kc,u=e}return c&&o==="text/plain"&&(u=c,c=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:c,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ym(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lw(e,t,a,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:t&&Ar(o.pathname,t)==="/"?o.pathname=`${tu(t)}/_root.${s}`:o.pathname=`${tu(o.pathname)}.${s}`,o}async function uR(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dR(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function fR(e,t,a){let s=await Promise.all(e.map(async o=>{let c=t.routes[o.route.id];if(c){let u=await uR(c,a);return u.links?u.links():[]}return[]}));return gR(s.flat(1).filter(dR).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function pb(e,t,a,s,o,c){let u=(h,p)=>a[p]?h.route.id!==a[p].route.id:!0,d=(h,p)=>{var v;return a[p].pathname!==h.pathname||((v=a[p].route.path)==null?void 0:v.endsWith("*"))&&a[p].params["*"]!==h.params["*"]};return c==="assets"?t.filter((h,p)=>u(h,p)||d(h,p)):c==="data"?t.filter((h,p)=>{var g;let v=s.routes[h.route.id];if(!v||!v.hasLoader)return!1;if(u(h,p)||d(h,p))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function hR(e,t,{includeHydrateFallback:a}={}){return mR(e.map(s=>{let o=t.routes[s.route.id];if(!o)return[];let c=[o.module];return o.clientActionModule&&(c=c.concat(o.clientActionModule)),o.clientLoaderModule&&(c=c.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(c=c.concat(o.hydrateFallbackModule)),o.imports&&(c=c.concat(o.imports)),c}).flat(1))}function mR(e){return[...new Set(e)]}function pR(e){let t={},a=Object.keys(e).sort();for(let s of a)t[s]=e[s];return t}function gR(e,t){let a=new Set;return new Set(t),e.reduce((s,o)=>{let c=JSON.stringify(pR(o));return a.has(c)||(a.add(c),s.push({key:c,link:o})),s},[])}function bm(){let e=y.useContext(bi);return ym(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function vR(){let e=y.useContext(wu);return ym(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var wm=y.createContext(void 0);wm.displayName="FrameworkContext";function xm(){let e=y.useContext(wm);return ym(e,"You must render this element inside a <HydratedRouter> element"),e}function yR(e,t){let a=y.useContext(wm),[s,o]=y.useState(!1),[c,u]=y.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:p,onMouseLeave:v,onTouchStart:g}=t,x=y.useRef(null);y.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let E=T=>{T.forEach(A=>{u(A.isIntersecting)})},R=new IntersectionObserver(E,{threshold:.5});return x.current&&R.observe(x.current),()=>{R.disconnect()}}},[e]),y.useEffect(()=>{if(s){let E=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(E)}}},[s]);let S=()=>{o(!0)},_=()=>{o(!1),u(!1)};return a?e!=="intent"?[c,x,{}]:[c,x,{onFocus:xo(d,S),onBlur:xo(h,_),onMouseEnter:xo(p,S),onMouseLeave:xo(v,_),onTouchStart:xo(g,S)}]:[!1,x,{}]}function xo(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function bR({page:e,...t}){let a=OT(),{router:s}=bm(),o=y.useMemo(()=>V0(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?a?y.createElement(xR,{page:e,matches:o,...t}):y.createElement(SR,{page:e,matches:o,...t}):null}function wR(e){let{manifest:t,routeModules:a}=xm(),[s,o]=y.useState([]);return y.useEffect(()=>{let c=!1;return fR(e,t,a).then(u=>{c||o(u)}),()=>{c=!0}},[e,t,a]),s}function xR({page:e,matches:t,...a}){let s=jr(),{future:o}=xm(),{basename:c}=bm(),u=y.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let d=lw(e,c,o.unstable_trailingSlashAwareDataRequests,"rsc"),h=!1,p=[];for(let v of t)typeof v.route.shouldRevalidate=="function"?h=!0:p.push(v.route.id);return h&&p.length>0&&d.searchParams.set("_routes",p.join(",")),[d.pathname+d.search]},[c,o.unstable_trailingSlashAwareDataRequests,e,s,t]);return y.createElement(y.Fragment,null,u.map(d=>y.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...a})))}function SR({page:e,matches:t,...a}){let s=jr(),{future:o,manifest:c,routeModules:u}=xm(),{basename:d}=bm(),{loaderData:h,matches:p}=vR(),v=y.useMemo(()=>pb(e,t,p,c,s,"data"),[e,t,p,c,s]),g=y.useMemo(()=>pb(e,t,p,c,s,"assets"),[e,t,p,c,s]),x=y.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let E=new Set,R=!1;if(t.forEach(A=>{var L;let N=c.routes[A.route.id];!N||!N.hasLoader||(!v.some(G=>G.route.id===A.route.id)&&A.route.id in h&&((L=u[A.route.id])!=null&&L.shouldRevalidate)||N.hasClientLoader?R=!0:E.add(A.route.id))}),E.size===0)return[];let T=lw(e,d,o.unstable_trailingSlashAwareDataRequests,"data");return R&&E.size>0&&T.searchParams.set("_routes",t.filter(A=>E.has(A.route.id)).map(A=>A.route.id).join(",")),[T.pathname+T.search]},[d,o.unstable_trailingSlashAwareDataRequests,h,s,c,v,t,e,u]),S=y.useMemo(()=>hR(g,c),[g,c]),_=wR(g);return y.createElement(y.Fragment,null,x.map(E=>y.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...a})),S.map(E=>y.createElement("link",{key:E,rel:"modulepreload",href:E,...a})),_.map(({key:E,link:R})=>y.createElement("link",{key:E,nonce:a.nonce,...R,crossOrigin:R.crossOrigin??a.crossOrigin})))}function _R(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var ER=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{ER&&(window.__reactRouterVersion="7.15.1")}catch{}function CR({basename:e,children:t,useTransitions:a,window:s}){let o=y.useRef();o.current==null&&(o.current=rT({window:s,v5Compat:!0}));let c=o.current,[u,d]=y.useState({action:c.action,location:c.location}),h=y.useCallback(p=>{a===!1?d(p):y.startTransition(()=>d(p))},[a]);return y.useLayoutEffect(()=>c.listen(h),[c,h]),y.createElement(eR,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:c,useTransitions:a})}var cw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uw=y.forwardRef(function({onClick:t,discover:a="render",prefetch:s="none",relative:o,reloadDocument:c,replace:u,mask:d,state:h,target:p,to:v,preventScrollReset:g,viewTransition:x,defaultShouldRevalidate:S,..._},E){let{basename:R,navigator:T,useTransitions:A}=y.useContext(En),N=typeof v=="string"&&cw.test(v),L=J0(v,R);v=L.to;let G=zT(v,{relative:o}),V=jr(),P=null;if(d){let fe=mm(d,[],V.mask?V.mask.pathname:"/",!0);R!=="/"&&(fe.pathname=fe.pathname==="/"?R:Ln([R,fe.pathname])),P=T.createHref(fe)}let[q,re,me]=yR(s,_),ye=NR(v,{replace:u,mask:d,state:h,target:p,preventScrollReset:g,relative:o,viewTransition:x,defaultShouldRevalidate:S,useTransitions:A});function oe(fe){t&&t(fe),fe.defaultPrevented||ye(fe)}let de=!(L.isExternal||c),ge=y.createElement("a",{..._,...me,href:(de?P:void 0)||L.absoluteURL||G,onClick:de?oe:t,ref:_R(E,re),target:p,"data-discover":!N&&a==="render"?"true":void 0});return q&&!N?y.createElement(y.Fragment,null,ge,y.createElement(bR,{page:G})):ge});uw.displayName="Link";var TR=y.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:s="",end:o=!1,style:c,to:u,viewTransition:d,children:h,...p},v){let g=Xo(u,{relative:p.relative}),x=jr(),S=y.useContext(wu),{navigator:_,basename:E}=y.useContext(En),R=S!=null&&DR(g)&&d===!0,T=_.encodeLocation?_.encodeLocation(g).pathname:g.pathname,A=x.pathname,N=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;a||(A=A.toLowerCase(),N=N?N.toLowerCase():null,T=T.toLowerCase()),N&&E&&(N=Ar(N,E)||N);const L=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let G=A===T||!o&&A.startsWith(T)&&A.charAt(L)==="/",V=N!=null&&(N===T||!o&&N.startsWith(T)&&N.charAt(T.length)==="/"),P={isActive:G,isPending:V,isTransitioning:R},q=G?t:void 0,re;typeof s=="function"?re=s(P):re=[s,G?"active":null,V?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let me=typeof c=="function"?c(P):c;return y.createElement(uw,{...p,"aria-current":q,className:re,ref:v,style:me,to:u,viewTransition:d},typeof h=="function"?h(P):h)});TR.displayName="NavLink";var RR=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:s,replace:o,state:c,method:u=Vc,action:d,onSubmit:h,relative:p,preventScrollReset:v,viewTransition:g,defaultShouldRevalidate:x,...S},_)=>{let{useTransitions:E}=y.useContext(En),R=jR(),T=MR(d,{relative:p}),A=u.toLowerCase()==="get"?"get":"post",N=typeof d=="string"&&cw.test(d),L=G=>{if(h&&h(G),G.defaultPrevented)return;G.preventDefault();let V=G.nativeEvent.submitter,P=(V==null?void 0:V.getAttribute("formmethod"))||u,q=()=>R(V||G.currentTarget,{fetcherKey:t,method:P,navigate:a,replace:o,state:c,relative:p,preventScrollReset:v,viewTransition:g,defaultShouldRevalidate:x});E&&a!==!1?y.startTransition(()=>q()):q()};return y.createElement("form",{ref:_,method:A,action:T,onSubmit:s?h:L,...S,"data-discover":!N&&e==="render"?"true":void 0})});RR.displayName="Form";function AR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function dw(e){let t=y.useContext(bi);return nt(t,AR(e)),t}function NR(e,{target:t,replace:a,mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:d,defaultShouldRevalidate:h,useTransitions:p}={}){let v=BT(),g=jr(),x=Xo(e,{relative:u});return y.useCallback(S=>{if(iR(S,t)){S.preventDefault();let _=a!==void 0?a:Uo(g)===Uo(x),E=()=>v(e,{replace:_,mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:d,defaultShouldRevalidate:h});p?y.startTransition(()=>E()):E()}},[g,v,x,a,s,o,t,e,c,u,d,h,p])}var kR=0,OR=()=>`__${String(++kR)}__`;function jR(){let{router:e}=dw("useSubmit"),{basename:t}=y.useContext(En),a=XT(),s=e.fetch,o=e.navigate;return y.useCallback(async(c,u={})=>{let{action:d,method:h,encType:p,formData:v,body:g}=cR(c,t);if(u.navigate===!1){let x=u.fetcherKey||OR();await s(x,a,u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:g,formMethod:u.method||h,formEncType:u.encType||p,flushSync:u.flushSync})}else await o(u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:g,formMethod:u.method||h,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,o,t,a])}function MR(e,{relative:t}={}){let{basename:a}=y.useContext(En),s=y.useContext(Or);nt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),c={...Xo(e||".",{relative:t})},u=jr();if(e==null){c.search=u.search;let d=new URLSearchParams(c.search),h=d.getAll("index");if(h.some(v=>v==="")){d.delete("index"),h.filter(g=>g).forEach(g=>d.append("index",g));let v=d.toString();c.search=v?`?${v}`:""}}return(!e||e===".")&&o.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:Ln([a,c.pathname])),Uo(c)}function DR(e,{relative:t}={}){let a=y.useContext(ew);nt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=dw("useViewTransitionState"),o=Xo(e,{relative:t});if(!a.isTransitioning)return!1;let c=Ar(a.currentLocation.pathname,s)||a.currentLocation.pathname,u=Ar(a.nextLocation.pathname,s)||a.nextLocation.pathname;return eu(o.pathname,u)!=null||eu(o.pathname,c)!=null}var Jo=G0();const fw=q0(Jo);var Jn=function(){return Jn=Object.assign||function(t){for(var a,s=1,o=arguments.length;s<o;s++){a=arguments[s];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])}return t},Jn.apply(this,arguments)};function wi(e,t){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(a[s[o]]=e[s[o]]);return a}function LR(e,t,a,s){function o(c){return c instanceof a?c:new a(function(u){u(c)})}return new(a||(a=Promise))(function(c,u){function d(v){try{p(s.next(v))}catch(g){u(g)}}function h(v){try{p(s.throw(v))}catch(g){u(g)}}function p(v){v.done?c(v.value):o(v.value).then(d,h)}p((s=s.apply(e,t||[])).next())})}function UR(e,t,a){if(a||arguments.length===2)for(var s=0,o=t.length,c;s<o;s++)(c||!(s in t))&&(c||(c=Array.prototype.slice.call(t,0,s)),c[s]=t[s]);return e.concat(c||Array.prototype.slice.call(t))}const PR=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Sm extends Error{constructor(t,a="FunctionsError",s){super(t),this.name=a,this.context=s}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class zR extends Sm{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class gb extends Sm{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class vb extends Sm{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Dh;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Dh||(Dh={}));class BR{constructor(t,{headers:a={},customFetch:s,region:o=Dh.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=PR(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return LR(this,arguments,void 0,function*(a,s={}){var o;let c,u;try{const{headers:d,method:h,body:p,signal:v,timeout:g}=s;let x={},{region:S}=s;S||(S=this.region);const _=new URL(`${this.url}/${a}`);S&&S!=="any"&&(x["x-region"]=S,_.searchParams.set("forceFunctionRegion",S));let E;p&&(d&&!Object.prototype.hasOwnProperty.call(d,"Content-Type")||!d)?typeof Blob<"u"&&p instanceof Blob||p instanceof ArrayBuffer?(x["Content-Type"]="application/octet-stream",E=p):typeof p=="string"?(x["Content-Type"]="text/plain",E=p):typeof FormData<"u"&&p instanceof FormData?E=p:(x["Content-Type"]="application/json",E=JSON.stringify(p)):p&&typeof p!="string"&&!(typeof Blob<"u"&&p instanceof Blob)&&!(p instanceof ArrayBuffer)&&!(typeof FormData<"u"&&p instanceof FormData)?E=JSON.stringify(p):E=p;let R=v;g&&(u=new AbortController,c=setTimeout(()=>u.abort(),g),v?(R=u.signal,v.addEventListener("abort",()=>u.abort())):R=u.signal);const T=yield this.fetch(_.toString(),{method:h||"POST",headers:Object.assign(Object.assign(Object.assign({},x),this.headers),d),body:E,signal:R}).catch(G=>{throw new zR(G)}),A=T.headers.get("x-relay-error");if(A&&A==="true")throw new gb(T);if(!T.ok)throw new vb(T);let N=((o=T.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),L;return N==="application/json"?L=yield T.json():N==="application/octet-stream"||N==="application/pdf"?L=yield T.blob():N==="text/event-stream"?L=T:N==="multipart/form-data"?L=yield T.formData():L=yield T.text(),{data:L,error:null,response:T}}catch(d){return{data:null,error:d,response:d instanceof vb||d instanceof gb?d.context:void 0}}finally{c&&clearTimeout(c)}})}}const hw=3,yb=e=>Math.min(1e3*2**e,3e4),IR=[520,503],mw=["GET","HEAD","OPTIONS"];var $R=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function bb(e,t){return new Promise(a=>{if(t!=null&&t.aborted){a();return}const s=setTimeout(()=>{t==null||t.removeEventListener("abort",o),a()},e);function o(){clearTimeout(s),a()}t==null||t.addEventListener("abort",o)})}function HR(e,t,a,s){return!(!s||a>=hw||!mw.includes(e)||!IR.includes(t))}var qR=class{constructor(e){var t,a,s,o,c;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(a=e.isMaybeSingle)!==null&&a!==void 0?a:!1,this.shouldStripNulls=(s=e.shouldStripNulls)!==null&&s!==void 0?s:!1,this.urlLengthLimit=(o=e.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(c=e.retry)!==null&&c!==void 0?c:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var a=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const u=this.headers.get("Accept");u==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!u||u==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const s=this.fetch;let c=(async()=>{let u=0;for(;;){const p=new Headers(a.headers);u>0&&p.set("X-Retry-Count",String(u));let v;try{v=await s(a.url.toString(),{method:a.method,headers:p,body:JSON.stringify(a.body,(g,x)=>typeof x=="bigint"?x.toString():x),signal:a.signal})}catch(g){if((g==null?void 0:g.name)==="AbortError"||(g==null?void 0:g.code)==="ABORT_ERR"||!mw.includes(a.method))throw g;if(a.retryEnabled&&u<hw){const x=yb(u);u++,await bb(x,a.signal);continue}throw g}if(HR(a.method,v.status,u,a.retryEnabled)){var d,h;const g=(d=(h=v.headers)===null||h===void 0?void 0:h.get("Retry-After"))!==null&&d!==void 0?d:null,x=g!==null?Math.max(0,parseInt(g,10)||0)*1e3:yb(u);await v.text(),u++,await bb(x,a.signal);continue}return await a.processResponse(v)}})();return this.shouldThrowOnError||(c=c.catch(u=>{var d;let h="",p="",v="";const g=u==null?void 0:u.cause;if(g){var x,S,_,E;const A=(x=g==null?void 0:g.message)!==null&&x!==void 0?x:"",N=(S=g==null?void 0:g.code)!==null&&S!==void 0?S:"";h=`${(_=u==null?void 0:u.name)!==null&&_!==void 0?_:"FetchError"}: ${u==null?void 0:u.message}`,h+=`
Caused by: ${(E=g==null?void 0:g.name)!==null&&E!==void 0?E:"Error"}: ${A}`,N&&(h+=` (${N})`),g!=null&&g.stack&&(h+=`
${g.stack}`)}else{var R;h=(R=u==null?void 0:u.stack)!==null&&R!==void 0?R:""}const T=this.url.toString().length;return(u==null?void 0:u.name)==="AbortError"||(u==null?void 0:u.code)==="ABORT_ERR"?(v="",p="Request was aborted (timeout or manual cancellation)",T>this.urlLengthLimit&&(p+=`. Note: Your request URL is ${T} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((g==null?void 0:g.name)==="HeadersOverflowError"||(g==null?void 0:g.code)==="UND_ERR_HEADERS_OVERFLOW")&&(v="",p="HTTP headers exceeded server limits (typically 16KB)",T>this.urlLengthLimit&&(p+=`. Your request URL is ${T} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(d=u==null?void 0:u.name)!==null&&d!==void 0?d:"FetchError"}: ${u==null?void 0:u.message}`,details:h,hint:p,code:v},data:null,count:null,status:0,statusText:""}})),c.then(e,t)}async processResponse(e){var t=this;let a=null,s=null,o=null,c=e.status,u=e.statusText;if(e.ok){var d,h;if(t.method!=="HEAD"){var p;const x=await e.text();x===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((p=t.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?s=x:s=JSON.parse(x))}const v=(d=t.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),g=(h=e.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");v&&g&&g.length>1&&(o=parseInt(g[1])),t.isMaybeSingle&&Array.isArray(s)&&(s.length>1?(a={code:"PGRST116",details:`Results contain ${s.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},s=null,o=null,c=406,u="Not Acceptable"):s.length===1?s=s[0]:s=null)}else{const v=await e.text();try{a=JSON.parse(v),Array.isArray(a)&&e.status===404&&(s=[],a=null,c=200,u="OK")}catch{e.status===404&&v===""?(c=204,u="No Content"):a={message:v}}if(a&&t.shouldThrowOnError)throw new $R(a)}return{success:a===null,error:a,data:s,count:o,status:c,statusText:u}}returns(){return this}overrideTypes(){return this}},GR=class extends qR{select(e){let t=!1;const a=(e??"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",a),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:a,foreignTable:s,referencedTable:o=s}={}){const c=o?`${o}.order`:"order",u=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${u?`${u},`:""}${e}.${t?"asc":"desc"}${a===void 0?"":a?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:a=t}={}){const s=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:a,referencedTable:s=a}={}){const o=typeof s>"u"?"offset":`${s}.offset`,c=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(c,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:a=!1,buffers:s=!1,wal:o=!1,format:c="text"}={}){var u;const d=[e?"analyze":null,t?"verbose":null,a?"settings":null,s?"buffers":null,o?"wal":null].filter(Boolean).join("|"),h=(u=this.headers.get("Accept"))!==null&&u!==void 0?u:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${h}"; options=${d};`),c==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const wb=new RegExp("[,()]");var ai=class extends GR{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const a=Array.from(new Set(t)).map(s=>typeof s=="string"&&wb.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${a})`),this}notIn(e,t){const a=Array.from(new Set(t)).map(s=>typeof s=="string"&&wb.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`not.in.(${a})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:a,type:s}={}){let o="";s==="plain"?o="pl":s==="phrase"?o="ph":s==="websearch"&&(o="w");const c=a===void 0?"":`(${a})`;return this.url.searchParams.append(e,`${o}fts${c}.${t}`),this}match(e){return Object.entries(e).filter(([t,a])=>a!==void 0).forEach(([t,a])=>{this.url.searchParams.append(t,`eq.${a}`)}),this}not(e,t,a){return this.url.searchParams.append(e,`not.${t}.${a}`),this}or(e,{foreignTable:t,referencedTable:a=t}={}){const s=a?`${a}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,a){return this.url.searchParams.append(e,`${t}.${a}`),this}},VR=class{constructor(e,{headers:t={},schema:a,fetch:s,urlLengthLimit:o=8e3,retry:c}){this.url=e,this.headers=new Headers(t),this.schema=a,this.fetch=s,this.urlLengthLimit=o,this.retry=c}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:a=!1,count:s}=t??{},o=a?"HEAD":"GET";let c=!1;const u=(e??"*").split("").map(p=>/\s/.test(p)&&!c?"":(p==='"'&&(c=!c),p)).join(""),{url:d,headers:h}=this.cloneRequestState();return d.searchParams.set("select",u),s&&h.append("Prefer",`count=${s}`),new ai({method:o,url:d,headers:h,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:a=!0}={}){var s;const o="POST",{url:c,headers:u}=this.cloneRequestState();if(t&&u.append("Prefer",`count=${t}`),a||u.append("Prefer","missing=default"),Array.isArray(e)){const d=e.reduce((h,p)=>h.concat(Object.keys(p)),[]);if(d.length>0){const h=[...new Set(d)].map(p=>`"${p}"`);c.searchParams.set("columns",h.join(","))}}return new ai({method:o,url:c,headers:u,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:a=!1,count:s,defaultToNull:o=!0}={}){var c;const u="POST",{url:d,headers:h}=this.cloneRequestState();if(h.append("Prefer",`resolution=${a?"ignore":"merge"}-duplicates`),t!==void 0&&d.searchParams.set("on_conflict",t),s&&h.append("Prefer",`count=${s}`),o||h.append("Prefer","missing=default"),Array.isArray(e)){const p=e.reduce((v,g)=>v.concat(Object.keys(g)),[]);if(p.length>0){const v=[...new Set(p)].map(g=>`"${g}"`);d.searchParams.set("columns",v.join(","))}}return new ai({method:u,url:d,headers:h,schema:this.schema,body:e,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var a;const s="PATCH",{url:o,headers:c}=this.cloneRequestState();return t&&c.append("Prefer",`count=${t}`),new ai({method:s,url:o,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const a="DELETE",{url:s,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new ai({method:a,url:s,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Po(e){"@babel/helpers - typeof";return Po=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Po(e)}function KR(e,t){if(Po(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t);if(Po(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FR(e){var t=KR(e,"string");return Po(t)=="symbol"?t:t+""}function YR(e,t,a){return(t=FR(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function xb(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function wc(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?xb(Object(a),!0).forEach(function(s){YR(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):xb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}var WR=class pw{constructor(t,{headers:a={},schema:s,fetch:o,timeout:c,urlLengthLimit:u=8e3,retry:d}={}){this.url=t,this.headers=new Headers(a),this.schemaName=s,this.urlLengthLimit=u;const h=o??globalThis.fetch;c!==void 0&&c>0?this.fetch=(p,v)=>{const g=new AbortController,x=setTimeout(()=>g.abort(),c),S=v==null?void 0:v.signal;if(S){if(S.aborted)return clearTimeout(x),h(p,v);const _=()=>{clearTimeout(x),g.abort()};return S.addEventListener("abort",_,{once:!0}),h(p,wc(wc({},v),{},{signal:g.signal})).finally(()=>{clearTimeout(x),S.removeEventListener("abort",_)})}return h(p,wc(wc({},v),{},{signal:g.signal})).finally(()=>clearTimeout(x))}:this.fetch=h,this.retry=d}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new VR(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new pw(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,a={},{head:s=!1,get:o=!1,count:c}={}){var u;let d;const h=new URL(`${this.url}/rpc/${t}`);let p;const v=S=>S!==null&&typeof S=="object"&&(!Array.isArray(S)||S.some(v)),g=s&&Object.values(a).some(v);g?(d="POST",p=a):s||o?(d=s?"HEAD":"GET",Object.entries(a).filter(([S,_])=>_!==void 0).map(([S,_])=>[S,Array.isArray(_)?`{${_.join(",")}}`:`${_}`]).forEach(([S,_])=>{h.searchParams.append(S,_)})):(d="POST",p=a);const x=new Headers(this.headers);return g?x.set("Prefer",c?`count=${c},return=minimal`:"return=minimal"):c&&x.set("Prefer",`count=${c}`),new ai({method:d,url:h,headers:x,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class XR{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const a=globalThis;if(typeof globalThis<"u"&&typeof a.WebSocket<"u")return{type:"native",wsConstructor:a.WebSocket};const s=typeof global<"u"?global:void 0;if(s&&typeof s.WebSocket<"u")return{type:"native",wsConstructor:s.WebSocket};if(typeof globalThis<"u"&&typeof a.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&a.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const o=globalThis.process;if(o){const c=o.versions;if(c&&c.node){const u=c.node,d=parseInt(u.replace(/^v/,"").split(".")[0]);return d>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${d} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${d} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let a=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(a+=`
Suggested solution: ${t.workaround}`),new Error(a)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const JR="2.106.2",QR=`realtime-js/${JR}`,ZR="1.0.0",gw="2.0.0",eA=gw,tA=1e4,nA=100,ha={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},vw={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Lh={connecting:"connecting",closing:"closing",closed:"closed"};class rA{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,a){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return a(this._binaryEncodeUserBroadcastPush(t));let s=[t.join_ref,t.ref,t.topic,t.event,t.payload];return a(JSON.stringify(s))}_binaryEncodeUserBroadcastPush(t){var a;return this._isArrayBuffer((a=t.payload)===null||a===void 0?void 0:a.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var a,s;const o=(s=(a=t.payload)===null||a===void 0?void 0:a.payload)!==null&&s!==void 0?s:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var a,s;const o=(s=(a=t.payload)===null||a===void 0?void 0:a.payload)!==null&&s!==void 0?s:{},u=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,u)}_encodeUserBroadcastPush(t,a,s){var o,c;const u=t.topic,d=(o=t.ref)!==null&&o!==void 0?o:"",h=(c=t.join_ref)!==null&&c!==void 0?c:"",p=t.payload.event,v=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},g=Object.keys(v).length===0?"":JSON.stringify(v);if(h.length>255)throw new Error(`joinRef length ${h.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`ref length ${d.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`topic length ${u.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`userEvent length ${p.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`metadata length ${g.length} exceeds maximum of 255`);const x=this.USER_BROADCAST_PUSH_META_LENGTH+h.length+d.length+u.length+p.length+g.length,S=new ArrayBuffer(this.HEADER_LENGTH+x);let _=new DataView(S),E=0;_.setUint8(E++,this.KINDS.userBroadcastPush),_.setUint8(E++,h.length),_.setUint8(E++,d.length),_.setUint8(E++,u.length),_.setUint8(E++,p.length),_.setUint8(E++,g.length),_.setUint8(E++,a),Array.from(h,T=>_.setUint8(E++,T.charCodeAt(0))),Array.from(d,T=>_.setUint8(E++,T.charCodeAt(0))),Array.from(u,T=>_.setUint8(E++,T.charCodeAt(0))),Array.from(p,T=>_.setUint8(E++,T.charCodeAt(0))),Array.from(g,T=>_.setUint8(E++,T.charCodeAt(0)));var R=new Uint8Array(S.byteLength+s.byteLength);return R.set(new Uint8Array(S),0),R.set(new Uint8Array(s),S.byteLength),R.buffer}decode(t,a){if(this._isArrayBuffer(t)){let s=this._binaryDecode(t);return a(s)}if(typeof t=="string"){const s=JSON.parse(t),[o,c,u,d,h]=s;return a({join_ref:o,ref:c,topic:u,event:d,payload:h})}return a({})}_binaryDecode(t){const a=new DataView(t),s=a.getUint8(0),o=new TextDecoder;switch(s){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,a,o)}}_decodeUserBroadcast(t,a,s){const o=a.getUint8(1),c=a.getUint8(2),u=a.getUint8(3),d=a.getUint8(4);let h=this.HEADER_LENGTH+4;const p=s.decode(t.slice(h,h+o));h=h+o;const v=s.decode(t.slice(h,h+c));h=h+c;const g=s.decode(t.slice(h,h+u));h=h+u;const x=t.slice(h,t.byteLength),S=d===this.JSON_ENCODING?JSON.parse(s.decode(x)):x,_={type:this.BROADCAST_EVENT,event:v,payload:S};return u>0&&(_.meta=JSON.parse(g)),{join_ref:null,ref:null,topic:p,event:this.BROADCAST_EVENT,payload:_}}_isArrayBuffer(t){var a;return t instanceof ArrayBuffer||((a=t==null?void 0:t.constructor)===null||a===void 0?void 0:a.name)==="ArrayBuffer"}_pick(t,a){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([s])=>a.includes(s)))}}var We;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(We||(We={}));const Sb=(e,t,a={})=>{var s;const o=(s=a.skipTypes)!==null&&s!==void 0?s:[];return t?Object.keys(t).reduce((c,u)=>(c[u]=aA(u,e,t,o),c),{}):{}},aA=(e,t,a,s)=>{const o=t.find(d=>d.name===e),c=o==null?void 0:o.type,u=a[e];return c&&!s.includes(c)?yw(c,u):Uh(u)},yw=(e,t)=>{if(e.charAt(0)==="_"){const a=e.slice(1,e.length);return lA(t,a)}switch(e){case We.bool:return sA(t);case We.float4:case We.float8:case We.int2:case We.int4:case We.int8:case We.numeric:case We.oid:return iA(t);case We.json:case We.jsonb:return oA(t);case We.timestamp:return cA(t);case We.abstime:case We.date:case We.daterange:case We.int4range:case We.int8range:case We.money:case We.reltime:case We.text:case We.time:case We.timestamptz:case We.timetz:case We.tsrange:case We.tstzrange:return Uh(t);default:return Uh(t)}},Uh=e=>e,sA=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},iA=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},oA=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},lA=(e,t)=>{if(typeof e!="string")return e;const a=e.length-1,s=e[a];if(e[0]==="{"&&s==="}"){let c;const u=e.slice(1,a);try{c=JSON.parse("["+u+"]")}catch{c=u?u.split(","):[]}return c.map(d=>yw(t,d))}return e},cA=e=>typeof e=="string"?e.replace(" ","T"):e,bw=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var Oo=e=>typeof e=="function"?e:function(){return e},uA=typeof self<"u"?self:null,si=typeof window<"u"?window:null,Wn=uA||si||globalThis,dA="2.0.0",fA=1e4,hA=1e3,Xn={connecting:0,open:1,closing:2,closed:3},Yt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Cr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Ph={longpoll:"longpoll",websocket:"websocket"},mA={complete:4},zh="base64url.bearer.phx.",xc=class{constructor(e,t,a,s){this.channel=e,this.event=t,this.payload=a||function(){return{}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:a}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},ww=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},pA=class{constructor(e,t,a){this.state=Yt.closed,this.topic=e,this.params=Oo(t||{}),this.socket=a,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new xc(this,Cr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ww(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Yt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",s=>{this.state=Yt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Yt.closed,this.socket.remove(this)}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=Yt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new xc(this,Cr.leave,Oo({}),this.timeout).send(),this.state=Yt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Cr.reply,(s,o)=>{this.trigger(this.replyEventName(o),s)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Yt.closed,this.bindings=[]}onClose(e){this.on(Cr.close,e)}onError(e){return this.on(Cr.error,t=>e(t))}on(e,t){let a=this.bindingRef++;return this.bindings.push({event:e,ref:a,callback:t}),a}off(e,t){this.bindings=this.bindings.filter(a=>!(a.event===e&&(typeof t>"u"||t===a.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,a=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new xc(this,e,function(){return t},a);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Yt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Cr.close,"leave")},a=new xc(this,Cr.leave,Oo({}),e);return a.receive("ok",()=>t()).receive("timeout",()=>t()),a.send(),this.canPush()||a.trigger("ok",{}),a}onMessage(e,t,a){return t}filterBindings(e,t,a){return!0}isMember(e,t,a,s){return this.topic!==e?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:a,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Yt.joining,this.joinPush.resend(e))}trigger(e,t,a,s){let o=this.onMessage(e,t,a,s);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(u=>u.event===e&&this.filterBindings(u,t,a));for(let u=0;u<c.length;u++)c[u].callback(o,a,s||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Yt.closed}isErrored(){return this.state===Yt.errored}isJoined(){return this.state===Yt.joined}isJoining(){return this.state===Yt.joining}isLeaving(){return this.state===Yt.leaving}},nu=class{static request(e,t,a,s,o,c,u){if(Wn.XDomainRequest){let d=new Wn.XDomainRequest;return this.xdomainRequest(d,e,t,s,o,c,u)}else if(Wn.XMLHttpRequest){let d=new Wn.XMLHttpRequest;return this.xhrRequest(d,e,t,a,s,o,c,u)}else{if(Wn.fetch&&Wn.AbortController)return this.fetchRequest(e,t,a,s,o,c,u);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,a,s,o,c,u){let d={method:e,headers:a,body:s},h=null;return o&&(h=new AbortController,setTimeout(()=>h.abort(),o),d.signal=h.signal),Wn.fetch(t,d).then(p=>p.text()).then(p=>this.parseJSON(p)).then(p=>u&&u(p)).catch(p=>{p.name==="AbortError"&&c?c():u&&u(null)}),h}static xdomainRequest(e,t,a,s,o,c,u){return e.timeout=o,e.open(t,a),e.onload=()=>{let d=this.parseJSON(e.responseText);u&&u(d)},c&&(e.ontimeout=c),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,a,s,o,c,u,d){e.open(t,a,!0),e.timeout=c;for(let[h,p]of Object.entries(s))e.setRequestHeader(h,p);return e.onerror=()=>d&&d(null),e.onreadystatechange=()=>{if(e.readyState===mA.complete&&d){let h=this.parseJSON(e.responseText);d(h)}},u&&(e.ontimeout=u),e.send(o),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let a=[];for(var s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let o=t?`${t}[${s}]`:s,c=e[s];typeof c=="object"?a.push(this.serialize(c,o)):a.push(encodeURIComponent(o)+"="+encodeURIComponent(c))}return a.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let a=e.match(/\?/)?"&":"?";return`${e}${a}${this.serialize(t)}`}},gA=e=>{let t="",a=new Uint8Array(e),s=a.byteLength;for(let o=0;o<s;o++)t+=String.fromCharCode(a[o]);return btoa(t)},Ws=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(zh)&&(this.authToken=atob(t[1].slice(zh.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Xn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Ph.websocket),"$1/"+Ph.longpoll)}endpointURL(){return nu.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,a){this.close(e,t,a),this.readyState=Xn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Xn.open||this.readyState===Xn.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:a,token:s,messages:o}=t;if(a===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=s}else a=0;switch(a){case 200:o.forEach(c=>{setTimeout(()=>this.onmessage({data:c}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Xn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${a}`)}})}send(e){typeof e!="string"&&(e=gA(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,a){for(let o of this.reqs)o.abort();this.readyState=Xn.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:a});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(e,t,a,s,o){let c,u=()=>{this.reqs.delete(c),s()};c=nu.request(e,this.endpointURL(),t,a,this.timeout,u,d=>{this.reqs.delete(c),this.isActive()&&o(d)}),this.reqs.add(c)}},vA=class Co{constructor(t,a={}){let s=a.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(s.state,o=>{let{onJoin:c,onLeave:u,onSync:d}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Co.syncState(this.state,o,c,u),this.pendingDiffs.forEach(h=>{this.state=Co.syncDiff(this.state,h,c,u)}),this.pendingDiffs=[],d()}),this.channel.on(s.diff,o=>{let{onJoin:c,onLeave:u,onSync:d}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=Co.syncDiff(this.state,o,c,u),d())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Co.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,a,s,o){let c=this.clone(t),u={},d={};return this.map(c,(h,p)=>{a[h]||(d[h]=p)}),this.map(a,(h,p)=>{let v=c[h];if(v){let g=p.metas.map(E=>E.phx_ref),x=v.metas.map(E=>E.phx_ref),S=p.metas.filter(E=>x.indexOf(E.phx_ref)<0),_=v.metas.filter(E=>g.indexOf(E.phx_ref)<0);S.length>0&&(u[h]=p,u[h].metas=S),_.length>0&&(d[h]=this.clone(v),d[h].metas=_)}else u[h]=p}),this.syncDiff(c,{joins:u,leaves:d},s,o)}static syncDiff(t,a,s,o){let{joins:c,leaves:u}=this.clone(a);return s||(s=function(){}),o||(o=function(){}),this.map(c,(d,h)=>{let p=t[d];if(t[d]=this.clone(h),p){let v=t[d].metas.map(x=>x.phx_ref),g=p.metas.filter(x=>v.indexOf(x.phx_ref)<0);t[d].metas.unshift(...g)}s(d,p,h)}),this.map(u,(d,h)=>{let p=t[d];if(!p)return;let v=h.metas.map(g=>g.phx_ref);p.metas=p.metas.filter(g=>v.indexOf(g.phx_ref)<0),o(d,p,h),p.metas.length===0&&delete t[d]}),t}static list(t,a){return a||(a=function(s,o){return o}),this.map(t,(s,o)=>a(s,o))}static map(t,a){return Object.getOwnPropertyNames(t).map(s=>a(s,t[s]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Sc={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let a=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(a))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[a,s,o,c,u]=JSON.parse(e);return t({join_ref:a,ref:s,topic:o,event:c,payload:u})}},binaryEncode(e){let{join_ref:t,ref:a,event:s,topic:o,payload:c}=e,u=this.META_LENGTH+t.length+a.length+o.length+s.length,d=new ArrayBuffer(this.HEADER_LENGTH+u),h=new DataView(d),p=0;h.setUint8(p++,this.KINDS.push),h.setUint8(p++,t.length),h.setUint8(p++,a.length),h.setUint8(p++,o.length),h.setUint8(p++,s.length),Array.from(t,g=>h.setUint8(p++,g.charCodeAt(0))),Array.from(a,g=>h.setUint8(p++,g.charCodeAt(0))),Array.from(o,g=>h.setUint8(p++,g.charCodeAt(0))),Array.from(s,g=>h.setUint8(p++,g.charCodeAt(0)));var v=new Uint8Array(d.byteLength+c.byteLength);return v.set(new Uint8Array(d),0),v.set(new Uint8Array(c),d.byteLength),v.buffer},binaryDecode(e){let t=new DataView(e),a=t.getUint8(0),s=new TextDecoder;switch(a){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,a){let s=t.getUint8(1),o=t.getUint8(2),c=t.getUint8(3),u=this.HEADER_LENGTH+this.META_LENGTH-1,d=a.decode(e.slice(u,u+s));u=u+s;let h=a.decode(e.slice(u,u+o));u=u+o;let p=a.decode(e.slice(u,u+c));u=u+c;let v=e.slice(u,e.byteLength);return{join_ref:d,ref:null,topic:h,event:p,payload:v}},decodeReply(e,t,a){let s=t.getUint8(1),o=t.getUint8(2),c=t.getUint8(3),u=t.getUint8(4),d=this.HEADER_LENGTH+this.META_LENGTH,h=a.decode(e.slice(d,d+s));d=d+s;let p=a.decode(e.slice(d,d+o));d=d+o;let v=a.decode(e.slice(d,d+c));d=d+c;let g=a.decode(e.slice(d,d+u));d=d+u;let x=e.slice(d,e.byteLength),S={status:g,response:x};return{join_ref:h,ref:p,topic:v,event:Cr.reply,payload:S}},decodeBroadcast(e,t,a){let s=t.getUint8(1),o=t.getUint8(2),c=this.HEADER_LENGTH+2,u=a.decode(e.slice(c,c+s));c=c+s;let d=a.decode(e.slice(c,c+o));c=c+o;let h=e.slice(c,e.byteLength);return{join_ref:null,ref:null,topic:u,event:d,payload:h}}},yA=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||fA,this.transport=t.transport||Wn.WebSocket||Ws,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let a=null;try{a=Wn&&Wn.sessionStorage}catch{}this.sessionStore=t.sessionStorage||a,this.establishedConnections=0,this.defaultEncoder=Sc.encode.bind(Sc),this.defaultDecoder=Sc.decode.bind(Sc),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Ws?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;si&&si.addEventListener&&(si.addEventListener("pagehide",o=>{this.conn&&(this.disconnect(),s=this.connectClock)}),si.addEventListener("pageshow",o=>{s===this.connectClock&&(s=null,this.connect())}),si.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=o=>t.rejoinAfterMs?t.rejoinAfterMs(o):[1e3,2e3,5e3][o-1]||1e4,this.reconnectAfterMs=o=>t.reconnectAfterMs?t.reconnectAfterMs(o):[10,50,100,150,200,250,500,1e3,2e3][o-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(o,c,u)=>{console.log(`${o}: ${c}`,u)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Oo(t.params||{}),this.endPoint=`${e}/${Ph.websocket}`,this.vsn=t.vsn||dA,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ww(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Ws}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=nu.appendParams(nu.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,a){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,a)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Oo(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Ws?this.connectWithFallback(Ws,this.longPollFallbackMs):this.transportConnect())}log(e,t,a){this.logger&&this.logger(e,t,a)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),a=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(o=>{o.ref===t&&(this.off([s]),e(Date.now()-a))});return!0}transportName(e){switch(e){case Ws:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${zh}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let a=!1,s=!0,o,c,u=this.transportName(e),d=h=>{this.log("transport",`falling back to ${u}...`,h),this.off([o,c]),s=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${u}`))return d("memorized");this.fallbackTimer=setTimeout(d,t),c=this.onError(h=>{this.log("transport","error",h),s&&!a&&(clearTimeout(this.fallbackTimer),d(h))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(a=!0,!s){let h=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${h}`,"true"),this.log("transport",`established ${h} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(d,t),this.ping(h=>{this.log("transport","connected to primary after",h),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),hA,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,a){if(!this.conn)return e&&e();const s=this.conn;this.waitForBufferDone(s,()=>{t?s.close(t,a||""):s.close(),this.waitForSocketClosed(s,()=>{this.conn===s&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,a=1){if(a===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,a+1)},150*a)}waitForSocketClosed(e,t,a=1){if(a===5||e.readyState===Xn.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,a+1)},150*a)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,a=this.establishedConnections;this.triggerStateCallbacks("error",e,t,a),(t===this.transport||a>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(Cr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Xn.connecting:return"connecting";case Xn.open:return"open";case Xn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([a])=>e.indexOf(a)===-1)}channel(e,t={}){let a=new pA(e,t,this);return this.channels.push(a),a}push(e){if(this.hasLogger()){let{topic:t,event:a,payload:s,ref:o,join_ref:c}=e;this.log("push",`${t} ${a} (${c}, ${o})`,s)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:a,event:s,payload:o,ref:c,join_ref:u}=t;if(c&&c===this.pendingHeartbeatRef){const d=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.status==="ok"?"ok":"error",d)}catch(h){this.log("error","error in heartbeat callback",h)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${o.status||""} ${a} ${s} ${c&&"("+c+")"||""}`.trim(),o);for(let d=0;d<this.channels.length;d++){const h=this.channels[d];h.isMember(a,s,o,u)&&h.trigger(s,o,c,u)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([a,s])=>{try{s(...t)}catch(o){this.log("error",`error in ${e} callback`,o)}})}catch(a){this.log("error",`error triggering ${e} callbacks`,a)}}leaveOpenTopic(e){let t=this.channels.find(a=>a.topic===e&&(a.isJoined()||a.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class jo{constructor(t,a){const s=wA(a);this.presence=new vA(t.getChannel(),s),this.presence.onJoin((o,c,u)=>{const d=jo.onJoinPayload(o,c,u);t.getChannel().trigger("presence",d)}),this.presence.onLeave((o,c,u)=>{const d=jo.onLeavePayload(o,c,u);t.getChannel().trigger("presence",d)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return jo.transformState(this.presence.state)}static transformState(t){return t=bA(t),Object.getOwnPropertyNames(t).reduce((a,s)=>{const o=t[s];return a[s]=Fc(o),a},{})}static onJoinPayload(t,a,s){const o=_b(a),c=Fc(s);return{event:"join",key:t,currentPresences:o,newPresences:c}}static onLeavePayload(t,a,s){const o=_b(a),c=Fc(s);return{event:"leave",key:t,currentPresences:o,leftPresences:c}}}function Fc(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function bA(e){return JSON.parse(JSON.stringify(e))}function wA(e){return(e==null?void 0:e.events)&&{events:e.events}}function _b(e){return e!=null&&e.metas?Fc(e):[]}var Eb;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Eb||(Eb={}));class xA{get state(){return this.presenceAdapter.state}constructor(t,a){this.channel=t,this.presenceAdapter=new jo(this.channel.channelAdapter,a)}}function SA(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const a=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${a}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class _A{constructor(t,a,s){const o=EA(s);this.channel=t.getSocket().channel(a,o),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,a){return this.channel.on(t,a)}off(t,a){this.channel.off(t,a)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,a,s){let o;try{o=this.channel.push(t,a,s)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>nA){const c=this.channel.pushBuffer.shift();c.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${c.event}`,c.payload())}return o}updateJoinPayload(t){const a=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},a),t)}canPush(){return this.socket.isConnected()&&this.state===ha.joined}isJoined(){return this.state===ha.joined}isJoining(){return this.state===ha.joining}isClosed(){return this.state===ha.closed}isLeaving(){return this.state===ha.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function EA(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var Cb;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Cb||(Cb={}));var ci;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ci||(ci={}));var Tr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Tr||(Tr={}));class Mo{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,a={config:{}},s){var o,c;if(this.topic=t,this.params=a,this.socket=s,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},a.config),this.channelAdapter=new _A(this.socket.socketAdapter,t,this.params),this.presence=new xA(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=bw(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((c=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,a=this.timeout){var s,o,c;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:u,presence:d,private:h}}=this.params,p=(o=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(S=>S.filter))!==null&&o!==void 0?o:[],v=!!this.bindings[ci.PRESENCE]&&this.bindings[ci.PRESENCE].length>0||((c=this.params.config.presence)===null||c===void 0?void 0:c.enabled)===!0,g={},x={broadcast:u,presence:Object.assign(Object.assign({},d),{enabled:v}),postgres_changes:p,private:h};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(S=>{t==null||t(Tr.CHANNEL_ERROR,SA(S))}),this._onClose(()=>t==null?void 0:t(Tr.CLOSED)),this.updateJoinPayload(Object.assign({config:x},g)),this._updateFilterMessage(),this.channelAdapter.subscribe(a).receive("ok",async({postgres_changes:S})=>{if(this.socket._isManualToken()||this.socket.setAuth(),S===void 0){t==null||t(Tr.SUBSCRIBED);return}this._updatePostgresBindings(S,t)}).receive("error",S=>{this.state=ha.errored;const _=Object.values(S).join(", ")||"error";t==null||t(Tr.CHANNEL_ERROR,new Error(_,{cause:S}))}).receive("timeout",()=>{t==null||t(Tr.TIMED_OUT)})}return this}_updatePostgresBindings(t,a){var s;const o=this.bindings.postgres_changes,c=(s=o==null?void 0:o.length)!==null&&s!==void 0?s:0,u=[];for(let d=0;d<c;d++){const h=o[d],{filter:{event:p,schema:v,table:g,filter:x}}=h,S=t&&t[d];if(S&&S.event===p&&Mo.isFilterValueEqual(S.schema,v)&&Mo.isFilterValueEqual(S.table,g)&&Mo.isFilterValueEqual(S.filter,x))u.push(Object.assign(Object.assign({},h),{id:S.id}));else{this.unsubscribe(),this.state=ha.errored,a==null||a(Tr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=u,this.state!=ha.errored&&a&&a(Tr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,a={}){return await this.send({type:"presence",event:"track",payload:t},a.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,a,s){const o=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),c=t===ci.PRESENCE||t===ci.POSTGRES_CHANGES;if(o&&c)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,a,s)}async httpSend(t,a,s={}){var o;if(a==null)return Promise.reject(new Error("Payload is required for httpSend()"));const c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:a,private:this.private}]})},d=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(o=s.timeout)!==null&&o!==void 0?o:this.timeout);if(d.status===202)return{success:!0};let h=d.statusText;try{const p=await d.json();h=p.error||p.message||h}catch{}return Promise.reject(new Error(h))}async send(t,a={}){var s,o;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:c,payload:u}=t,d={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(d.Authorization=`Bearer ${this.socket.accessTokenValue}`);const h={method:"POST",headers:d,body:JSON.stringify({messages:[{topic:this.subTopic,event:c,payload:u,private:this.private}]})};try{const p=await this._fetchWithTimeout(this.broadcastEndpointURL,h,(s=a.timeout)!==null&&s!==void 0?s:this.timeout);return await((o=p.body)===null||o===void 0?void 0:o.cancel()),p.ok?"ok":"error"}catch(p){return p instanceof Error&&p.name==="AbortError"?"timed out":"error"}}else return new Promise(c=>{var u,d,h;const p=this.channelAdapter.push(t.type,t,a.timeout||this.timeout);t.type==="broadcast"&&!(!((h=(d=(u=this.params)===null||u===void 0?void 0:u.config)===null||d===void 0?void 0:d.broadcast)===null||h===void 0)&&h.ack)&&c("ok"),p.receive("ok",()=>c("ok")),p.receive("error",()=>c("error")),p.receive("timeout",()=>c("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(a=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>a("ok")).receive("timeout",()=>a("timed out")).receive("error",()=>a("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,a,s){const o=new AbortController,c=setTimeout(()=>o.abort(),s),u=await this.socket.fetch(t,Object.assign(Object.assign({},a),{signal:o.signal}));return clearTimeout(c),u}_on(t,a,s){const o=t.toLocaleLowerCase(),c=this.channelAdapter.on(t,s),u={type:o,filter:a,callback:s,ref:c};return this.bindings[o]?this.bindings[o].push(u):this.bindings[o]=[u],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,a,s)=>{var o,c,u,d,h,p,v;const g=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(g,s))return!1;const x=(o=this.bindings[g])===null||o===void 0?void 0:o.find(S=>S.ref===t.ref);if(!x)return!0;if(["broadcast","presence","postgres_changes"].includes(g))if("id"in x){const S=x.id,_=(c=x.filter)===null||c===void 0?void 0:c.event;return S&&((u=a.ids)===null||u===void 0?void 0:u.includes(S))&&(_==="*"||(_==null?void 0:_.toLocaleLowerCase())===((d=a.data)===null||d===void 0?void 0:d.type.toLocaleLowerCase()))}else{const S=(p=(h=x==null?void 0:x.filter)===null||h===void 0?void 0:h.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return S==="*"||S===((v=a==null?void 0:a.event)===null||v===void 0?void 0:v.toLocaleLowerCase())}else return x.type.toLocaleLowerCase()===g})}_notThisChannelEvent(t,a){const{close:s,error:o,leave:c,join:u}=vw;return a&&[s,o,c,u].includes(t)&&a!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,a,s)=>{if(typeof a=="object"&&"ids"in a){const o=a.data,{schema:c,table:u,commit_timestamp:d,type:h,errors:p}=o;return Object.assign(Object.assign({},{schema:c,table:u,commit_timestamp:d,eventType:h,new:{},old:{},errors:p}),this._getPayloadRecords(o))}return a})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const a in t.bindings)for(const s of t.bindings[a])this._on(s.type,s.filter,s.callback)}static isFilterValueEqual(t,a){return(t??void 0)===(a??void 0)}_getPayloadRecords(t){const a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=Sb(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=Sb(t.columns,t.old_record)),a}}class CA{constructor(t,a){this.socket=new yA(t,a)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,a,s,o=1e4){return new Promise(c=>{setTimeout(()=>c("timeout"),o),this.socket.disconnect(()=>{t(),c("ok")},a,s)})}push(t){this.socket.push(t)}log(t,a,s){this.socket.log(t,a,s)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Lh.connecting}isDisconnecting(){return this.socket.connectionState()==Lh.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Tb={HEARTBEAT_INTERVAL:25e3},TA=[1e3,2e3,5e3,1e4],RA=1e4;function AA(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var a;return(a=Array.from(e.keys())[t])!==null&&a!==void 0?a:null},removeItem(t){e.delete(t)},setItem(t,a){e.set(t,String(a))}}}function NA(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return AA()}const kA=`
addEventListener("message", (e) => {
if (e.data.event === "start") {
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
}
});`;class OA{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,a){var s;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new rA,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=c=>c?(...u)=>c(...u):(...u)=>fetch(...u),!(!((s=a==null?void 0:a.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=a.params.apikey;const o=this._initializeOptions(a);this.socketAdapter=new CA(t,o),this.httpEndpoint=bw(t),this.fetch=this._resolveFetch(a==null?void 0:a.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const a=t.message;throw a.includes("Node.js")?new Error(`${a}
To use Realtime in Node.js, you need to provide a WebSocket implementation:
Option 1: Use Node.js 22+ which has native WebSocket support
Option 2: Install and provide the "ws" package:
npm install ws
import ws from "ws"
const client = new RealtimeClient(url, {
...options,
transport: ws
})`):new Error(`WebSocket not available: ${a}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,a){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,a)}getChannels(){return this.channels}async removeChannel(t){const a=await t.unsubscribe();return a==="ok"&&t.teardown(),a}async removeAllChannels(){const t=this.channels.map(async s=>{const o=await s.unsubscribe();return s.teardown(),o}),a=await Promise.all(t);return await this.disconnect(),a}log(t,a,s){this.socketAdapter.log(t,a,s)}connectionState(){return this.socketAdapter.connectionState()||Lh.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,a={config:{}}){const s=`realtime:${t}`,o=this.getChannels().find(c=>c.topic===s);if(o)return o;{const c=new Mo(`realtime:${t}`,a,this);return this._cancelPendingDisconnect(),this.channels.push(c),c}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(a=>a.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let a,s=!1;if(t)a=t,s=!0;else if(this.accessToken)try{a=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),a=this.accessTokenValue}else a=this.accessTokenValue;s?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=a&&(this.accessTokenValue=a,this.channels.forEach(o=>{const c={access_token:a,version:QR};a&&o.updateJoinPayload(c),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(vw.access_token,{access_token:a})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(a=>{this.log("error",`Error setting auth in ${t}`,a)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(a=>{this.log("error","error waiting for auth on connect",a)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(a,s)=>{a=="sent"&&this._setAuthSafely(),t&&t(a,s)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=a=>{this.log("worker","worker error",a.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=a=>{a.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let a;if(t)a=t;else{const s=new Blob([kA],{type:"application/javascript"});a=URL.createObjectURL(s)}return a}_initializeOptions(t){var a,s,o,c,u,d,h,p,v,g,x,S;this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!1,this.accessToken=(s=t==null?void 0:t.accessToken)!==null&&s!==void 0?s:null;const _={};_.timeout=(o=t==null?void 0:t.timeout)!==null&&o!==void 0?o:tA,_.heartbeatIntervalMs=(c=t==null?void 0:t.heartbeatIntervalMs)!==null&&c!==void 0?c:Tb.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(u=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&u!==void 0?u:2*((d=t==null?void 0:t.heartbeatIntervalMs)!==null&&d!==void 0?d:Tb.HEARTBEAT_INTERVAL),_.transport=(h=t==null?void 0:t.transport)!==null&&h!==void 0?h:XR.getWebSocketConstructor(),_.params=t==null?void 0:t.params,_.logger=t==null?void 0:t.logger,_.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),_.sessionStorage=(p=t==null?void 0:t.sessionStorage)!==null&&p!==void 0?p:NA(),_.reconnectAfterMs=(v=t==null?void 0:t.reconnectAfterMs)!==null&&v!==void 0?v:(A=>TA[A-1]||RA);let E,R;const T=(g=t==null?void 0:t.vsn)!==null&&g!==void 0?g:eA;switch(T){case ZR:E=(A,N)=>N(JSON.stringify(A)),R=(A,N)=>N(JSON.parse(A));break;case gw:E=this.serializer.encode.bind(this.serializer),R=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${_.vsn}`)}if(_.vsn=T,_.encode=(x=t==null?void 0:t.encode)!==null&&x!==void 0?x:E,_.decode=(S=t==null?void 0:t.decode)!==null&&S!==void 0?S:R,_.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,_.params=Object.assign(Object.assign({},_.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,_.autoSendHeartbeat=!this.worker}return _}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var zo=class extends Error{constructor(e,t){var a;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((a=t.icebergType)==null?void 0:a.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function jA(e,t,a){const s=new URL(t,e);if(a)for(const[o,c]of Object.entries(a))c!==void 0&&s.searchParams.set(o,c);return s.toString()}async function MA(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function DA(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:a,path:s,query:o,body:c,headers:u}){const d=jA(e.baseUrl,s,o),h=await MA(e.auth),p=await t(d,{method:a,headers:{...c?{"Content-Type":"application/json"}:{},...h,...u},body:c?JSON.stringify(c):void 0}),v=await p.text(),g=(p.headers.get("content-type")||"").includes("application/json"),x=g&&v?JSON.parse(v):v;if(!p.ok){const S=g?x:void 0,_=S==null?void 0:S.error;throw new zo((_==null?void 0:_.message)??`Request failed with status ${p.status}`,{status:p.status,icebergType:_==null?void 0:_.type,icebergCode:_==null?void 0:_.code,details:S})}return{status:p.status,headers:p.headers,data:x}}}}function _c(e){return e.join("")}var LA=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:_c(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(s=>({namespace:s}))}async createNamespace(e,t){const a={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:a})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${_c(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${_c(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${_c(e.namespace)}`}),!0}catch(t){if(t instanceof zo&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(a){if(a instanceof zo&&a.status===409)return;throw a}}};function Xs(e){return e.join("")}var UA=class{constructor(e,t="",a){this.client=e,this.prefix=t,this.accessDelegation=a}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xs(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const a={};return this.accessDelegation&&(a["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xs(e.namespace)}/tables`,body:t,headers:a})).data.metadata}async updateTable(e,t){const a=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Xs(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":a.data["metadata-location"],metadata:a.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Xs(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Xs(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Xs(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(a){if(a instanceof zo&&a.status===404)return!1;throw a}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(a){if(a instanceof zo&&a.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw a}}},PA=class{constructor(e){var s;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const a=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=DA({baseUrl:a,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(s=e.accessDelegation)==null?void 0:s.join(","),this.namespaceOps=new LA(this.client,t),this.tableOps=new UA(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(e)}function zA(e,t){if(Bo(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t);if(Bo(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BA(e){var t=zA(e,"string");return Bo(t)=="symbol"?t:t+""}function IA(e,t,a){return(t=BA(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Rb(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function Se(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Rb(Object(a),!0).forEach(function(s){IA(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Rb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}var Su=class extends Error{constructor(e,t="storage",a,s){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=a,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function _u(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Bh=class extends Su{constructor(e,t,a,s="storage"){super(e,s,t,a),this.name=s==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=a}toJSON(){return Se({},super.toJSON())}},xw=class extends Su{constructor(e,t,a="storage"){super(e,a),this.name=a==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function ru(e,t,a){const s=Se({},e),o=t.toLowerCase();for(const c of Object.keys(s))c.toLowerCase()===o&&delete s[c];return s[o]=a,s}function $A(e){const t={};for(const[a,s]of Object.entries(e))t[a.toLowerCase()]=s;return t}const HA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),qA=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ih=e=>{if(Array.isArray(e))return e.map(a=>Ih(a));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([a,s])=>{const o=a.replace(/([-_][a-z])/gi,c=>c.toUpperCase().replace(/[-_]/g,""));t[o]=Ih(s)}),t},GA=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Ab=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const a=t.error;if(typeof a.message=="string")return a.message}}return JSON.stringify(e)},VA=async(e,t,a,s)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const o=e;let c=parseInt(String(o.status),10);Number.isFinite(c)||(c=500),o.json().then(u=>{const d=(u==null?void 0:u.statusCode)||(u==null?void 0:u.code)||c+"";t(new Bh(Ab(u),c,d,s))}).catch(()=>{const u=c+"";t(new Bh(o.statusText||`HTTP ${c} error`,c,u,s))})}else t(new xw(Ab(e),e,s))},KA=(e,t,a,s)=>{const o={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!s)return Se(Se({},o),a);if(qA(s)){var c;const u=(t==null?void 0:t.headers)||{};let d;for(const[h,p]of Object.entries(u))h.toLowerCase()==="content-type"&&(d=p);o.headers=ru(u,"Content-Type",(c=d)!==null&&c!==void 0?c:"application/json"),o.body=JSON.stringify(s)}else o.body=s;return t!=null&&t.duplex&&(o.duplex=t.duplex),Se(Se({},o),a)};async function So(e,t,a,s,o,c,u){return new Promise((d,h)=>{e(a,KA(t,s,o,c)).then(p=>{if(!p.ok)throw p;if(s!=null&&s.noResolveJson)return p;if(u==="vectors"){const v=p.headers.get("content-type");if(p.headers.get("content-length")==="0"||p.status===204)return{};if(!v||!v.includes("application/json"))return{}}return p.json()}).then(p=>d(p)).catch(p=>VA(p,h,s,u))})}function Sw(e="storage"){return{get:async(t,a,s,o)=>So(t,"GET",a,s,o,void 0,e),post:async(t,a,s,o,c)=>So(t,"POST",a,o,c,s,e),put:async(t,a,s,o,c)=>So(t,"PUT",a,o,c,s,e),head:async(t,a,s,o)=>So(t,"HEAD",a,Se(Se({},s),{},{noResolveJson:!0}),o,void 0,e),remove:async(t,a,s,o,c)=>So(t,"DELETE",a,o,c,s,e)}}const FA=Sw("storage"),{get:Io,post:Mn,put:$h,head:YA,remove:_m}=FA,ln=Sw("vectors");var xi=class{constructor(e,t={},a,s="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=$A(t),this.fetch=HA(a),this.namespace=s}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=ru(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(_u(a))return{data:null,error:a};throw a}}};let _w;_w=Symbol.toStringTag;var WA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[_w]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(_u(t))return{data:null,error:t};throw t}}};let Ew;Ew=Symbol.toStringTag;var XA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Ew]="BlobDownloadBuilder",this.promise=null}asStream(){return new WA(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(_u(t))return{data:null,error:t};throw t}}};const JA={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Nb={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var QA=class extends xi{constructor(e,t={},a,s){super(e,t,s,"storage"),this.bucketId=a}async uploadOrUpdate(e,t,a,s){var o=this;return o.handleOperation(async()=>{let c;const u=Se(Se({},Nb),s);let d=Se(Se({},o.headers),e==="POST"&&{"x-upsert":String(u.upsert)});const h=u.metadata;if(typeof Blob<"u"&&a instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),h&&c.append("metadata",o.encodeMetadata(h)),c.append("",a)):typeof FormData<"u"&&a instanceof FormData?(c=a,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),h&&!c.has("metadata")&&c.append("metadata",o.encodeMetadata(h))):(c=a,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,h&&(d["x-metadata"]=o.toBase64(o.encodeMetadata(h))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),s!=null&&s.headers)for(const[x,S]of Object.entries(s.headers))d=ru(d,x,S);const p=o._removeEmptyFolders(t),v=o._getFinalPath(p),g=await(e=="PUT"?$h:Mn)(o.fetch,`${o.url}/object/${v}`,c,Se({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}));return{path:p,id:g.Id,fullPath:g.Key}})}async upload(e,t,a){return this.uploadOrUpdate("POST",e,t,a)}async uploadToSignedUrl(e,t,a,s){var o=this;const c=o._removeEmptyFolders(e),u=o._getFinalPath(c),d=new URL(o.url+`/object/upload/sign/${u}`);return d.searchParams.set("token",t),o.handleOperation(async()=>{let h;const p=Se(Se({},Nb),s);let v=Se(Se({},o.headers),{"x-upsert":String(p.upsert)});const g=p.metadata;if(typeof Blob<"u"&&a instanceof Blob?(h=new FormData,h.append("cacheControl",p.cacheControl),g&&h.append("metadata",o.encodeMetadata(g)),h.append("",a)):typeof FormData<"u"&&a instanceof FormData?(h=a,h.has("cacheControl")||h.append("cacheControl",p.cacheControl),g&&!h.has("metadata")&&h.append("metadata",o.encodeMetadata(g))):(h=a,v["cache-control"]=`max-age=${p.cacheControl}`,v["content-type"]=p.contentType,g&&(v["x-metadata"]=o.toBase64(o.encodeMetadata(g))),(typeof ReadableStream<"u"&&h instanceof ReadableStream||h&&typeof h=="object"&&"pipe"in h&&typeof h.pipe=="function")&&!p.duplex&&(p.duplex="half")),s!=null&&s.headers)for(const[x,S]of Object.entries(s.headers))v=ru(v,x,S);return{path:c,fullPath:(await $h(o.fetch,d.toString(),h,Se({headers:v},p!=null&&p.duplex?{duplex:p.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var a=this;return a.handleOperation(async()=>{let s=a._getFinalPath(e);const o=Se({},a.headers);t!=null&&t.upsert&&(o["x-upsert"]="true");const c=await Mn(a.fetch,`${a.url}/object/upload/sign/${s}`,{},{headers:o}),u=new URL(a.url+c.url),d=u.searchParams.get("token");if(!d)throw new Su("No token returned by API");return{signedUrl:u.toString(),path:e,token:d}})}async update(e,t,a){return this.uploadOrUpdate("PUT",e,t,a)}async move(e,t,a){var s=this;return s.handleOperation(async()=>await Mn(s.fetch,`${s.url}/object/move`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:a==null?void 0:a.destinationBucket},{headers:s.headers}))}async copy(e,t,a){var s=this;return s.handleOperation(async()=>({path:(await Mn(s.fetch,`${s.url}/object/copy`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:a==null?void 0:a.destinationBucket},{headers:s.headers})).Key}))}async createSignedUrl(e,t,a){var s=this;return s.handleOperation(async()=>{let o=s._getFinalPath(e);const c=typeof(a==null?void 0:a.transform)=="object"&&a.transform!==null&&Object.keys(a.transform).length>0;let u=await Mn(s.fetch,`${s.url}/object/sign/${o}`,Se({expiresIn:t},c?{transform:a.transform}:{}),{headers:s.headers});const d=new URLSearchParams;a!=null&&a.download&&d.set("download",a.download===!0?"":a.download),(a==null?void 0:a.cacheNonce)!=null&&d.set("cacheNonce",String(a.cacheNonce));const h=d.toString();return{signedUrl:encodeURI(`${s.url}${u.signedURL}${h?`&${h}`:""}`)}})}async createSignedUrls(e,t,a){var s=this;return s.handleOperation(async()=>{const o=await Mn(s.fetch,`${s.url}/object/sign/${s.bucketId}`,{expiresIn:t,paths:e},{headers:s.headers}),c=new URLSearchParams;a!=null&&a.download&&c.set("download",a.download===!0?"":a.download),(a==null?void 0:a.cacheNonce)!=null&&c.set("cacheNonce",String(a.cacheNonce));const u=c.toString();return o.map(d=>Se(Se({},d),{},{signedUrl:d.signedURL?encodeURI(`${s.url}${d.signedURL}${u?`&${u}`:""}`):null}))})}download(e,t,a){const s=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",o=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(o,t.transform),(t==null?void 0:t.cacheNonce)!=null&&o.set("cacheNonce",String(t.cacheNonce));const c=o.toString(),u=this._getFinalPath(e),d=()=>Io(this.fetch,`${this.url}/${s}/${u}${c?`?${c}`:""}`,{headers:this.headers,noResolveJson:!0},a);return new XA(d,this.shouldThrowOnError)}async info(e){var t=this;const a=t._getFinalPath(e);return t.handleOperation(async()=>Ih(await Io(t.fetch,`${t.url}/object/info/${a}`,{headers:t.headers})))}async exists(e){var t=this;const a=t._getFinalPath(e);try{return await YA(t.fetch,`${t.url}/object/${a}`,{headers:t.headers}),{data:!0,error:null}}catch(o){if(t.shouldThrowOnError)throw o;if(_u(o)){var s;const c=o instanceof Bh?o.status:o instanceof xw?(s=o.originalError)===null||s===void 0?void 0:s.status:void 0;if(c!==void 0&&[400,404].includes(c))return{data:!1,error:o}}throw o}}getPublicUrl(e,t){const a=this._getFinalPath(e),s=new URLSearchParams;t!=null&&t.download&&s.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const o=s.toString(),c=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${c}/public/${a}`)+(o?`?${o}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await _m(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,a){var s=this;return s.handleOperation(async()=>{const o=Se(Se(Se({},JA),t),{},{prefix:e||""});return await Mn(s.fetch,`${s.url}/object/list/${s.bucketId}`,o,{headers:s.headers},a)})}async listV2(e,t){var a=this;return a.handleOperation(async()=>{const s=Se({},e);return await Mn(a.fetch,`${a.url}/object/list-v2/${a.bucketId}`,s,{headers:a.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const ZA="2.106.2",Qo={"X-Client-Info":`storage-js/${ZA}`};var eN=class extends xi{constructor(e,t={},a,s){const o=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const c=o.href.replace(/\/$/,""),u=Se(Se({},Qo),t);super(c,u,a,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const a=t.listBucketOptionsToQueryString(e);return await Io(t.fetch,`${t.url}/bucket${a}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Io(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var a=this;return a.handleOperation(async()=>await Mn(a.fetch,`${a.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:a.headers}))}async updateBucket(e,t){var a=this;return a.handleOperation(async()=>await $h(a.fetch,`${a.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:a.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Mn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await _m(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},tN=class extends xi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=Se(Se({},Qo),t);super(s,o,a,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Mn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const a=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&a.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&a.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&a.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&a.set("sortOrder",e.sortOrder),e!=null&&e.search&&a.set("search",e.search);const s=a.toString(),o=s?`${t.url}/bucket?${s}`:`${t.url}/bucket`;return await Io(t.fetch,o,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await _m(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!GA(e))throw new Su("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const a=new PA({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),s=this.shouldThrowOnError;return new Proxy(a,{get(o,c){const u=o[c];return typeof u!="function"?u:async(...d)=>{try{return{data:await u.apply(o,d),error:null}}catch(h){if(s)throw h;return{data:null,error:h}}}}})}},nN=class extends xi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=Se(Se({},Qo),{},{"Content-Type":"application/json"},t);super(s,o,a,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var a=this;return a.handleOperation(async()=>await ln.post(a.fetch,`${a.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:a.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var a=this;return a.handleOperation(async()=>await ln.post(a.fetch,`${a.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:a.headers})||{})}},rN=class extends xi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=Se(Se({},Qo),{},{"Content-Type":"application/json"},t);super(s,o,a,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},aN=class extends xi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=Se(Se({},Qo),{},{"Content-Type":"application/json"},t);super(s,o,a,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await ln.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},sN=class extends aN{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new iN(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,a=this;return t().call(a,e)}async getBucket(e){var t=()=>super.getBucket,a=this;return t().call(a,e)}async listBuckets(e={}){var t=()=>super.listBuckets,a=this;return t().call(a,e)}async deleteBucket(e){var t=()=>super.deleteBucket,a=this;return t().call(a,e)}},iN=class extends nN{constructor(e,t,a,s){super(e,t,s),this.vectorBucketName=a}async createIndex(e){var t=()=>super.createIndex,a=this;return t().call(a,Se(Se({},e),{},{vectorBucketName:a.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,a=this;return t().call(a,Se(Se({},e),{},{vectorBucketName:a.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,a=this;return t().call(a,a.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,a=this;return t().call(a,a.vectorBucketName,e)}index(e){return new oN(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},oN=class extends rN{constructor(e,t,a,s,o){super(e,t,o),this.vectorBucketName=a,this.indexName=s}async putVectors(e){var t=()=>super.putVectors,a=this;return t().call(a,Se(Se({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async getVectors(e){var t=()=>super.getVectors,a=this;return t().call(a,Se(Se({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,a=this;return t().call(a,Se(Se({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,a=this;return t().call(a,Se(Se({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,a=this;return t().call(a,Se(Se({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}},lN=class extends eN{constructor(e,t={},a,s){super(e,t,a,s)}from(e){return new QA(this.url,this.headers,e,this.fetch)}get vectors(){return new sN(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new tN(this.url+"/iceberg",this.headers,this.fetch)}};const Cw="2.106.2",ii=30*1e3,Hh=3,hh=Hh*ii,cN="http://localhost:9999",uN="supabase.auth.token",dN={"X-Client-Info":`gotrue-js/${Cw}`},qh="X-Supabase-Api-Version",Tw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},fN=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,hN=600*1e3;class mi extends Error{constructor(t,a,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=s}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function le(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class mN extends mi{constructor(t,a,s){super(t,a,s),this.name="AuthApiError",this.status=a,this.code=s}}function pN(e){return le(e)&&e.name==="AuthApiError"}class Dn extends mi{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}}class Mr extends mi{constructor(t,a,s,o){super(t,s,o),this.name=a,this.status=s}}class xt extends Mr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Ec(e){return le(e)&&e.name==="AuthSessionMissingError"}class Js extends Mr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Cc extends Mr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Tc extends Mr{constructor(t,a=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=a}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function gN(e){return le(e)&&e.name==="AuthImplicitGrantRedirectError"}class kb extends Mr{constructor(t,a=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=a}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class vN extends Mr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Gh extends Mr{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}}function mh(e){return le(e)&&e.name==="AuthRetryableFetchError"}class Ob extends Mr{constructor(t,a,s){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Vh extends Mr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const au="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),jb=`
\r=`.split(""),yN=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<jb.length;t+=1)e[jb[t].charCodeAt(0)]=-2;for(let t=0;t<au.length;t+=1)e[au[t].charCodeAt(0)]=t;return e})();function Mb(e,t,a){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;a(au[s]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;a(au[s]),t.queuedBits-=6}}function Rw(e,t,a){const s=yN[e];if(s>-1)for(t.queue=t.queue<<6|s,t.queuedBits+=6;t.queuedBits>=8;)a(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Db(e){const t=[],a=u=>{t.push(String.fromCodePoint(u))},s={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},c=u=>{xN(u,s,a)};for(let u=0;u<e.length;u+=1)Rw(e.charCodeAt(u),o,c);return t.join("")}function bN(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function wN(e,t){for(let a=0;a<e.length;a+=1){let s=e.charCodeAt(a);if(s>55295&&s<=56319){const o=(s-55296)*1024&65535;s=(e.charCodeAt(a+1)-56320&65535|o)+65536,a+=1}bN(s,t)}}function xN(e,t,a){if(t.utf8seq===0){if(e<=127){a(e);return}for(let s=1;s<6;s+=1)if((e>>7-s&1)===0){t.utf8seq=s;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&a(t.codepoint)}}function di(e){const t=[],a={queue:0,queuedBits:0},s=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)Rw(e.charCodeAt(o),a,s);return new Uint8Array(t)}function SN(e){const t=[];return wN(e,a=>t.push(a)),new Uint8Array(t)}function Qa(e){const t=[],a={queue:0,queuedBits:0},s=o=>{t.push(o)};return e.forEach(o=>Mb(o,a,s)),Mb(null,a,s),t.join("")}function _N(e){return Math.round(Date.now()/1e3)+e}function EN(){return Symbol("auth-callback")}const Nt=()=>typeof window<"u"&&typeof document<"u",Ka={tested:!1,writable:!1},Aw=()=>{if(!Nt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ka.tested)return Ka.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Ka.tested=!0,Ka.writable=!0}catch{Ka.tested=!0,Ka.writable=!1}return Ka.writable};function CN(e){const t={},a=new URL(e);if(a.hash&&a.hash[0]==="#")try{new URLSearchParams(a.hash.substring(1)).forEach((o,c)=>{t[c]=o})}catch{}return a.searchParams.forEach((s,o)=>{t[o]=s}),t}const Nw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),TN=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",oi=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},Fa=async(e,t)=>{const a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return null}},At=async(e,t)=>{await e.removeItem(t)};class Eu{constructor(){this.promise=new Eu.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}}Eu.promiseConstructor=Promise;function Rc(e){const t=e.split(".");if(t.length!==3)throw new Vh("Invalid JWT structure");for(let s=0;s<t.length;s++)if(!fN.test(t[s]))throw new Vh("JWT not in base64url format");return{header:JSON.parse(Db(t[0])),payload:JSON.parse(Db(t[1])),signature:di(t[2]),raw:{header:t[0],payload:t[1]}}}async function RN(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function AN(e,t){return new Promise((s,o)=>{(async()=>{for(let c=0;c<1/0;c++)try{const u=await e(c);if(!t(c,null,u)){s(u);return}}catch(u){if(!t(c,u)){o(u);return}}})()})}function NN(e){return("0"+e.toString(16)).substr(-2)}function kN(){const t=new Uint32Array(56);if(typeof crypto>"u"){const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=a.length;let o="";for(let c=0;c<56;c++)o+=a.charAt(Math.floor(Math.random()*s));return o}return crypto.getRandomValues(t),Array.from(t,NN).join("")}async function ON(e){const a=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",a),o=new Uint8Array(s);return Array.from(o).map(c=>String.fromCharCode(c)).join("")}async function jN(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const a=await ON(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Qs(e,t,a=!1){const s=kN();let o=s;a&&(o+="/recovery"),await oi(e,`${t}-code-verifier`,o);const c=await jN(s);return[c,s===c?"plain":"s256"]}const MN=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function DN(e){const t=e.headers.get(qh);if(!t||!t.match(MN))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function LN(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function UN(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const PN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function _r(e){if(!PN.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function On(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function ph(){const e={};return new Proxy(e,{get:(t,a)=>{if(a==="__isUserNotAvailableProxy")return!0;if(typeof a=="symbol"){const s=a.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${a}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function zN(e,t){return new Proxy(e,{get:(a,s,o)=>{if(s==="__isInsecureUserWarningProxy")return!0;if(typeof s=="symbol"){const c=s.toString();if(c==="Symbol(Symbol.toPrimitive)"||c==="Symbol(Symbol.toStringTag)"||c==="Symbol(util.inspect.custom)"||c==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(a,s,o)}return!t.value&&typeof s=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(a,s,o)}})}function Lb(e){return JSON.parse(JSON.stringify(e))}const Xa=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},BN=[502,503,504,520,521,522,523,524,530];async function Ub(e){var t;if(!TN(e))throw new Gh(Xa(e),0);if(BN.includes(e.status))throw new Gh(Xa(e),e.status);let a;try{a=await e.json()}catch(c){throw new Dn(Xa(c),c)}let s;const o=DN(e);if(o&&o.getTime()>=Tw["2024-01-01"].timestamp&&typeof a=="object"&&a&&typeof a.code=="string"?s=a.code:typeof a=="object"&&a&&typeof a.error_code=="string"&&(s=a.error_code),s){if(s==="weak_password")throw new Ob(Xa(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new xt}else if(typeof a=="object"&&a&&typeof a.weak_password=="object"&&a.weak_password&&Array.isArray(a.weak_password.reasons)&&a.weak_password.reasons.length&&a.weak_password.reasons.reduce((c,u)=>c&&typeof u=="string",!0))throw new Ob(Xa(a),e.status,a.weak_password.reasons);throw new mN(Xa(a),e.status||500,s)}const IN=(e,t,a,s)=>{const o={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),o.body=JSON.stringify(s),Object.assign(Object.assign({},o),a))};async function pe(e,t,a,s){var o;const c=Object.assign({},s==null?void 0:s.headers);c[qh]||(c[qh]=Tw["2024-01-01"].name),s!=null&&s.jwt&&(c.Authorization=`Bearer ${s.jwt}`);const u=(o=s==null?void 0:s.query)!==null&&o!==void 0?o:{};s!=null&&s.redirectTo&&(u.redirect_to=s.redirectTo);const d=Object.keys(u).length?"?"+new URLSearchParams(u).toString():"",h=await $N(e,t,a+d,{headers:c,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(h):{data:Object.assign({},h),error:null}}async function $N(e,t,a,s,o,c){const u=IN(t,s,o,c);let d;try{d=await e(a,Object.assign({},u))}catch(h){throw console.error(h),new Gh(Xa(h),0)}if(d.ok||await Ub(d),s!=null&&s.noResolveJson)return d;try{return await d.json()}catch(h){await Ub(h)}}function xn(e){var t;let a=null;GN(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=_N(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:a,user:s},error:null}}function Pb(e){const t=xn(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((a,s)=>a&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ma(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function HN(e){return{data:e,error:null}}function qN(e){const{action_link:t,email_otp:a,hashed_token:s,redirect_to:o,verification_type:c}=e,u=wi(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),d={action_link:t,email_otp:a,hashed_token:s,redirect_to:o,verification_type:c},h=Object.assign({},u);return{data:{properties:d,user:h},error:null}}function zb(e){return e}function GN(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const gh=["global","local","others"];class VN{_encodePathSegment(t){if(t==="."||t==="..")throw new mi("Invalid path segment");return encodeURIComponent(t)}constructor({url:t="",headers:a={},fetch:s,experimental:o}){this.url=t,this.headers=a,this.fetch=Nw(s),this.experimental=o??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,a=gh[0]){if(gh.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${gh.join(", ")}`);try{return await pe(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(le(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,a={}){try{return await pe(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:ma})}catch(s){if(le(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:a}=t,s=wi(t,["options"]),o=Object.assign(Object.assign({},s),a);return"newEmail"in s&&(o.new_email=s==null?void 0:s.newEmail,delete o.newEmail),await pe(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:qN,redirectTo:a==null?void 0:a.redirectTo})}catch(a){if(le(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await pe(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ma})}catch(a){if(le(a))return{data:{user:null},error:a};throw a}}async listUsers(t){var a,s,o,c,u,d,h;try{const p={nextPage:null,lastPage:0,total:0},v=await pe(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(a=t==null?void 0:t.page)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:"",per_page:(c=(o=t==null?void 0:t.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:zb});if(v.error)throw v.error;const g=await v.json(),x=(u=v.headers.get("x-total-count"))!==null&&u!==void 0?u:0,S=(h=(d=v.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&h!==void 0?h:[];return S.length>0&&(S.forEach(_=>{const E=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),R=JSON.parse(_.split(";")[1].split("=")[1]);p[`${R}Page`]=E}),p.total=parseInt(x)),{data:Object.assign(Object.assign({},g),p),error:null}}catch(p){if(le(p))return{data:{users:[]},error:p};throw p}}async getUserById(t){_r(t);try{return await pe(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ma})}catch(a){if(le(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){_r(t);try{return await pe(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:ma})}catch(s){if(le(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,a=!1){_r(t);try{return await pe(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:ma})}catch(s){if(le(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){_r(t.userId);try{const{data:a,error:s}=await pe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:a,error:s}}catch(a){if(le(a))return{data:null,error:a};throw a}}async _deleteFactor(t){_r(t.userId),_r(t.id);try{return{data:await pe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(le(a))return{data:null,error:a};throw a}}async _listOAuthClients(t){var a,s,o,c,u,d,h;try{const p={nextPage:null,lastPage:0,total:0},v=await pe(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(a=t==null?void 0:t.page)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:"",per_page:(c=(o=t==null?void 0:t.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:zb});if(v.error)throw v.error;const g=await v.json(),x=(u=v.headers.get("x-total-count"))!==null&&u!==void 0?u:0,S=(h=(d=v.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&h!==void 0?h:[];return S.length>0&&(S.forEach(_=>{const E=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),R=JSON.parse(_.split(";")[1].split("=")[1]);p[`${R}Page`]=E}),p.total=parseInt(x)),{data:Object.assign(Object.assign({},g),p),error:null}}catch(p){if(le(p))return{data:{clients:[]},error:p};throw p}}async _createOAuthClient(t){try{return await pe(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(le(a))return{data:null,error:a};throw a}}async _getOAuthClient(t){try{const a=this._encodePathSegment(t);return await pe(this.fetch,"GET",`${this.url}/admin/oauth/clients/${a}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(a){if(le(a))return{data:null,error:a};throw a}}async _updateOAuthClient(t,a){try{const s=this._encodePathSegment(t);return await pe(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${s}`,{body:a,headers:this.headers,xform:o=>({data:o,error:null})})}catch(s){if(le(s))return{data:null,error:s};throw s}}async _deleteOAuthClient(t){try{const a=this._encodePathSegment(t);return await pe(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${a}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(a){if(le(a))return{data:null,error:a};throw a}}async _regenerateOAuthClientSecret(t){try{const a=this._encodePathSegment(t);return await pe(this.fetch,"POST",`${this.url}/admin/oauth/clients/${a}/regenerate_secret`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(a){if(le(a))return{data:null,error:a};throw a}}async _listCustomProviders(t){try{const a={};return t!=null&&t.type&&(a.type=t.type),await pe(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:a,xform:s=>{var o;return{data:{providers:(o=s==null?void 0:s.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(a){if(le(a))return{data:{providers:[]},error:a};throw a}}async _createCustomProvider(t){try{return await pe(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(le(a))return{data:null,error:a};throw a}}async _getCustomProvider(t){try{const a=this._encodePathSegment(t);return await pe(this.fetch,"GET",`${this.url}/admin/custom-providers/${a}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(a){if(le(a))return{data:null,error:a};throw a}}async _updateCustomProvider(t,a){try{const s=this._encodePathSegment(t);return await pe(this.fetch,"PUT",`${this.url}/admin/custom-providers/${s}`,{body:a,headers:this.headers,xform:o=>({data:o,error:null})})}catch(s){if(le(s))return{data:null,error:s};throw s}}async _deleteCustomProvider(t){try{const a=this._encodePathSegment(t);return await pe(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${a}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(a){if(le(a))return{data:null,error:a};throw a}}async _adminListPasskeys(t){On(this.experimental),_r(t.userId);try{return await pe(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(le(a))return{data:null,error:a};throw a}}async _adminDeletePasskey(t){On(this.experimental),_r(t.userId),_r(t.passkeyId);try{return await pe(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(a){if(le(a))return{data:null,error:a};throw a}}}function Bb(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}const Kn={debug:!!(globalThis&&Aw()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class kw extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class Ib extends kw{}async function KN(e,t,a){Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;let o;t>0&&(o=setTimeout(()=>{s.abort(),Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async c=>{if(c){clearTimeout(o),Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,c.name);try{return await a()}finally{Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,c.name)}}else{if(t===0)throw Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new Ib(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Kn.debug)try{const u=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(u,null," "))}catch(u){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",u)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(o),await a()}})}catch(c){if(t>0&&clearTimeout(o),c!==null&&typeof c=="object"&&"name"in c&&c.name==="AbortError"&&t>0){if(s.signal.aborted)return Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async u=>{if(u){Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,u.name);try{return await a()}finally{Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,u.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await a()}));throw Kn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new Ib(`Lock "${e}" was released because another request stole it`)}throw c}}function FN(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Ow(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function YN(e){return parseInt(e,16)}function WN(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,s=>s.toString(16).padStart(2,"0")).join("")}function XN(e){var t;const{chainId:a,domain:s,expirationTime:o,issuedAt:c=new Date,nonce:u,notBefore:d,requestId:h,resources:p,scheme:v,uri:g,version:x}=e;{if(!Number.isInteger(a))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${a}`);if(!s)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(u&&u.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${u}`);if(!g)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(x!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${x}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const S=Ow(e.address),_=v?`${v}://${s}`:s,E=e.statement?`${e.statement}
`:"",R=`${_} wants you to sign in with your Ethereum account:
${S}
${E}`;let T=`URI: ${g}
Version: ${x}
Chain ID: ${a}${u?`
Nonce: ${u}`:""}
Issued At: ${c.toISOString()}`;if(o&&(T+=`
Expiration Time: ${o.toISOString()}`),d&&(T+=`
Not Before: ${d.toISOString()}`),h&&(T+=`
Request ID: ${h}`),p){let A=`
Resources:`;for(const N of p){if(!N||typeof N!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${N}`);A+=`
- ${N}`}T+=A}return`${R}
${T}`}class ht extends Error{constructor({message:t,code:a,cause:s,name:o}){var c;super(t,{cause:s}),this.__isWebAuthnError=!0,this.name=(c=o??(s instanceof Error?s.name:void 0))!==null&&c!==void 0?c:"Unknown Error",this.code=a}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class su extends ht{constructor(t,a){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:a,message:t}),this.name="WebAuthnUnknownError",this.originalError=a}}function JN({error:e,options:t}){var a,s,o;const{publicKey:c}=t;if(!c)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ht({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((a=c.authenticatorSelection)===null||a===void 0?void 0:a.requireResidentKey)===!0)return new ht({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((s=c.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new ht({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=c.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new ht({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new ht({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return c.pubKeyCredParams.filter(d=>d.type==="public-key").length===0?new ht({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new ht({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const u=window.location.hostname;if(jw(u)){if(c.rp.id!==u)return new ht({message:`The RP ID "${c.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(c.user.id.byteLength<1||c.user.id.byteLength>64)return new ht({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new ht({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function QN({error:e,options:t}){const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ht({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(jw(s)){if(a.rpId!==s)return new ht({message:`The RP ID "${a.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new ht({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class ZN{createNewAbortSignal(){if(this.controller){const a=new Error("Cancelling existing WebAuthn API call for new one");a.name="AbortError",this.controller.abort(a)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const Kh=new ZN;function $b(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:a,excludeCredentials:s}=e,o=wi(e,["challenge","user","excludeCredentials"]),c=di(t).buffer,u=Object.assign(Object.assign({},a),{id:di(a.id).buffer}),d=Object.assign(Object.assign({},o),{challenge:c,user:u});if(s&&s.length>0){d.excludeCredentials=new Array(s.length);for(let h=0;h<s.length;h++){const p=s[h];d.excludeCredentials[h]=Object.assign(Object.assign({},p),{id:di(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return d}function Hb(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:a}=e,s=wi(e,["challenge","allowCredentials"]),o=di(t).buffer,c=Object.assign(Object.assign({},s),{challenge:o});if(a&&a.length>0){c.allowCredentials=new Array(a.length);for(let u=0;u<a.length;u++){const d=a[u];c.allowCredentials[u]=Object.assign(Object.assign({},d),{id:di(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return c}function qb(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const a=e;return{id:e.id,rawId:e.id,response:{attestationObject:Qa(new Uint8Array(e.response.attestationObject)),clientDataJSON:Qa(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=a.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Gb(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const a=e,s=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Qa(new Uint8Array(o.authenticatorData)),clientDataJSON:Qa(new Uint8Array(o.clientDataJSON)),signature:Qa(new Uint8Array(o.signature)),userHandle:o.userHandle?Qa(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:s,authenticatorAttachment:(t=a.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function jw(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function iu(){var e,t;return!!(Nt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Mw(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new su("Browser returned unexpected credential type",t)}:{data:null,error:new su("Empty credential response",t)}}catch(t){return{data:null,error:JN({error:t,options:e})}}}async function Dw(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new su("Browser returned unexpected credential type",t)}:{data:null,error:new su("Empty credential response",t)}}catch(t){return{data:null,error:QN({error:t,options:e})}}}const ek={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},tk={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function ou(...e){const t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),a=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),s={};for(const o of e)if(o)for(const c in o){const u=o[c];if(u!==void 0)if(Array.isArray(u))s[c]=u;else if(a(u))s[c]=u;else if(t(u)){const d=s[c];t(d)?s[c]=ou(d,u):s[c]=ou(u)}else s[c]=u}return s}function nk(e,t){return ou(ek,e,t||{})}function rk(e,t){return ou(tk,e,t||{})}class ak{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:a,friendlyName:s,signal:o},c){var u;try{const{data:d,error:h}=await this.client.mfa.challenge({factorId:t,webauthn:a});if(!d)return{data:null,error:h};const p=o??Kh.createNewAbortSignal();if(d.webauthn.type==="create"){const{user:v}=d.webauthn.credential_options.publicKey;if(!v.name){const g=s;if(g)v.name=`${v.id}:${g}`;else{const S=(await this.client.getUser()).data.user,_=((u=S==null?void 0:S.user_metadata)===null||u===void 0?void 0:u.name)||(S==null?void 0:S.email)||(S==null?void 0:S.id)||"User";v.name=`${v.id}:${_}`}}v.displayName||(v.displayName=v.name)}switch(d.webauthn.type){case"create":{const v=nk(d.webauthn.credential_options.publicKey,c==null?void 0:c.create),{data:g,error:x}=await Mw({publicKey:v,signal:p});return g?{data:{factorId:t,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:g}},error:null}:{data:null,error:x}}case"request":{const v=rk(d.webauthn.credential_options.publicKey,c==null?void 0:c.request),{data:g,error:x}=await Dw(Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:v,signal:p}));return g?{data:{factorId:t,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:g}},error:null}:{data:null,error:x}}}}catch(d){return le(d)?{data:null,error:d}:{data:null,error:new Dn("Unexpected error in challenge",d)}}}async _verify({challengeId:t,factorId:a,webauthn:s}){return this.client.mfa.verify({factorId:a,challengeId:t,webauthn:s})}async _authenticate({factorId:t,webauthn:{rpId:a=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!a)return{data:null,error:new mi("rpId is required for WebAuthn authentication")};try{if(!iu())return{data:null,error:new Dn("Browser does not support WebAuthn",null)};const{data:u,error:d}=await this.challenge({factorId:t,webauthn:{rpId:a,rpOrigins:s},signal:o},{request:c});if(!u)return{data:null,error:d};const{webauthn:h}=u;return this._verify({factorId:t,challengeId:u.challengeId,webauthn:{type:h.type,rpId:a,rpOrigins:s,credential_response:h.credential_response}})}catch(u){return le(u)?{data:null,error:u}:{data:null,error:new Dn("Unexpected error in authenticate",u)}}}async _register({friendlyName:t,webauthn:{rpId:a=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!a)return{data:null,error:new mi("rpId is required for WebAuthn registration")};try{if(!iu())return{data:null,error:new Dn("Browser does not support WebAuthn",null)};const{data:u,error:d}=await this._enroll({friendlyName:t});if(!u)return await this.client.mfa.listFactors().then(v=>{var g;return(g=v.data)===null||g===void 0?void 0:g.all.find(x=>x.factor_type==="webauthn"&&x.friendly_name===t&&x.status!=="unverified")}).then(v=>v?this.client.mfa.unenroll({factorId:v==null?void 0:v.id}):void 0),{data:null,error:d};const{data:h,error:p}=await this._challenge({factorId:u.id,friendlyName:u.friendly_name,webauthn:{rpId:a,rpOrigins:s},signal:o},{create:c});return h?this._verify({factorId:u.id,challengeId:h.challengeId,webauthn:{rpId:a,rpOrigins:s,type:h.webauthn.type,credential_response:h.webauthn.credential_response}}):{data:null,error:p}}catch(u){return le(u)?{data:null,error:u}:{data:null,error:new Dn("Unexpected error in register",u)}}}}FN();const sk={url:cN,storageKey:uN,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:dN,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function Vb(e,t,a){return await a()}const Zs={};class $o{get jwks(){var t,a;return(a=(t=Zs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){Zs[this.storageKey]=Object.assign(Object.assign({},Zs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=Zs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Zs[this.storageKey]=Object.assign(Object.assign({},Zs[this.storageKey]),{cachedAt:t})}constructor(t){var a,s,o,c;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const u=Object.assign(Object.assign({},sk),t);if(this.storageKey=u.storageKey,this.instanceID=(a=$o.nextInstanceID[this.storageKey])!==null&&a!==void 0?a:0,$o.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!u.debug,typeof u.debug=="function"&&(this.logger=u.debug),this.instanceID>0&&Nt()){const d=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(d),this.logDebugMessages&&console.trace(d)}if(this.persistSession=u.persistSession,this.autoRefreshToken=u.autoRefreshToken,this.experimental=(s=u.experimental)!==null&&s!==void 0?s:{},this.admin=new VN({url:u.url,headers:u.headers,fetch:u.fetch,experimental:this.experimental}),this.url=u.url,this.headers=u.headers,this.fetch=Nw(u.fetch),this.lock=u.lock||Vb,this.detectSessionInUrl=u.detectSessionInUrl,this.flowType=u.flowType,this.hasCustomAuthorizationHeader=u.hasCustomAuthorizationHeader,this.throwOnError=u.throwOnError,this.lockAcquireTimeout=u.lockAcquireTimeout,u.lock?this.lock=u.lock:this.persistSession&&Nt()&&(!((o=globalThis==null?void 0:globalThis.navigator)===null||o===void 0)&&o.locks)?this.lock=KN:this.lock=Vb,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new ak(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(u.storage?this.storage=u.storage:Aw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Bb(this.memoryStorage)),u.userStorage&&(this.userStorage=u.userStorage)):(this.memoryStorage={},this.storage=Bb(this.memoryStorage)),Nt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(d){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",d)}(c=this.broadcastChannel)===null||c===void 0||c.addEventListener("message",async d=>{this._debug("received broadcast notification from other tab or client",d);try{await this._notifyAllSubscribers(d.data.event,d.data.session,!1)}catch(h){this._debug("#broadcastChannel","error",h)}})}u.skipAutoInitialize||this.initialize().catch(d=>{this._debug("#initialize()","error",d)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Cw}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let a={},s="none";if(Nt()&&(a=CN(window.location.href),this._isImplicitGrantCallback(a)?s="implicit":await this._isPKCECallback(a)&&(s="pkce")),Nt()&&this.detectSessionInUrl&&s!=="none"){const{data:o,error:c}=await this._getSessionFromURL(a,s);if(c){if(this._debug("#_initialize()","error detecting session from URL",c),gN(c)){const h=(t=c.details)===null||t===void 0?void 0:t.code;if(h==="identity_already_exists"||h==="identity_not_found"||h==="single_identity_not_deletable")return{error:c}}return{error:c}}const{session:u,redirectType:d}=o;return this._debug("#_initialize()","detected session in URL",u,"redirect type",d),await this._saveSession(u),setTimeout(async()=>{d==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",u):await this._notifyAllSubscribers("SIGNED_IN",u)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(a){return le(a)?this._returnResult({error:a}):this._returnResult({error:new Dn("Unexpected error during initialization",a)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,s,o;try{const c=await pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(o=t==null?void 0:t.options)===null||o===void 0?void 0:o.captchaToken}},xform:xn}),{data:u,error:d}=c;if(d||!u)return this._returnResult({data:{user:null,session:null},error:d});const h=u.session,p=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(c){if(le(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signUp(t){var a,s,o;try{let c;if("email"in t){const{email:v,password:g,options:x}=t;let S=null,_=null;this.flowType==="pkce"&&([S,_]=await Qs(this.storage,this.storageKey)),c=await pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:x==null?void 0:x.emailRedirectTo,body:{email:v,password:g,data:(a=x==null?void 0:x.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken},code_challenge:S,code_challenge_method:_},xform:xn})}else if("phone"in t){const{phone:v,password:g,options:x}=t;c=await pe(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:v,password:g,data:(s=x==null?void 0:x.data)!==null&&s!==void 0?s:{},channel:(o=x==null?void 0:x.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken}},xform:xn})}else throw new Cc("You must provide either an email or phone number and a password");const{data:u,error:d}=c;if(d||!u)return await At(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:d});const h=u.session,p=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(c){if(await At(this.storage,`${this.storageKey}-code-verifier`),le(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signInWithPassword(t){try{let a;if("email"in t){const{email:c,password:u,options:d}=t;a=await pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:c,password:u,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Pb})}else if("phone"in t){const{phone:c,password:u,options:d}=t;a=await pe(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:c,password:u,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Pb})}else throw new Cc("You must provide either an email or phone number and a password");const{data:s,error:o}=a;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!s||!s.session||!s.user){const c=new Js;return this._returnResult({data:{user:null,session:null},error:c})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:o})}catch(a){if(le(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithOAuth(t){var a,s,o,c;return await this._handleProviderSignIn(t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(c=t.options)===null||c===void 0?void 0:c.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:a}=t;switch(a){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${a}"`)}}async signInWithEthereum(t){var a,s,o,c,u,d,h,p,v,g,x;let S,_;if("message"in t)S=t.message,_=t.signature;else{const{chain:E,wallet:R,statement:T,options:A}=t;let N;if(Nt())if(typeof R=="object")N=R;else{const re=window;if("ethereum"in re&&typeof re.ethereum=="object"&&"request"in re.ethereum&&typeof re.ethereum.request=="function")N=re.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof R!="object"||!(A!=null&&A.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");N=R}const L=new URL((a=A==null?void 0:A.url)!==null&&a!==void 0?a:window.location.href),G=await N.request({method:"eth_requestAccounts"}).then(re=>re).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!G||G.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const V=Ow(G[0]);let P=(s=A==null?void 0:A.signInWithEthereum)===null||s===void 0?void 0:s.chainId;if(!P){const re=await N.request({method:"eth_chainId"});P=YN(re)}const q={domain:L.host,address:V,statement:T,uri:L.href,version:"1",chainId:P,nonce:(o=A==null?void 0:A.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(u=(c=A==null?void 0:A.signInWithEthereum)===null||c===void 0?void 0:c.issuedAt)!==null&&u!==void 0?u:new Date,expirationTime:(d=A==null?void 0:A.signInWithEthereum)===null||d===void 0?void 0:d.expirationTime,notBefore:(h=A==null?void 0:A.signInWithEthereum)===null||h===void 0?void 0:h.notBefore,requestId:(p=A==null?void 0:A.signInWithEthereum)===null||p===void 0?void 0:p.requestId,resources:(v=A==null?void 0:A.signInWithEthereum)===null||v===void 0?void 0:v.resources};S=XN(q),_=await N.request({method:"personal_sign",params:[WN(S),V]})}try{const{data:E,error:R}=await pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:S,signature:_},!((g=t.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(x=t.options)===null||x===void 0?void 0:x.captchaToken}}:null),xform:xn});if(R)throw R;if(!E||!E.session||!E.user){const T=new Js;return this._returnResult({data:{user:null,session:null},error:T})}return E.session&&(await this._saveSession(E.session),await this._notifyAllSubscribers("SIGNED_IN",E.session)),this._returnResult({data:Object.assign({},E),error:R})}catch(E){if(le(E))return this._returnResult({data:{user:null,session:null},error:E});throw E}}async signInWithSolana(t){var a,s,o,c,u,d,h,p,v,g,x,S;let _,E;if("message"in t)_=t.message,E=t.signature;else{const{chain:R,wallet:T,statement:A,options:N}=t;let L;if(Nt())if(typeof T=="object")L=T;else{const V=window;if("solana"in V&&typeof V.solana=="object"&&("signIn"in V.solana&&typeof V.solana.signIn=="function"||"signMessage"in V.solana&&typeof V.solana.signMessage=="function"))L=V.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof T!="object"||!(N!=null&&N.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");L=T}const G=new URL((a=N==null?void 0:N.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in L&&L.signIn){const V=await L.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},N==null?void 0:N.signInWithSolana),{version:"1",domain:G.host,uri:G.href}),A?{statement:A}:null));let P;if(Array.isArray(V)&&V[0]&&typeof V[0]=="object")P=V[0];else if(V&&typeof V=="object"&&"signedMessage"in V&&"signature"in V)P=V;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in P&&"signature"in P&&(typeof P.signedMessage=="string"||P.signedMessage instanceof Uint8Array)&&P.signature instanceof Uint8Array)_=typeof P.signedMessage=="string"?P.signedMessage:new TextDecoder().decode(P.signedMessage),E=P.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in L)||typeof L.signMessage!="function"||!("publicKey"in L)||typeof L!="object"||!L.publicKey||!("toBase58"in L.publicKey)||typeof L.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");_=[`${G.host} wants you to sign in with your Solana account:`,L.publicKey.toBase58(),...A?["",A,""]:[""],"Version: 1",`URI: ${G.href}`,`Issued At: ${(o=(s=N==null?void 0:N.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((c=N==null?void 0:N.signInWithSolana)===null||c===void 0)&&c.notBefore?[`Not Before: ${N.signInWithSolana.notBefore}`]:[],...!((u=N==null?void 0:N.signInWithSolana)===null||u===void 0)&&u.expirationTime?[`Expiration Time: ${N.signInWithSolana.expirationTime}`]:[],...!((d=N==null?void 0:N.signInWithSolana)===null||d===void 0)&&d.chainId?[`Chain ID: ${N.signInWithSolana.chainId}`]:[],...!((h=N==null?void 0:N.signInWithSolana)===null||h===void 0)&&h.nonce?[`Nonce: ${N.signInWithSolana.nonce}`]:[],...!((p=N==null?void 0:N.signInWithSolana)===null||p===void 0)&&p.requestId?[`Request ID: ${N.signInWithSolana.requestId}`]:[],...!((g=(v=N==null?void 0:N.signInWithSolana)===null||v===void 0?void 0:v.resources)===null||g===void 0)&&g.length?["Resources",...N.signInWithSolana.resources.map(P=>`- ${P}`)]:[]].join(`
`);const V=await L.signMessage(new TextEncoder().encode(_),"utf8");if(!V||!(V instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");E=V}}try{const{data:R,error:T}=await pe(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:_,signature:Qa(E)},!((x=t.options)===null||x===void 0)&&x.captchaToken?{gotrue_meta_security:{captcha_token:(S=t.options)===null||S===void 0?void 0:S.captchaToken}}:null),xform:xn});if(T)throw T;if(!R||!R.session||!R.user){const A=new Js;return this._returnResult({data:{user:null,session:null},error:A})}return R.session&&(await this._saveSession(R.session),await this._notifyAllSubscribers("SIGNED_IN",R.session)),this._returnResult({data:Object.assign({},R),error:T})}catch(R){if(le(R))return this._returnResult({data:{user:null,session:null},error:R});throw R}}async _exchangeCodeForSession(t){const a=await Fa(this.storage,`${this.storageKey}-code-verifier`),[s,o]=(a??"").split("/");try{if(!s&&this.flowType==="pkce")throw new vN;const{data:c,error:u}=await pe(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:xn});if(await At(this.storage,`${this.storageKey}-code-verifier`),u)throw u;if(!c||!c.session||!c.user){const d=new Js;return this._returnResult({data:{user:null,session:null,redirectType:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers(o==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c.session)),this._returnResult({data:Object.assign(Object.assign({},c),{redirectType:o??null}),error:u})}catch(c){if(await At(this.storage,`${this.storageKey}-code-verifier`),le(c))return this._returnResult({data:{user:null,session:null,redirectType:null},error:c});throw c}}async signInWithIdToken(t){try{const{options:a,provider:s,token:o,access_token:c,nonce:u}=t,d=await pe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:o,access_token:c,nonce:u,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:xn}),{data:h,error:p}=d;if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!h||!h.session||!h.user){const v=new Js;return this._returnResult({data:{user:null,session:null},error:v})}return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",h.session)),this._returnResult({data:h,error:p})}catch(a){if(le(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithOtp(t){var a,s,o,c,u;try{if("email"in t){const{email:d,options:h}=t;let p=null,v=null;this.flowType==="pkce"&&([p,v]=await Qs(this.storage,this.storageKey));const{error:g}=await pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:d,data:(a=h==null?void 0:h.data)!==null&&a!==void 0?a:{},create_user:(s=h==null?void 0:h.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:v},redirectTo:h==null?void 0:h.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:g})}if("phone"in t){const{phone:d,options:h}=t,{data:p,error:v}=await pe(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:d,data:(o=h==null?void 0:h.data)!==null&&o!==void 0?o:{},create_user:(c=h==null?void 0:h.shouldCreateUser)!==null&&c!==void 0?c:!0,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},channel:(u=h==null?void 0:h.channel)!==null&&u!==void 0?u:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:p==null?void 0:p.message_id},error:v})}throw new Cc("You must provide either an email or phone number.")}catch(d){if(await At(this.storage,`${this.storageKey}-code-verifier`),le(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async verifyOtp(t){var a,s;try{let o,c;"options"in t&&(o=(a=t.options)===null||a===void 0?void 0:a.redirectTo,c=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:u,error:d}=await pe(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:c}}),redirectTo:o,xform:xn});if(d)throw d;if(!u)throw new Error("An error occurred on token verification.");const h=u.session,p=u.user;return h!=null&&h.access_token&&(await this._saveSession(h),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(o){if(le(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var a,s,o,c,u;try{let d=null,h=null;this.flowType==="pkce"&&([d,h]=await Qs(this.storage,this.storageKey));const p=await pe(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(s=(a=t.options)===null||a===void 0?void 0:a.redirectTo)!==null&&s!==void 0?s:void 0}),!((o=t==null?void 0:t.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:d,code_challenge_method:h}),headers:this.headers,xform:HN});return!((c=p.data)===null||c===void 0)&&c.url&&Nt()&&!(!((u=t.options)===null||u===void 0)&&u.skipBrowserRedirect)&&window.location.assign(p.data.url),this._returnResult(p)}catch(d){if(await At(this.storage,`${this.storageKey}-code-verifier`),le(d))return this._returnResult({data:null,error:d});throw d}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;if(s)throw s;if(!a)throw new xt;const{error:o}=await pe(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if(le(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const a=`${this.url}/resend`;if("email"in t){const{email:s,type:o,options:c}=t,{error:u}=await pe(this.fetch,"POST",a,{headers:this.headers,body:{email:s,type:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:u})}else if("phone"in t){const{phone:s,type:o,options:c}=t,{data:u,error:d}=await pe(this.fetch,"POST",a,{headers:this.headers,body:{phone:s,type:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Cc("You must provide either an email or phone number and a type")}catch(a){if(le(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async a=>a))}async _acquireLock(t,a){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await s,await a()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=a();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const a=await this.__loadSession();return await t(a)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const a=await Fa(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",a),a!==null&&(this._isValidSession(a)?t=a:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<hh:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.userStorage){const u=await Fa(this.userStorage,this.storageKey+"-user");u!=null&&u.user?t.user=u.user:t.user=ph()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const u={value:this.suppressGetSessionWarning};t.user=zN(t.user,u),u.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);return c?this._returnResult({data:{session:null},error:c}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const a=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return a.data.user&&(this.suppressGetSessionWarning=!0),a}async _getUser(t){try{return t?await pe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ma}):await this._useSession(async a=>{var s,o,c;const{data:u,error:d}=a;if(d)throw d;return!(!((s=u.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new xt}:await pe(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(c=(o=u.session)===null||o===void 0?void 0:o.access_token)!==null&&c!==void 0?c:void 0,xform:ma})})}catch(a){if(le(a))return Ec(a)&&(await this._removeSession(),await At(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:a});throw a}}async updateUser(t,a={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,a))}async _updateUser(t,a={}){try{return await this._useSession(async s=>{const{data:o,error:c}=s;if(c)throw c;if(!o.session)throw new xt;const u=o.session;let d=null,h=null;this.flowType==="pkce"&&t.email!=null&&([d,h]=await Qs(this.storage,this.storageKey));const{data:p,error:v}=await pe(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:a==null?void 0:a.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:d,code_challenge_method:h}),jwt:u.access_token,xform:ma});if(v)throw v;return u.user=p.user,await this._saveSession(u),await this._notifyAllSubscribers("USER_UPDATED",u),this._returnResult({data:{user:u.user},error:null})})}catch(s){if(await At(this.storage,`${this.storageKey}-code-verifier`),le(s))return this._returnResult({data:{user:null},error:s});throw s}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new xt;const a=Date.now()/1e3;let s=a,o=!0,c=null;const{payload:u}=Rc(t.access_token);if(u.exp&&(s=u.exp,o=s<=a),o){const{data:d,error:h}=await this._callRefreshToken(t.refresh_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!d)return{data:{user:null,session:null},error:null};c=d}else{const{data:d,error:h}=await this._getUser(t.access_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});c={access_token:t.access_token,refresh_token:t.refresh_token,user:d.user,token_type:"bearer",expires_in:s-a,expires_at:s},await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)}return this._returnResult({data:{user:c.user,session:c},error:null})}catch(a){if(le(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async a=>{var s;if(!t){const{data:u,error:d}=a;if(d)throw d;t=(s=u.session)!==null&&s!==void 0?s:void 0}if(!(t!=null&&t.refresh_token))throw new xt;const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);return c?this._returnResult({data:{user:null,session:null},error:c}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(a){if(le(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async _getSessionFromURL(t,a){var s;try{if(!Nt())throw new Tc("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Tc(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(a){case"implicit":if(this.flowType==="pkce")throw new kb("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Tc("Not a valid implicit grant flow url.");break;default:}if(a==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new kb("No code detected.");const{data:N,error:L}=await this._exchangeCodeForSession(t.code);if(L)throw L;const G=new URL(window.location.href);return G.searchParams.delete("code"),window.history.replaceState(window.history.state,"",G.toString()),{data:{session:N.session,redirectType:(s=N.redirectType)!==null&&s!==void 0?s:null},error:null}}const{provider_token:o,provider_refresh_token:c,access_token:u,refresh_token:d,expires_in:h,expires_at:p,token_type:v}=t;if(!u||!h||!d||!v)throw new Tc("No session defined in URL");const g=Math.round(Date.now()/1e3),x=parseInt(h);let S=g+x;p&&(S=parseInt(p));const _=S-g;_*1e3<=ii&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${_}s, should have been closer to ${x}s`);const E=S-x;g-E>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",E,S,g):g-E<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",E,S,g);const{data:R,error:T}=await this._getUser(u);if(T)throw T;const A={provider_token:o,provider_refresh_token:c,access_token:u,expires_in:x,expires_at:S,refresh_token:d,token_type:v,user:R.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:A,redirectType:t.type},error:null})}catch(o){if(le(o))return this._returnResult({data:{session:null,redirectType:null},error:o});throw o}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const a=await Fa(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&a)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c&&!Ec(c))return this._returnResult({error:c});const u=(s=o.session)===null||s===void 0?void 0:s.access_token;if(u){const{error:d}=await this.admin.signOut(u,t);if(d&&!(pN(d)&&(d.status===404||d.status===401||d.status===403)||Ec(d)))return this._returnResult({error:d})}return t!=="others"&&(await this._removeSession(),await At(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const a=EN(),s={id:a,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",a),this.stateChangeEmitters.delete(a)}};return this._debug("#onAuthStateChange()","registered callback with id",a),this.stateChangeEmitters.set(a,s),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(a)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async a=>{var s,o;try{const{data:{session:c},error:u}=a;if(u)throw u;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",c)),this._debug("INITIAL_SESSION","callback id",t,"session",c)}catch(c){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",c),Ec(c)?console.warn(c):console.error(c)}})}async resetPasswordForEmail(t,a={}){let s=null,o=null;this.flowType==="pkce"&&([s,o]=await Qs(this.storage,this.storageKey,!0));try{return await pe(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:o,gotrue_meta_security:{captcha_token:a.captchaToken}},headers:this.headers,redirectTo:a.redirectTo})}catch(c){if(await At(this.storage,`${this.storageKey}-code-verifier`),le(c))return this._returnResult({data:null,error:c});throw c}}async getUserIdentities(){var t;try{const{data:a,error:s}=await this.getUser();if(s)throw s;return this._returnResult({data:{identities:(t=a.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var a;try{const{data:s,error:o}=await this._useSession(async c=>{var u,d,h,p,v;const{data:g,error:x}=c;if(x)throw x;const S=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(u=t.options)===null||u===void 0?void 0:u.redirectTo,scopes:(d=t.options)===null||d===void 0?void 0:d.scopes,queryParams:(h=t.options)===null||h===void 0?void 0:h.queryParams,skipBrowserRedirect:!0});return await pe(this.fetch,"GET",S,{headers:this.headers,jwt:(v=(p=g.session)===null||p===void 0?void 0:p.access_token)!==null&&v!==void 0?v:void 0})});if(o)throw o;return Nt()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),this._returnResult({data:{provider:t.provider,url:s==null?void 0:s.url},error:null})}catch(s){if(le(s))return this._returnResult({data:{provider:t.provider,url:null},error:s});throw s}}async linkIdentityIdToken(t){return await this._useSession(async a=>{var s;try{const{error:o,data:{session:c}}=a;if(o)throw o;const{options:u,provider:d,token:h,access_token:p,nonce:v}=t,g=await pe(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(s=c==null?void 0:c.access_token)!==null&&s!==void 0?s:void 0,body:{provider:d,id_token:h,access_token:p,nonce:v,link_identity:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:xn}),{data:x,error:S}=g;return S?this._returnResult({data:{user:null,session:null},error:S}):!x||!x.session||!x.user?this._returnResult({data:{user:null,session:null},error:new Js}):(x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("USER_UPDATED",x.session)),this._returnResult({data:x,error:S}))}catch(o){if(await At(this.storage,`${this.storageKey}-code-verifier`),le(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async a=>{var s,o;const{data:c,error:u}=a;if(u)throw u;return await pe(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(s=c.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0})})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async _refreshAccessToken(t){const a=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{const s=Date.now();return await AN(async o=>(o>0&&await RN(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await pe(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:xn})),(o,c)=>{const u=200*Math.pow(2,o);return c&&mh(c)&&Date.now()+u-s<ii})}catch(s){if(this._debug(a,"error",s),le(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(a,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,a){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:a.redirectTo,scopes:a.scopes,queryParams:a.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",a,"url",s),Nt()&&!a.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t,a;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const o=await Fa(this.storage,this.storageKey);if(o&&this.userStorage){let u=await Fa(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!u&&(u={user:o.user},await oi(this.userStorage,this.storageKey+"-user",u)),o.user=(t=u==null?void 0:u.user)!==null&&t!==void 0?t:ph()}else if(o&&!o.user&&!o.user){const u=await Fa(this.storage,this.storageKey+"-user");u&&(u!=null&&u.user)?(o.user=u.user,await At(this.storage,this.storageKey+"-user"),await oi(this.storage,this.storageKey,o)):o.user=ph()}if(this._debug(s,"session from storage",o),!this._isValidSession(o)){this._debug(s,"session is not valid"),o!==null&&await this._removeSession();return}const c=((a=o.expires_at)!==null&&a!==void 0?a:1/0)*1e3-Date.now()<hh;if(this._debug(s,`session has${c?"":" not"} expired with margin of ${hh}s`),c){if(this.autoRefreshToken&&o.refresh_token){const{error:u}=await this._callRefreshToken(o.refresh_token);u&&(console.error(u),mh(u)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",u),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:u,error:d}=await this._getUser(o.access_token);!d&&(u!=null&&u.user)?(o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(u){console.error("Error getting user data:",u),this._debug(s,"error getting user data, skipping SIGNED_IN notification",u)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(s,"error",o),console.error(o);return}finally{this._debug(s,"end")}}async _callRefreshToken(t){var a,s;if(!t)throw new xt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Eu;const{data:c,error:u}=await this._refreshAccessToken(t);if(u)throw u;if(!c.session)throw new xt;await this._saveSession(c.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",c.session);const d={data:c.session,error:null};return this.refreshingDeferred.resolve(d),d}catch(c){if(this._debug(o,"error",c),le(c)){const u={data:null,error:c};return mh(c)||await this._removeSession(),(a=this.refreshingDeferred)===null||a===void 0||a.resolve(u),u}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(c),c}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,a,s=!0){const o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",a,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:a});const c=[],u=Array.from(this.stateChangeEmitters.values()).map(async d=>{try{await d.callback(t,a)}catch(h){c.push(h)}});if(await Promise.all(u),c.length>0){for(let d=0;d<c.length;d+=1)console.error(c[d]);throw c[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await At(this.storage,`${this.storageKey}-code-verifier`);const a=Object.assign({},t),s=a.user&&a.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&a.user&&await oi(this.userStorage,this.storageKey+"-user",{user:a.user});const o=Object.assign({},a);delete o.user;const c=Lb(o);await oi(this.storage,this.storageKey,c)}else{const o=Lb(a);await oi(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await At(this.storage,this.storageKey),await At(this.storage,this.storageKey+"-code-verifier"),await At(this.storage,this.storageKey+"-user"),this.userStorage&&await At(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Nt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(a){console.error("removing visibilitychange callback failed",a)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ii);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const a=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=a,a&&typeof a=="object"&&typeof a.unref=="function"?a.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(a)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const a=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,a&&clearTimeout(a)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async a=>{const{data:{session:s}}=a;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((s.expires_at*1e3-t)/ii);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${ii}ms, refresh threshold is ${Hh} ticks`),o<=Hh&&await this._callRefreshToken(s.refresh_token)})}catch(a){console.error("Auto refresh tick failed with error. This is likely a transient error.",a)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof kw)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Nt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const a=`#_onVisibilityChanged(${t})`;this._debug(a,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(a,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,a,s){const o=[`provider=${encodeURIComponent(a)}`];if(s!=null&&s.redirectTo&&o.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&o.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[c,u]=await Qs(this.storage,this.storageKey),d=new URLSearchParams({code_challenge:`${encodeURIComponent(c)}`,code_challenge_method:`${encodeURIComponent(u)}`});o.push(d.toString())}if(s!=null&&s.queryParams){const c=new URLSearchParams(s.queryParams);o.push(c.toString())}return s!=null&&s.skipBrowserRedirect&&o.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;return c?this._returnResult({data:null,error:c}):await pe(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token})})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async _enroll(t){try{return await this._useSession(async a=>{var s,o;const{data:c,error:u}=a;if(u)return this._returnResult({data:null,error:u});const d=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:h,error:p}=await pe(this.fetch,"POST",`${this.url}/factors`,{body:d,headers:this.headers,jwt:(s=c==null?void 0:c.session)===null||s===void 0?void 0:s.access_token});return p?this._returnResult({data:null,error:p}):(t.factorType==="totp"&&h.type==="totp"&&(!((o=h==null?void 0:h.totp)===null||o===void 0)&&o.qr_code)&&(h.totp.qr_code=`data:image/svg+xml;utf-8,${h.totp.qr_code}`),this._returnResult({data:h,error:null}))})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c)return this._returnResult({data:null,error:c});const u=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?qb(t.webauthn.credential_response):Gb(t.webauthn.credential_response)})}:{code:t.code}),{data:d,error:h}=await pe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:u,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});return h?this._returnResult({data:null,error:h}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+d.expires_in},d)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",d),this._returnResult({data:d,error:h}))})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c)return this._returnResult({data:null,error:c});const u=await pe(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});if(u.error)return u;const{data:d}=u;if(d.type!=="webauthn")return{data:d,error:null};switch(d.webauthn.type){case"create":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:$b(d.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:Hb(d.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}})}async _challengeAndVerify(t){const{data:a,error:s}=await this._challenge({factorId:t.factorId});return s?this._returnResult({data:null,error:s}):await this._verify({factorId:t.factorId,challengeId:a.id,code:t.code})}async _listFactors(){var t;const{data:{user:a},error:s}=await this.getUser();if(s)return{data:null,error:s};const o={all:[],phone:[],totp:[],webauthn:[]};for(const c of(t=a==null?void 0:a.factors)!==null&&t!==void 0?t:[])o.all.push(c),c.status==="verified"&&o[c.factor_type].push(c);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(t){var a,s,o,c;if(t)try{const{payload:S}=Rc(t);let _=null;S.aal&&(_=S.aal);let E=_;const{data:{user:R},error:T}=await this.getUser(t);if(T)return this._returnResult({data:null,error:T});((s=(a=R==null?void 0:R.factors)===null||a===void 0?void 0:a.filter(L=>L.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(E="aal2");const N=S.amr||[];return{data:{currentLevel:_,nextLevel:E,currentAuthenticationMethods:N},error:null}}catch(S){if(le(S))return this._returnResult({data:null,error:S});throw S}const{data:{session:u},error:d}=await this.getSession();if(d)return this._returnResult({data:null,error:d});if(!u)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:h}=Rc(u.access_token);let p=null;h.aal&&(p=h.aal);let v=p;((c=(o=u.user.factors)===null||o===void 0?void 0:o.filter(S=>S.status==="verified"))!==null&&c!==void 0?c:[]).length>0&&(v="aal2");const x=h.amr||[];return{data:{currentLevel:p,nextLevel:v,currentAuthenticationMethods:x},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;return o?this._returnResult({data:null,error:o}):s?await pe(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:s.access_token,xform:c=>({data:c,error:null})}):this._returnResult({data:null,error:new xt})})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async _approveAuthorization(t,a){try{return await this._useSession(async s=>{const{data:{session:o},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new xt});const u=await pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:d=>({data:d,error:null})});return u.data&&u.data.redirect_url&&Nt()&&!(a!=null&&a.skipBrowserRedirect)&&window.location.assign(u.data.redirect_url),u})}catch(s){if(le(s))return this._returnResult({data:null,error:s});throw s}}async _denyAuthorization(t,a){try{return await this._useSession(async s=>{const{data:{session:o},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new xt});const u=await pe(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:d=>({data:d,error:null})});return u.data&&u.data.redirect_url&&Nt()&&!(a!=null&&a.skipBrowserRedirect)&&window.location.assign(u.data.redirect_url),u})}catch(s){if(le(s))return this._returnResult({data:null,error:s});throw s}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;return s?this._returnResult({data:null,error:s}):a?await pe(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new xt})})}catch(t){if(le(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;return o?this._returnResult({data:null,error:o}):s?(await pe(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new xt})})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async fetchJwk(t,a={keys:[]}){let s=a.keys.find(d=>d.kid===t);if(s)return s;const o=Date.now();if(s=this.jwks.keys.find(d=>d.kid===t),s&&this.jwks_cached_at+hN>o)return s;const{data:c,error:u}=await pe(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(u)throw u;return!c.keys||c.keys.length===0||(this.jwks=c,this.jwks_cached_at=o,s=c.keys.find(d=>d.kid===t),!s)?null:s}async getClaims(t,a={}){try{let s=t;if(!s){const{data:S,error:_}=await this.getSession();if(_||!S.session)return this._returnResult({data:null,error:_});s=S.session.access_token}const{header:o,payload:c,signature:u,raw:{header:d,payload:h}}=Rc(s);a!=null&&a.allowExpired||LN(c.exp);const p=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,a!=null&&a.keys?{keys:a.keys}:a==null?void 0:a.jwks);if(!p){const{error:S}=await this.getUser(s);if(S)throw S;return{data:{claims:c,header:o,signature:u},error:null}}const v=UN(o.alg),g=await crypto.subtle.importKey("jwk",p,v,!0,["verify"]);if(!await crypto.subtle.verify(v,g,u,SN(`${d}.${h}`)))throw new Vh("Invalid JWT signature");return{data:{claims:c,header:o,signature:u},error:null}}catch(s){if(le(s))return this._returnResult({data:null,error:s});throw s}}async signInWithPasskey(t){var a,s,o;On(this.experimental);try{if(!iu())return this._returnResult({data:null,error:new Dn("Browser does not support WebAuthn",null)});const{data:c,error:u}=await this._startPasskeyAuthentication({options:{captchaToken:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}});if(u||!c)return this._returnResult({data:null,error:u});const d=Hb(c.options),h=(o=(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.signal)!==null&&o!==void 0?o:Kh.createNewAbortSignal(),{data:p,error:v}=await Dw({publicKey:d,signal:h});if(v||!p)return this._returnResult({data:null,error:v??new Dn("WebAuthn ceremony failed",null)});const g=Gb(p);return this._verifyPasskeyAuthentication({challengeId:c.challenge_id,credential:g})}catch(c){if(le(c))return this._returnResult({data:null,error:c});throw c}}async registerPasskey(t){var a,s;On(this.experimental);try{if(!iu())return this._returnResult({data:null,error:new Dn("Browser does not support WebAuthn",null)});const{data:o,error:c}=await this._startPasskeyRegistration();if(c||!o)return this._returnResult({data:null,error:c});const u=$b(o.options),d=(s=(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.signal)!==null&&s!==void 0?s:Kh.createNewAbortSignal(),{data:h,error:p}=await Mw({publicKey:u,signal:d});if(p||!h)return this._returnResult({data:null,error:p??new Dn("WebAuthn ceremony failed",null)});const v=qb(h);return this._verifyPasskeyRegistration({challengeId:o.challenge_id,credential:v})}catch(o){if(le(o))return this._returnResult({data:null,error:o});throw o}}async _startPasskeyRegistration(){On(this.experimental);try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new xt});const{data:o,error:c}=await pe(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:a.access_token,body:{}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:o,error:null})})}catch(t){if(le(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){On(this.experimental);try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new xt});const{data:c,error:u}=await pe(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:s.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:c,error:null})})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async _startPasskeyAuthentication(t){var a;On(this.experimental);try{const{data:s,error:o}=await pe(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})}catch(s){if(le(s))return this._returnResult({data:null,error:s});throw s}}async _verifyPasskeyAuthentication(t){On(this.experimental);try{const{data:a,error:s}=await pe(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:xn});return s?this._returnResult({data:null,error:s}):(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:null}))}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async _listPasskeys(){On(this.experimental);try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new xt});const{data:o,error:c}=await pe(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:a.access_token,xform:u=>({data:u,error:null})});return c?this._returnResult({data:null,error:c}):this._returnResult({data:o,error:null})})}catch(t){if(le(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){On(this.experimental);try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new xt});const{data:c,error:u}=await pe(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:s.access_token,body:{friendly_name:t.friendlyName}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:c,error:null})})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}async _deletePasskey(t){On(this.experimental);try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new xt});const{error:c}=await pe(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:s.access_token,noResolveJson:!0});return c?this._returnResult({data:null,error:c}):this._returnResult({data:null,error:null})})}catch(a){if(le(a))return this._returnResult({data:null,error:a});throw a}}}$o.nextInstanceID={};const ik=$o,ok="2.106.2";let To="";typeof Deno<"u"?To="deno":typeof document<"u"?To="web":typeof navigator<"u"&&navigator.product==="ReactNative"?To="react-native":To="node";const lk={"X-Client-Info":`supabase-js-${To}/${ok}`},ck={headers:lk},uk={schema:"public"},dk={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},fk={},hk={enabled:!1,respectSamplingDecision:!0};function mk(e,t,a,s){function o(c){return c instanceof a?c:new a(function(u){u(c)})}return new(a||(a=Promise))(function(c,u){function d(v){try{p(s.next(v))}catch(g){u(g)}}function h(v){try{p(s.throw(v))}catch(g){u(g)}}function p(v){v.done?c(v.value):o(v.value).then(d,h)}p((s=s.apply(e,[])).next())})}let vh=null;const pk="@opentelemetry/api";function gk(){return vh===null&&(vh=import(pk).catch(()=>null)),vh}function vk(){return mk(this,void 0,void 0,function*(){try{const e=yield gk();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const a=t.traceparent;return a?{traceparent:a,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function yk(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[a,s,o,c]=t;if(a.length!==2||s.length!==32||o.length!==16||c.length!==2)return null;const u=/^[0-9a-f]+$/i;return!u.test(a)||!u.test(s)||!u.test(o)||!u.test(c)||s==="00000000000000000000000000000000"||o==="0000000000000000"?null:{version:a,traceId:s,parentId:o,traceFlags:c,isSampled:(parseInt(c,16)&1)===1}}function bk(e,t){if(!e||!t||t.length===0)return!1;let a;if(e instanceof URL)a=e;else try{a=new URL(e)}catch{return!1}for(const s of t)try{if(typeof s=="string"){if(wk(a.hostname,s))return!0}else if(s instanceof RegExp){if(s.test(a.hostname))return!0}else if(typeof s=="function"&&s(a))return!0}catch{continue}return!1}function wk(e,t){if(t===e)return!0;if(t.startsWith("*.")){const a=t.slice(2);if(e.endsWith(a)&&(e===a||e.endsWith("."+a)))return!0}return!1}function xk(e){const t=[];try{const a=new URL(e);t.push(a.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function Ho(e){"@babel/helpers - typeof";return Ho=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ho(e)}function Sk(e,t){if(Ho(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t);if(Ho(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _k(e){var t=Sk(e,"string");return Ho(t)=="symbol"?t:t+""}function Ek(e,t,a){return(t=_k(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Kb(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function it(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Kb(Object(a),!0).forEach(function(s){Ek(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Kb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}const Ck=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),Tk=()=>Headers,Rk=(e,t,a,s,o)=>{const c=Ck(s),u=Tk(),d=(o==null?void 0:o.enabled)===!0,h=(o==null?void 0:o.respectSamplingDecision)!==!1,p=d?xk(t):null;return async(v,g)=>{var x;const S=(x=await a())!==null&&x!==void 0?x:e;let _=new u(g==null?void 0:g.headers);if(_.has("apikey")||_.set("apikey",e),_.has("Authorization")||_.set("Authorization",`Bearer ${S}`),p){const E=await Ak(v,p,h);E&&(E.traceparent&&!_.has("traceparent")&&_.set("traceparent",E.traceparent),E.tracestate&&!_.has("tracestate")&&_.set("tracestate",E.tracestate),E.baggage&&!_.has("baggage")&&_.set("baggage",E.baggage))}return c(v,it(it({},g),{},{headers:_}))}};async function Ak(e,t,a){if(!bk(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const s=await vk();if(!s||!s.traceparent)return null;if(a){const o=yk(s.traceparent);if(o&&!o.isSampled)return null}return s}function Fb(e){return typeof e=="boolean"?{enabled:e}:e}function Nk(e){return e.endsWith("/")?e:e+"/"}function kk(e,t){var a,s,o,c,u,d;const{db:h,auth:p,realtime:v,global:g}=e,{db:x,auth:S,realtime:_,global:E}=t,R=Fb(e.tracePropagation),T=Fb(t.tracePropagation),A={db:it(it({},x),h),auth:it(it({},S),p),realtime:it(it({},_),v),storage:{},global:it(it(it({},E),g),{},{headers:it(it({},(a=E==null?void 0:E.headers)!==null&&a!==void 0?a:{}),(s=g==null?void 0:g.headers)!==null&&s!==void 0?s:{})}),tracePropagation:{enabled:(o=(c=R==null?void 0:R.enabled)!==null&&c!==void 0?c:T==null?void 0:T.enabled)!==null&&o!==void 0?o:!1,respectSamplingDecision:(u=(d=R==null?void 0:R.respectSamplingDecision)!==null&&d!==void 0?d:T==null?void 0:T.respectSamplingDecision)!==null&&u!==void 0?u:!0},accessToken:async()=>""};return e.accessToken?A.accessToken=e.accessToken:delete A.accessToken,A}function Ok(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Nk(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var jk=class extends ik{constructor(e){super(e)}},Mk=class{constructor(e,t,a){var s,o;this.supabaseUrl=e,this.supabaseKey=t;const c=Ok(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const u=`sb-${c.hostname.split(".")[0]}-auth-token`,d={db:uk,realtime:fk,auth:it(it({},dk),{},{storageKey:u}),global:ck,tracePropagation:hk},h=kk(a??{},d);if(this.settings=h,this.storageKey=(s=h.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(o=h.global.headers)!==null&&o!==void 0?o:{},h.accessToken)this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(v,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}});else{var p;this.auth=this._initSupabaseAuthClient((p=h.auth)!==null&&p!==void 0?p:{},this.headers,h.global.fetch)}this.fetch=Rk(t,e,this._getAccessToken.bind(this),h.global.fetch,h.tracePropagation),this.realtime=this._initRealtimeClient(it({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},h.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(v=>this.realtime.setAuth(v)).catch(v=>console.warn("Failed to set initial Realtime auth token:",v)),this.rest=new WR(new URL("rest/v1",c).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch,timeout:h.db.timeout,urlLengthLimit:h.db.urlLengthLimit}),this.storage=new lN(this.storageUrl.href,this.headers,this.fetch,a==null?void 0:a.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new BR(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},a={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,a)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,a;if(e.accessToken)return await e.accessToken();const{data:s}=await e.auth.getSession();return(t=(a=s.session)===null||a===void 0?void 0:a.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:a,storage:s,userStorage:o,storageKey:c,flowType:u,lock:d,debug:h,throwOnError:p,experimental:v,lockAcquireTimeout:g,skipAutoInitialize:x},S,_){const E={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new jk({url:this.authUrl.href,headers:it(it({},E),S),storageKey:c,autoRefreshToken:e,persistSession:t,detectSessionInUrl:a,storage:s,userStorage:o,flowType:u,lock:d,debug:h,throwOnError:p,experimental:v,fetch:_,lockAcquireTimeout:g,skipAutoInitialize:x,hasCustomAuthorizationHeader:Object.keys(this.headers).some(R=>R.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new OA(this.realtimeUrl.href,it(it({},e),{},{params:it(it({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,a){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==a?(this.changedAccessToken=a,this.realtime.setAuth(a)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Dk=(e,t,a)=>new Mk(e,t,a);function Lk(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const a=t.match(/^v(\d+)\./);return a?parseInt(a[1],10)<=18:!1}Lk()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Uk={BASE_URL:"/tablero-cdc/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE",VITE_SUPABASE_URL:"https://dbit.digitalcompass.agency",VITE_WEBHOOK_URL:"https://agenteit.digitalcompass.agency/webhook/tablero-cdc-sync-proyecto"},Pk=["VITE_SUPABASE_URL","VITE_SUPABASE_ANON_KEY"],Yb=Pk.filter(e=>!Uk[e]);if(Yb.length>0)throw new Error(`Faltan variables de entorno de Supabase. Revisa tu archivo .env.
Variables faltantes: ${Yb.join(", ")}`);const St=Dk("https://dbit.digitalcompass.agency","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE",{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0}}),Lw="gomezleemarketing.com",Uw="gmarrero@gomezleemarketing.com",zk=[Uw,"areyes@gomezleemarketing.com"];function Bk(e){return e?e.toLowerCase().endsWith(`@${Lw}`):!1}function Ik(){return typeof window>"u"?"/tablero-cdc/":new URL("/tablero-cdc/",window.location.origin).toString()}function $k(e){var o;const t=e.user_metadata||{},a=t.full_name||t.name||t.display_name||((o=e.email)==null?void 0:o.split("@")[0])||null,s=t.avatar_url||t.picture||null;return{id:e.id,uid:e.id,email:e.email??null,displayName:a,photoURL:s,raw:e}}const Pw=y.createContext(null);function Hk({children:e}){var S;const[t,a]=y.useState(null),[s,o]=y.useState(!0),[c,u]=y.useState(null),d=y.useCallback(async _=>{if(!_){a(null);return}if(!Bk(_.email)){await St.auth.signOut(),a(null),u("Solo se permite acceso con correos corporativos de GomezLee Marketing.");return}a($k(_)),u(null)},[]);y.useEffect(()=>{let _=!0;St.auth.getSession().then(async({data:R,error:T})=>{var A;if(_){if(T){console.error("Error al recuperar sesión de Supabase:",T),a(null),u("No se pudo recuperar la sesión. Intenta iniciar sesión de nuevo.");return}await d(((A=R.session)==null?void 0:A.user)??null)}}).catch(R=>{_&&(console.error("Error inesperado al recuperar sesión:",R),a(null),u("No se pudo recuperar la sesión. Intenta iniciar sesión de nuevo."))}).finally(()=>{_&&o(!1)});const{data:E}=St.auth.onAuthStateChange((R,T)=>{d((T==null?void 0:T.user)??null),o(!1)});return()=>{_=!1,E.subscription.unsubscribe()}},[d]);const h=y.useCallback(async()=>{u(null);const{error:_}=await St.auth.signInWithOAuth({provider:"google",options:{redirectTo:Ik(),queryParams:{prompt:"select_account",hd:Lw}}});_&&(console.error("Error al iniciar sesión con Google:",_),u("No se pudo iniciar sesión. Intenta de nuevo."))},[]),p=y.useCallback(async()=>{const{error:_}=await St.auth.signOut();if(_){console.error("Error al cerrar sesión:",_),u("No se pudo cerrar sesión. Intenta de nuevo.");return}a(null),u(null)},[]),v=((S=t==null?void 0:t.email)==null?void 0:S.toLowerCase())||"",g=y.useMemo(()=>v===Uw,[v]),x=y.useMemo(()=>zk.includes(v),[v]);return b.jsx(Pw.Provider,{value:{user:t,loading:s,error:c,isGerardo:g,canDeleteProjects:x,loginWithGoogle:h,logout:p},children:e})}function Zo(){const e=y.useContext(Pw);if(!e)throw new Error("useAuth debe usarse dentro de <AuthProvider>");return e}/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zw=(...e)=>e.filter((t,a,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===a).join(" ").trim();/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,s)=>s?s.toUpperCase():a.toLowerCase());/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wb=e=>{const t=Gk(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Vk={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"};/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kk=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fk=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:c,iconNode:u,...d},h)=>y.createElement("svg",{ref:h,...Vk,width:t,height:t,stroke:e,strokeWidth:s?Number(a)*24/Number(t):a,className:zw("lucide",o),...!c&&!Kk(d)&&{"aria-hidden":"true"},...d},[...u.map(([p,v])=>y.createElement(p,v)),...Array.isArray(c)?c:[c]]));/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xe=(e,t)=>{const a=y.forwardRef(({className:s,...o},c)=>y.createElement(Fk,{ref:c,iconNode:t,className:zw(`lucide-${qk(Wb(e))}`,`lucide-${e}`,s),...o}));return a.displayName=Wb(e),a};/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yk=[["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"}]],Wk=Xe("calendar",Yk);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Cu=Xe("check",Xk);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jk=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Em=Xe("chevron-down",Jk);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qk=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Zk=Xe("chevron-left",Qk);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Bw=Xe("chevron-right",eO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],nO=Xe("chevron-up",tO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rO=[["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"}]],Fh=Xe("circle-alert",rO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],sO=Xe("circle-check",aO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const iO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],oO=Xe("circle",iO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lO=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],cO=Xe("dollar-sign",lO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],dO=Xe("external-link",uO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fO=[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]],hO=Xe("file-check-corner",fO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mO=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Cm=Xe("layout-grid",mO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pO=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],gO=Xe("link-2",pO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vO=[["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"}]],yO=Xe("link",vO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bO=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ac=Xe("loader-circle",bO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wO=[["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"}]],xO=Xe("lock",wO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const SO=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],_O=Xe("log-out",SO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const EO=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],CO=Xe("map-pin",EO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Tm=Xe("plus",TO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RO=[["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"}]],AO=Xe("refresh-cw",RO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const NO=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Xb=Xe("search",NO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kO=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Jb=Xe("tag",kO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OO=[["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"}]],jO=Xe("trash-2",OO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const MO=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],DO=Xe("user",MO);/**
* @license lucide-react v0.575.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Iw=Xe("x",LO);function Qb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Dr(...e){return t=>{let a=!1;const s=e.map(o=>{const c=Qb(o,t);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let o=0;o<s.length;o++){const c=s[o];typeof c=="function"?c():Qb(e[o],null)}}}}function qe(...e){return y.useCallback(Dr(...e),e)}var UO=Symbol.for("react.lazy"),lu=hm[" use ".trim().toString()];function PO(e){return typeof e=="object"&&e!==null&&"then"in e}function $w(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===UO&&"_payload"in e&&PO(e._payload)}function Tu(e){const t=BO(e),a=y.forwardRef((s,o)=>{let{children:c,...u}=s;$w(c)&&typeof lu=="function"&&(c=lu(c._payload));const d=y.Children.toArray(c),h=d.find($O);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}var zO=Tu("Slot");function BO(e){const t=y.forwardRef((a,s)=>{let{children:o,...c}=a;if($w(o)&&typeof lu=="function"&&(o=lu(o._payload)),y.isValidElement(o)){const u=qO(o),d=HO(c,o.props);return o.type!==y.Fragment&&(d.ref=s?Dr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var IO=Symbol("radix.slottable");function $O(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===IO}function HO(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function qO(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function Hw(e){var t,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=Hw(e[t]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function qw(){for(var e,t,a=0,s="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=Hw(e))&&(s&&(s+=" "),s+=t);return s}const Zb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,e0=qw,Rm=(e,t)=>a=>{var s;if((t==null?void 0:t.variants)==null)return e0(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:o,defaultVariants:c}=t,u=Object.keys(o).map(p=>{const v=a==null?void 0:a[p],g=c==null?void 0:c[p];if(v===null)return null;const x=Zb(v)||Zb(g);return o[p][x]}),d=a&&Object.entries(a).reduce((p,v)=>{let[g,x]=v;return x===void 0||(p[g]=x),p},{}),h=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((p,v)=>{let{class:g,className:x,...S}=v;return Object.entries(S).every(_=>{let[E,R]=_;return Array.isArray(R)?R.includes({...c,...d}[E]):{...c,...d}[E]===R})?[...p,g,x]:p},[]);return e0(e,u,h,a==null?void 0:a.class,a==null?void 0:a.className)},GO=(e,t)=>{const a=new Array(e.length+t.length);for(let s=0;s<e.length;s++)a[s]=e[s];for(let s=0;s<t.length;s++)a[e.length+s]=t[s];return a},VO=(e,t)=>({classGroupId:e,validator:t}),Gw=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a}),cu="-",t0=[],KO="arbitrary..",FO=e=>{const t=WO(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return YO(u);const d=u.split(cu),h=d[0]===""&&d.length>1?1:0;return Vw(d,h,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const h=s[u],p=a[u];return h?p?GO(p,h):h:p||t0}return a[u]||t0}}},Vw=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;const o=e[t],c=a.nextPart.get(o);if(c){const p=Vw(e,t+1,c);if(p)return p}const u=a.validators;if(u===null)return;const d=t===0?e.join(cu):e.slice(t).join(cu),h=u.length;for(let p=0;p<h;p++){const v=u[p];if(v.validator(d))return v.classGroupId}},YO=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),a=t.indexOf(":"),s=t.slice(0,a);return s?KO+s:void 0})(),WO=e=>{const{theme:t,classGroups:a}=e;return XO(a,t)},XO=(e,t)=>{const a=Gw();for(const s in e){const o=e[s];Am(o,a,s,t)}return a},Am=(e,t,a,s)=>{const o=e.length;for(let c=0;c<o;c++){const u=e[c];JO(u,t,a,s)}},JO=(e,t,a,s)=>{if(typeof e=="string"){QO(e,t,a);return}if(typeof e=="function"){ZO(e,t,a,s);return}e2(e,t,a,s)},QO=(e,t,a)=>{const s=e===""?t:Kw(t,e);s.classGroupId=a},ZO=(e,t,a,s)=>{if(t2(e)){Am(e(s),t,a,s);return}t.validators===null&&(t.validators=[]),t.validators.push(VO(a,e))},e2=(e,t,a,s)=>{const o=Object.entries(e),c=o.length;for(let u=0;u<c;u++){const[d,h]=o[u];Am(h,Kw(t,d),a,s)}},Kw=(e,t)=>{let a=e;const s=t.split(cu),o=s.length;for(let c=0;c<o;c++){const u=s[c];let d=a.nextPart.get(u);d||(d=Gw(),a.nextPart.set(u,d)),a=d}return a},t2=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,n2=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),s=Object.create(null);const o=(c,u)=>{a[c]=u,t++,t>e&&(t=0,s=a,a=Object.create(null))};return{get(c){let u=a[c];if(u!==void 0)return u;if((u=s[c])!==void 0)return o(c,u),u},set(c,u){c in a?a[c]=u:o(c,u)}}},Yh="!",n0=":",r2=[],r0=(e,t,a,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:s,isExternal:o}),a2=e=>{const{prefix:t,experimentalParseClassName:a}=e;let s=o=>{const c=[];let u=0,d=0,h=0,p;const v=o.length;for(let E=0;E<v;E++){const R=o[E];if(u===0&&d===0){if(R===n0){c.push(o.slice(h,E)),h=E+1;continue}if(R==="/"){p=E;continue}}R==="["?u++:R==="]"?u--:R==="("?d++:R===")"&&d--}const g=c.length===0?o:o.slice(h);let x=g,S=!1;g.endsWith(Yh)?(x=g.slice(0,-1),S=!0):g.startsWith(Yh)&&(x=g.slice(1),S=!0);const _=p&&p>h?p-h:void 0;return r0(c,S,x,_)};if(t){const o=t+n0,c=s;s=u=>u.startsWith(o)?c(u.slice(o.length)):r0(r2,!1,u,void 0,!0)}if(a){const o=s;s=c=>a({className:c,parseClassName:o})}return s},s2=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((a,s)=>{t.set(a,1e6+s)}),a=>{const s=[];let o=[];for(let c=0;c<a.length;c++){const u=a[c],d=u[0]==="[",h=t.has(u);d||h?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(u)):o.push(u)}return o.length>0&&(o.sort(),s.push(...o)),s}},i2=e=>({cache:n2(e.cacheSize),parseClassName:a2(e),sortModifiers:s2(e),postfixLookupClassGroupIds:o2(e),...FO(e)}),o2=e=>{const t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let s=0;s<a.length;s++)t[a[s]]=!0;return t},l2=/\s+/,c2=(e,t)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:c,postfixLookupClassGroupIds:u}=t,d=[],h=e.trim().split(l2);let p="";for(let v=h.length-1;v>=0;v-=1){const g=h[v],{isExternal:x,modifiers:S,hasImportantModifier:_,baseClassName:E,maybePostfixModifierPosition:R}=a(g);if(x){p=g+(p.length>0?" "+p:p);continue}let T=!!R,A;if(T){const P=E.substring(0,R);A=s(P);const q=A&&u[A]?s(E):void 0;q&&q!==A&&(A=q,T=!1)}else A=s(E);if(!A){if(!T){p=g+(p.length>0?" "+p:p);continue}if(A=s(E),!A){p=g+(p.length>0?" "+p:p);continue}T=!1}const N=S.length===0?"":S.length===1?S[0]:c(S).join(":"),L=_?N+Yh:N,G=L+A;if(d.indexOf(G)>-1)continue;d.push(G);const V=o(A,T);for(let P=0;P<V.length;++P){const q=V[P];d.push(L+q)}p=g+(p.length>0?" "+p:p)}return p},u2=(...e)=>{let t=0,a,s,o="";for(;t<e.length;)(a=e[t++])&&(s=Fw(a))&&(o&&(o+=" "),o+=s);return o},Fw=e=>{if(typeof e=="string")return e;let t,a="";for(let s=0;s<e.length;s++)e[s]&&(t=Fw(e[s]))&&(a&&(a+=" "),a+=t);return a},d2=(e,...t)=>{let a,s,o,c;const u=h=>{const p=t.reduce((v,g)=>g(v),e());return a=i2(p),s=a.cache.get,o=a.cache.set,c=d,d(h)},d=h=>{const p=s(h);if(p)return p;const v=c2(h,a);return o(h,v),v};return c=u,(...h)=>c(u2(...h))},f2=[],pt=e=>{const t=a=>a[e]||f2;return t.isThemeGetter=!0,t},Yw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ww=/^\((?:(\w[\w-]*):)?(.+)\)$/i,h2=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,m2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,p2=/\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$/,g2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,v2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,y2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ua=e=>h2.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Fn=e=>!!e&&Number.isInteger(Number(e)),yh=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Er=e=>m2.test(e),Xw=()=>!0,b2=e=>p2.test(e)&&!g2.test(e),Nm=()=>!1,w2=e=>v2.test(e),x2=e=>y2.test(e),S2=e=>!ce(e)&&!ue(e),_2=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),E2=e=>ba(e,Zw,Nm),ce=e=>Yw.test(e),Ya=e=>ba(e,ex,b2),a0=e=>ba(e,j2,Oe),C2=e=>ba(e,nx,Xw),T2=e=>ba(e,tx,Nm),s0=e=>ba(e,Jw,Nm),R2=e=>ba(e,Qw,x2),Nc=e=>ba(e,rx,w2),ue=e=>Ww.test(e),_o=e=>ss(e,ex),A2=e=>ss(e,tx),i0=e=>ss(e,Jw),N2=e=>ss(e,Zw),k2=e=>ss(e,Qw),kc=e=>ss(e,rx,!0),O2=e=>ss(e,nx,!0),ba=(e,t,a)=>{const s=Yw.exec(e);return s?s[1]?t(s[1]):a(s[2]):!1},ss=(e,t,a=!1)=>{const s=Ww.exec(e);return s?s[1]?t(s[1]):a:!1},Jw=e=>e==="position"||e==="percentage",Qw=e=>e==="image"||e==="url",Zw=e=>e==="length"||e==="size"||e==="bg-size",ex=e=>e==="length",j2=e=>e==="number",tx=e=>e==="family-name",nx=e=>e==="number"||e==="weight",rx=e=>e==="shadow",M2=()=>{const e=pt("color"),t=pt("font"),a=pt("text"),s=pt("font-weight"),o=pt("tracking"),c=pt("leading"),u=pt("breakpoint"),d=pt("container"),h=pt("spacing"),p=pt("radius"),v=pt("shadow"),g=pt("inset-shadow"),x=pt("text-shadow"),S=pt("drop-shadow"),_=pt("blur"),E=pt("perspective"),R=pt("aspect"),T=pt("ease"),A=pt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...L(),ue,ce],V=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],q=()=>[ue,ce,h],re=()=>[ua,"full","auto",...q()],me=()=>[Fn,"none","subgrid",ue,ce],ye=()=>["auto",{span:["full",Fn,ue,ce]},Fn,ue,ce],oe=()=>[Fn,"auto",ue,ce],de=()=>["auto","min","max","fr",ue,ce],ge=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],fe=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...q()],F=()=>[ua,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...q()],J=()=>[ua,"screen","full","dvw","lvw","svw","min","max","fit",...q()],ee=()=>[ua,"screen","full","lh","dvh","lvh","svh","min","max","fit",...q()],H=()=>[e,ue,ce],k=()=>[...L(),i0,s0,{position:[ue,ce]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",N2,E2,{size:[ue,ce]}],Y=()=>[yh,_o,Ya],Q=()=>["","none","full",p,ue,ce],ne=()=>["",Oe,_o,Ya],te=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Oe,yh,i0,s0],Te=()=>["","none",_,ue,ce],Re=()=>["none",Oe,ue,ce],Ee=()=>["none",Oe,ue,ce],rt=()=>[Oe,ue,ce],Fe=()=>[ua,"full",...q()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Er],breakpoint:[Er],color:[Xw],container:[Er],"drop-shadow":[Er],ease:["in","out","in-out"],font:[S2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Er],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Er],shadow:[Er],spacing:["px",Oe],text:[Er],"text-shadow":[Er],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ua,ce,ue,R]}],container:["container"],"container-type":[{"@container":["","normal","size",ue,ce]}],"container-named":[_2],columns:[{columns:[Oe,ce,ue,d]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:G()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:re()}],"inset-x":[{"inset-x":re()}],"inset-y":[{"inset-y":re()}],start:[{"inset-s":re(),start:re()}],end:[{"inset-e":re(),end:re()}],"inset-bs":[{"inset-bs":re()}],"inset-be":[{"inset-be":re()}],top:[{top:re()}],right:[{right:re()}],bottom:[{bottom:re()}],left:[{left:re()}],visibility:["visible","invisible","collapse"],z:[{z:[Fn,"auto",ue,ce]}],basis:[{basis:[ua,"full","auto",d,...q()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,ua,"auto","initial","none",ce]}],grow:[{grow:["",Oe,ue,ce]}],shrink:[{shrink:["",Oe,ue,ce]}],order:[{order:[Fn,"first","last","none",ue,ce]}],"grid-cols":[{"grid-cols":me()}],"col-start-end":[{col:ye()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":me()}],"row-start-end":[{row:ye()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:q()}],"gap-x":[{"gap-x":q()}],"gap-y":[{"gap-y":q()}],"justify-content":[{justify:[...ge(),"normal"]}],"justify-items":[{"justify-items":[...fe(),"normal"]}],"justify-self":[{"justify-self":["auto",...fe()]}],"align-content":[{content:["normal",...ge()]}],"align-items":[{items:[...fe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...fe(),{baseline:["","last"]}]}],"place-content":[{"place-content":ge()}],"place-items":[{"place-items":[...fe(),"baseline"]}],"place-self":[{"place-self":["auto",...fe()]}],p:[{p:q()}],px:[{px:q()}],py:[{py:q()}],ps:[{ps:q()}],pe:[{pe:q()}],pbs:[{pbs:q()}],pbe:[{pbe:q()}],pt:[{pt:q()}],pr:[{pr:q()}],pb:[{pb:q()}],pl:[{pl:q()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":q()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":q()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[d,"screen",...F()]}],"min-w":[{"min-w":[d,"screen","none",...F()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",a,_o,Ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,O2,C2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yh,ce]}],"font-family":[{font:[A2,T2,t]}],"font-features":[{"font-features":[ce]}],"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:[o,ue,ce]}],"line-clamp":[{"line-clamp":[Oe,"none",ue,a0]}],leading:[{leading:[c,...q()]}],"list-image":[{"list-image":["none",ue,ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ue,ce]}],"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:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",ue,Ya]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Oe,"auto",ue,ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:q()}],"tab-size":[{tab:[Fn,ue,ce]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ue,ce]}],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",ue,ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fn,ue,ce],radial:["",ue,ce],conic:[Fn,ue,ce]},k2,R2]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"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-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":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:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,ue,ce]}],"outline-w":[{outline:["",Oe,_o,Ya]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",v,kc,Nc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",g,kc,Nc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Oe,Ya]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",x,kc,Nc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Oe,ue,ce]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"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":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"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":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"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":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"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":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"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":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"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":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[ue,ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"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":L()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"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:k()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ue,ce]}],filter:[{filter:["","none",ue,ce]}],blur:[{blur:Te()}],brightness:[{brightness:[Oe,ue,ce]}],contrast:[{contrast:[Oe,ue,ce]}],"drop-shadow":[{"drop-shadow":["","none",S,kc,Nc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Oe,ue,ce]}],"hue-rotate":[{"hue-rotate":[Oe,ue,ce]}],invert:[{invert:["",Oe,ue,ce]}],saturate:[{saturate:[Oe,ue,ce]}],sepia:[{sepia:["",Oe,ue,ce]}],"backdrop-filter":[{"backdrop-filter":["","none",ue,ce]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,ue,ce]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,ue,ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,ue,ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,ue,ce]}],"backdrop-invert":[{"backdrop-invert":["",Oe,ue,ce]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,ue,ce]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,ue,ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,ue,ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":q()}],"border-spacing-x":[{"border-spacing-x":q()}],"border-spacing-y":[{"border-spacing-y":q()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ue,ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",ue,ce]}],ease:[{ease:["linear","initial",T,ue,ce]}],delay:[{delay:[Oe,ue,ce]}],animate:[{animate:["none",A,ue,ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,ue,ce]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:rt()}],"skew-x":[{"skew-x":rt()}],"skew-y":[{"skew-y":rt()}],transform:[{transform:[ue,ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],zoom:[{zoom:[Fn,ue,ce]}],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",ue,ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":H()}],"scrollbar-track-color":[{"scrollbar-track":H()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":q()}],"scroll-mx":[{"scroll-mx":q()}],"scroll-my":[{"scroll-my":q()}],"scroll-ms":[{"scroll-ms":q()}],"scroll-me":[{"scroll-me":q()}],"scroll-mbs":[{"scroll-mbs":q()}],"scroll-mbe":[{"scroll-mbe":q()}],"scroll-mt":[{"scroll-mt":q()}],"scroll-mr":[{"scroll-mr":q()}],"scroll-mb":[{"scroll-mb":q()}],"scroll-ml":[{"scroll-ml":q()}],"scroll-p":[{"scroll-p":q()}],"scroll-px":[{"scroll-px":q()}],"scroll-py":[{"scroll-py":q()}],"scroll-ps":[{"scroll-ps":q()}],"scroll-pe":[{"scroll-pe":q()}],"scroll-pbs":[{"scroll-pbs":q()}],"scroll-pbe":[{"scroll-pbe":q()}],"scroll-pt":[{"scroll-pt":q()}],"scroll-pr":[{"scroll-pr":q()}],"scroll-pb":[{"scroll-pb":q()}],"scroll-pl":[{"scroll-pl":q()}],"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",ue,ce]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Oe,_o,Ya,a0]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},D2=d2(M2);function ke(...e){return D2(qw(e))}const L2=Rm("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Xt=y.forwardRef(({className:e,variant:t,size:a,asChild:s=!1,...o},c)=>{const u=s?zO:"button";return b.jsx(u,{className:ke(L2({variant:t,size:a,className:e})),ref:c,...o})});Xt.displayName="Button";function U2(){const{loginWithGoogle:e,error:t,loading:a}=Zo();return b.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-4",children:b.jsxs("div",{className:"w-full max-w-sm",children:[b.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[b.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary flex items-center justify-center shadow-lg",children:b.jsx(Cm,{className:"w-7 h-7 text-primary-foreground"})}),b.jsx("div",{className:"text-center leading-tight",children:b.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Tablero CDC"})})]}),b.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm",children:[b.jsxs(Xt,{onClick:e,disabled:a,className:"w-full gap-2.5 h-10 rounded-full font-medium",children:[b.jsxs("svg",{"aria-hidden":"true",className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[b.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),b.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),b.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),b.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Entrar con Google"]}),t&&b.jsx("div",{className:"mt-4 rounded-lg bg-destructive/10 border border-destructive/20 px-4 py-3",children:b.jsx("p",{className:"text-sm text-destructive text-center leading-snug",children:t})})]}),b.jsxs("p",{className:"text-center text-xs text-muted-foreground mt-6",children:["Solo acceso para usuarios ",b.jsx("span",{className:"font-medium",children:"@gomezleemarketing.com"})]})]})})}const Qn=y.forwardRef(({className:e,type:t,...a},s)=>b.jsx("input",{type:t,className:ke("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...a}));Qn.displayName="Input";function be(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e==null||e(o),a===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function P2(e,t){const a=y.createContext(t),s=c=>{const{children:u,...d}=c,h=y.useMemo(()=>d,Object.values(d));return b.jsx(a.Provider,{value:h,children:u})};s.displayName=e+"Provider";function o(c){const u=y.useContext(a);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[s,o]}function wa(e,t=[]){let a=[];function s(c,u){const d=y.createContext(u),h=a.length;a=[...a,u];const p=g=>{var T;const{scope:x,children:S,..._}=g,E=((T=x==null?void 0:x[e])==null?void 0:T[h])||d,R=y.useMemo(()=>_,Object.values(_));return b.jsx(E.Provider,{value:R,children:S})};p.displayName=c+"Provider";function v(g,x){var E;const S=((E=x==null?void 0:x[e])==null?void 0:E[h])||d,_=y.useContext(S);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[p,v]}const o=()=>{const c=a.map(u=>y.createContext(u));return function(d){const h=(d==null?void 0:d[e])||c;return y.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return o.scopeName=e,[s,z2(o,...t)]}function z2(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const u=s.reduce((d,{useScope:h,scopeName:p})=>{const g=h(c)[`__scope${p}`];return{...d,...g}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return a.scopeName=t.scopeName,a}var gt=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},B2=hm[" useInsertionEffect ".trim().toString()]||gt;function pi({prop:e,defaultProp:t,onChange:a=()=>{},caller:s}){const[o,c,u]=I2({defaultProp:t,onChange:a}),d=e!==void 0,h=d?e:o;{const v=y.useRef(e!==void 0);y.useEffect(()=>{const g=v.current;g!==d&&console.warn(`${s} is changing from ${g?"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,s])}const p=y.useCallback(v=>{var g;if(d){const x=$2(v)?v(e):v;x!==e&&((g=u.current)==null||g.call(u,x))}else c(v)},[d,e,c,u]);return[h,p]}function I2({defaultProp:e,onChange:t}){const[a,s]=y.useState(e),o=y.useRef(a),c=y.useRef(t);return B2(()=>{c.current=t},[t]),y.useEffect(()=>{var u;o.current!==a&&((u=c.current)==null||u.call(c,a),o.current=a)},[a,o]),[a,s,c]}function $2(e){return typeof e=="function"}function H2(e){const t=q2(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(V2);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function q2(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=F2(o),d=K2(c,o.props);return o.type!==y.Fragment&&(d.ref=s?Dr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var G2=Symbol("radix.slottable");function V2(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===G2}function K2(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function F2(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Y2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=Y2.reduce((e,t)=>{const a=H2(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function ax(e,t){e&&Jo.flushSync(()=>e.dispatchEvent(t))}function o0(e){const t=W2(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(J2);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function W2(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=Z2(o),d=Q2(c,o.props);return o.type!==y.Fragment&&(d.ref=s?Dr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var X2=Symbol("radix.slottable");function J2(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===X2}function Q2(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function Z2(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function km(e){const t=e+"CollectionProvider",[a,s]=wa(t),[o,c]=a(t,{collectionRef:{current:null},itemMap:new Map}),u=E=>{const{scope:R,children:T}=E,A=ae.useRef(null),N=ae.useRef(new Map).current;return b.jsx(o,{scope:R,itemMap:N,collectionRef:A,children:T})};u.displayName=t;const d=e+"CollectionSlot",h=o0(d),p=ae.forwardRef((E,R)=>{const{scope:T,children:A}=E,N=c(d,T),L=qe(R,N.collectionRef);return b.jsx(h,{ref:L,children:A})});p.displayName=d;const v=e+"CollectionItemSlot",g="data-radix-collection-item",x=o0(v),S=ae.forwardRef((E,R)=>{const{scope:T,children:A,...N}=E,L=ae.useRef(null),G=qe(R,L),V=c(v,T);return ae.useEffect(()=>(V.itemMap.set(L,{ref:L,...N}),()=>void V.itemMap.delete(L))),b.jsx(x,{[g]:"",ref:G,children:A})});S.displayName=v;function _(E){const R=c(e+"CollectionConsumer",E);return ae.useCallback(()=>{const A=R.collectionRef.current;if(!A)return[];const N=Array.from(A.querySelectorAll(`[${g}]`));return Array.from(R.itemMap.values()).sort((V,P)=>N.indexOf(V.ref.current)-N.indexOf(P.ref.current))},[R.collectionRef,R.itemMap])}return[{Provider:u,Slot:p,ItemSlot:S},_,s]}var ej=y.createContext(void 0);function Om(e){const t=y.useContext(ej);return e||t||"ltr"}function Un(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...a)=>{var s;return(s=t.current)==null?void 0:s.call(t,...a)},[])}function tj(e,t=globalThis==null?void 0:globalThis.document){const a=Un(e);y.useEffect(()=>{const s=o=>{o.key==="Escape"&&a(o)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[a,t])}var nj="DismissableLayer",Wh="dismissableLayer.update",rj="dismissableLayer.pointerDownOutside",aj="dismissableLayer.focusOutside",l0,sx=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ru=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...h}=e,p=y.useContext(sx),[v,g]=y.useState(null),x=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=y.useState({}),_=qe(t,P=>g(P)),E=Array.from(p.layers),[R]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=E.indexOf(R),A=v?E.indexOf(v):-1,N=p.layersWithOutsidePointerEventsDisabled.size>0,L=A>=T,G=oj(P=>{const q=P.target,re=[...p.branches].some(me=>me.contains(q));!L||re||(o==null||o(P),u==null||u(P),P.defaultPrevented||d==null||d())},x),V=lj(P=>{const q=P.target;[...p.branches].some(me=>me.contains(q))||(c==null||c(P),u==null||u(P),P.defaultPrevented||d==null||d())},x);return tj(P=>{A===p.layers.size-1&&(s==null||s(P),!P.defaultPrevented&&d&&(P.preventDefault(),d()))},x),y.useEffect(()=>{if(v)return a&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(l0=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),c0(),()=>{a&&p.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=l0)}},[v,x,a,p]),y.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),c0())},[v,p]),y.useEffect(()=>{const P=()=>S({});return document.addEventListener(Wh,P),()=>document.removeEventListener(Wh,P)},[]),b.jsx(De.div,{...h,ref:_,style:{pointerEvents:N?L?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,V.onFocusCapture),onBlurCapture:be(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,G.onPointerDownCapture)})});Ru.displayName=nj;var sj="DismissableLayerBranch",ij=y.forwardRef((e,t)=>{const a=y.useContext(sx),s=y.useRef(null),o=qe(t,s);return y.useEffect(()=>{const c=s.current;if(c)return a.branches.add(c),()=>{a.branches.delete(c)}},[a.branches]),b.jsx(De.div,{...e,ref:o})});ij.displayName=sj;function oj(e,t=globalThis==null?void 0:globalThis.document){const a=Un(e),s=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const c=d=>{if(d.target&&!s.current){let h=function(){ix(rj,a,p,{discrete:!0})};const p={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);s.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",c),t.removeEventListener("click",o.current)}},[t,a]),{onPointerDownCapture:()=>s.current=!0}}function lj(e,t=globalThis==null?void 0:globalThis.document){const a=Un(e),s=y.useRef(!1);return y.useEffect(()=>{const o=c=>{c.target&&!s.current&&ix(aj,a,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function c0(){const e=new CustomEvent(Wh);document.dispatchEvent(e)}function ix(e,t,a,{discrete:s}){const o=a.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&o.addEventListener(e,t,{once:!0}),s?ax(o,c):o.dispatchEvent(c)}var bh=0;function jm(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??u0()),document.body.insertAdjacentElement("beforeend",e[1]??u0()),bh++,()=>{bh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),bh--}},[])}function u0(){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 wh="focusScope.autoFocusOnMount",xh="focusScope.autoFocusOnUnmount",d0={bubbles:!1,cancelable:!0},cj="FocusScope",Au=y.forwardRef((e,t)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...u}=e,[d,h]=y.useState(null),p=Un(o),v=Un(c),g=y.useRef(null),x=qe(t,E=>h(E)),S=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(s){let E=function(N){if(S.paused||!d)return;const L=N.target;d.contains(L)?g.current=L:fa(g.current,{select:!0})},R=function(N){if(S.paused||!d)return;const L=N.relatedTarget;L!==null&&(d.contains(L)||fa(g.current,{select:!0}))},T=function(N){if(document.activeElement===document.body)for(const G of N)G.removedNodes.length>0&&fa(d)};document.addEventListener("focusin",E),document.addEventListener("focusout",R);const A=new MutationObserver(T);return d&&A.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",R),A.disconnect()}}},[s,d,S.paused]),y.useEffect(()=>{if(d){h0.add(S);const E=document.activeElement;if(!d.contains(E)){const T=new CustomEvent(wh,d0);d.addEventListener(wh,p),d.dispatchEvent(T),T.defaultPrevented||(uj(pj(ox(d)),{select:!0}),document.activeElement===E&&fa(d))}return()=>{d.removeEventListener(wh,p),setTimeout(()=>{const T=new CustomEvent(xh,d0);d.addEventListener(xh,v),d.dispatchEvent(T),T.defaultPrevented||fa(E??document.body,{select:!0}),d.removeEventListener(xh,v),h0.remove(S)},0)}}},[d,p,v,S]);const _=y.useCallback(E=>{if(!a&&!s||S.paused)return;const R=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,T=document.activeElement;if(R&&T){const A=E.currentTarget,[N,L]=dj(A);N&&L?!E.shiftKey&&T===L?(E.preventDefault(),a&&fa(N,{select:!0})):E.shiftKey&&T===N&&(E.preventDefault(),a&&fa(L,{select:!0})):T===A&&E.preventDefault()}},[a,s,S.paused]);return b.jsx(De.div,{tabIndex:-1,...u,ref:x,onKeyDown:_})});Au.displayName=cj;function uj(e,{select:t=!1}={}){const a=document.activeElement;for(const s of e)if(fa(s,{select:t}),document.activeElement!==a)return}function dj(e){const t=ox(e),a=f0(t,e),s=f0(t.reverse(),e);return[a,s]}function ox(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function f0(e,t){for(const a of e)if(!fj(a,{upTo:t}))return a}function fj(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 hj(e){return e instanceof HTMLInputElement&&"select"in e}function fa(e,{select:t=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&hj(e)&&t&&e.select()}}var h0=mj();function mj(){let e=[];return{add(t){const a=e[0];t!==a&&(a==null||a.pause()),e=m0(e,t),e.unshift(t)},remove(t){var a;e=m0(e,t),(a=e[0])==null||a.resume()}}}function m0(e,t){const a=[...e],s=a.indexOf(t);return s!==-1&&a.splice(s,1),a}function pj(e){return e.filter(t=>t.tagName!=="A")}var gj=hm[" useId ".trim().toString()]||(()=>{}),vj=0;function Rr(e){const[t,a]=y.useState(gj());return gt(()=>{a(s=>s??String(vj++))},[e]),t?`radix-${t}`:""}const yj=["top","right","bottom","left"],va=Math.min,on=Math.max,uu=Math.round,Oc=Math.floor,tr=e=>({x:e,y:e}),bj={left:"right",right:"left",bottom:"top",top:"bottom"};function Xh(e,t,a){return on(e,va(t,a))}function Nr(e,t){return typeof e=="function"?e(t):e}function kr(e){return e.split("-")[0]}function Si(e){return e.split("-")[1]}function Mm(e){return e==="x"?"y":"x"}function Dm(e){return e==="y"?"height":"width"}function er(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Lm(e){return Mm(er(e))}function wj(e,t,a){a===void 0&&(a=!1);const s=Si(e),o=Lm(e),c=Dm(o);let u=o==="x"?s===(a?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=du(u)),[u,du(u)]}function xj(e){const t=du(e);return[Jh(e),t,Jh(t)]}function Jh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const p0=["left","right"],g0=["right","left"],Sj=["top","bottom"],_j=["bottom","top"];function Ej(e,t,a){switch(e){case"top":case"bottom":return a?t?g0:p0:t?p0:g0;case"left":case"right":return t?Sj:_j;default:return[]}}function Cj(e,t,a,s){const o=Si(e);let c=Ej(kr(e),a==="start",s);return o&&(c=c.map(u=>u+"-"+o),t&&(c=c.concat(c.map(Jh)))),c}function du(e){const t=kr(e);return bj[t]+e.slice(t.length)}function Tj(e){return{top:0,right:0,bottom:0,left:0,...e}}function lx(e){return typeof e!="number"?Tj(e):{top:e,right:e,bottom:e,left:e}}function fu(e){const{x:t,y:a,width:s,height:o}=e;return{width:s,height:o,top:a,left:t,right:t+s,bottom:a+o,x:t,y:a}}function v0(e,t,a){let{reference:s,floating:o}=e;const c=er(t),u=Lm(t),d=Dm(u),h=kr(t),p=c==="y",v=s.x+s.width/2-o.width/2,g=s.y+s.height/2-o.height/2,x=s[d]/2-o[d]/2;let S;switch(h){case"top":S={x:v,y:s.y-o.height};break;case"bottom":S={x:v,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:g};break;case"left":S={x:s.x-o.width,y:g};break;default:S={x:s.x,y:s.y}}switch(Si(t)){case"start":S[u]-=x*(a&&p?-1:1);break;case"end":S[u]+=x*(a&&p?-1:1);break}return S}async function Rj(e,t){var a;t===void 0&&(t={});const{x:s,y:o,platform:c,rects:u,elements:d,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:v="viewport",elementContext:g="floating",altBoundary:x=!1,padding:S=0}=Nr(t,e),_=lx(S),R=d[x?g==="floating"?"reference":"floating":g],T=fu(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(R)))==null||a?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(d.floating)),boundary:p,rootBoundary:v,strategy:h})),A=g==="floating"?{x:s,y:o,width:u.floating.width,height:u.floating.height}:u.reference,N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d.floating)),L=await(c.isElement==null?void 0:c.isElement(N))?await(c.getScale==null?void 0:c.getScale(N))||{x:1,y:1}:{x:1,y:1},G=fu(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:A,offsetParent:N,strategy:h}):A);return{top:(T.top-G.top+_.top)/L.y,bottom:(G.bottom-T.bottom+_.bottom)/L.y,left:(T.left-G.left+_.left)/L.x,right:(G.right-T.right+_.right)/L.x}}const Aj=50,Nj=async(e,t,a)=>{const{placement:s="bottom",strategy:o="absolute",middleware:c=[],platform:u}=a,d=u.detectOverflow?u:{...u,detectOverflow:Rj},h=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:v,y:g}=v0(p,s,h),x=s,S=0;const _={};for(let E=0;E<c.length;E++){const R=c[E];if(!R)continue;const{name:T,fn:A}=R,{x:N,y:L,data:G,reset:V}=await A({x:v,y:g,initialPlacement:s,placement:x,strategy:o,middlewareData:_,rects:p,platform:d,elements:{reference:e,floating:t}});v=N??v,g=L??g,_[T]={..._[T],...G},V&&S<Aj&&(S++,typeof V=="object"&&(V.placement&&(x=V.placement),V.rects&&(p=V.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):V.rects),{x:v,y:g}=v0(p,x,h)),E=-1)}return{x:v,y:g,placement:x,strategy:o,middlewareData:_}},kj=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:s,placement:o,rects:c,platform:u,elements:d,middlewareData:h}=t,{element:p,padding:v=0}=Nr(e,t)||{};if(p==null)return{};const g=lx(v),x={x:a,y:s},S=Lm(o),_=Dm(S),E=await u.getDimensions(p),R=S==="y",T=R?"top":"left",A=R?"bottom":"right",N=R?"clientHeight":"clientWidth",L=c.reference[_]+c.reference[S]-x[S]-c.floating[_],G=x[S]-c.reference[S],V=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let P=V?V[N]:0;(!P||!await(u.isElement==null?void 0:u.isElement(V)))&&(P=d.floating[N]||c.floating[_]);const q=L/2-G/2,re=P/2-E[_]/2-1,me=va(g[T],re),ye=va(g[A],re),oe=me,de=P-E[_]-ye,ge=P/2-E[_]/2+q,fe=Xh(oe,ge,de),j=!h.arrow&&Si(o)!=null&&ge!==fe&&c.reference[_]/2-(ge<oe?me:ye)-E[_]/2<0,F=j?ge<oe?ge-oe:ge-de:0;return{[S]:x[S]+F,data:{[S]:fe,centerOffset:ge-fe-F,...j&&{alignmentOffset:F}},reset:j}}}),Oj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,s;const{placement:o,middlewareData:c,rects:u,initialPlacement:d,platform:h,elements:p}=t,{mainAxis:v=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:E=!0,...R}=Nr(e,t);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const T=kr(o),A=er(d),N=kr(d)===d,L=await(h.isRTL==null?void 0:h.isRTL(p.floating)),G=x||(N||!E?[du(d)]:xj(d)),V=_!=="none";!x&&V&&G.push(...Cj(d,E,_,L));const P=[d,...G],q=await h.detectOverflow(t,R),re=[];let me=((s=c.flip)==null?void 0:s.overflows)||[];if(v&&re.push(q[T]),g){const ge=wj(o,u,L);re.push(q[ge[0]],q[ge[1]])}if(me=[...me,{placement:o,overflows:re}],!re.every(ge=>ge<=0)){var ye,oe;const ge=(((ye=c.flip)==null?void 0:ye.index)||0)+1,fe=P[ge];if(fe&&(!(g==="alignment"?A!==er(fe):!1)||me.every(J=>er(J.placement)===A?J.overflows[0]>0:!0)))return{data:{index:ge,overflows:me},reset:{placement:fe}};let j=(oe=me.filter(F=>F.overflows[0]<=0).sort((F,J)=>F.overflows[1]-J.overflows[1])[0])==null?void 0:oe.placement;if(!j)switch(S){case"bestFit":{var de;const F=(de=me.filter(J=>{if(V){const ee=er(J.placement);return ee===A||ee==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(ee=>ee>0).reduce((ee,H)=>ee+H,0)]).sort((J,ee)=>J[1]-ee[1])[0])==null?void 0:de[0];F&&(j=F);break}case"initialPlacement":j=d;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function y0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function b0(e){return yj.some(t=>e[t]>=0)}const jj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:s}=t,{strategy:o="referenceHidden",...c}=Nr(e,t);switch(o){case"referenceHidden":{const u=await s.detectOverflow(t,{...c,elementContext:"reference"}),d=y0(u,a.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:b0(d)}}}case"escaped":{const u=await s.detectOverflow(t,{...c,altBoundary:!0}),d=y0(u,a.floating);return{data:{escapedOffsets:d,escaped:b0(d)}}}default:return{}}}}},cx=new Set(["left","top"]);async function Mj(e,t){const{placement:a,platform:s,elements:o}=e,c=await(s.isRTL==null?void 0:s.isRTL(o.floating)),u=kr(a),d=Si(a),h=er(a)==="y",p=cx.has(u)?-1:1,v=c&&h?-1:1,g=Nr(t,e);let{mainAxis:x,crossAxis:S,alignmentAxis:_}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof _=="number"&&(S=d==="end"?_*-1:_),h?{x:S*v,y:x*p}:{x:x*p,y:S*v}}const Dj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,s;const{x:o,y:c,placement:u,middlewareData:d}=t,h=await Mj(t,e);return u===((a=d.offset)==null?void 0:a.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:o+h.x,y:c+h.y,data:{...h,placement:u}}}}},Lj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:s,placement:o,platform:c}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:h={fn:T=>{let{x:A,y:N}=T;return{x:A,y:N}}},...p}=Nr(e,t),v={x:a,y:s},g=await c.detectOverflow(t,p),x=er(kr(o)),S=Mm(x);let _=v[S],E=v[x];if(u){const T=S==="y"?"top":"left",A=S==="y"?"bottom":"right",N=_+g[T],L=_-g[A];_=Xh(N,_,L)}if(d){const T=x==="y"?"top":"left",A=x==="y"?"bottom":"right",N=E+g[T],L=E-g[A];E=Xh(N,E,L)}const R=h.fn({...t,[S]:_,[x]:E});return{...R,data:{x:R.x-a,y:R.y-s,enabled:{[S]:u,[x]:d}}}}}},Uj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:a,y:s,placement:o,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=Nr(e,t),v={x:a,y:s},g=er(o),x=Mm(g);let S=v[x],_=v[g];const E=Nr(d,t),R=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:0,crossAxis:0,...E};if(h){const N=x==="y"?"height":"width",L=c.reference[x]-c.floating[N]+R.mainAxis,G=c.reference[x]+c.reference[N]-R.mainAxis;S<L?S=L:S>G&&(S=G)}if(p){var T,A;const N=x==="y"?"width":"height",L=cx.has(kr(o)),G=c.reference[g]-c.floating[N]+(L&&((T=u.offset)==null?void 0:T[g])||0)+(L?0:R.crossAxis),V=c.reference[g]+c.reference[N]+(L?0:((A=u.offset)==null?void 0:A[g])||0)-(L?R.crossAxis:0);_<G?_=G:_>V&&(_=V)}return{[x]:S,[g]:_}}}},Pj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var a,s;const{placement:o,rects:c,platform:u,elements:d}=t,{apply:h=()=>{},...p}=Nr(e,t),v=await u.detectOverflow(t,p),g=kr(o),x=Si(o),S=er(o)==="y",{width:_,height:E}=c.floating;let R,T;g==="top"||g==="bottom"?(R=g,T=x===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(T=g,R=x==="end"?"top":"bottom");const A=E-v.top-v.bottom,N=_-v.left-v.right,L=va(E-v[R],A),G=va(_-v[T],N),V=!t.middlewareData.shift;let P=L,q=G;if((a=t.middlewareData.shift)!=null&&a.enabled.x&&(q=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(P=A),V&&!x){const me=on(v.left,0),ye=on(v.right,0),oe=on(v.top,0),de=on(v.bottom,0);S?q=_-2*(me!==0||ye!==0?me+ye:on(v.left,v.right)):P=E-2*(oe!==0||de!==0?oe+de:on(v.top,v.bottom))}await h({...t,availableWidth:q,availableHeight:P});const re=await u.getDimensions(d.floating);return _!==re.width||E!==re.height?{reset:{rects:!0}}:{}}}};function Nu(){return typeof window<"u"}function _i(e){return ux(e)?(e.nodeName||"").toLowerCase():"#document"}function cn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rr(e){var t;return(t=(ux(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ux(e){return Nu()?e instanceof Node||e instanceof cn(e).Node:!1}function Pn(e){return Nu()?e instanceof Element||e instanceof cn(e).Element:!1}function Lr(e){return Nu()?e instanceof HTMLElement||e instanceof cn(e).HTMLElement:!1}function w0(e){return!Nu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof cn(e).ShadowRoot}function el(e){const{overflow:t,overflowX:a,overflowY:s,display:o}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+a)&&o!=="inline"&&o!=="contents"}function zj(e){return/^(table|td|th)$/.test(_i(e))}function ku(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Bj=/transform|translate|scale|rotate|perspective|filter/,Ij=/paint|layout|strict|content/,Wa=e=>!!e&&e!=="none";let Sh;function Um(e){const t=Pn(e)?zn(e):e;return Wa(t.transform)||Wa(t.translate)||Wa(t.scale)||Wa(t.rotate)||Wa(t.perspective)||!Pm()&&(Wa(t.backdropFilter)||Wa(t.filter))||Bj.test(t.willChange||"")||Ij.test(t.contain||"")}function $j(e){let t=ya(e);for(;Lr(t)&&!gi(t);){if(Um(t))return t;if(ku(t))return null;t=ya(t)}return null}function Pm(){return Sh==null&&(Sh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Sh}function gi(e){return/^(html|body|#document)$/.test(_i(e))}function zn(e){return cn(e).getComputedStyle(e)}function Ou(e){return Pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ya(e){if(_i(e)==="html")return e;const t=e.assignedSlot||e.parentNode||w0(e)&&e.host||rr(e);return w0(t)?t.host:t}function dx(e){const t=ya(e);return gi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lr(t)&&el(t)?t:dx(t)}function qo(e,t,a){var s;t===void 0&&(t=[]),a===void 0&&(a=!0);const o=dx(e),c=o===((s=e.ownerDocument)==null?void 0:s.body),u=cn(o);if(c){const d=Qh(u);return t.concat(u,u.visualViewport||[],el(o)?o:[],d&&a?qo(d):[])}else return t.concat(o,qo(o,[],a))}function Qh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fx(e){const t=zn(e);let a=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Lr(e),c=o?e.offsetWidth:a,u=o?e.offsetHeight:s,d=uu(a)!==c||uu(s)!==u;return d&&(a=c,s=u),{width:a,height:s,$:d}}function zm(e){return Pn(e)?e:e.contextElement}function fi(e){const t=zm(e);if(!Lr(t))return tr(1);const a=t.getBoundingClientRect(),{width:s,height:o,$:c}=fx(t);let u=(c?uu(a.width):a.width)/s,d=(c?uu(a.height):a.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const Hj=tr(0);function hx(e){const t=cn(e);return!Pm()||!t.visualViewport?Hj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qj(e,t,a){return t===void 0&&(t=!1),!a||t&&a!==cn(e)?!1:t}function ts(e,t,a,s){t===void 0&&(t=!1),a===void 0&&(a=!1);const o=e.getBoundingClientRect(),c=zm(e);let u=tr(1);t&&(s?Pn(s)&&(u=fi(s)):u=fi(e));const d=qj(c,a,s)?hx(c):tr(0);let h=(o.left+d.x)/u.x,p=(o.top+d.y)/u.y,v=o.width/u.x,g=o.height/u.y;if(c){const x=cn(c),S=s&&Pn(s)?cn(s):s;let _=x,E=Qh(_);for(;E&&s&&S!==_;){const R=fi(E),T=E.getBoundingClientRect(),A=zn(E),N=T.left+(E.clientLeft+parseFloat(A.paddingLeft))*R.x,L=T.top+(E.clientTop+parseFloat(A.paddingTop))*R.y;h*=R.x,p*=R.y,v*=R.x,g*=R.y,h+=N,p+=L,_=cn(E),E=Qh(_)}}return fu({width:v,height:g,x:h,y:p})}function ju(e,t){const a=Ou(e).scrollLeft;return t?t.left+a:ts(rr(e)).left+a}function mx(e,t){const a=e.getBoundingClientRect(),s=a.left+t.scrollLeft-ju(e,a),o=a.top+t.scrollTop;return{x:s,y:o}}function Gj(e){let{elements:t,rect:a,offsetParent:s,strategy:o}=e;const c=o==="fixed",u=rr(s),d=t?ku(t.floating):!1;if(s===u||d&&c)return a;let h={scrollLeft:0,scrollTop:0},p=tr(1);const v=tr(0),g=Lr(s);if((g||!g&&!c)&&((_i(s)!=="body"||el(u))&&(h=Ou(s)),g)){const S=ts(s);p=fi(s),v.x=S.x+s.clientLeft,v.y=S.y+s.clientTop}const x=u&&!g&&!c?mx(u,h):tr(0);return{width:a.width*p.x,height:a.height*p.y,x:a.x*p.x-h.scrollLeft*p.x+v.x+x.x,y:a.y*p.y-h.scrollTop*p.y+v.y+x.y}}function Vj(e){return Array.from(e.getClientRects())}function Kj(e){const t=rr(e),a=Ou(e),s=e.ownerDocument.body,o=on(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),c=on(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let u=-a.scrollLeft+ju(e);const d=-a.scrollTop;return zn(s).direction==="rtl"&&(u+=on(t.clientWidth,s.clientWidth)-o),{width:o,height:c,x:u,y:d}}const x0=25;function Fj(e,t){const a=cn(e),s=rr(e),o=a.visualViewport;let c=s.clientWidth,u=s.clientHeight,d=0,h=0;if(o){c=o.width,u=o.height;const v=Pm();(!v||v&&t==="fixed")&&(d=o.offsetLeft,h=o.offsetTop)}const p=ju(s);if(p<=0){const v=s.ownerDocument,g=v.body,x=getComputedStyle(g),S=v.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,_=Math.abs(s.clientWidth-g.clientWidth-S);_<=x0&&(c-=_)}else p<=x0&&(c+=p);return{width:c,height:u,x:d,y:h}}function Yj(e,t){const a=ts(e,!0,t==="fixed"),s=a.top+e.clientTop,o=a.left+e.clientLeft,c=Lr(e)?fi(e):tr(1),u=e.clientWidth*c.x,d=e.clientHeight*c.y,h=o*c.x,p=s*c.y;return{width:u,height:d,x:h,y:p}}function S0(e,t,a){let s;if(t==="viewport")s=Fj(e,a);else if(t==="document")s=Kj(rr(e));else if(Pn(t))s=Yj(t,a);else{const o=hx(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fu(s)}function px(e,t){const a=ya(e);return a===t||!Pn(a)||gi(a)?!1:zn(a).position==="fixed"||px(a,t)}function Wj(e,t){const a=t.get(e);if(a)return a;let s=qo(e,[],!1).filter(d=>Pn(d)&&_i(d)!=="body"),o=null;const c=zn(e).position==="fixed";let u=c?ya(e):e;for(;Pn(u)&&!gi(u);){const d=zn(u),h=Um(u);!h&&d.position==="fixed"&&(o=null),(c?!h&&!o:!h&&d.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||el(u)&&!h&&px(e,u))?s=s.filter(v=>v!==u):o=d,u=ya(u)}return t.set(e,s),s}function Xj(e){let{element:t,boundary:a,rootBoundary:s,strategy:o}=e;const u=[...a==="clippingAncestors"?ku(t)?[]:Wj(t,this._c):[].concat(a),s],d=S0(t,u[0],o);let h=d.top,p=d.right,v=d.bottom,g=d.left;for(let x=1;x<u.length;x++){const S=S0(t,u[x],o);h=on(S.top,h),p=va(S.right,p),v=va(S.bottom,v),g=on(S.left,g)}return{width:p-g,height:v-h,x:g,y:h}}function Jj(e){const{width:t,height:a}=fx(e);return{width:t,height:a}}function Qj(e,t,a){const s=Lr(t),o=rr(t),c=a==="fixed",u=ts(e,!0,c,t);let d={scrollLeft:0,scrollTop:0};const h=tr(0);function p(){h.x=ju(o)}if(s||!s&&!c)if((_i(t)!=="body"||el(o))&&(d=Ou(t)),s){const S=ts(t,!0,c,t);h.x=S.x+t.clientLeft,h.y=S.y+t.clientTop}else o&&p();c&&!s&&o&&p();const v=o&&!s&&!c?mx(o,d):tr(0),g=u.left+d.scrollLeft-h.x-v.x,x=u.top+d.scrollTop-h.y-v.y;return{x:g,y:x,width:u.width,height:u.height}}function _h(e){return zn(e).position==="static"}function _0(e,t){if(!Lr(e)||zn(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return rr(e)===a&&(a=a.ownerDocument.body),a}function gx(e,t){const a=cn(e);if(ku(e))return a;if(!Lr(e)){let o=ya(e);for(;o&&!gi(o);){if(Pn(o)&&!_h(o))return o;o=ya(o)}return a}let s=_0(e,t);for(;s&&zj(s)&&_h(s);)s=_0(s,t);return s&&gi(s)&&_h(s)&&!Um(s)?a:s||$j(e)||a}const Zj=async function(e){const t=this.getOffsetParent||gx,a=this.getDimensions,s=await a(e.floating);return{reference:Qj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function eM(e){return zn(e).direction==="rtl"}const tM={convertOffsetParentRelativeRectToViewportRelativeRect:Gj,getDocumentElement:rr,getClippingRect:Xj,getOffsetParent:gx,getElementRects:Zj,getClientRects:Vj,getDimensions:Jj,getScale:fi,isElement:Pn,isRTL:eM};function vx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nM(e,t){let a=null,s;const o=rr(e);function c(){var d;clearTimeout(s),(d=a)==null||d.disconnect(),a=null}function u(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),c();const p=e.getBoundingClientRect(),{left:v,top:g,width:x,height:S}=p;if(d||t(),!x||!S)return;const _=Oc(g),E=Oc(o.clientWidth-(v+x)),R=Oc(o.clientHeight-(g+S)),T=Oc(v),N={rootMargin:-_+"px "+-E+"px "+-R+"px "+-T+"px",threshold:on(0,va(1,h))||1};let L=!0;function G(V){const P=V[0].intersectionRatio;if(P!==h){if(!L)return u();P?u(!1,P):s=setTimeout(()=>{u(!1,1e-7)},1e3)}P===1&&!vx(p,e.getBoundingClientRect())&&u(),L=!1}try{a=new IntersectionObserver(G,{...N,root:o.ownerDocument})}catch{a=new IntersectionObserver(G,N)}a.observe(e)}return u(!0),c}function rM(e,t,a,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,p=zm(e),v=o||c?[...p?qo(p):[],...t?qo(t):[]]:[];v.forEach(T=>{o&&T.addEventListener("scroll",a,{passive:!0}),c&&T.addEventListener("resize",a)});const g=p&&d?nM(p,a):null;let x=-1,S=null;u&&(S=new ResizeObserver(T=>{let[A]=T;A&&A.target===p&&S&&t&&(S.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=S)==null||N.observe(t)})),a()}),p&&!h&&S.observe(p),t&&S.observe(t));let _,E=h?ts(e):null;h&&R();function R(){const T=ts(e);E&&!vx(E,T)&&a(),E=T,_=requestAnimationFrame(R)}return a(),()=>{var T;v.forEach(A=>{o&&A.removeEventListener("scroll",a),c&&A.removeEventListener("resize",a)}),g==null||g(),(T=S)==null||T.disconnect(),S=null,h&&cancelAnimationFrame(_)}}const aM=Dj,sM=Lj,iM=Oj,oM=Pj,lM=jj,E0=kj,cM=Uj,uM=(e,t,a)=>{const s=new Map,o={platform:tM,...a},c={...o.platform,_c:s};return Nj(e,t,{...o,platform:c})};var dM=typeof document<"u",fM=function(){},Yc=dM?y.useLayoutEffect:fM;function hu(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 a,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(s=a;s--!==0;)if(!hu(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),a=o.length,a!==Object.keys(t).length)return!1;for(s=a;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=a;s--!==0;){const c=o[s];if(!(c==="_owner"&&e.$$typeof)&&!hu(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function yx(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function C0(e,t){const a=yx(e);return Math.round(t*a)/a}function Eh(e){const t=y.useRef(e);return Yc(()=>{t.current=e}),t}function hM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:s=[],platform:o,elements:{reference:c,floating:u}={},transform:d=!0,whileElementsMounted:h,open:p}=e,[v,g]=y.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[x,S]=y.useState(s);hu(x,s)||S(s);const[_,E]=y.useState(null),[R,T]=y.useState(null),A=y.useCallback(J=>{J!==V.current&&(V.current=J,E(J))},[]),N=y.useCallback(J=>{J!==P.current&&(P.current=J,T(J))},[]),L=c||_,G=u||R,V=y.useRef(null),P=y.useRef(null),q=y.useRef(v),re=h!=null,me=Eh(h),ye=Eh(o),oe=Eh(p),de=y.useCallback(()=>{if(!V.current||!P.current)return;const J={placement:t,strategy:a,middleware:x};ye.current&&(J.platform=ye.current),uM(V.current,P.current,J).then(ee=>{const H={...ee,isPositioned:oe.current!==!1};ge.current&&!hu(q.current,H)&&(q.current=H,Jo.flushSync(()=>{g(H)}))})},[x,t,a,ye,oe]);Yc(()=>{p===!1&&q.current.isPositioned&&(q.current.isPositioned=!1,g(J=>({...J,isPositioned:!1})))},[p]);const ge=y.useRef(!1);Yc(()=>(ge.current=!0,()=>{ge.current=!1}),[]),Yc(()=>{if(L&&(V.current=L),G&&(P.current=G),L&&G){if(me.current)return me.current(L,G,de);de()}},[L,G,de,me,re]);const fe=y.useMemo(()=>({reference:V,floating:P,setReference:A,setFloating:N}),[A,N]),j=y.useMemo(()=>({reference:L,floating:G}),[L,G]),F=y.useMemo(()=>{const J={position:a,left:0,top:0};if(!j.floating)return J;const ee=C0(j.floating,v.x),H=C0(j.floating,v.y);return d?{...J,transform:"translate("+ee+"px, "+H+"px)",...yx(j.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:ee,top:H}},[a,d,j.floating,v.x,v.y]);return y.useMemo(()=>({...v,update:de,refs:fe,elements:j,floatingStyles:F}),[v,de,fe,j,F])}const mM=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:s,padding:o}=typeof e=="function"?e(a):e;return s&&t(s)?s.current!=null?E0({element:s.current,padding:o}).fn(a):{}:s?E0({element:s,padding:o}).fn(a):{}}}},pM=(e,t)=>{const a=aM(e);return{name:a.name,fn:a.fn,options:[e,t]}},gM=(e,t)=>{const a=sM(e);return{name:a.name,fn:a.fn,options:[e,t]}},vM=(e,t)=>({fn:cM(e).fn,options:[e,t]}),yM=(e,t)=>{const a=iM(e);return{name:a.name,fn:a.fn,options:[e,t]}},bM=(e,t)=>{const a=oM(e);return{name:a.name,fn:a.fn,options:[e,t]}},wM=(e,t)=>{const a=lM(e);return{name:a.name,fn:a.fn,options:[e,t]}},xM=(e,t)=>{const a=mM(e);return{name:a.name,fn:a.fn,options:[e,t]}};var SM="Arrow",bx=y.forwardRef((e,t)=>{const{children:a,width:s=10,height:o=5,...c}=e;return b.jsx(De.svg,{...c,ref:t,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});bx.displayName=SM;var _M=bx;function wx(e){const[t,a]=y.useState(void 0);return gt(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const c=o[0];let u,d;if("borderBoxSize"in c){const h=c.borderBoxSize,p=Array.isArray(h)?h[0]:h;u=p.inlineSize,d=p.blockSize}else u=e.offsetWidth,d=e.offsetHeight;a({width:u,height:d})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else a(void 0)},[e]),t}var Bm="Popper",[xx,Mu]=wa(Bm),[EM,Sx]=xx(Bm),_x=e=>{const{__scopePopper:t,children:a}=e,[s,o]=y.useState(null);return b.jsx(EM,{scope:t,anchor:s,onAnchorChange:o,children:a})};_x.displayName=Bm;var Ex="PopperAnchor",Cx=y.forwardRef((e,t)=>{const{__scopePopper:a,virtualRef:s,...o}=e,c=Sx(Ex,a),u=y.useRef(null),d=qe(t,u),h=y.useRef(null);return y.useEffect(()=>{const p=h.current;h.current=(s==null?void 0:s.current)||u.current,p!==h.current&&c.onAnchorChange(h.current)}),s?null:b.jsx(De.div,{...o,ref:d})});Cx.displayName=Ex;var Im="PopperContent",[CM,TM]=xx(Im),Tx=y.forwardRef((e,t)=>{var te,se,ie,Te,Re,Ee;const{__scopePopper:a,side:s="bottom",sideOffset:o=0,align:c="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:v=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:S="optimized",onPlaced:_,...E}=e,R=Sx(Im,a),[T,A]=y.useState(null),N=qe(t,rt=>A(rt)),[L,G]=y.useState(null),V=wx(L),P=(V==null?void 0:V.width)??0,q=(V==null?void 0:V.height)??0,re=s+(c!=="center"?"-"+c:""),me=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},ye=Array.isArray(p)?p:[p],oe=ye.length>0,de={padding:me,boundary:ye.filter(AM),altBoundary:oe},{refs:ge,floatingStyles:fe,placement:j,isPositioned:F,middlewareData:J}=hM({strategy:"fixed",placement:re,whileElementsMounted:(...rt)=>rM(...rt,{animationFrame:S==="always"}),elements:{reference:R.anchor},middleware:[pM({mainAxis:o+q,alignmentAxis:u}),h&&gM({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?vM():void 0,...de}),h&&yM({...de}),bM({...de,apply:({elements:rt,rects:Fe,availableWidth:Cn,availableHeight:un})=>{const{width:Jt,height:_a}=Fe.reference,vt=rt.floating.style;vt.setProperty("--radix-popper-available-width",`${Cn}px`),vt.setProperty("--radix-popper-available-height",`${un}px`),vt.setProperty("--radix-popper-anchor-width",`${Jt}px`),vt.setProperty("--radix-popper-anchor-height",`${_a}px`)}}),L&&xM({element:L,padding:d}),NM({arrowWidth:P,arrowHeight:q}),x&&wM({strategy:"referenceHidden",...de})]}),[ee,H]=Nx(j),k=Un(_);gt(()=>{F&&(k==null||k())},[F,k]);const I=(te=J.arrow)==null?void 0:te.x,D=(se=J.arrow)==null?void 0:se.y,Y=((ie=J.arrow)==null?void 0:ie.centerOffset)!==0,[Q,ne]=y.useState();return gt(()=>{T&&ne(window.getComputedStyle(T).zIndex)},[T]),b.jsx("div",{ref:ge.setFloating,"data-radix-popper-content-wrapper":"",style:{...fe,transform:F?fe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(Te=J.transformOrigin)==null?void 0:Te.x,(Re=J.transformOrigin)==null?void 0:Re.y].join(" "),...((Ee=J.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(CM,{scope:a,placedSide:ee,onArrowChange:G,arrowX:I,arrowY:D,shouldHideArrow:Y,children:b.jsx(De.div,{"data-side":ee,"data-align":H,...E,ref:N,style:{...E.style,animation:F?void 0:"none"}})})})});Tx.displayName=Im;var Rx="PopperArrow",RM={top:"bottom",right:"left",bottom:"top",left:"right"},Ax=y.forwardRef(function(t,a){const{__scopePopper:s,...o}=t,c=TM(Rx,s),u=RM[c.placedSide];return b.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:b.jsx(_M,{...o,ref:a,style:{...o.style,display:"block"}})})});Ax.displayName=Rx;function AM(e){return e!==null}var NM=e=>({name:"transformOrigin",options:e,fn(t){var R,T,A;const{placement:a,rects:s,middlewareData:o}=t,u=((R=o.arrow)==null?void 0:R.centerOffset)!==0,d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[p,v]=Nx(a),g={start:"0%",center:"50%",end:"100%"}[v],x=(((T=o.arrow)==null?void 0:T.x)??0)+d/2,S=(((A=o.arrow)==null?void 0:A.y)??0)+h/2;let _="",E="";return p==="bottom"?(_=u?g:`${x}px`,E=`${-h}px`):p==="top"?(_=u?g:`${x}px`,E=`${s.floating.height+h}px`):p==="right"?(_=`${-h}px`,E=u?g:`${S}px`):p==="left"&&(_=`${s.floating.width+h}px`,E=u?g:`${S}px`),{data:{x:_,y:E}}}});function Nx(e){const[t,a="center"]=e.split("-");return[t,a]}var kx=_x,Ox=Cx,jx=Tx,Mx=Ax,kM="Portal",Du=y.forwardRef((e,t)=>{var d;const{container:a,...s}=e,[o,c]=y.useState(!1);gt(()=>c(!0),[]);const u=a||o&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return u?fw.createPortal(b.jsx(De.div,{...s,ref:t}),u):null});Du.displayName=kM;function OM(e,t){return y.useReducer((a,s)=>t[a][s]??a,e)}var Ur=e=>{const{present:t,children:a}=e,s=jM(t),o=typeof a=="function"?a({present:s.isPresent}):y.Children.only(a),c=qe(s.ref,MM(o));return typeof a=="function"||s.isPresent?y.cloneElement(o,{ref:c}):null};Ur.displayName="Presence";function jM(e){const[t,a]=y.useState(),s=y.useRef(null),o=y.useRef(e),c=y.useRef("none"),u=e?"mounted":"unmounted",[d,h]=OM(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const p=jc(s.current);c.current=d==="mounted"?p:"none"},[d]),gt(()=>{const p=s.current,v=o.current;if(v!==e){const x=c.current,S=jc(p);e?h("MOUNT"):S==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(v&&x!==S?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),gt(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,g=S=>{const E=jc(s.current).includes(CSS.escape(S.animationName));if(S.target===t&&E&&(h("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",p=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},x=S=>{S.target===t&&(c.current=jc(s.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{v.clearTimeout(p),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:y.useCallback(p=>{s.current=p?getComputedStyle(p):null,a(p)},[])}}function jc(e){return(e==null?void 0:e.animationName)||"none"}function MM(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Ch="rovingFocusGroup.onEntryFocus",DM={bubbles:!1,cancelable:!0},tl="RovingFocusGroup",[Zh,Dx,LM]=km(tl),[UM,Lx]=wa(tl,[LM]),[PM,zM]=UM(tl),Ux=y.forwardRef((e,t)=>b.jsx(Zh.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(Zh.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(BM,{...e,ref:t})})}));Ux.displayName=tl;var BM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:o=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:v=!1,...g}=e,x=y.useRef(null),S=qe(t,x),_=Om(c),[E,R]=pi({prop:u,defaultProp:d??null,onChange:h,caller:tl}),[T,A]=y.useState(!1),N=Un(p),L=Dx(a),G=y.useRef(!1),[V,P]=y.useState(0);return y.useEffect(()=>{const q=x.current;if(q)return q.addEventListener(Ch,N),()=>q.removeEventListener(Ch,N)},[N]),b.jsx(PM,{scope:a,orientation:s,dir:_,loop:o,currentTabStopId:E,onItemFocus:y.useCallback(q=>R(q),[R]),onItemShiftTab:y.useCallback(()=>A(!0),[]),onFocusableItemAdd:y.useCallback(()=>P(q=>q+1),[]),onFocusableItemRemove:y.useCallback(()=>P(q=>q-1),[]),children:b.jsx(De.div,{tabIndex:T||V===0?-1:0,"data-orientation":s,...g,ref:S,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{G.current=!0}),onFocus:be(e.onFocus,q=>{const re=!G.current;if(q.target===q.currentTarget&&re&&!T){const me=new CustomEvent(Ch,DM);if(q.currentTarget.dispatchEvent(me),!me.defaultPrevented){const ye=L().filter(j=>j.focusable),oe=ye.find(j=>j.active),de=ye.find(j=>j.id===E),fe=[oe,de,...ye].filter(Boolean).map(j=>j.ref.current);Bx(fe,v)}}G.current=!1}),onBlur:be(e.onBlur,()=>A(!1))})})}),Px="RovingFocusGroupItem",zx=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:o=!1,tabStopId:c,children:u,...d}=e,h=Rr(),p=c||h,v=zM(Px,a),g=v.currentTabStopId===p,x=Dx(a),{onFocusableItemAdd:S,onFocusableItemRemove:_,currentTabStopId:E}=v;return y.useEffect(()=>{if(s)return S(),()=>_()},[s,S,_]),b.jsx(Zh.ItemSlot,{scope:a,id:p,focusable:s,active:o,children:b.jsx(De.span,{tabIndex:g?0:-1,"data-orientation":v.orientation,...d,ref:t,onMouseDown:be(e.onMouseDown,R=>{s?v.onItemFocus(p):R.preventDefault()}),onFocus:be(e.onFocus,()=>v.onItemFocus(p)),onKeyDown:be(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){v.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const T=HM(R,v.orientation,v.dir);if(T!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let N=x().filter(L=>L.focusable).map(L=>L.ref.current);if(T==="last")N.reverse();else if(T==="prev"||T==="next"){T==="prev"&&N.reverse();const L=N.indexOf(R.currentTarget);N=v.loop?qM(N,L+1):N.slice(L+1)}setTimeout(()=>Bx(N))}}),children:typeof u=="function"?u({isCurrentTabStop:g,hasTabStop:E!=null}):u})})});zx.displayName=Px;var IM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $M(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function HM(e,t,a){const s=$M(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return IM[s]}function Bx(e,t=!1){const a=document.activeElement;for(const s of e)if(s===a||(s.focus({preventScroll:t}),document.activeElement!==a))return}function qM(e,t){return e.map((a,s)=>e[(t+s)%e.length])}var GM=Ux,VM=zx;function KM(e){const t=FM(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(WM);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function FM(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=JM(o),d=XM(c,o.props);return o.type!==y.Fragment&&(d.ref=s?Dr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YM=Symbol("radix.slottable");function WM(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YM}function XM(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function JM(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var QM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ei=new WeakMap,Mc=new WeakMap,Dc={},Th=0,Ix=function(e){return e&&(e.host||Ix(e.parentNode))},ZM=function(e,t){return t.map(function(a){if(e.contains(a))return a;var s=Ix(a);return s&&e.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},eD=function(e,t,a,s){var o=ZM(t,Array.isArray(e)?e:[e]);Dc[a]||(Dc[a]=new WeakMap);var c=Dc[a],u=[],d=new Set,h=new Set(o),p=function(g){!g||d.has(g)||(d.add(g),p(g.parentNode))};o.forEach(p);var v=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(x){if(d.has(x))v(x);else try{var S=x.getAttribute(s),_=S!==null&&S!=="false",E=(ei.get(x)||0)+1,R=(c.get(x)||0)+1;ei.set(x,E),c.set(x,R),u.push(x),E===1&&_&&Mc.set(x,!0),R===1&&x.setAttribute(a,"true"),_||x.setAttribute(s,"true")}catch(T){console.error("aria-hidden: cannot operate on ",x,T)}})};return v(t),d.clear(),Th++,function(){u.forEach(function(g){var x=ei.get(g)-1,S=c.get(g)-1;ei.set(g,x),c.set(g,S),x||(Mc.has(g)||g.removeAttribute(s),Mc.delete(g)),S||g.removeAttribute(a)}),Th--,Th||(ei=new WeakMap,ei=new WeakMap,Mc=new WeakMap,Dc={})}},$m=function(e,t,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=QM(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),eD(s,o,a,"aria-hidden")):function(){return null}},Wc="right-scroll-bar-position",Xc="width-before-scroll-bar",tD="with-scroll-bars-hidden",nD="--removed-body-scroll-bar-size";function Rh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rD(e,t){var a=y.useState(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(s){var o=a.value;o!==s&&(a.value=s,a.callback(s,o))}}}})[0];return a.callback=t,a.facade}var aD=typeof window<"u"?y.useLayoutEffect:y.useEffect,T0=new WeakMap;function sD(e,t){var a=rD(null,function(s){return e.forEach(function(o){return Rh(o,s)})});return aD(function(){var s=T0.get(a);if(s){var o=new Set(s),c=new Set(e),u=a.current;o.forEach(function(d){c.has(d)||Rh(d,null)}),c.forEach(function(d){o.has(d)||Rh(d,u)})}T0.set(a,e)},[e]),a}function iD(e){return e}function oD(e,t){t===void 0&&(t=iD);var a=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(c){var u=t(c,s);return a.push(u),function(){a=a.filter(function(d){return d!==u})}},assignSyncMedium:function(c){for(s=!0;a.length;){var u=a;a=[],u.forEach(c)}a={push:function(d){return c(d)},filter:function(){return a}}},assignMedium:function(c){s=!0;var u=[];if(a.length){var d=a;a=[],d.forEach(c),u=a}var h=function(){var v=u;u=[],v.forEach(c)},p=function(){return Promise.resolve().then(h)};p(),a={push:function(v){u.push(v),p()},filter:function(v){return u=u.filter(v),a}}}};return o}function lD(e){e===void 0&&(e={});var t=oD(null);return t.options=Jn({async:!0,ssr:!1},e),t}var $x=function(e){var t=e.sideCar,a=wi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return y.createElement(s,Jn({},a))};$x.isSideCarExport=!0;function cD(e,t){return e.useMedium(t),$x}var Hx=lD(),Ah=function(){},Lu=y.forwardRef(function(e,t){var a=y.useRef(null),s=y.useState({onScrollCapture:Ah,onWheelCapture:Ah,onTouchMoveCapture:Ah}),o=s[0],c=s[1],u=e.forwardProps,d=e.children,h=e.className,p=e.removeScrollBar,v=e.enabled,g=e.shards,x=e.sideCar,S=e.noRelative,_=e.noIsolation,E=e.inert,R=e.allowPinchZoom,T=e.as,A=T===void 0?"div":T,N=e.gapMode,L=wi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),G=x,V=sD([a,t]),P=Jn(Jn({},L),o);return y.createElement(y.Fragment,null,v&&y.createElement(G,{sideCar:Hx,removeScrollBar:p,shards:g,noRelative:S,noIsolation:_,inert:E,setCallbacks:c,allowPinchZoom:!!R,lockRef:a,gapMode:N}),u?y.cloneElement(y.Children.only(d),Jn(Jn({},P),{ref:V})):y.createElement(A,Jn({},P,{className:h,ref:V}),d))});Lu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lu.classNames={fullWidth:Xc,zeroRight:Wc};var uD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uD();return t&&e.setAttribute("nonce",t),e}function fD(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var mD=function(){var e=0,t=null;return{add:function(a){e==0&&(t=dD())&&(fD(t,a),hD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pD=function(){var e=mD();return function(t,a){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&a])}},qx=function(){var e=pD(),t=function(a){var s=a.styles,o=a.dynamic;return e(s,o),null};return t},gD={left:0,top:0,right:0,gap:0},Nh=function(e){return parseInt(e||"",10)||0},vD=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Nh(a),Nh(s),Nh(o)]},yD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gD;var t=vD(e),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-a+t[2]-t[0])}},bD=qx(),hi="data-scroll-locked",wD=function(e,t,a,s){var o=e.left,c=e.top,u=e.right,d=e.gap;return a===void 0&&(a="margin"),`
.`.concat(tD,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(d,"px ").concat(s,`;
}
body[`).concat(hi,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(s,";"),a==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(c,`px;
padding-right: `).concat(u,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(d,"px ").concat(s,`;
`),a==="padding"&&"padding-right: ".concat(d,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(Wc,` {
right: `).concat(d,"px ").concat(s,`;
}
.`).concat(Xc,` {
margin-right: `).concat(d,"px ").concat(s,`;
}
.`).concat(Wc," .").concat(Wc,` {
right: 0 `).concat(s,`;
}
.`).concat(Xc," .").concat(Xc,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(hi,`] {
`).concat(nD,": ").concat(d,`px;
}
`)},R0=function(){var e=parseInt(document.body.getAttribute(hi)||"0",10);return isFinite(e)?e:0},xD=function(){y.useEffect(function(){return document.body.setAttribute(hi,(R0()+1).toString()),function(){var e=R0()-1;e<=0?document.body.removeAttribute(hi):document.body.setAttribute(hi,e.toString())}},[])},SD=function(e){var t=e.noRelative,a=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;xD();var c=y.useMemo(function(){return yD(o)},[o]);return y.createElement(bD,{styles:wD(c,!t,o,a?"":"!important")})},em=!1;if(typeof window<"u")try{var Lc=Object.defineProperty({},"passive",{get:function(){return em=!0,!0}});window.addEventListener("test",Lc,Lc),window.removeEventListener("test",Lc,Lc)}catch{em=!1}var ti=em?{passive:!1}:!1,_D=function(e){return e.tagName==="TEXTAREA"},Gx=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!_D(e)&&a[t]==="visible")},ED=function(e){return Gx(e,"overflowY")},CD=function(e){return Gx(e,"overflowX")},A0=function(e,t){var a=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=Vx(e,s);if(o){var c=Kx(e,s),u=c[1],d=c[2];if(u>d)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},TD=function(e){var t=e.scrollTop,a=e.scrollHeight,s=e.clientHeight;return[t,a,s]},RD=function(e){var t=e.scrollLeft,a=e.scrollWidth,s=e.clientWidth;return[t,a,s]},Vx=function(e,t){return e==="v"?ED(t):CD(t)},Kx=function(e,t){return e==="v"?TD(t):RD(t)},AD=function(e,t){return e==="h"&&t==="rtl"?-1:1},ND=function(e,t,a,s,o){var c=AD(e,window.getComputedStyle(t).direction),u=c*s,d=a.target,h=t.contains(d),p=!1,v=u>0,g=0,x=0;do{if(!d)break;var S=Kx(e,d),_=S[0],E=S[1],R=S[2],T=E-R-c*_;(_||T)&&Vx(e,d)&&(g+=T,x+=_);var A=d.parentNode;d=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!h&&d!==document.body||h&&(t.contains(d)||t===d));return(v&&Math.abs(g)<1||!v&&Math.abs(x)<1)&&(p=!0),p},Uc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},N0=function(e){return[e.deltaX,e.deltaY]},k0=function(e){return e&&"current"in e?e.current:e},kD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},OD=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},jD=0,ni=[];function MD(e){var t=y.useRef([]),a=y.useRef([0,0]),s=y.useRef(),o=y.useState(jD++)[0],c=y.useState(qx)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var E=UR([e.lockRef.current],(e.shards||[]).map(k0),!0).filter(Boolean);return E.forEach(function(R){return R.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=y.useCallback(function(E,R){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!u.current.allowPinchZoom;var T=Uc(E),A=a.current,N="deltaX"in E?E.deltaX:A[0]-T[0],L="deltaY"in E?E.deltaY:A[1]-T[1],G,V=E.target,P=Math.abs(N)>Math.abs(L)?"h":"v";if("touches"in E&&P==="h"&&V.type==="range")return!1;var q=window.getSelection(),re=q&&q.anchorNode,me=re?re===V||re.contains(V):!1;if(me)return!1;var ye=A0(P,V);if(!ye)return!0;if(ye?G=P:(G=P==="v"?"h":"v",ye=A0(P,V)),!ye)return!1;if(!s.current&&"changedTouches"in E&&(N||L)&&(s.current=G),!G)return!0;var oe=s.current||G;return ND(oe,R,E,oe==="h"?N:L)},[]),h=y.useCallback(function(E){var R=E;if(!(!ni.length||ni[ni.length-1]!==c)){var T="deltaY"in R?N0(R):Uc(R),A=t.current.filter(function(G){return G.name===R.type&&(G.target===R.target||R.target===G.shadowParent)&&kD(G.delta,T)})[0];if(A&&A.should){R.cancelable&&R.preventDefault();return}if(!A){var N=(u.current.shards||[]).map(k0).filter(Boolean).filter(function(G){return G.contains(R.target)}),L=N.length>0?d(R,N[0]):!u.current.noIsolation;L&&R.cancelable&&R.preventDefault()}}},[]),p=y.useCallback(function(E,R,T,A){var N={name:E,delta:R,target:T,should:A,shadowParent:DD(T)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(L){return L!==N})},1)},[]),v=y.useCallback(function(E){a.current=Uc(E),s.current=void 0},[]),g=y.useCallback(function(E){p(E.type,N0(E),E.target,d(E,e.lockRef.current))},[]),x=y.useCallback(function(E){p(E.type,Uc(E),E.target,d(E,e.lockRef.current))},[]);y.useEffect(function(){return ni.push(c),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",h,ti),document.addEventListener("touchmove",h,ti),document.addEventListener("touchstart",v,ti),function(){ni=ni.filter(function(E){return E!==c}),document.removeEventListener("wheel",h,ti),document.removeEventListener("touchmove",h,ti),document.removeEventListener("touchstart",v,ti)}},[]);var S=e.removeScrollBar,_=e.inert;return y.createElement(y.Fragment,null,_?y.createElement(c,{styles:OD(o)}):null,S?y.createElement(SD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LD=cD(Hx,MD);var Uu=y.forwardRef(function(e,t){return y.createElement(Lu,Jn({},e,{ref:t,sideCar:LD}))});Uu.classNames=Lu.classNames;var tm=["Enter"," "],UD=["ArrowDown","PageUp","Home"],Fx=["ArrowUp","PageDown","End"],PD=[...UD,...Fx],zD={ltr:[...tm,"ArrowRight"],rtl:[...tm,"ArrowLeft"]},BD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},nl="Menu",[Go,ID,$D]=km(nl),[is,Yx]=wa(nl,[$D,Mu,Lx]),Pu=Mu(),Wx=Lx(),[HD,os]=is(nl),[qD,rl]=is(nl),Xx=e=>{const{__scopeMenu:t,open:a=!1,children:s,dir:o,onOpenChange:c,modal:u=!0}=e,d=Pu(t),[h,p]=y.useState(null),v=y.useRef(!1),g=Un(c),x=Om(o);return y.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})}},[]),b.jsx(kx,{...d,children:b.jsx(HD,{scope:t,open:a,onOpenChange:g,content:h,onContentChange:p,children:b.jsx(qD,{scope:t,onClose:y.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:v,dir:x,modal:u,children:s})})})};Xx.displayName=nl;var GD="MenuAnchor",Hm=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e,o=Pu(a);return b.jsx(Ox,{...o,...s,ref:t})});Hm.displayName=GD;var qm="MenuPortal",[VD,Jx]=is(qm,{forceMount:void 0}),Qx=e=>{const{__scopeMenu:t,forceMount:a,children:s,container:o}=e,c=os(qm,t);return b.jsx(VD,{scope:t,forceMount:a,children:b.jsx(Ur,{present:a||c.open,children:b.jsx(Du,{asChild:!0,container:o,children:s})})})};Qx.displayName=qm;var _n="MenuContent",[KD,Gm]=is(_n),Zx=y.forwardRef((e,t)=>{const a=Jx(_n,e.__scopeMenu),{forceMount:s=a.forceMount,...o}=e,c=os(_n,e.__scopeMenu),u=rl(_n,e.__scopeMenu);return b.jsx(Go.Provider,{scope:e.__scopeMenu,children:b.jsx(Ur,{present:s||c.open,children:b.jsx(Go.Slot,{scope:e.__scopeMenu,children:u.modal?b.jsx(FD,{...o,ref:t}):b.jsx(YD,{...o,ref:t})})})})}),FD=y.forwardRef((e,t)=>{const a=os(_n,e.__scopeMenu),s=y.useRef(null),o=qe(t,s);return y.useEffect(()=>{const c=s.current;if(c)return $m(c)},[]),b.jsx(Vm,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:be(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),YD=y.forwardRef((e,t)=>{const a=os(_n,e.__scopeMenu);return b.jsx(Vm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),WD=KM("MenuContent.ScrollLock"),Vm=y.forwardRef((e,t)=>{const{__scopeMenu:a,loop:s=!1,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:g,onInteractOutside:x,onDismiss:S,disableOutsideScroll:_,...E}=e,R=os(_n,a),T=rl(_n,a),A=Pu(a),N=Wx(a),L=ID(a),[G,V]=y.useState(null),P=y.useRef(null),q=qe(t,P,R.onContentChange),re=y.useRef(0),me=y.useRef(""),ye=y.useRef(0),oe=y.useRef(null),de=y.useRef("right"),ge=y.useRef(0),fe=_?Uu:y.Fragment,j=_?{as:WD,allowPinchZoom:!0}:void 0,F=ee=>{var te,se;const H=me.current+ee,k=L().filter(ie=>!ie.disabled),I=document.activeElement,D=(te=k.find(ie=>ie.ref.current===I))==null?void 0:te.textValue,Y=k.map(ie=>ie.textValue),Q=oL(Y,H,D),ne=(se=k.find(ie=>ie.textValue===Q))==null?void 0:se.ref.current;(function ie(Te){me.current=Te,window.clearTimeout(re.current),Te!==""&&(re.current=window.setTimeout(()=>ie(""),1e3))})(H),ne&&setTimeout(()=>ne.focus())};y.useEffect(()=>()=>window.clearTimeout(re.current),[]),jm();const J=y.useCallback(ee=>{var k,I;return de.current===((k=oe.current)==null?void 0:k.side)&&cL(ee,(I=oe.current)==null?void 0:I.area)},[]);return b.jsx(KD,{scope:a,searchRef:me,onItemEnter:y.useCallback(ee=>{J(ee)&&ee.preventDefault()},[J]),onItemLeave:y.useCallback(ee=>{var H;J(ee)||((H=P.current)==null||H.focus(),V(null))},[J]),onTriggerLeave:y.useCallback(ee=>{J(ee)&&ee.preventDefault()},[J]),pointerGraceTimerRef:ye,onPointerGraceIntentChange:y.useCallback(ee=>{oe.current=ee},[]),children:b.jsx(fe,{...j,children:b.jsx(Au,{asChild:!0,trapped:o,onMountAutoFocus:be(c,ee=>{var H;ee.preventDefault(),(H=P.current)==null||H.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:b.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:g,onInteractOutside:x,onDismiss:S,children:b.jsx(GM,{asChild:!0,...N,dir:T.dir,orientation:"vertical",loop:s,currentTabStopId:G,onCurrentTabStopIdChange:V,onEntryFocus:be(h,ee=>{T.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:b.jsx(jx,{role:"menu","aria-orientation":"vertical","data-state":pS(R.open),"data-radix-menu-content":"",dir:T.dir,...A,...E,ref:q,style:{outline:"none",...E.style},onKeyDown:be(E.onKeyDown,ee=>{const k=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,I=ee.ctrlKey||ee.altKey||ee.metaKey,D=ee.key.length===1;k&&(ee.key==="Tab"&&ee.preventDefault(),!I&&D&&F(ee.key));const Y=P.current;if(ee.target!==Y||!PD.includes(ee.key))return;ee.preventDefault();const ne=L().filter(te=>!te.disabled).map(te=>te.ref.current);Fx.includes(ee.key)&&ne.reverse(),sL(ne)}),onBlur:be(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(re.current),me.current="")}),onPointerMove:be(e.onPointerMove,Vo(ee=>{const H=ee.target,k=ge.current!==ee.clientX;if(ee.currentTarget.contains(H)&&k){const I=ee.clientX>ge.current?"right":"left";de.current=I,ge.current=ee.clientX}}))})})})})})})});Zx.displayName=_n;var XD="MenuGroup",Km=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e;return b.jsx(De.div,{role:"group",...s,ref:t})});Km.displayName=XD;var JD="MenuLabel",eS=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e;return b.jsx(De.div,{...s,ref:t})});eS.displayName=JD;var mu="MenuItem",O0="menu.itemSelect",zu=y.forwardRef((e,t)=>{const{disabled:a=!1,onSelect:s,...o}=e,c=y.useRef(null),u=rl(mu,e.__scopeMenu),d=Gm(mu,e.__scopeMenu),h=qe(t,c),p=y.useRef(!1),v=()=>{const g=c.current;if(!a&&g){const x=new CustomEvent(O0,{bubbles:!0,cancelable:!0});g.addEventListener(O0,S=>s==null?void 0:s(S),{once:!0}),ax(g,x),x.defaultPrevented?p.current=!1:u.onClose()}};return b.jsx(tS,{...o,ref:h,disabled:a,onClick:be(e.onClick,v),onPointerDown:g=>{var x;(x=e.onPointerDown)==null||x.call(e,g),p.current=!0},onPointerUp:be(e.onPointerUp,g=>{var x;p.current||(x=g.currentTarget)==null||x.click()}),onKeyDown:be(e.onKeyDown,g=>{const x=d.searchRef.current!=="";a||x&&g.key===" "||tm.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});zu.displayName=mu;var tS=y.forwardRef((e,t)=>{const{__scopeMenu:a,disabled:s=!1,textValue:o,...c}=e,u=Gm(mu,a),d=Wx(a),h=y.useRef(null),p=qe(t,h),[v,g]=y.useState(!1),[x,S]=y.useState("");return y.useEffect(()=>{const _=h.current;_&&S((_.textContent??"").trim())},[c.children]),b.jsx(Go.ItemSlot,{scope:a,disabled:s,textValue:o??x,children:b.jsx(VM,{asChild:!0,...d,focusable:!s,children:b.jsx(De.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...c,ref:p,onPointerMove:be(e.onPointerMove,Vo(_=>{s?u.onItemLeave(_):(u.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:be(e.onPointerLeave,Vo(_=>u.onItemLeave(_))),onFocus:be(e.onFocus,()=>g(!0)),onBlur:be(e.onBlur,()=>g(!1))})})})}),QD="MenuCheckboxItem",nS=y.forwardRef((e,t)=>{const{checked:a=!1,onCheckedChange:s,...o}=e;return b.jsx(oS,{scope:e.__scopeMenu,checked:a,children:b.jsx(zu,{role:"menuitemcheckbox","aria-checked":pu(a)?"mixed":a,...o,ref:t,"data-state":Ym(a),onSelect:be(o.onSelect,()=>s==null?void 0:s(pu(a)?!0:!a),{checkForDefaultPrevented:!1})})})});nS.displayName=QD;var rS="MenuRadioGroup",[ZD,eL]=is(rS,{value:void 0,onValueChange:()=>{}}),aS=y.forwardRef((e,t)=>{const{value:a,onValueChange:s,...o}=e,c=Un(s);return b.jsx(ZD,{scope:e.__scopeMenu,value:a,onValueChange:c,children:b.jsx(Km,{...o,ref:t})})});aS.displayName=rS;var sS="MenuRadioItem",iS=y.forwardRef((e,t)=>{const{value:a,...s}=e,o=eL(sS,e.__scopeMenu),c=a===o.value;return b.jsx(oS,{scope:e.__scopeMenu,checked:c,children:b.jsx(zu,{role:"menuitemradio","aria-checked":c,...s,ref:t,"data-state":Ym(c),onSelect:be(s.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,a)},{checkForDefaultPrevented:!1})})})});iS.displayName=sS;var Fm="MenuItemIndicator",[oS,tL]=is(Fm,{checked:!1}),lS=y.forwardRef((e,t)=>{const{__scopeMenu:a,forceMount:s,...o}=e,c=tL(Fm,a);return b.jsx(Ur,{present:s||pu(c.checked)||c.checked===!0,children:b.jsx(De.span,{...o,ref:t,"data-state":Ym(c.checked)})})});lS.displayName=Fm;var nL="MenuSeparator",cS=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e;return b.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});cS.displayName=nL;var rL="MenuArrow",uS=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e,o=Pu(a);return b.jsx(Mx,{...o,...s,ref:t})});uS.displayName=rL;var aL="MenuSub",[q5,dS]=is(aL),Ro="MenuSubTrigger",fS=y.forwardRef((e,t)=>{const a=os(Ro,e.__scopeMenu),s=rl(Ro,e.__scopeMenu),o=dS(Ro,e.__scopeMenu),c=Gm(Ro,e.__scopeMenu),u=y.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:h}=c,p={__scopeMenu:e.__scopeMenu},v=y.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return y.useEffect(()=>v,[v]),y.useEffect(()=>{const g=d.current;return()=>{window.clearTimeout(g),h(null)}},[d,h]),b.jsx(Hm,{asChild:!0,...p,children:b.jsx(tS,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":o.contentId,"data-state":pS(a.open),...e,ref:Dr(t,o.onTriggerChange),onClick:g=>{var x;(x=e.onClick)==null||x.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:be(e.onPointerMove,Vo(g=>{c.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!a.open&&!u.current&&(c.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{a.onOpenChange(!0),v()},100))})),onPointerLeave:be(e.onPointerLeave,Vo(g=>{var S,_;v();const x=(S=a.content)==null?void 0:S.getBoundingClientRect();if(x){const E=(_=a.content)==null?void 0:_.dataset.side,R=E==="right",T=R?-5:5,A=x[R?"left":"right"],N=x[R?"right":"left"];c.onPointerGraceIntentChange({area:[{x:g.clientX+T,y:g.clientY},{x:A,y:x.top},{x:N,y:x.top},{x:N,y:x.bottom},{x:A,y:x.bottom}],side:E}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(g),g.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:be(e.onKeyDown,g=>{var S;const x=c.searchRef.current!=="";e.disabled||x&&g.key===" "||zD[s.dir].includes(g.key)&&(a.onOpenChange(!0),(S=a.content)==null||S.focus(),g.preventDefault())})})})});fS.displayName=Ro;var hS="MenuSubContent",mS=y.forwardRef((e,t)=>{const a=Jx(_n,e.__scopeMenu),{forceMount:s=a.forceMount,...o}=e,c=os(_n,e.__scopeMenu),u=rl(_n,e.__scopeMenu),d=dS(hS,e.__scopeMenu),h=y.useRef(null),p=qe(t,h);return b.jsx(Go.Provider,{scope:e.__scopeMenu,children:b.jsx(Ur,{present:s||c.open,children:b.jsx(Go.Slot,{scope:e.__scopeMenu,children:b.jsx(Vm,{id:d.contentId,"aria-labelledby":d.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var g;u.isUsingKeyboardRef.current&&((g=h.current)==null||g.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:be(e.onFocusOutside,v=>{v.target!==d.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:be(e.onEscapeKeyDown,v=>{u.onClose(),v.preventDefault()}),onKeyDown:be(e.onKeyDown,v=>{var S;const g=v.currentTarget.contains(v.target),x=BD[u.dir].includes(v.key);g&&x&&(c.onOpenChange(!1),(S=d.trigger)==null||S.focus(),v.preventDefault())})})})})})});mS.displayName=hS;function pS(e){return e?"open":"closed"}function pu(e){return e==="indeterminate"}function Ym(e){return pu(e)?"indeterminate":e?"checked":"unchecked"}function sL(e){const t=document.activeElement;for(const a of e)if(a===t||(a.focus(),document.activeElement!==t))return}function iL(e,t){return e.map((a,s)=>e[(t+s)%e.length])}function oL(e,t,a){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,c=a?e.indexOf(a):-1;let u=iL(e,Math.max(c,0));o.length===1&&(u=u.filter(p=>p!==a));const h=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return h!==a?h:void 0}function lL(e,t){const{x:a,y:s}=e;let o=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const d=t[c],h=t[u],p=d.x,v=d.y,g=h.x,x=h.y;v>s!=x>s&&a<(g-p)*(s-v)/(x-v)+p&&(o=!o)}return o}function cL(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return lL(a,t)}function Vo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var uL=Xx,dL=Hm,fL=Qx,hL=Zx,mL=Km,pL=eS,gL=zu,vL=nS,yL=aS,bL=iS,wL=lS,xL=cS,SL=uS,_L=fS,EL=mS,Bu="DropdownMenu",[CL]=wa(Bu,[Yx]),Pt=Yx(),[TL,gS]=CL(Bu),vS=e=>{const{__scopeDropdownMenu:t,children:a,dir:s,open:o,defaultOpen:c,onOpenChange:u,modal:d=!0}=e,h=Pt(t),p=y.useRef(null),[v,g]=pi({prop:o,defaultProp:c??!1,onChange:u,caller:Bu});return b.jsx(TL,{scope:t,triggerId:Rr(),triggerRef:p,contentId:Rr(),open:v,onOpenChange:g,onOpenToggle:y.useCallback(()=>g(x=>!x),[g]),modal:d,children:b.jsx(uL,{...h,open:v,onOpenChange:g,dir:s,modal:d,children:a})})};vS.displayName=Bu;var yS="DropdownMenuTrigger",bS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,disabled:s=!1,...o}=e,c=gS(yS,a),u=Pt(a);return b.jsx(dL,{asChild:!0,...u,children:b.jsx(De.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...o,ref:Dr(t,c.triggerRef),onPointerDown:be(e.onPointerDown,d=>{!s&&d.button===0&&d.ctrlKey===!1&&(c.onOpenToggle(),c.open||d.preventDefault())}),onKeyDown:be(e.onKeyDown,d=>{s||(["Enter"," "].includes(d.key)&&c.onOpenToggle(),d.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});bS.displayName=yS;var RL="DropdownMenuPortal",wS=e=>{const{__scopeDropdownMenu:t,...a}=e,s=Pt(t);return b.jsx(fL,{...s,...a})};wS.displayName=RL;var xS="DropdownMenuContent",SS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=gS(xS,a),c=Pt(a),u=y.useRef(!1);return b.jsx(hL,{id:o.contentId,"aria-labelledby":o.triggerId,...c,...s,ref:t,onCloseAutoFocus:be(e.onCloseAutoFocus,d=>{var h;u.current||(h=o.triggerRef.current)==null||h.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:be(e.onInteractOutside,d=>{const h=d.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,v=h.button===2||p;(!o.modal||v)&&(u.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)"}})});SS.displayName=xS;var AL="DropdownMenuGroup",NL=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(mL,{...o,...s,ref:t})});NL.displayName=AL;var kL="DropdownMenuLabel",_S=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(pL,{...o,...s,ref:t})});_S.displayName=kL;var OL="DropdownMenuItem",ES=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(gL,{...o,...s,ref:t})});ES.displayName=OL;var jL="DropdownMenuCheckboxItem",CS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(vL,{...o,...s,ref:t})});CS.displayName=jL;var ML="DropdownMenuRadioGroup",DL=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(yL,{...o,...s,ref:t})});DL.displayName=ML;var LL="DropdownMenuRadioItem",TS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(bL,{...o,...s,ref:t})});TS.displayName=LL;var UL="DropdownMenuItemIndicator",RS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(wL,{...o,...s,ref:t})});RS.displayName=UL;var PL="DropdownMenuSeparator",AS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(xL,{...o,...s,ref:t})});AS.displayName=PL;var zL="DropdownMenuArrow",BL=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(SL,{...o,...s,ref:t})});BL.displayName=zL;var IL="DropdownMenuSubTrigger",NS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(_L,{...o,...s,ref:t})});NS.displayName=IL;var $L="DropdownMenuSubContent",kS=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=Pt(a);return b.jsx(EL,{...o,...s,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)"}})});kS.displayName=$L;var HL=vS,qL=bS,GL=wS,OS=SS,jS=_S,MS=ES,DS=CS,LS=TS,US=RS,PS=AS,zS=NS,BS=kS;const VL=HL,KL=qL,FL=y.forwardRef(({className:e,inset:t,children:a,...s},o)=>b.jsxs(zS,{ref:o,className:ke("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...s,children:[a,b.jsx(Bw,{className:"ml-auto"})]}));FL.displayName=zS.displayName;const YL=y.forwardRef(({className:e,...t},a)=>b.jsx(BS,{ref:a,className:ke("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)",e),...t}));YL.displayName=BS.displayName;const IS=y.forwardRef(({className:e,sideOffset:t=4,...a},s)=>b.jsx(GL,{children:b.jsx(OS,{ref:s,sideOffset:t,className:ke("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)",e),...a})}));IS.displayName=OS.displayName;const $S=y.forwardRef(({className:e,inset:t,...a},s)=>b.jsx(MS,{ref:s,className:ke("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));$S.displayName=MS.displayName;const WL=y.forwardRef(({className:e,children:t,checked:a,...s},o)=>b.jsxs(DS,{ref:o,className:ke("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...s,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(US,{children:b.jsx(Cu,{className:"h-4 w-4"})})}),t]}));WL.displayName=DS.displayName;const XL=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(LS,{ref:s,className:ke("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(US,{children:b.jsx(oO,{className:"h-2 w-2 fill-current"})})}),t]}));XL.displayName=LS.displayName;const JL=y.forwardRef(({className:e,inset:t,...a},s)=>b.jsx(jS,{ref:s,className:ke("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));JL.displayName=jS.displayName;const HS=y.forwardRef(({className:e,...t},a)=>b.jsx(PS,{ref:a,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));HS.displayName=PS.displayName;function QL(e,t=[]){let a=[];function s(c,u){const d=y.createContext(u);d.displayName=c+"Context";const h=a.length;a=[...a,u];const p=g=>{var T;const{scope:x,children:S,..._}=g,E=((T=x==null?void 0:x[e])==null?void 0:T[h])||d,R=y.useMemo(()=>_,Object.values(_));return b.jsx(E.Provider,{value:R,children:S})};p.displayName=c+"Provider";function v(g,x){var E;const S=((E=x==null?void 0:x[e])==null?void 0:E[h])||d,_=y.useContext(S);if(_)return _;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[p,v]}const o=()=>{const c=a.map(u=>y.createContext(u));return function(d){const h=(d==null?void 0:d[e])||c;return y.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return o.scopeName=e,[s,ZL(o,...t)]}function ZL(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const u=s.reduce((d,{useScope:h,scopeName:p})=>{const g=h(c)[`__scope${p}`];return{...d,...g}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return a.scopeName=t.scopeName,a}var e3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wm=e3.reduce((e,t)=>{const a=Tu(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),kh={exports:{}},Oh={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var j0;function t3(){if(j0)return Oh;j0=1;var e=bu();function t(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var a=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function d(g,x){var S=x(),_=s({inst:{value:S,getSnapshot:x}}),E=_[0].inst,R=_[1];return c(function(){E.value=S,E.getSnapshot=x,h(E)&&R({inst:E})},[g,S,x]),o(function(){return h(E)&&R({inst:E}),g(function(){h(E)&&R({inst:E})})},[g]),u(S),S}function h(g){var x=g.getSnapshot;g=g.value;try{var S=x();return!a(g,S)}catch{return!0}}function p(g,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Oh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Oh}var M0;function n3(){return M0||(M0=1,kh.exports=t3()),kh.exports}var r3=n3();function a3(){return r3.useSyncExternalStore(s3,()=>!0,()=>!1)}function s3(){return()=>{}}var Xm="Avatar",[i3]=QL(Xm),[o3,qS]=i3(Xm),GS=y.forwardRef((e,t)=>{const{__scopeAvatar:a,...s}=e,[o,c]=y.useState("idle");return b.jsx(o3,{scope:a,imageLoadingStatus:o,onImageLoadingStatusChange:c,children:b.jsx(Wm.span,{...s,ref:t})})});GS.displayName=Xm;var VS="AvatarImage",KS=y.forwardRef((e,t)=>{const{__scopeAvatar:a,src:s,onLoadingStatusChange:o=()=>{},...c}=e,u=qS(VS,a),d=l3(s,c),h=Un(p=>{o(p),u.onImageLoadingStatusChange(p)});return gt(()=>{d!=="idle"&&h(d)},[d,h]),d==="loaded"?b.jsx(Wm.img,{...c,ref:t,src:s}):null});KS.displayName=VS;var FS="AvatarFallback",YS=y.forwardRef((e,t)=>{const{__scopeAvatar:a,delayMs:s,...o}=e,c=qS(FS,a),[u,d]=y.useState(s===void 0);return y.useEffect(()=>{if(s!==void 0){const h=window.setTimeout(()=>d(!0),s);return()=>window.clearTimeout(h)}},[s]),u&&c.imageLoadingStatus!=="loaded"?b.jsx(Wm.span,{...o,ref:t}):null});YS.displayName=FS;function D0(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function l3(e,{referrerPolicy:t,crossOrigin:a}){const s=a3(),o=y.useRef(null),c=s?(o.current||(o.current=new window.Image),o.current):null,[u,d]=y.useState(()=>D0(c,e));return gt(()=>{d(D0(c,e))},[c,e]),gt(()=>{const h=g=>()=>{d(g)};if(!c)return;const p=h("loaded"),v=h("error");return c.addEventListener("load",p),c.addEventListener("error",v),t&&(c.referrerPolicy=t),typeof a=="string"&&(c.crossOrigin=a),()=>{c.removeEventListener("load",p),c.removeEventListener("error",v)}},[c,a,t]),u}var WS=GS,XS=KS,JS=YS;const QS=y.forwardRef(({className:e,...t},a)=>b.jsx(WS,{ref:a,className:ke("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));QS.displayName=WS.displayName;const ZS=y.forwardRef(({className:e,...t},a)=>b.jsx(XS,{ref:a,className:ke("aspect-square h-full w-full",e),...t}));ZS.displayName=XS.displayName;const e_=y.forwardRef(({className:e,...t},a)=>b.jsx(JS,{ref:a,className:ke("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));e_.displayName=JS.displayName;const c3=Rm("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function nm({className:e,variant:t,...a}){return b.jsx("div",{className:ke(c3({variant:t}),e),...a})}const u3=["Ascenda","Bacardí","Bayer","Benedicto Wong","Big Cola","BMI","Casio","CDC","Colgate","Cordiflex","Diageo","Estelar","Estrella Azul","GLM","In Drive","Mars","Microsoft","Molino Criollo","Naicom","Nestlé","P&G","Pepsico","RRHH","Taco Bell","Us Meat","Vozez","Whirlpool","Little Caesars","Intcomex","Cemix","Súper Xtra","Grupo AJE","Varios","KitchenAid","Maytag","Across","Claro","Bruni","Volt","InDrive","TrueShore","Coca Cola","Más Móvil","US Rice","Café Indio","Café Maya","Jack Daniels","GLM Digital","Compass","Starbucks","Skechers","Ron Bermudez","Nature´s Heart","Larimart","Motorola","Bajaj - Pulsar","Xelet Media","Philip Morris","Malher","Carnation","La Lechera"].sort(),Jm={CDC:"Marrero",Colombia:"J. Fernando","Costa Rica":"Poul","El Salvador":"Christian",Estelar:"Pablo",Guatemala:"Gerardo",Honduras:"Lucy",Jamaica:"Liz",Latam:"JL",Mexico:"Poul",Nicaragua:"Poul",OCI:"Liz",Panama:"Gabriel","Puerto Rico":"Liz","Republica Dominicana":"Liz",RRHH:"Maximo",Trinidad:"Liz",Venezuela:"Jose Fer",Vozez:"Nathalia","GLM Digital":"Lil",IQM:"Lil"},d3=Object.keys(Jm).sort(),f3=["Carnation","GLM RRHH","La Lechera","Malher","US Meat","Coffee Mate y Nescafé","Nestum y Nido","Whirlpool","Motorola","Philip Morris","US Meat Guatemala","KitKat, Crunch, Choco Trío","Colgate","Kit Kat","UMA","Purina","Maggi e Ideal","Nestlé","Jimador","Multimarcas","Maggi","Covo","El Machetazo","Grupo Bocel","Supply Chain","Carnation y La Lechera","GLM Administración","Nestlé Bice","GLM","Nescafé","Idea, Qué Rico y Maggi","EY","Nesquik","Maggi, Ketchup, Qué Rico","Ideal","Claro Empresas","Nido","Presto","Nestlé RD","GLM Colombia","Motorola RD","GLM Caribe","Mandino","Coffee Mate","GLM Latam","RRHH RD","Philip Morris TT","GLM RD","Smirnoff","Kaspersky","US Pork","Qué Rico y Maggi","Claro y Motorola","Sedal","Maytag","Qué Rico, Maggi y Ketchup","Multimarca","Aviva y Princesa","KitchenAid","Enredé","Ascenda","Lipton Té","Heiniken","Oral B","Aafresh","IQOS","Natures Heart"],h3=["Aprobado","No aprobado","Stand by","Aprobado /no ejecutado","Pre aprobado","On going","Sin respuesta"],rm=[{id:"blue",name:"Azul",hex:"#4285F4"},{id:"red",name:"Rojo",hex:"#EA4335"},{id:"yellow",name:"Amarillo",hex:"#FBBC04"},{id:"green",name:"Verde",hex:"#34A853"},{id:"purple",name:"Morado",hex:"#A142F4"},{id:"teal",name:"Turquesa",hex:"#00ACC1"},{id:"orange",name:"Naranja",hex:"#FB8C00"},{id:"pink",name:"Rosa",hex:"#E91E63"},{id:"indigo",name:"Índigo",hex:"#3F51B5"},{id:"gray",name:"Gris",hex:"#5F6368"}],m3=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function t_(e){var t;return((t=rm.find(a=>a.id===e))==null?void 0:t.hex)??rm[0].hex}function p3({project:e,onClick:t}){const a=!!e.status,{isGerardo:s}=Zo(),o=c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),t())};return b.jsxs("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:o,className:ke("group block text-left w-full rounded-2xl bg-card overflow-hidden p-0 ring-1 ring-border cursor-pointer","transition-all duration-200 hover:-translate-y-0.5","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"opacity-65 hover:opacity-90"),style:{boxShadow:a?"0 1px 2px oklch(0.5 0.02 280 / 0.04)":"var(--shadow-soft)"},onMouseEnter:c=>{a||(c.currentTarget.style.boxShadow="var(--shadow-hover)")},onMouseLeave:c=>{c.currentTarget.style.boxShadow=a?"0 1px 2px oklch(0.5 0.02 280 / 0.04)":"var(--shadow-soft)"},children:[b.jsx("div",{className:"min-h-14 rounded-t-2xl px-4 py-3",style:{backgroundColor:a?"#9AA0A6":t_(e.color)},children:b.jsx("h3",{className:"text-white font-semibold text-sm leading-snug line-clamp-2 drop-shadow-sm",children:e.nombre||"Sin título"})}),b.jsxs("div",{className:"p-4 space-y-2.5",children:[b.jsx(Pc,{icon:b.jsx(Jb,{className:"w-3.5 h-3.5"}),label:"Cliente",value:e.cliente}),b.jsx(Pc,{icon:b.jsx(Jb,{className:"w-3.5 h-3.5"}),label:"Marca",value:e.marca}),b.jsx(Pc,{icon:b.jsx(CO,{className:"w-3.5 h-3.5"}),label:"País",value:e.bu}),b.jsx(Pc,{icon:b.jsx(DO,{className:"w-3.5 h-3.5"}),label:"Solicita",value:e.solicitante}),b.jsxs("div",{className:"flex items-center justify-between pt-2 mt-2 border-t border-border/70",children:[b.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground",children:[e.propuestaLinks.length>0&&b.jsxs("span",{className:"flex items-center gap-1",title:"Propuestas",children:[b.jsx(gO,{className:"w-3 h-3"})," ",e.propuestaLinks.length]}),e.afLinks.length>0&&b.jsxs("span",{className:"flex items-center gap-1",title:"Artes finales",children:[b.jsx(hO,{className:"w-3 h-3"})," AF·",e.afLinks.length]})]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[s&&e.monto!=null&&b.jsxs("span",{className:"text-[11px] font-medium text-foreground/70",children:["$",e.monto.toLocaleString()]}),e.status&&b.jsxs(nm,{variant:"secondary",className:ke("text-[10px] px-1.5 py-0 h-5 font-medium",e.status==="Aprobado"&&"bg-emerald-100 text-emerald-800 hover:bg-emerald-100",e.status==="No aprobado"&&"bg-red-100 text-red-800 hover:bg-red-100"),children:[e.status==="Aprobado"&&b.jsx(sO,{className:"w-2.5 h-2.5 mr-0.5"}),e.status]})]})]})]})]})}function Pc({icon:e,label:t,value:a}){return b.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[b.jsx("span",{className:"text-muted-foreground mt-0.5 flex-shrink-0",children:e}),b.jsx("span",{className:"text-muted-foreground w-14 flex-shrink-0",children:t}),b.jsx("span",{className:"text-foreground font-medium truncate",children:a||"—"})]})}function g3(e){const t=v3(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(b3);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function v3(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=x3(o),d=w3(c,o.props);return o.type!==y.Fragment&&(d.ref=s?Dr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var y3=Symbol("radix.slottable");function b3(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===y3}function w3(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function x3(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Iu="Dialog",[n_]=wa(Iu),[S3,Bn]=n_(Iu),r_=e=>{const{__scopeDialog:t,children:a,open:s,defaultOpen:o,onOpenChange:c,modal:u=!0}=e,d=y.useRef(null),h=y.useRef(null),[p,v]=pi({prop:s,defaultProp:o??!1,onChange:c,caller:Iu});return b.jsx(S3,{scope:t,triggerRef:d,contentRef:h,contentId:Rr(),titleId:Rr(),descriptionId:Rr(),open:p,onOpenChange:v,onOpenToggle:y.useCallback(()=>v(g=>!g),[v]),modal:u,children:a})};r_.displayName=Iu;var a_="DialogTrigger",_3=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Bn(a_,a),c=qe(t,o.triggerRef);return b.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":ep(o.open),...s,ref:c,onClick:be(e.onClick,o.onOpenToggle)})});_3.displayName=a_;var Qm="DialogPortal",[E3,s_]=n_(Qm,{forceMount:void 0}),i_=e=>{const{__scopeDialog:t,forceMount:a,children:s,container:o}=e,c=Bn(Qm,t);return b.jsx(E3,{scope:t,forceMount:a,children:y.Children.map(s,u=>b.jsx(Ur,{present:a||c.open,children:b.jsx(Du,{asChild:!0,container:o,children:u})}))})};i_.displayName=Qm;var gu="DialogOverlay",o_=y.forwardRef((e,t)=>{const a=s_(gu,e.__scopeDialog),{forceMount:s=a.forceMount,...o}=e,c=Bn(gu,e.__scopeDialog);return c.modal?b.jsx(Ur,{present:s||c.open,children:b.jsx(T3,{...o,ref:t})}):null});o_.displayName=gu;var C3=g3("DialogOverlay.RemoveScroll"),T3=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Bn(gu,a);return b.jsx(Uu,{as:C3,allowPinchZoom:!0,shards:[o.contentRef],children:b.jsx(De.div,{"data-state":ep(o.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),ns="DialogContent",l_=y.forwardRef((e,t)=>{const a=s_(ns,e.__scopeDialog),{forceMount:s=a.forceMount,...o}=e,c=Bn(ns,e.__scopeDialog);return b.jsx(Ur,{present:s||c.open,children:c.modal?b.jsx(R3,{...o,ref:t}):b.jsx(A3,{...o,ref:t})})});l_.displayName=ns;var R3=y.forwardRef((e,t)=>{const a=Bn(ns,e.__scopeDialog),s=y.useRef(null),o=qe(t,a.contentRef,s);return y.useEffect(()=>{const c=s.current;if(c)return $m(c)},[]),b.jsx(c_,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),(u=a.triggerRef.current)==null||u.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&c.preventDefault()}),onFocusOutside:be(e.onFocusOutside,c=>c.preventDefault())})}),A3=y.forwardRef((e,t)=>{const a=Bn(ns,e.__scopeDialog),s=y.useRef(!1),o=y.useRef(!1);return b.jsx(c_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var u,d;(u=e.onCloseAutoFocus)==null||u.call(e,c),c.defaultPrevented||(s.current||(d=a.triggerRef.current)==null||d.focus(),c.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:c=>{var h,p;(h=e.onInteractOutside)==null||h.call(e,c),c.defaultPrevented||(s.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=c.target;((p=a.triggerRef.current)==null?void 0:p.contains(u))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),c_=y.forwardRef((e,t)=>{const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:c,...u}=e,d=Bn(ns,a),h=y.useRef(null),p=qe(t,h);return jm(),b.jsxs(b.Fragment,{children:[b.jsx(Au,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:c,children:b.jsx(Ru,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":ep(d.open),...u,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(N3,{titleId:d.titleId}),b.jsx(O3,{contentRef:h,descriptionId:d.descriptionId})]})]})}),Zm="DialogTitle",u_=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Bn(Zm,a);return b.jsx(De.h2,{id:o.titleId,...s,ref:t})});u_.displayName=Zm;var d_="DialogDescription",f_=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Bn(d_,a);return b.jsx(De.p,{id:o.descriptionId,...s,ref:t})});f_.displayName=d_;var h_="DialogClose",m_=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Bn(h_,a);return b.jsx(De.button,{type:"button",...s,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});m_.displayName=h_;function ep(e){return e?"open":"closed"}var p_="DialogTitleWarning",[G5,g_]=P2(p_,{contentName:ns,titleName:Zm,docsSlug:"dialog"}),N3=({titleId:e})=>{const t=g_(p_),a=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},k3="DialogDescriptionWarning",O3=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${g_(k3).contentName}}.`;return y.useEffect(()=>{var c;const o=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},j3=r_,M3=i_,v_=o_,y_=l_,b_=u_,w_=f_,D3=m_;const L3=j3,U3=M3,x_=y.forwardRef(({className:e,...t},a)=>b.jsx(v_,{ref:a,className:ke("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));x_.displayName=v_.displayName;const S_=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(U3,{children:[b.jsx(x_,{}),b.jsxs(y_,{ref:s,className:ke("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",e),...a,children:[t,b.jsxs(D3,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(Iw,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));S_.displayName=y_.displayName;const __=({className:e,...t})=>b.jsx("div",{className:ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});__.displayName="DialogHeader";const E_=({className:e,...t})=>b.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});E_.displayName="DialogFooter";const C_=y.forwardRef(({className:e,...t},a)=>b.jsx(b_,{ref:a,className:ke("text-lg font-semibold leading-none tracking-tight",e),...t}));C_.displayName=b_.displayName;const T_=y.forwardRef(({className:e,...t},a)=>b.jsx(w_,{ref:a,className:ke("text-sm text-muted-foreground",e),...t}));T_.displayName=w_.displayName;var P3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],z3=P3.reduce((e,t)=>{const a=Tu(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),B3="Label",R_=y.forwardRef((e,t)=>b.jsx(z3.label,{...e,ref:t,onMouseDown:a=>{var o;a.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));R_.displayName=B3;var A_=R_;const I3=Rm("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),sn=y.forwardRef(({className:e,...t},a)=>b.jsx(A_,{ref:a,className:ke(I3(),e),...t}));sn.displayName=A_.displayName;const N_=y.forwardRef(({className:e,...t},a)=>b.jsx("textarea",{className:ke("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));N_.displayName="Textarea";function k_(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $u="Checkbox",[$3]=wa($u),[H3,tp]=$3($u);function q3(e){const{__scopeCheckbox:t,checked:a,children:s,defaultChecked:o,disabled:c,form:u,name:d,onCheckedChange:h,required:p,value:v="on",internal_do_not_use_render:g}=e,[x,S]=pi({prop:a,defaultProp:o??!1,onChange:h,caller:$u}),[_,E]=y.useState(null),[R,T]=y.useState(null),A=y.useRef(!1),N=_?!!u||!!_.closest("form"):!0,L={checked:x,disabled:c,setChecked:S,control:_,setControl:E,name:d,form:u,value:v,hasConsumerStoppedPropagationRef:A,required:p,defaultChecked:ga(o)?!1:o,isFormControl:N,bubbleInput:R,setBubbleInput:T};return b.jsx(H3,{scope:t,...L,children:G3(g)?g(L):s})}var O_="CheckboxTrigger",j_=y.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:a,...s},o)=>{const{control:c,value:u,disabled:d,checked:h,required:p,setControl:v,setChecked:g,hasConsumerStoppedPropagationRef:x,isFormControl:S,bubbleInput:_}=tp(O_,e),E=qe(o,v),R=y.useRef(h);return y.useEffect(()=>{const T=c==null?void 0:c.form;if(T){const A=()=>g(R.current);return T.addEventListener("reset",A),()=>T.removeEventListener("reset",A)}},[c,g]),b.jsx(De.button,{type:"button",role:"checkbox","aria-checked":ga(h)?"mixed":h,"aria-required":p,"data-state":P_(h),"data-disabled":d?"":void 0,disabled:d,value:u,...s,ref:E,onKeyDown:be(t,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:be(a,T=>{g(A=>ga(A)?!0:!A),_&&S&&(x.current=T.isPropagationStopped(),x.current||T.stopPropagation())})})});j_.displayName=O_;var np=y.forwardRef((e,t)=>{const{__scopeCheckbox:a,name:s,checked:o,defaultChecked:c,required:u,disabled:d,value:h,onCheckedChange:p,form:v,...g}=e;return b.jsx(q3,{__scopeCheckbox:a,checked:o,defaultChecked:c,disabled:d,required:u,onCheckedChange:p,name:s,form:v,value:h,internal_do_not_use_render:({isFormControl:x})=>b.jsxs(b.Fragment,{children:[b.jsx(j_,{...g,ref:t,__scopeCheckbox:a}),x&&b.jsx(U_,{__scopeCheckbox:a})]})})});np.displayName=$u;var M_="CheckboxIndicator",D_=y.forwardRef((e,t)=>{const{__scopeCheckbox:a,forceMount:s,...o}=e,c=tp(M_,a);return b.jsx(Ur,{present:s||ga(c.checked)||c.checked===!0,children:b.jsx(De.span,{"data-state":P_(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});D_.displayName=M_;var L_="CheckboxBubbleInput",U_=y.forwardRef(({__scopeCheckbox:e,...t},a)=>{const{control:s,hasConsumerStoppedPropagationRef:o,checked:c,defaultChecked:u,required:d,disabled:h,name:p,value:v,form:g,bubbleInput:x,setBubbleInput:S}=tp(L_,e),_=qe(a,S),E=k_(c),R=wx(s);y.useEffect(()=>{const A=x;if(!A)return;const N=window.HTMLInputElement.prototype,G=Object.getOwnPropertyDescriptor(N,"checked").set,V=!o.current;if(E!==c&&G){const P=new Event("click",{bubbles:V});A.indeterminate=ga(c),G.call(A,ga(c)?!1:c),A.dispatchEvent(P)}},[x,E,c,o]);const T=y.useRef(ga(c)?!1:c);return b.jsx(De.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??T.current,required:d,disabled:h,name:p,value:v,form:g,...t,tabIndex:-1,ref:_,style:{...t.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});U_.displayName=L_;function G3(e){return typeof e=="function"}function ga(e){return e==="indeterminate"}function P_(e){return ga(e)?"indeterminate":e?"checked":"unchecked"}const z_=y.forwardRef(({className:e,...t},a)=>b.jsx(np,{ref:a,className:ke("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow cursor-pointer focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:b.jsx(D_,{className:ke("grid place-content-center text-current"),children:b.jsx(Cu,{className:"h-4 w-4"})})}));z_.displayName=np.displayName;function L0(e,[t,a]){return Math.min(a,Math.max(t,e))}function V3(e){const t=K3(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(Y3);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function K3(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=X3(o),d=W3(c,o.props);return o.type!==y.Fragment&&(d.ref=s?Dr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var F3=Symbol("radix.slottable");function Y3(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===F3}function W3(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function X3(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var B_=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"}),J3="VisuallyHidden",Q3=y.forwardRef((e,t)=>b.jsx(De.span,{...e,ref:t,style:{...B_,...e.style}}));Q3.displayName=J3;var Z3=[" ","Enter","ArrowUp","ArrowDown"],eU=[" ","Enter"],rs="Select",[Hu,qu,tU]=km(rs),[Ei]=wa(rs,[tU,Mu]),Gu=Mu(),[nU,xa]=Ei(rs),[rU,aU]=Ei(rs),I_=e=>{const{__scopeSelect:t,children:a,open:s,defaultOpen:o,onOpenChange:c,value:u,defaultValue:d,onValueChange:h,dir:p,name:v,autoComplete:g,disabled:x,required:S,form:_}=e,E=Gu(t),[R,T]=y.useState(null),[A,N]=y.useState(null),[L,G]=y.useState(!1),V=Om(p),[P,q]=pi({prop:s,defaultProp:o??!1,onChange:c,caller:rs}),[re,me]=pi({prop:u,defaultProp:d,onChange:h,caller:rs}),ye=y.useRef(null),oe=R?_||!!R.closest("form"):!0,[de,ge]=y.useState(new Set),fe=Array.from(de).map(j=>j.props.value).join(";");return b.jsx(kx,{...E,children:b.jsxs(nU,{required:S,scope:t,trigger:R,onTriggerChange:T,valueNode:A,onValueNodeChange:N,valueNodeHasChildren:L,onValueNodeHasChildrenChange:G,contentId:Rr(),value:re,onValueChange:me,open:P,onOpenChange:q,dir:V,triggerPointerDownPosRef:ye,disabled:x,children:[b.jsx(Hu.Provider,{scope:t,children:b.jsx(rU,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(j=>{ge(F=>new Set(F).add(j))},[]),onNativeOptionRemove:y.useCallback(j=>{ge(F=>{const J=new Set(F);return J.delete(j),J})},[]),children:a})}),oe?b.jsxs(uE,{"aria-hidden":!0,required:S,tabIndex:-1,name:v,autoComplete:g,value:re,onChange:j=>me(j.target.value),disabled:x,form:_,children:[re===void 0?b.jsx("option",{value:""}):null,Array.from(de)]},fe):null]})})};I_.displayName=rs;var $_="SelectTrigger",H_=y.forwardRef((e,t)=>{const{__scopeSelect:a,disabled:s=!1,...o}=e,c=Gu(a),u=xa($_,a),d=u.disabled||s,h=qe(t,u.onTriggerChange),p=qu(a),v=y.useRef("touch"),[g,x,S]=fE(E=>{const R=p().filter(N=>!N.disabled),T=R.find(N=>N.value===u.value),A=hE(R,E,T);A!==void 0&&u.onValueChange(A.value)}),_=E=>{d||(u.onOpenChange(!0),S()),E&&(u.triggerPointerDownPosRef.current={x:Math.round(E.pageX),y:Math.round(E.pageY)})};return b.jsx(Ox,{asChild:!0,...c,children:b.jsx(De.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":dE(u.value)?"":void 0,...o,ref:h,onClick:be(o.onClick,E=>{E.currentTarget.focus(),v.current!=="mouse"&&_(E)}),onPointerDown:be(o.onPointerDown,E=>{v.current=E.pointerType;const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),E.button===0&&E.ctrlKey===!1&&E.pointerType==="mouse"&&(_(E),E.preventDefault())}),onKeyDown:be(o.onKeyDown,E=>{const R=g.current!=="";!(E.ctrlKey||E.altKey||E.metaKey)&&E.key.length===1&&x(E.key),!(R&&E.key===" ")&&Z3.includes(E.key)&&(_(),E.preventDefault())})})})});H_.displayName=$_;var q_="SelectValue",G_=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:s,style:o,children:c,placeholder:u="",...d}=e,h=xa(q_,a),{onValueNodeHasChildrenChange:p}=h,v=c!==void 0,g=qe(t,h.onValueNodeChange);return gt(()=>{p(v)},[p,v]),b.jsx(De.span,{...d,ref:g,style:{pointerEvents:"none"},children:dE(h.value)?b.jsx(b.Fragment,{children:u}):c})});G_.displayName=q_;var sU="SelectIcon",V_=y.forwardRef((e,t)=>{const{__scopeSelect:a,children:s,...o}=e;return b.jsx(De.span,{"aria-hidden":!0,...o,ref:t,children:s||"▼"})});V_.displayName=sU;var iU="SelectPortal",K_=e=>b.jsx(Du,{asChild:!0,...e});K_.displayName=iU;var as="SelectContent",F_=y.forwardRef((e,t)=>{const a=xa(as,e.__scopeSelect),[s,o]=y.useState();if(gt(()=>{o(new DocumentFragment)},[]),!a.open){const c=s;return c?Jo.createPortal(b.jsx(Y_,{scope:e.__scopeSelect,children:b.jsx(Hu.Slot,{scope:e.__scopeSelect,children:b.jsx("div",{children:e.children})})}),c):null}return b.jsx(W_,{...e,ref:t})});F_.displayName=as;var jn=10,[Y_,Sa]=Ei(as),oU="SelectContentImpl",lU=V3("SelectContent.RemoveScroll"),W_=y.forwardRef((e,t)=>{const{__scopeSelect:a,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:c,onPointerDownOutside:u,side:d,sideOffset:h,align:p,alignOffset:v,arrowPadding:g,collisionBoundary:x,collisionPadding:S,sticky:_,hideWhenDetached:E,avoidCollisions:R,...T}=e,A=xa(as,a),[N,L]=y.useState(null),[G,V]=y.useState(null),P=qe(t,te=>L(te)),[q,re]=y.useState(null),[me,ye]=y.useState(null),oe=qu(a),[de,ge]=y.useState(!1),fe=y.useRef(!1);y.useEffect(()=>{if(N)return $m(N)},[N]),jm();const j=y.useCallback(te=>{const[se,...ie]=oe().map(Ee=>Ee.ref.current),[Te]=ie.slice(-1),Re=document.activeElement;for(const Ee of te)if(Ee===Re||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===se&&G&&(G.scrollTop=0),Ee===Te&&G&&(G.scrollTop=G.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==Re))return},[oe,G]),F=y.useCallback(()=>j([q,N]),[j,q,N]);y.useEffect(()=>{de&&F()},[de,F]);const{onOpenChange:J,triggerPointerDownPosRef:ee}=A;y.useEffect(()=>{if(N){let te={x:0,y:0};const se=Te=>{var Re,Ee;te={x:Math.abs(Math.round(Te.pageX)-(((Re=ee.current)==null?void 0:Re.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((Ee=ee.current)==null?void 0:Ee.y)??0))}},ie=Te=>{te.x<=10&&te.y<=10?Te.preventDefault():N.contains(Te.target)||J(!1),document.removeEventListener("pointermove",se),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",se),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",se),document.removeEventListener("pointerup",ie,{capture:!0})}}},[N,J,ee]),y.useEffect(()=>{const te=()=>J(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[J]);const[H,k]=fE(te=>{const se=oe().filter(Re=>!Re.disabled),ie=se.find(Re=>Re.ref.current===document.activeElement),Te=hE(se,te,ie);Te&&setTimeout(()=>Te.ref.current.focus())}),I=y.useCallback((te,se,ie)=>{const Te=!fe.current&&!ie;(A.value!==void 0&&A.value===se||Te)&&(re(te),Te&&(fe.current=!0))},[A.value]),D=y.useCallback(()=>N==null?void 0:N.focus(),[N]),Y=y.useCallback((te,se,ie)=>{const Te=!fe.current&&!ie;(A.value!==void 0&&A.value===se||Te)&&ye(te)},[A.value]),Q=s==="popper"?am:X_,ne=Q===am?{side:d,sideOffset:h,align:p,alignOffset:v,arrowPadding:g,collisionBoundary:x,collisionPadding:S,sticky:_,hideWhenDetached:E,avoidCollisions:R}:{};return b.jsx(Y_,{scope:a,content:N,viewport:G,onViewportChange:V,itemRefCallback:I,selectedItem:q,onItemLeave:D,itemTextRefCallback:Y,focusSelectedItem:F,selectedItemText:me,position:s,isPositioned:de,searchRef:H,children:b.jsx(Uu,{as:lU,allowPinchZoom:!0,children:b.jsx(Au,{asChild:!0,trapped:A.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:be(o,te=>{var se;(se=A.trigger)==null||se.focus({preventScroll:!0}),te.preventDefault()}),children:b.jsx(Ru,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:b.jsx(Q,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:te=>te.preventDefault(),...T,...ne,onPlaced:()=>ge(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:be(T.onKeyDown,te=>{const se=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!se&&te.key.length===1&&k(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let Te=oe().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(te.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const Re=te.target,Ee=Te.indexOf(Re);Te=Te.slice(Ee+1)}setTimeout(()=>j(Te)),te.preventDefault()}})})})})})})});W_.displayName=oU;var cU="SelectItemAlignedPosition",X_=y.forwardRef((e,t)=>{const{__scopeSelect:a,onPlaced:s,...o}=e,c=xa(as,a),u=Sa(as,a),[d,h]=y.useState(null),[p,v]=y.useState(null),g=qe(t,P=>v(P)),x=qu(a),S=y.useRef(!1),_=y.useRef(!0),{viewport:E,selectedItem:R,selectedItemText:T,focusSelectedItem:A}=u,N=y.useCallback(()=>{if(c.trigger&&c.valueNode&&d&&p&&E&&R&&T){const P=c.trigger.getBoundingClientRect(),q=p.getBoundingClientRect(),re=c.valueNode.getBoundingClientRect(),me=T.getBoundingClientRect();if(c.dir!=="rtl"){const Re=me.left-q.left,Ee=re.left-Re,rt=P.left-Ee,Fe=P.width+rt,Cn=Math.max(Fe,q.width),un=window.innerWidth-jn,Jt=L0(Ee,[jn,Math.max(jn,un-Cn)]);d.style.minWidth=Fe+"px",d.style.left=Jt+"px"}else{const Re=q.right-me.right,Ee=window.innerWidth-re.right-Re,rt=window.innerWidth-P.right-Ee,Fe=P.width+rt,Cn=Math.max(Fe,q.width),un=window.innerWidth-jn,Jt=L0(Ee,[jn,Math.max(jn,un-Cn)]);d.style.minWidth=Fe+"px",d.style.right=Jt+"px"}const ye=x(),oe=window.innerHeight-jn*2,de=E.scrollHeight,ge=window.getComputedStyle(p),fe=parseInt(ge.borderTopWidth,10),j=parseInt(ge.paddingTop,10),F=parseInt(ge.borderBottomWidth,10),J=parseInt(ge.paddingBottom,10),ee=fe+j+de+J+F,H=Math.min(R.offsetHeight*5,ee),k=window.getComputedStyle(E),I=parseInt(k.paddingTop,10),D=parseInt(k.paddingBottom,10),Y=P.top+P.height/2-jn,Q=oe-Y,ne=R.offsetHeight/2,te=R.offsetTop+ne,se=fe+j+te,ie=ee-se;if(se<=Y){const Re=ye.length>0&&R===ye[ye.length-1].ref.current;d.style.bottom="0px";const Ee=p.clientHeight-E.offsetTop-E.offsetHeight,rt=Math.max(Q,ne+(Re?D:0)+Ee+F),Fe=se+rt;d.style.height=Fe+"px"}else{const Re=ye.length>0&&R===ye[0].ref.current;d.style.top="0px";const rt=Math.max(Y,fe+E.offsetTop+(Re?I:0)+ne)+ie;d.style.height=rt+"px",E.scrollTop=se-Y+E.offsetTop}d.style.margin=`${jn}px 0`,d.style.minHeight=H+"px",d.style.maxHeight=oe+"px",s==null||s(),requestAnimationFrame(()=>S.current=!0)}},[x,c.trigger,c.valueNode,d,p,E,R,T,c.dir,s]);gt(()=>N(),[N]);const[L,G]=y.useState();gt(()=>{p&&G(window.getComputedStyle(p).zIndex)},[p]);const V=y.useCallback(P=>{P&&_.current===!0&&(N(),A==null||A(),_.current=!1)},[N,A]);return b.jsx(dU,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:S,onScrollButtonChange:V,children:b.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:L},children:b.jsx(De.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});X_.displayName=cU;var uU="SelectPopperPosition",am=y.forwardRef((e,t)=>{const{__scopeSelect:a,align:s="start",collisionPadding:o=jn,...c}=e,u=Gu(a);return b.jsx(jx,{...u,...c,ref:t,align:s,collisionPadding:o,style:{boxSizing:"border-box",...c.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)"}})});am.displayName=uU;var[dU,rp]=Ei(as,{}),sm="SelectViewport",J_=y.forwardRef((e,t)=>{const{__scopeSelect:a,nonce:s,...o}=e,c=Sa(sm,a),u=rp(sm,a),d=qe(t,c.onViewportChange),h=y.useRef(0);return b.jsxs(b.Fragment,{children:[b.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:s}),b.jsx(Hu.Slot,{scope:a,children:b.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,p=>{const v=p.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:x}=u;if(x!=null&&x.current&&g){const S=Math.abs(h.current-v.scrollTop);if(S>0){const _=window.innerHeight-jn*2,E=parseFloat(g.style.minHeight),R=parseFloat(g.style.height),T=Math.max(E,R);if(T<_){const A=T+S,N=Math.min(_,A),L=A-N;g.style.height=N+"px",g.style.bottom==="0px"&&(v.scrollTop=L>0?L:0,g.style.justifyContent="flex-end")}}}h.current=v.scrollTop})})})]})});J_.displayName=sm;var Q_="SelectGroup",[fU,hU]=Ei(Q_),mU=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e,o=Rr();return b.jsx(fU,{scope:a,id:o,children:b.jsx(De.div,{role:"group","aria-labelledby":o,...s,ref:t})})});mU.displayName=Q_;var Z_="SelectLabel",eE=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e,o=hU(Z_,a);return b.jsx(De.div,{id:o.id,...s,ref:t})});eE.displayName=Z_;var vu="SelectItem",[pU,tE]=Ei(vu),nE=y.forwardRef((e,t)=>{const{__scopeSelect:a,value:s,disabled:o=!1,textValue:c,...u}=e,d=xa(vu,a),h=Sa(vu,a),p=d.value===s,[v,g]=y.useState(c??""),[x,S]=y.useState(!1),_=qe(t,A=>{var N;return(N=h.itemRefCallback)==null?void 0:N.call(h,A,s,o)}),E=Rr(),R=y.useRef("touch"),T=()=>{o||(d.onValueChange(s),d.onOpenChange(!1))};if(s==="")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 b.jsx(pU,{scope:a,value:s,disabled:o,textId:E,isSelected:p,onItemTextChange:y.useCallback(A=>{g(N=>N||((A==null?void 0:A.textContent)??"").trim())},[]),children:b.jsx(Hu.ItemSlot,{scope:a,value:s,disabled:o,textValue:v,children:b.jsx(De.div,{role:"option","aria-labelledby":E,"data-highlighted":x?"":void 0,"aria-selected":p&&x,"data-state":p?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...u,ref:_,onFocus:be(u.onFocus,()=>S(!0)),onBlur:be(u.onBlur,()=>S(!1)),onClick:be(u.onClick,()=>{R.current!=="mouse"&&T()}),onPointerUp:be(u.onPointerUp,()=>{R.current==="mouse"&&T()}),onPointerDown:be(u.onPointerDown,A=>{R.current=A.pointerType}),onPointerMove:be(u.onPointerMove,A=>{var N;R.current=A.pointerType,o?(N=h.onItemLeave)==null||N.call(h):R.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(u.onPointerLeave,A=>{var N;A.currentTarget===document.activeElement&&((N=h.onItemLeave)==null||N.call(h))}),onKeyDown:be(u.onKeyDown,A=>{var L;((L=h.searchRef)==null?void 0:L.current)!==""&&A.key===" "||(eU.includes(A.key)&&T(),A.key===" "&&A.preventDefault())})})})})});nE.displayName=vu;var Ao="SelectItemText",rE=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:s,style:o,...c}=e,u=xa(Ao,a),d=Sa(Ao,a),h=tE(Ao,a),p=aU(Ao,a),[v,g]=y.useState(null),x=qe(t,T=>g(T),h.onItemTextChange,T=>{var A;return(A=d.itemTextRefCallback)==null?void 0:A.call(d,T,h.value,h.disabled)}),S=v==null?void 0:v.textContent,_=y.useMemo(()=>b.jsx("option",{value:h.value,disabled:h.disabled,children:S},h.value),[h.disabled,h.value,S]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=p;return gt(()=>(E(_),()=>R(_)),[E,R,_]),b.jsxs(b.Fragment,{children:[b.jsx(De.span,{id:h.textId,...c,ref:x}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Jo.createPortal(c.children,u.valueNode):null]})});rE.displayName=Ao;var aE="SelectItemIndicator",sE=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e;return tE(aE,a).isSelected?b.jsx(De.span,{"aria-hidden":!0,...s,ref:t}):null});sE.displayName=aE;var im="SelectScrollUpButton",iE=y.forwardRef((e,t)=>{const a=Sa(im,e.__scopeSelect),s=rp(im,e.__scopeSelect),[o,c]=y.useState(!1),u=qe(t,s.onScrollButtonChange);return gt(()=>{if(a.viewport&&a.isPositioned){let d=function(){const p=h.scrollTop>0;c(p)};const h=a.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),o?b.jsx(lE,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=a;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});iE.displayName=im;var om="SelectScrollDownButton",oE=y.forwardRef((e,t)=>{const a=Sa(om,e.__scopeSelect),s=rp(om,e.__scopeSelect),[o,c]=y.useState(!1),u=qe(t,s.onScrollButtonChange);return gt(()=>{if(a.viewport&&a.isPositioned){let d=function(){const p=h.scrollHeight-h.clientHeight,v=Math.ceil(h.scrollTop)<p;c(v)};const h=a.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),o?b.jsx(lE,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=a;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});oE.displayName=om;var lE=y.forwardRef((e,t)=>{const{__scopeSelect:a,onAutoScroll:s,...o}=e,c=Sa("SelectScrollButton",a),u=y.useRef(null),d=qu(a),h=y.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),gt(()=>{var v;const p=d().find(g=>g.ref.current===document.activeElement);(v=p==null?void 0:p.ref.current)==null||v.scrollIntoView({block:"nearest"})},[d]),b.jsx(De.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(s,50))}),onPointerMove:be(o.onPointerMove,()=>{var p;(p=c.onItemLeave)==null||p.call(c),u.current===null&&(u.current=window.setInterval(s,50))}),onPointerLeave:be(o.onPointerLeave,()=>{h()})})}),gU="SelectSeparator",cE=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e;return b.jsx(De.div,{"aria-hidden":!0,...s,ref:t})});cE.displayName=gU;var lm="SelectArrow",vU=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e,o=Gu(a),c=xa(lm,a),u=Sa(lm,a);return c.open&&u.position==="popper"?b.jsx(Mx,{...o,...s,ref:t}):null});vU.displayName=lm;var yU="SelectBubbleInput",uE=y.forwardRef(({__scopeSelect:e,value:t,...a},s)=>{const o=y.useRef(null),c=qe(s,o),u=k_(t);return y.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(h,"value").set;if(u!==t&&v){const g=new Event("change",{bubbles:!0});v.call(d,t),d.dispatchEvent(g)}},[u,t]),b.jsx(De.select,{...a,style:{...B_,...a.style},ref:c,defaultValue:t})});uE.displayName=yU;function dE(e){return e===""||e===void 0}function fE(e){const t=Un(e),a=y.useRef(""),s=y.useRef(0),o=y.useCallback(u=>{const d=a.current+u;t(d),(function h(p){a.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>h(""),1e3))})(d)},[t]),c=y.useCallback(()=>{a.current="",window.clearTimeout(s.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(s.current),[]),[a,o,c]}function hE(e,t,a){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,c=a?e.indexOf(a):-1;let u=bU(e,Math.max(c,0));o.length===1&&(u=u.filter(p=>p!==a));const h=u.find(p=>p.textValue.toLowerCase().startsWith(o.toLowerCase()));return h!==a?h:void 0}function bU(e,t){return e.map((a,s)=>e[(t+s)%e.length])}var wU=I_,mE=H_,xU=G_,SU=V_,_U=K_,pE=F_,EU=J_,gE=eE,vE=nE,CU=rE,TU=sE,yE=iE,bE=oE,wE=cE;const zc=wU,Bc=xU,No=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(mE,{ref:s,className:ke("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background cursor-pointer data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[t,b.jsx(SU,{asChild:!0,children:b.jsx(Em,{className:"h-4 w-4 opacity-50"})})]}));No.displayName=mE.displayName;const xE=y.forwardRef(({className:e,...t},a)=>b.jsx(yE,{ref:a,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(nO,{className:"h-4 w-4"})}));xE.displayName=yE.displayName;const SE=y.forwardRef(({className:e,...t},a)=>b.jsx(bE,{ref:a,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(Em,{className:"h-4 w-4"})}));SE.displayName=bE.displayName;const ko=y.forwardRef(({className:e,children:t,position:a="popper",...s},o)=>b.jsx(_U,{children:b.jsxs(pE,{ref:o,className:ke("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)",a==="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:a,...s,children:[b.jsx(xE,{}),b.jsx(EU,{className:ke("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),b.jsx(SE,{})]})}));ko.displayName=pE.displayName;const RU=y.forwardRef(({className:e,...t},a)=>b.jsx(gE,{ref:a,className:ke("px-2 py-1.5 text-sm font-semibold",e),...t}));RU.displayName=gE.displayName;const li=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(vE,{ref:s,className:ke("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[b.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(TU,{children:b.jsx(Cu,{className:"h-4 w-4"})})}),b.jsx(CU,{children:t})]}));li.displayName=vE.displayName;const AU=y.forwardRef(({className:e,...t},a)=>b.jsx(wE,{ref:a,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));AU.displayName=wE.displayName;var NU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],kU=NU.reduce((e,t)=>{const a=Tu(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),OU="Separator",U0="horizontal",jU=["horizontal","vertical"],_E=y.forwardRef((e,t)=>{const{decorative:a,orientation:s=U0,...o}=e,c=MU(s)?s:U0,d=a?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return b.jsx(kU.div,{"data-orientation":c,...d,...o,ref:t})});_E.displayName=OU;function MU(e){return jU.includes(e)}var EE=_E;const Jc=y.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...s},o)=>b.jsx(EE,{ref:o,decorative:a,orientation:t,className:ke("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Jc.displayName=EE.displayName;function DU({value:e,onChange:t}){return b.jsx("div",{className:"flex flex-wrap gap-2",children:rm.map(a=>b.jsx("button",{type:"button",onClick:()=>t(a.id),title:a.name,className:ke("w-9 h-9 rounded-full flex items-center justify-center transition-all ring-offset-2 ring-offset-background hover:scale-110",e===a.id&&"ring-2 ring-foreground/40 scale-110"),style:{backgroundColor:a.hex},children:e===a.id&&b.jsx(Cu,{className:"w-4 h-4 text-white drop-shadow"})},a.id))})}function P0({label:e,prefix:t,links:a,onChange:s,readOnly:o,emptyText:c}){const[u,d]=y.useState(""),h=()=>{const g=u.trim();g&&(s([...a,g]),d(""))},p=(g,x)=>s(a.map((S,_)=>_===g?x:S)),v=g=>s(a.filter((x,S)=>S!==g));return b.jsxs("div",{className:"space-y-2",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("span",{className:"text-sm font-medium text-foreground",children:[e," ",t&&b.jsxs("span",{className:"text-xs text-muted-foreground font-normal",children:["(",t,")"]})]}),b.jsx("span",{className:"text-xs text-muted-foreground",children:a.length})]}),a.length===0&&b.jsx("p",{className:"text-xs text-muted-foreground italic px-1",children:c??"Sin links aún"}),b.jsx("div",{className:"space-y-1.5",children:a.map((g,x)=>b.jsxs("div",{className:"group flex items-center gap-1.5",children:[b.jsxs("div",{className:"flex-shrink-0 w-7 h-7 rounded-md bg-accent flex items-center justify-center text-[10px] font-semibold text-accent-foreground",children:[t??"·",x+1]}),o?b.jsxs("a",{href:g,target:"_blank",rel:"noreferrer",className:"flex-1 text-sm text-primary hover:underline truncate flex items-center gap-1.5 py-1.5 px-2 rounded-md hover:bg-accent/60 transition-colors",children:[b.jsx(yO,{className:"w-3.5 h-3.5 flex-shrink-0"}),b.jsx("span",{className:"truncate",children:g}),b.jsx(dO,{className:"w-3 h-3 flex-shrink-0 opacity-60"})]}):b.jsxs(b.Fragment,{children:[b.jsx(Qn,{value:g,onChange:S=>p(x,S.target.value),placeholder:"https://…",className:"h-9 text-sm"}),b.jsx(Xt,{type:"button",variant:"ghost",size:"icon",className:"h-9 w-9 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>v(x),children:b.jsx(Iw,{className:"w-4 h-4"})})]})]},x))}),!o&&b.jsxs("div",{className:"flex gap-1.5 pt-1",children:[b.jsx(Qn,{value:u,onChange:g=>d(g.target.value),onKeyDown:g=>g.key==="Enter"&&(g.preventDefault(),h()),placeholder:"Pegar link y Enter",className:"h-9 text-sm"}),b.jsxs(Xt,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-9",children:[b.jsx(Tm,{className:"w-4 h-4 mr-1"})," Añadir"]})]})]})}function CE(e){return String(e||"").replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF]/g,"").replace(/\s+/g," ").trim()}function Sn(e){return CE(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function pa(e){const t=CE(e);return Sn(t)==="republica dominicana"?"Republica Dominicana":t}function Ja(e){const t=new Map;for(const a of e){const s=pa(a);if(!s)continue;const o=Sn(s);o&&(t.has(o)||t.set(o,s))}return Array.from(t.values())}function Ic(e,t){const a=Ja(e),s=pa(t);if(!s)return a;const o=Sn(s);return a.some(u=>Sn(u)===o)?a:[s,...a]}const ui={clientes:u3,marcas:f3,bus:d3,buCm:Jm,status:[...h3]};let Qc=[],cm=ui,Ko=!1,TE=!1,ap=null,Do=null,Za=null,$c=0;function um(){Qc.forEach(e=>e())}function da(e){return Ja(e)}function LU(e){return String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function UU(e){const t=LU(e);return["client","clients","cliente","clientes"].includes(t)?"client":["brand","brands","marca","marcas"].includes(t)?"brand":["country","countries","pais","paises","bu","business_unit","business unit"].includes(t)?"country":["status","estatus","estado","estados"].includes(t)?"status":["country_manager","country manager","cm","bu_cm","bu cm","manager","managers"].includes(t)?"country_manager":t}function PU(e){return pa(String(e.label||e.value||""))}function zU(e){const t=[],a=[],s=[],o=[],c={...Jm};for(const u of e){if(u.is_active===!1)continue;const d=UU(u.category),h=PU(u),p=pa(String(u.value||""));if(!(!h&&!p)&&(d==="client"&&t.push(h||p),d==="brand"&&a.push(h||p),d==="country"&&s.push(h||p),d==="status"&&o.push(h||p),d==="country_manager"&&p)){const v=h||p;v&&v!==p&&(c[p]=v)}}return{clientes:t.length?da(t):da(ui.clientes),marcas:a.length?da(a):da(ui.marcas),bus:s.length?da(s):da(ui.bus),buCm:c,status:o.length?da(o):da(ui.status)}}function BU(e){ap=e,um()}async function dm(){Ko=!0,BU(null),um();try{const{data:e,error:t}=await St.from("tablero_cdc_app_lists").select("category, value, label, sort_order, is_active").eq("is_active",!0).order("category",{ascending:!0}).order("sort_order",{ascending:!0}).order("label",{ascending:!0});if(t)throw t;cm=zU(e||[]),TE=!0}catch(e){console.error("Error cargando listas desde Supabase:",e),ap=e instanceof Error?e.message:"No se pudieron cargar los desplegables desde Supabase.",cm=ui}finally{Ko=!1,um()}}function IU(){Za&&clearTimeout(Za),Za=setTimeout(()=>{Za=null,Ko||dm()},350)}function $U(){Do||(Do=St.channel("tablero-cdc-app-lists").on("postgres_changes",{event:"*",schema:"public",table:"tablero_cdc_app_lists"},()=>IU()).subscribe(e=>{(e==="CHANNEL_ERROR"||e==="TIMED_OUT")&&console.warn("Supabase Realtime no pudo suscribirse a tablero_cdc_app_lists:",e)}))}function HU(){Za&&(clearTimeout(Za),Za=null),Do&&(St.removeChannel(Do),Do=null)}function qU(){const[,e]=y.useState(0);return y.useEffect(()=>{const t=()=>e(a=>a+1);return Qc.push(t),$c+=1,$U(),!TE&&!Ko&&dm(),()=>{Qc=Qc.filter(a=>a!==t),$c=Math.max(0,$c-1),$c===0&&HU()}},[]),{lists:cm,loading:Ko,error:ap,refresh:dm}}const RE="blue",AE="Activo",NE="gmarrero@gomezleemarketing.com",GU=[NE,"areyes@gomezleemarketing.com"];let Zc=[],al=[],Fo=!1,kE=!1,sp=null,Lo=null,es=null,Hc=0;function yu(){Zc.forEach(e=>e())}function z0(e,t=""){return typeof e=="string"?e:t}function VU(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function KU(e){return!e||e===AE?"":e}function FU(e){return e&&e.trim()?e:AE}function YU(e){const t=e.extra_data||{},a=e.project_links||[],s=a.filter(d=>d.link_type==="proposal").map(d=>d.url||"").filter(Boolean),o=a.filter(d=>d.link_type==="final_art").map(d=>d.url||"").filter(Boolean),c=e.created_at?new Date(e.created_at).getTime():Date.now(),u=Number.isFinite(c)?new Date(c):new Date;return{id:e.id,nombre:e.title||"",color:z0(t.color,RE),cliente:e.client||"",bu:e.country||"",cm:e.country_manager||"",marca:e.brand||"",solicitante:e.requested_by||"",comentarios:e.description||"",briefLink:e.brief_link||"",propuestaLinks:s,afLinks:o,status:KU(e.status),monto:e.internal_amount==null?null:Number(e.internal_amount),mes:z0(t.mes,"")||u.toLocaleString("es-DO",{month:"long"}),anio:VU(t.anio,u.getFullYear()),createdAt:Number.isFinite(c)?c:Date.now()}}async function ip(){const{data:e,error:t}=await St.auth.getUser();if(t||!e.user)throw new Error("No hay una sesión activa de Supabase.");return e.user}async function OE(){return(await ip()).id}async function jE(){var t;return((t=(await ip()).email)==null?void 0:t.toLowerCase())===NE}async function WU(){var t;const e=await ip();return GU.includes(((t=e.email)==null?void 0:t.toLowerCase())||"")}function ME(e){return{title:e.nombre,client:e.cliente,brand:e.marca,country:e.bu,requested_by:e.solicitante,country_manager:e.cm,description:e.comentarios,status:FU(e.status),internal_amount:e.monto??null,brief_link:e.briefLink,extra_data:{color:e.color??RE,mes:e.mes,anio:e.anio}}}function XU(e,t){const a=t.propuestaLinks.map(o=>o.trim()).filter(Boolean).map((o,c)=>({project_id:e,link_type:"proposal",url:o,label:`Propuesta ${c+1}`})),s=t.afLinks.map(o=>o.trim()).filter(Boolean).map((o,c)=>({project_id:e,link_type:"final_art",url:o,label:`AF ${c+1}`}));return[...a,...s]}function JU(e){al=e,yu()}function Zn(e){sp=e,yu()}function QU(){return"https://agenteit.digitalcompass.agency/webhook/tablero-cdc-sync-proyecto".trim()||""}async function op(e,t){const a=QU();if(!a)return console.info("No se configuró VITE_WEBHOOK_URL; se omite sincronización con Google Sheet."),{sheetSyncStatus:"skipped",sheetSyncMessage:t==="delete"?"No hay webhook configurado para eliminar el proyecto del Google Sheet.":"Proyecto guardado. No hay webhook configurado para sincronizar el Sheet."};const s=new AbortController,o=window.setTimeout(()=>s.abort(),15e3);try{const c=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_id:e,action:t,source:"tablero-cdc",sent_at:new Date().toISOString()}),signal:s.signal});if(!c.ok){const u=await c.text().catch(()=>""),d=u||`${c.status} ${c.statusText}`.trim();return console.warn("El proyecto se guardó en Supabase, pero n8n no respondió correctamente.",{status:c.status,statusText:c.statusText,errorText:u}),{sheetSyncStatus:"failed",sheetSyncMessage:t==="delete"?`No se pudo eliminar el proyecto del Google Sheet: ${d}`:`Proyecto guardado, pero el Sheet no se pudo sincronizar: ${d}`}}return{sheetSyncStatus:"synced",sheetSyncMessage:t==="delete"?"Proyecto eliminado del Google Sheet.":"Proyecto guardado y sincronizado con el Google Sheet."}}catch(c){const u=c instanceof DOMException&&c.name==="AbortError";return console.warn("El proyecto se guardó en Supabase, pero no se pudo sincronizar con Google Sheet.",c),{sheetSyncStatus:u?"timeout":"failed",sheetSyncMessage:u?t==="delete"?"n8n tardó demasiado en responder. No se eliminó el proyecto para evitar inconsistencias.":"Proyecto guardado, pero n8n tardó demasiado en responder. Revisa el workflow si el Sheet no se actualizó.":t==="delete"?"No se pudo eliminar el proyecto del Google Sheet. No se eliminó el proyecto para evitar inconsistencias.":"Proyecto guardado, pero no se pudo sincronizar con Google Sheet."}}finally{window.clearTimeout(o)}}function B0(){es&&clearTimeout(es),es=setTimeout(()=>{es=null,Fo||vi()},350)}function ZU(){Lo||(Lo=St.channel("tablero-cdc-projects").on("postgres_changes",{event:"*",schema:"public",table:"tablero_cdc_projects"},()=>B0()).on("postgres_changes",{event:"*",schema:"public",table:"tablero_cdc_project_links"},()=>B0()).subscribe(e=>{(e==="CHANNEL_ERROR"||e==="TIMED_OUT")&&console.warn("Supabase Realtime no pudo suscribirse a proyectos:",e)}))}function e5(){es&&(clearTimeout(es),es=null),Lo&&(St.removeChannel(Lo),Lo=null)}async function DE(e,t){const{error:a}=await St.from("tablero_cdc_project_links").delete().eq("project_id",e);if(a)throw a;const s=XU(e,t);if(s.length===0)return;const{error:o}=await St.from("tablero_cdc_project_links").insert(s);if(o)throw o}async function vi(){Fo=!0,Zn(null),yu();try{const t=`
id,
title,
client,
brand,
country,
requested_by,
country_manager,
description,
status,
${await jE()?"internal_amount,":""}
brief_link,
created_at,
extra_data,
project_links:tablero_cdc_project_links (
id,
link_type,
url,
label
)
`,{data:a,error:s}=await St.from("tablero_cdc_projects").select(t).order("created_at",{ascending:!1});if(s)throw s;al=(a||[]).map(o=>YU(o)),kE=!0}catch(e){console.error("Error cargando proyectos desde Supabase:",e),sp=e instanceof Error?e.message:"No se pudieron cargar los proyectos desde Supabase."}finally{Fo=!1,yu()}}async function t5(e){Zn(null);const t=await OE(),a={...ME(e),created_by:t,updated_by:t},{data:s,error:o}=await St.from("tablero_cdc_projects").insert(a).select("id").single();if(o)throw Zn(o.message),o;await DE(s.id,e);const c=await op(s.id,"create");return await vi(),{projectId:s.id,...c}}async function n5(e,t){Zn(null);const a=await OE(),s=await jE(),o=al.find(v=>v.id===e),c=o?{...o,...t}:{...t},u=ME(c),d=s?{...u,updated_by:a}:{title:u.title,client:u.client,brand:u.brand,country:u.country,requested_by:u.requested_by,country_manager:u.country_manager,description:u.description,status:u.status,brief_link:u.brief_link,extra_data:u.extra_data,updated_by:a},{error:h}=await St.from("tablero_cdc_projects").update(d).eq("id",e);if(h)throw Zn(h.message),h;await DE(e,c);const p=await op(e,"update");return await vi(),{projectId:e,...p}}async function r5(e){if(Zn(null),!await WU()){const c="No tienes permiso para eliminar proyectos.";throw Zn(c),new Error(c)}const a=await op(e,"delete");if(a.sheetSyncStatus!=="synced"){const c=a.sheetSyncMessage||"No se pudo eliminar el proyecto del Google Sheet.";throw Zn(c),new Error(c)}const{error:s}=await St.from("tablero_cdc_project_links").delete().eq("project_id",e);if(s)throw Zn(s.message),s;const{error:o}=await St.from("tablero_cdc_projects").delete().eq("id",e);if(o)throw Zn(o.message),o;JU(al.filter(c=>c.id!==e)),await vi()}function LE(){const[,e]=y.useState(0);return y.useEffect(()=>{const t=()=>e(a=>a+1);return Zc.push(t),Hc+=1,ZU(),!kE&&!Fo&&vi(),()=>{Zc=Zc.filter(a=>a!==t),Hc=Math.max(0,Hc-1),Hc===0&&e5()}},[]),{projects:al,loading:Fo,error:sp,refresh:vi,add:t5,update:n5,remove:r5}}function a5(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const s5=e=>{switch(e){case"success":return l5;case"info":return u5;case"warning":return c5;case"error":return d5;default:return null}},i5=Array(12).fill(0),o5=({visible:e,className:t})=>ae.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ae.createElement("div",{className:"sonner-spinner"},i5.map((a,s)=>ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),l5=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.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"})),c5=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ae.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"})),u5=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.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"})),d5=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.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"})),f5=ae.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"},ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),h5=()=>{const[e,t]=ae.useState(document.hidden);return ae.useEffect(()=>{const a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let fm=1;class m5{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var a;const{message:s,...o}=t,c=typeof(t==null?void 0:t.id)=="number"||((a=t.id)==null?void 0:a.length)>0?t.id:fm++,u=this.toasts.find(h=>h.id===c),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(h=>h.id===c?(this.publish({...h,...t,id:c,title:s}),{...h,...t,id:c,dismissible:d,title:s}):h):this.addToast({title:s,...o,dismissible:d,id:c}),c},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:t,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),t),this.message=(t,a)=>this.create({...a,message:t}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let c=s!==void 0,u;const d=o.then(async p=>{if(u=["resolve",p],ae.isValidElement(p))c=!1,this.create({id:s,type:"default",message:p});else if(g5(p)&&!p.ok){c=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${p.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${p.status}`):a.description,_=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:x,..._})}else if(p instanceof Error){c=!1;const g=typeof a.error=="function"?await a.error(p):a.error,x=typeof a.description=="function"?await a.description(p):a.description,_=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:x,..._})}else if(a.success!==void 0){c=!1;const g=typeof a.success=="function"?await a.success(p):a.success,x=typeof a.description=="function"?await a.description(p):a.description,_=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:x,..._})}}).catch(async p=>{if(u=["reject",p],a.error!==void 0){c=!1;const v=typeof a.error=="function"?await a.error(p):a.error,g=typeof a.description=="function"?await a.description(p):a.description,S=typeof v=="object"&&!ae.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,...S})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),h=()=>new Promise((p,v)=>d.then(()=>u[0]==="reject"?v(u[1]):p(u[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:h}:Object.assign(s,{unwrap:h})},this.custom=(t,a)=>{const s=(a==null?void 0:a.id)||fm++;return this.create({jsx:t(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Wt=new m5,p5=(e,t)=>{const a=(t==null?void 0:t.id)||fm++;return Wt.addToast({title:e,...t,id:a}),a},g5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",v5=p5,y5=()=>Wt.toasts,b5=()=>Wt.getActiveToasts(),ri=Object.assign(v5,{success:Wt.success,info:Wt.info,warning:Wt.warning,error:Wt.error,custom:Wt.custom,message:Wt.message,promise:Wt.promise,dismiss:Wt.dismiss,loading:Wt.loading},{getHistory:y5,getToasts:b5});a5("[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 qc(e){return e.label!==void 0}const w5=3,x5="24px",S5="16px",I0=4e3,_5=356,E5=14,C5=45,T5=200;function Yn(...e){return e.filter(Boolean).join(" ")}function R5(e){const[t,a]=e.split("-"),s=[];return t&&s.push(t),a&&s.push(a),s}const A5=e=>{var t,a,s,o,c,u,d,h,p;const{invert:v,toast:g,unstyled:x,interacting:S,setHeights:_,visibleToasts:E,heights:R,index:T,toasts:A,expanded:N,removeToast:L,defaultRichColors:G,closeButton:V,style:P,cancelButtonStyle:q,actionButtonStyle:re,className:me="",descriptionClassName:ye="",duration:oe,position:de,gap:ge,expandByDefault:fe,classNames:j,icons:F,closeButtonAriaLabel:J="Close toast"}=e,[ee,H]=ae.useState(null),[k,I]=ae.useState(null),[D,Y]=ae.useState(!1),[Q,ne]=ae.useState(!1),[te,se]=ae.useState(!1),[ie,Te]=ae.useState(!1),[Re,Ee]=ae.useState(!1),[rt,Fe]=ae.useState(0),[Cn,un]=ae.useState(0),Jt=ae.useRef(g.duration||oe||I0),_a=ae.useRef(null),vt=ae.useRef(null),Ci=T===0,Ti=T+1<=E,Mt=g.type,Pr=g.dismissible!==!1,Dt=g.className||"",Vu=g.descriptionClassName||"",Ea=ae.useMemo(()=>R.findIndex(_e=>_e.toastId===g.id)||0,[R,g.id]),sl=ae.useMemo(()=>{var _e;return(_e=g.closeButton)!=null?_e:V},[g.closeButton,V]),Ca=ae.useMemo(()=>g.duration||oe||I0,[g.duration,oe]),Ri=ae.useRef(0),ar=ae.useRef(0),il=ae.useRef(0),zr=ae.useRef(null),[Ta,Lt]=de.split("-"),Tn=ae.useMemo(()=>R.reduce((_e,Ze,yt)=>yt>=Ea?_e:_e+Ze.height,0),[R,Ea]),kt=h5(),Ku=g.invert||v,Ai=Mt==="loading";ar.current=ae.useMemo(()=>Ea*ge+Tn,[Ea,Tn]),ae.useEffect(()=>{Jt.current=Ca},[Ca]),ae.useEffect(()=>{Y(!0)},[]),ae.useEffect(()=>{const _e=vt.current;if(_e){const Ze=_e.getBoundingClientRect().height;return un(Ze),_(yt=>[{toastId:g.id,height:Ze,position:g.position},...yt]),()=>_(yt=>yt.filter(Ot=>Ot.toastId!==g.id))}},[_,g.id]),ae.useLayoutEffect(()=>{if(!D)return;const _e=vt.current,Ze=_e.style.height;_e.style.height="auto";const yt=_e.getBoundingClientRect().height;_e.style.height=Ze,un(yt),_(Ot=>Ot.find(tt=>tt.toastId===g.id)?Ot.map(tt=>tt.toastId===g.id?{...tt,height:yt}:tt):[{toastId:g.id,height:yt,position:g.position},...Ot])},[D,g.title,g.description,_,g.id,g.jsx,g.action,g.cancel]);const In=ae.useCallback(()=>{ne(!0),Fe(ar.current),_(_e=>_e.filter(Ze=>Ze.toastId!==g.id)),setTimeout(()=>{L(g)},T5)},[g,L,_,ar]);ae.useEffect(()=>{if(g.promise&&Mt==="loading"||g.duration===1/0||g.type==="loading")return;let _e;return N||S||kt?(()=>{if(il.current<Ri.current){const Ot=new Date().getTime()-Ri.current;Jt.current=Jt.current-Ot}il.current=new Date().getTime()})():(()=>{Jt.current!==1/0&&(Ri.current=new Date().getTime(),_e=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),In()},Jt.current))})(),()=>clearTimeout(_e)},[N,S,g,Mt,kt,In]),ae.useEffect(()=>{g.delete&&(In(),g.onDismiss==null||g.onDismiss.call(g,g))},[In,g.delete]);function ls(){var _e;if(F!=null&&F.loading){var Ze;return ae.createElement("div",{className:Yn(j==null?void 0:j.loader,g==null||(Ze=g.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":Mt==="loading"},F.loading)}return ae.createElement(o5,{className:Yn(j==null?void 0:j.loader,g==null||(_e=g.classNames)==null?void 0:_e.loader),visible:Mt==="loading"})}const cs=g.icon||(F==null?void 0:F[Mt])||s5(Mt);var Ra,$n;return ae.createElement("li",{tabIndex:0,ref:vt,className:Yn(me,Dt,j==null?void 0:j.toast,g==null||(t=g.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[Mt],g==null||(a=g.classNames)==null?void 0:a[Mt]),"data-sonner-toast":"","data-rich-colors":(Ra=g.richColors)!=null?Ra:G,"data-styled":!(g.jsx||g.unstyled||x),"data-mounted":D,"data-promise":!!g.promise,"data-swiped":Re,"data-removed":Q,"data-visible":Ti,"data-y-position":Ta,"data-x-position":Lt,"data-index":T,"data-front":Ci,"data-swiping":te,"data-dismissible":Pr,"data-type":Mt,"data-invert":Ku,"data-swipe-out":ie,"data-swipe-direction":k,"data-expanded":!!(N||fe&&D),"data-testid":g.testId,style:{"--index":T,"--toasts-before":T,"--z-index":A.length-T,"--offset":`${Q?rt:ar.current}px`,"--initial-height":fe?"auto":`${Cn}px`,...P,...g.style},onDragEnd:()=>{se(!1),H(null),zr.current=null},onPointerDown:_e=>{_e.button!==2&&(Ai||!Pr||(_a.current=new Date,Fe(ar.current),_e.target.setPointerCapture(_e.pointerId),_e.target.tagName!=="BUTTON"&&(se(!0),zr.current={x:_e.clientX,y:_e.clientY})))},onPointerUp:()=>{var _e,Ze,yt;if(ie||!Pr)return;zr.current=null;const Ot=Number(((_e=vt.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Br=Number(((Ze=vt.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tt=new Date().getTime()-((yt=_a.current)==null?void 0:yt.getTime()),zt=ee==="x"?Ot:Br,Aa=Math.abs(zt)/tt;if(Math.abs(zt)>=C5||Aa>.11){Fe(ar.current),g.onDismiss==null||g.onDismiss.call(g,g),I(ee==="x"?Ot>0?"right":"left":Br>0?"down":"up"),In(),Te(!0);return}else{var Bt,It;(Bt=vt.current)==null||Bt.style.setProperty("--swipe-amount-x","0px"),(It=vt.current)==null||It.style.setProperty("--swipe-amount-y","0px")}Ee(!1),se(!1),H(null)},onPointerMove:_e=>{var Ze,yt,Ot;if(!zr.current||!Pr||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;const tt=_e.clientY-zr.current.y,zt=_e.clientX-zr.current.x;var Aa;const Bt=(Aa=e.swipeDirections)!=null?Aa:R5(de);!ee&&(Math.abs(zt)>1||Math.abs(tt)>1)&&H(Math.abs(zt)>Math.abs(tt)?"x":"y");let It={x:0,y:0};const us=Rn=>1/(1.5+Math.abs(Rn)/20);if(ee==="y"){if(Bt.includes("top")||Bt.includes("bottom"))if(Bt.includes("top")&&tt<0||Bt.includes("bottom")&&tt>0)It.y=tt;else{const Rn=tt*us(tt);It.y=Math.abs(Rn)<Math.abs(tt)?Rn:tt}}else if(ee==="x"&&(Bt.includes("left")||Bt.includes("right")))if(Bt.includes("left")&&zt<0||Bt.includes("right")&&zt>0)It.x=zt;else{const Rn=zt*us(zt);It.x=Math.abs(Rn)<Math.abs(zt)?Rn:zt}(Math.abs(It.x)>0||Math.abs(It.y)>0)&&Ee(!0),(yt=vt.current)==null||yt.style.setProperty("--swipe-amount-x",`${It.x}px`),(Ot=vt.current)==null||Ot.style.setProperty("--swipe-amount-y",`${It.y}px`)}},sl&&!g.jsx&&Mt!=="loading"?ae.createElement("button",{"aria-label":J,"data-disabled":Ai,"data-close-button":!0,onClick:Ai||!Pr?()=>{}:()=>{In(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Yn(j==null?void 0:j.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},($n=F==null?void 0:F.close)!=null?$n:f5):null,(Mt||g.icon||g.promise)&&g.icon!==null&&((F==null?void 0:F[Mt])!==null||g.icon)?ae.createElement("div",{"data-icon":"",className:Yn(j==null?void 0:j.icon,g==null||(o=g.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||ls():null,g.type!=="loading"?cs:null):null,ae.createElement("div",{"data-content":"",className:Yn(j==null?void 0:j.content,g==null||(c=g.classNames)==null?void 0:c.content)},ae.createElement("div",{"data-title":"",className:Yn(j==null?void 0:j.title,g==null||(u=g.classNames)==null?void 0:u.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?ae.createElement("div",{"data-description":"",className:Yn(ye,Vu,j==null?void 0:j.description,g==null||(d=g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),ae.isValidElement(g.cancel)?g.cancel:g.cancel&&qc(g.cancel)?ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||q,onClick:_e=>{qc(g.cancel)&&Pr&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,_e),In())},className:Yn(j==null?void 0:j.cancelButton,g==null||(h=g.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,ae.isValidElement(g.action)?g.action:g.action&&qc(g.action)?ae.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||re,onClick:_e=>{qc(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,_e),!_e.defaultPrevented&&In())},className:Yn(j==null?void 0:j.actionButton,g==null||(p=g.classNames)==null?void 0:p.actionButton)},g.action.label):null)};function $0(){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 N5(e,t){const a={};return[e,t].forEach((s,o)=>{const c=o===1,u=c?"--mobile-offset":"--offset",d=c?S5:x5;function h(p){["top","right","bottom","left"].forEach(v=>{a[`${u}-${v}`]=typeof p=="number"?`${p}px`:p})}typeof s=="number"||typeof s=="string"?h(s):typeof s=="object"?["top","right","bottom","left"].forEach(p=>{s[p]===void 0?a[`${u}-${p}`]=d:a[`${u}-${p}`]=typeof s[p]=="number"?`${s[p]}px`:s[p]}):h(d)}),a}const k5=ae.forwardRef(function(t,a){const{id:s,invert:o,position:c="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:h,className:p,offset:v,mobileOffset:g,theme:x="light",richColors:S,duration:_,style:E,visibleToasts:R=w5,toastOptions:T,dir:A=$0(),gap:N=E5,icons:L,containerAriaLabel:G="Notifications"}=t,[V,P]=ae.useState([]),q=ae.useMemo(()=>s?V.filter(D=>D.toasterId===s):V.filter(D=>!D.toasterId),[V,s]),re=ae.useMemo(()=>Array.from(new Set([c].concat(q.filter(D=>D.position).map(D=>D.position)))),[q,c]),[me,ye]=ae.useState([]),[oe,de]=ae.useState(!1),[ge,fe]=ae.useState(!1),[j,F]=ae.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),J=ae.useRef(null),ee=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=ae.useRef(null),k=ae.useRef(!1),I=ae.useCallback(D=>{P(Y=>{var Q;return(Q=Y.find(ne=>ne.id===D.id))!=null&&Q.delete||Wt.dismiss(D.id),Y.filter(({id:ne})=>ne!==D.id)})},[]);return ae.useEffect(()=>Wt.subscribe(D=>{if(D.dismiss){requestAnimationFrame(()=>{P(Y=>Y.map(Q=>Q.id===D.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{fw.flushSync(()=>{P(Y=>{const Q=Y.findIndex(ne=>ne.id===D.id);return Q!==-1?[...Y.slice(0,Q),{...Y[Q],...D},...Y.slice(Q+1)]:[D,...Y]})})})}),[V]),ae.useEffect(()=>{if(x!=="system"){F(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:Y})=>{F(Y?"dark":"light")})}catch{D.addListener(({matches:Q})=>{try{F(Q?"dark":"light")}catch(ne){console.error(ne)}})}},[x]),ae.useEffect(()=>{V.length<=1&&de(!1)},[V]),ae.useEffect(()=>{const D=Y=>{var Q;if(u.every(se=>Y[se]||Y.code===se)){var te;de(!0),(te=J.current)==null||te.focus()}Y.code==="Escape"&&(document.activeElement===J.current||(Q=J.current)!=null&&Q.contains(document.activeElement))&&de(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[u]),ae.useEffect(()=>{if(J.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,k.current=!1)}},[J.current]),ae.createElement("section",{ref:a,"aria-label":`${G} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},re.map((D,Y)=>{var Q;const[ne,te]=D.split("-");return q.length?ae.createElement("ol",{key:D,dir:A==="auto"?$0():A,tabIndex:-1,ref:J,className:p,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":ne,"data-x-position":te,style:{"--front-toast-height":`${((Q=me[0])==null?void 0:Q.height)||0}px`,"--width":`${_5}px`,"--gap":`${N}px`,...E,...N5(v,g)},onBlur:se=>{k.current&&!se.currentTarget.contains(se.relatedTarget)&&(k.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||k.current||(k.current=!0,H.current=se.relatedTarget)},onMouseEnter:()=>de(!0),onMouseMove:()=>de(!0),onMouseLeave:()=>{ge||de(!1)},onDragEnd:()=>de(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||fe(!0)},onPointerUp:()=>fe(!1)},q.filter(se=>!se.position&&Y===0||se.position===D).map((se,ie)=>{var Te,Re;return ae.createElement(A5,{key:se.id,icons:L,index:ie,toast:se,defaultRichColors:S,duration:(Te=T==null?void 0:T.duration)!=null?Te:_,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:o,visibleToasts:R,closeButton:(Re=T==null?void 0:T.closeButton)!=null?Re:h,interacting:ge,position:D,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:I,toasts:q.filter(Ee=>Ee.position==se.position),heights:me.filter(Ee=>Ee.position==se.position),setHeights:ye,expandByDefault:d,gap:N,expanded:oe,swipeDirections:t.swipeDirections})})):null}))}),O5="Walmart Connect WMC";function Gc(e){return Sn(e)===Sn(O5)}const H0=()=>{const e=new Date;return{nombre:"",color:"blue",cliente:"",bu:"",cm:"",marca:"",solicitante:"",comentarios:"",briefLink:"",propuestaLinks:[],afLinks:[],status:"",monto:null,mes:m3[e.getMonth()],anio:e.getFullYear()}};function j5({open:e,onOpenChange:t,project:a,onDelete:s,deleting:o=!1}){const{add:c,update:u}=LE(),{lists:d,loading:h,error:p,refresh:v}=qU(),{isGerardo:g,canDeleteProjects:x}=Zo(),S=!!a,[_,E]=y.useState(H0()),[R,T]=y.useState([]),[A,N]=y.useState(!1),[L,G]=y.useState(null),[V,P]=y.useState(null),q=Ja(Ic(d.clientes,_.cliente)),re=Ja(Ic(d.marcas,_.marca)),me=Ja(Ic(d.bus,_.bu)),ye=Ja(Ic(d.status,_.status));y.useEffect(()=>{if(P(null),G(null),a){const{id:D,createdAt:Y,...Q}=a,ne=pa(Q.bu);E({...Q,bu:ne}),T(ne?[ne]:[])}else e&&(E(H0()),T([]))},[a,e]);const oe=(D,Y)=>E(Q=>({...Q,[D]:Y})),de=D=>{const Y=d.buCm[D];if(Y)return Y;const Q=Sn(D),ne=Object.entries(d.buCm).find(([te])=>Sn(te)===Q);return(ne==null?void 0:ne[1])??""},ge=D=>{const Y=pa(D);E(Q=>({...Q,bu:Y,cm:de(Y)}))},fe=D=>{const Y=pa(D);E(Q=>({...Q,cliente:Y,...Gc(Y)&&!S?{bu:"",cm:""}:Q.cliente&&Gc(Q.cliente)?{bu:"",cm:""}:{}})),Gc(Y)||T([])},j=!S&&Gc(_.cliente),F=(D,Y)=>{const Q=pa(D);T(ne=>Y?Ja([...ne,Q]):ne.filter(te=>Sn(te)!==Sn(Q)))},J=R.map(D=>({country:D,manager:de(D)})),ee=_.nombre.trim()&&_.cliente&&_.marca&&_.solicitante.trim()&&(j?R.length>0:_.bu),H=D=>{if(D.sheetSyncStatus==="synced"){ri.success(S?"Proyecto actualizado":"Proyecto creado",{description:"Se guardó y se sincronizó con el Google Sheet."});return}if(D.sheetSyncStatus==="skipped"){ri.success(S?"Proyecto actualizado":"Proyecto creado",{description:"Se guardó. La sincronización con Google Sheet no está configurada."});return}ri.warning("Proyecto guardado con aviso",{description:D.sheetSyncMessage})},k=async()=>{if(!ee||A)return;const D=g?_:{..._,status:(a==null?void 0:a.status)??"",monto:(a==null?void 0:a.monto)??null};try{if(N(!0),P(null),G("Guardando y sincronizando con Google Sheet…"),j){const Y=R,Q=[];for(const[te,se]of Y.entries()){G(`Guardando Walmart Connect WMC ${te+1} de ${Y.length}: ${se}`);const ie={...D,bu:se,cm:de(se),id:crypto.randomUUID(),createdAt:Date.now()+te};Q.push(await c(ie))}const ne=Q.filter(te=>te.sheetSyncStatus!=="synced");ne.length===0?ri.success("Proyectos Walmart Connect creados",{description:`Se crearon ${Y.length} proyectos y ${Y.length} filas en Google Sheet.`}):ri.warning("Proyectos Walmart Connect creados con aviso",{description:`${ne.length} de ${Y.length} sincronizaciones con Google Sheet requieren revisión.`})}else{const Y=S&&a?await u(a.id,D):await c({...D,id:crypto.randomUUID(),createdAt:Date.now()});H(Y)}t(!1)}catch(Y){console.error("Error guardando proyecto:",Y);const Q=Y instanceof Error?Y.message:"No se pudo guardar el proyecto. Revisa los permisos o intenta de nuevo.";P(Q),ri.error("No se pudo guardar el proyecto",{description:Q})}finally{N(!1),G(null)}},I=!!_.status;return b.jsx(L3,{open:e,onOpenChange:t,children:b.jsxs(S_,{className:"max-w-3xl max-h-[92vh] overflow-y-auto p-0 gap-0",children:[b.jsx("div",{className:"h-2.5 w-full rounded-t-lg",style:{backgroundColor:t_(_.color)}}),b.jsxs("div",{className:"px-7 pt-6 pb-7",children:[b.jsx(__,{className:"space-y-3",children:b.jsx("div",{className:"flex items-start justify-between gap-4",children:b.jsxs("div",{className:"flex-1",children:[b.jsx(C_,{className:"text-2xl tracking-tight",children:S?_.nombre||"Sin título":"Nuevo proyecto"}),b.jsxs(T_,{className:"mt-1 flex items-center gap-2 text-xs",children:[b.jsx(Wk,{className:"w-3.5 h-3.5"}),_.mes," · ",_.anio,I&&b.jsx(nm,{variant:"secondary",className:"ml-2",children:"Cerrado"})]})]})})}),b.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5 mt-6",children:[b.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[b.jsxs(sn,{children:["Nombre del proyecto ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Qn,{value:_.nombre,onChange:D=>oe("nombre",D.target.value),placeholder:"Ej: Promoción Día de las Madres",className:"h-10"})]}),b.jsxs("div",{className:"md:col-span-2 space-y-2",children:[b.jsx(sn,{children:"Etiqueta de color"}),b.jsx(DU,{value:_.color,onChange:D=>oe("color",D)})]}),b.jsx(Jc,{className:"md:col-span-2 my-1"}),(h||p)&&b.jsxs("div",{className:ke("md:col-span-2 flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-xs",p?"border-amber-300/50 bg-amber-50 text-amber-900":"border-border bg-muted/30 text-muted-foreground"),children:[b.jsx("span",{className:"flex items-center gap-2",children:h?b.jsxs(b.Fragment,{children:[b.jsx(Ac,{className:"h-3.5 w-3.5 animate-spin"}),"Cargando listas…"]}):b.jsxs(b.Fragment,{children:[b.jsx(Fh,{className:"h-3.5 w-3.5"}),"No se pudieron cargar las listas. Se usaron opciones locales."]})}),p&&b.jsx("button",{type:"button",onClick:()=>void v(),className:"font-medium text-amber-950 underline-offset-4 hover:underline",children:"Reintentar"})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(sn,{children:["Cliente ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs(zc,{value:_.cliente,onValueChange:fe,children:[b.jsx(No,{className:"h-10",children:b.jsx(Bc,{placeholder:"Seleccionar…"})}),b.jsx(ko,{children:q.map(D=>b.jsx(li,{value:D,children:D},D))})]})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(sn,{children:["Marca ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs(zc,{value:_.marca,onValueChange:D=>oe("marca",D),children:[b.jsx(No,{className:"h-10",children:b.jsx(Bc,{placeholder:"Seleccionar…"})}),b.jsx(ko,{children:re.map(D=>b.jsx(li,{value:D,children:D},D))})]})]}),j?b.jsxs("div",{className:"md:col-span-2 space-y-2 rounded-xl border border-primary/20 bg-primary/5 p-3",children:[b.jsxs("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between",children:[b.jsxs(sn,{children:["BU Solicita (Países) ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs("span",{className:"text-xs font-medium text-primary",children:[R.length," seleccionado(s)"]})]}),b.jsx("p",{className:"text-xs text-muted-foreground",children:"Para Walmart Connect WMC puedes seleccionar varios países. La app creará un proyecto y una fila del Sheet por cada país."}),b.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:me.map(D=>{const Y=R.some(ne=>Sn(ne)===Sn(D)),Q=de(D);return b.jsxs("label",{className:ke("flex cursor-pointer items-start gap-2 rounded-lg border bg-card px-3 py-2 text-sm transition-colors",Y?"border-primary/50 bg-primary/10":"border-border hover:bg-muted/40"),children:[b.jsx(z_,{checked:Y,onCheckedChange:ne=>F(D,ne===!0),className:"mt-0.5"}),b.jsxs("span",{className:"leading-tight",children:[b.jsx("span",{className:"block font-medium",children:D}),b.jsxs("span",{className:"text-xs text-muted-foreground",children:["CM: ",Q||"—"]})]})]},D)})})]}):b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(sn,{children:["BU Solicita (País) ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs(zc,{value:_.bu,onValueChange:ge,children:[b.jsx(No,{className:"h-10",children:b.jsx(Bc,{placeholder:"Seleccionar…"})}),b.jsx(ko,{children:me.map(D=>b.jsx(li,{value:D,children:D},D))})]})]}),b.jsxs("div",{className:ke("space-y-1.5",j&&"md:col-span-2"),children:[b.jsxs(sn,{className:"flex items-center gap-1.5",children:["Country Manager ",b.jsx("span",{className:"text-xs text-muted-foreground",children:"(automático)"})]}),j?b.jsx("div",{className:"min-h-10 rounded-md border border-border bg-muted/30 px-3 py-2 text-sm",children:J.length===0?b.jsx("span",{className:"text-muted-foreground",children:"Selecciona uno o más países."}):b.jsx("div",{className:"flex flex-wrap gap-1.5",children:J.map(({country:D,manager:Y})=>b.jsxs(nm,{variant:"secondary",className:"font-normal",children:[D,": ",Y||"—"]},D))})}):b.jsx(Qn,{value:_.cm,readOnly:!0,disabled:!0,className:"h-10 bg-muted/50",placeholder:"—"})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(sn,{children:["Solicitado por ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Qn,{value:_.solicitante,onChange:D=>oe("solicitante",D.target.value),placeholder:"Nombre de quien solicita",className:"h-10"})]}),b.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[b.jsx(sn,{children:"Comentarios"}),b.jsx(N_,{value:_.comentarios,onChange:D=>oe("comentarios",D.target.value),placeholder:"Notas adicionales del proyecto…",rows:2})]}),b.jsx(Jc,{className:"md:col-span-2 my-1"}),b.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[b.jsxs(sn,{children:["Link del Brief"," ",b.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"(carpeta de Fulgencio)"})]}),b.jsx(Qn,{value:_.briefLink,onChange:D=>oe("briefLink",D.target.value),placeholder:"https://drive.google.com/…",className:"h-10"})]}),b.jsx("div",{className:"md:col-span-2",children:b.jsx(P0,{label:"Links de Propuestas",links:_.propuestaLinks,onChange:D=>oe("propuestaLinks",D),emptyText:"Aún no hay propuestas. Pega tantos links como necesites."})}),b.jsx("div",{className:"md:col-span-2",children:b.jsx(P0,{label:"Links de Artes Finales",prefix:"AF",links:_.afLinks,onChange:D=>oe("afLinks",D),emptyText:"Aún no hay artes finales."})}),b.jsx(Jc,{className:"md:col-span-2 my-1"}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(sn,{className:"flex items-center gap-1.5",children:["Estatus",!g&&b.jsx(xO,{className:"w-3 h-3 text-muted-foreground"})]}),g?b.jsxs(zc,{value:_.status||"_none",onValueChange:D=>oe("status",D==="_none"?"":D),children:[b.jsx(No,{className:"h-10",children:b.jsx(Bc,{placeholder:"Sin estatus"})}),b.jsxs(ko,{children:[b.jsx(li,{value:"_none",children:"Sin estatus"}),ye.map(D=>b.jsx(li,{value:D,children:D},D))]})]}):b.jsx("div",{className:"h-10 px-3 flex items-center rounded-md border border-border bg-muted/30 text-sm text-foreground",children:_.status||"Sin estatus"}),!g&&b.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Solo Gerardo Marrero puede cambiar el estatus."})]}),g&&b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(sn,{className:"flex items-center gap-1.5",children:[b.jsx(cO,{className:"w-3.5 h-3.5"})," Interno Cargado"]}),b.jsx(Qn,{type:"number",value:_.monto??"",onChange:D=>oe("monto",D.target.value===""?null:Number(D.target.value)),placeholder:"0.00",className:"h-10"}),b.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Privado · solo Gerardo Marrero."})]})]}),(V||L)&&b.jsxs("div",{className:ke("mt-5 flex items-start gap-2 rounded-xl border px-3 py-2 text-sm",V?"border-destructive/30 bg-destructive/5 text-destructive":"border-primary/20 bg-primary/5 text-primary"),children:[V?b.jsx(Fh,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}):b.jsx(Ac,{className:"mt-0.5 h-4 w-4 flex-shrink-0 animate-spin"}),b.jsx("span",{children:V||L})]})]}),b.jsx(E_,{className:"px-7 py-4 border-t bg-muted/30 rounded-b-lg sm:justify-between",children:b.jsxs("div",{className:"flex w-full flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[b.jsx("div",{children:S&&a&&x&&s&&b.jsxs(Xt,{type:"button",variant:"destructive",onClick:()=>s(a),disabled:A||o,className:"gap-1.5 rounded-full",children:[o?b.jsx(Ac,{className:"h-4 w-4 animate-spin"}):b.jsx(jO,{className:"h-4 w-4"}),o?"Eliminando…":"Eliminar proyecto"]})}),b.jsxs("div",{className:"flex justify-end gap-2",children:[b.jsx(Xt,{variant:"ghost",onClick:()=>t(!1),disabled:A||o,children:"Cancelar"}),b.jsxs(Xt,{onClick:k,disabled:!ee||A||o,children:[A&&b.jsx(Ac,{className:"mr-1.5 h-4 w-4 animate-spin"}),A?"Guardando…":S?"Guardar cambios":j?"Crear proyectos":"Crear proyecto"]})]})]})})]})})}const Eo=12;function M5(e,t){if(e){const a=e.trim().split(/\s+/);return a.length>=2?(a[0][0]+a[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}return t?t.slice(0,2).toUpperCase():"?"}function D5(){const{projects:e,loading:t,error:a,refresh:s,remove:o}=LE(),{user:c,isGerardo:u,logout:d}=Zo(),h=y.useRef(null),[p,v]=y.useState(!1),[g,x]=y.useState(null),[S,_]=y.useState(""),[E,R]=y.useState("todos"),[T,A]=y.useState({todos:1,abiertos:1,cerrados:1}),[N,L]=y.useState(null),G=y.useMemo(()=>{const H=S.trim().toLowerCase();return[...e].sort((I,D)=>D.createdAt-I.createdAt).filter(I=>E==="abiertos"&&I.status||E==="cerrados"&&!I.status?!1:H?[I.nombre,I.cliente,I.marca,I.bu,I.solicitante].join(" ").toLowerCase().includes(H):!0)},[e,S,E]),V=T[E],P=Math.max(1,Math.ceil(G.length/Eo)),q=Math.min(V,P),re=(q-1)*Eo,me=G.slice(re,re+Eo),ye=G.length===0?0:re+1,oe=Math.min(re+Eo,G.length);y.useEffect(()=>{A(H=>({...H,[E]:1}))},[S,E]),y.useEffect(()=>{V>P&&A(H=>({...H,[E]:P}))},[V,E,P]);const de=H=>{const k=Math.min(Math.max(H,1),P);A(I=>({...I,[E]:k})),window.requestAnimationFrame(()=>{var I;(I=h.current)==null||I.scrollIntoView({behavior:"smooth",block:"start"})})},ge=()=>{x(null),v(!0)},fe=H=>{x(H),v(!0)},j=async H=>{if(window.confirm(`¿Seguro que deseas eliminar el proyecto "${H.nombre||"Sin título"}"?
Esta acción eliminará el proyecto del tablero y del Google Sheet.`)){L(H.id);try{await o(H.id),(g==null?void 0:g.id)===H.id&&(v(!1),x(null))}catch(I){console.error("Error eliminando proyecto:",I);const D=I instanceof Error?I.message:"No se pudo eliminar el proyecto. Revisa n8n, Supabase o permisos.";window.alert(D)}finally{L(null)}}},F=(c==null?void 0:c.displayName)??(c==null?void 0:c.email)??"Usuario",J=u?"Jefe CDC":"Usuario CDC",ee=M5(c==null?void 0:c.displayName,c==null?void 0:c.email);return b.jsxs("div",{className:"min-h-screen bg-background",children:[b.jsx("header",{className:"sticky top-0 z-30 bg-background/85 backdrop-blur-md border-b border-border",children:b.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-3.5 flex items-center gap-4",children:[b.jsxs("div",{className:"flex items-center gap-2.5",children:[b.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary flex items-center justify-center",children:b.jsx(Cm,{className:"w-4 h-4 text-primary-foreground"})}),b.jsxs("div",{className:"leading-tight",children:[b.jsx("h1",{className:"text-[15px] font-semibold tracking-tight",children:"Tablero CDC"}),b.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Aprobaciones de Proyectos"})]})]}),b.jsxs("div",{className:"flex-1 max-w-md ml-4 relative hidden md:block",children:[b.jsx(Xb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),b.jsx(Qn,{value:S,onChange:H=>_(H.target.value),placeholder:"Buscar proyecto, cliente, marca…",className:"pl-9 h-9 bg-muted/40 border-transparent focus-visible:bg-card focus-visible:border-border"})]}),b.jsx("div",{className:"flex-1 md:flex-none"}),b.jsxs(VL,{children:[b.jsx(KL,{asChild:!0,children:b.jsxs(Xt,{variant:"ghost",size:"sm",className:"gap-2 h-9 px-2.5",children:[b.jsxs(QS,{className:"w-7 h-7",children:[(c==null?void 0:c.photoURL)&&b.jsx(ZS,{src:c.photoURL,alt:F,referrerPolicy:"no-referrer"}),b.jsx(e_,{className:u?"bg-primary text-primary-foreground text-xs":"bg-accent text-accent-foreground text-xs",children:ee})]}),b.jsxs("div",{className:"text-left leading-tight hidden sm:block",children:[b.jsx("div",{className:"text-xs font-medium",children:F}),b.jsx("div",{className:"text-[10px] text-muted-foreground",children:J})]}),b.jsx(Em,{className:"w-3.5 h-3.5 text-muted-foreground"})]})}),b.jsxs(IS,{align:"end",className:"w-52",children:[b.jsxs("div",{className:"px-3 py-2",children:[b.jsx("p",{className:"text-xs font-medium truncate",children:F}),b.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:c==null?void 0:c.email})]}),b.jsx(HS,{}),b.jsxs($S,{onClick:d,className:"gap-2 text-destructive focus:text-destructive focus:bg-destructive/10 cursor-pointer",children:[b.jsx(_O,{className:"w-3.5 h-3.5"}),"Cerrar sesión"]})]})]}),b.jsxs(Xt,{onClick:ge,className:"gap-1.5 h-9 rounded-full px-4 shadow-sm",children:[b.jsx(Tm,{className:"w-4 h-4"})," Nuevo"]})]})}),b.jsxs("div",{ref:h,className:"max-w-[1400px] mx-auto px-6 pt-6 pb-3 space-y-3",children:[b.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[b.jsx("div",{children:b.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Proyectos"})}),b.jsx("div",{className:"flex items-center gap-2",children:b.jsx("div",{className:"inline-flex bg-muted/60 rounded-full p-1 text-xs",children:[["todos","Todos"],["abiertos","Activos"],["cerrados","Cerrados"]].map(([H,k])=>b.jsx("button",{onClick:()=>R(H),className:`px-3.5 py-1.5 rounded-full transition-colors font-medium ${E===H?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:k},H))})})]}),b.jsxs("div",{className:"relative md:hidden",children:[b.jsx(Xb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),b.jsx(Qn,{value:S,onChange:H=>_(H.target.value),placeholder:"Buscar proyecto, cliente, marca…",className:"pl-9 h-9 bg-muted/40 border-transparent focus-visible:bg-card focus-visible:border-border"})]})]}),b.jsxs("main",{className:"max-w-[1400px] mx-auto px-6 pb-16",children:[a&&b.jsxs("div",{className:"mb-4 flex flex-col gap-3 rounded-2xl border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive sm:flex-row sm:items-center sm:justify-between",children:[b.jsxs("span",{className:"flex items-start gap-2",children:[b.jsx(Fh,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),b.jsxs("span",{children:[b.jsx("span",{className:"font-medium",children:"No se pudieron cargar los proyectos."})," ",a]})]}),b.jsxs(Xt,{variant:"outline",size:"sm",onClick:()=>void s(),className:"gap-1.5",children:[b.jsx(AO,{className:"h-3.5 w-3.5"})," Reintentar"]})]}),t&&e.length===0?b.jsx(P5,{}):G.length===0?b.jsx(z5,{onNew:ge,hasProjects:e.length>0,filter:E,query:S}):b.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:me.map(H=>b.jsx(p3,{project:H,onClick:()=>fe(H)},H.id))}),G.length>Eo&&b.jsx(L5,{currentPage:q,totalPages:P,visibleStart:ye,visibleEnd:oe,totalItems:G.length,onPageChange:de})]}),b.jsx(j5,{open:p,onOpenChange:v,project:g,onDelete:j,deleting:!!g&&N===g.id})]})}function L5({currentPage:e,totalPages:t,visibleStart:a,visibleEnd:s,totalItems:o,onPageChange:c}){const u=U5(e,t);return b.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row items-center justify-between gap-3 rounded-2xl border border-border bg-card/70 px-4 py-3",children:[b.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.jsxs("span",{className:"font-medium text-foreground",children:[a,"-",s]})," ","de ",b.jsx("span",{className:"font-medium text-foreground",children:o})," proyectos"]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsxs(Xt,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1 rounded-full px-2.5",onClick:()=>c(e-1),disabled:e===1,children:[b.jsx(Zk,{className:"h-4 w-4"}),b.jsx("span",{className:"hidden sm:inline",children:"Anterior"})]}),b.jsx("div",{className:"flex items-center gap-1",children:u.map((d,h)=>d==="ellipsis"?b.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-xs text-muted-foreground",children:"…"},`ellipsis-${h}`):b.jsx(Xt,{type:"button",variant:d===e?"default":"ghost",size:"sm",className:"h-8 w-8 rounded-full p-0 text-xs",onClick:()=>c(d),"aria-current":d===e?"page":void 0,children:d},d))}),b.jsxs(Xt,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1 rounded-full px-2.5",onClick:()=>c(e+1),disabled:e===t,children:[b.jsx("span",{className:"hidden sm:inline",children:"Siguiente"}),b.jsx(Bw,{className:"h-4 w-4"})]})]})]})}function U5(e,t){if(t<=7)return Array.from({length:t},(o,c)=>c+1);const a=new Set([1,t,e]);return e>1&&a.add(e-1),e<t&&a.add(e+1),e<=3&&(a.add(2),a.add(3),a.add(4)),e>=t-2&&(a.add(t-3),a.add(t-2),a.add(t-1)),Array.from(a).filter(o=>o>=1&&o<=t).sort((o,c)=>o-c).reduce((o,c)=>{const u=o[o.length-1];return typeof u=="number"&&c-u>1&&o.push("ellipsis"),o.push(c),o},[])}function P5(){return b.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Array.from({length:8}).map((e,t)=>b.jsxs("div",{className:"min-h-[230px] overflow-hidden rounded-2xl border border-border bg-card",children:[b.jsx("div",{className:"h-14 bg-muted animate-pulse"}),b.jsxs("div",{className:"space-y-3 p-4",children:[b.jsx("div",{className:"h-3 w-3/4 rounded-full bg-muted animate-pulse"}),b.jsx("div",{className:"h-3 w-2/3 rounded-full bg-muted animate-pulse"}),b.jsx("div",{className:"h-3 w-1/2 rounded-full bg-muted animate-pulse"}),b.jsx("div",{className:"mt-6 h-8 rounded-full bg-muted animate-pulse"})]})]},t))})}function z5({onNew:e,hasProjects:t,filter:a,query:s}){const o=s.trim().length>0;let c="Tu tablero está vacío",u="Crea tu primer proyecto para que el equipo pueda darle seguimiento.";return t&&o?(c="Nada coincide con la búsqueda",u="Intenta cambiar la búsqueda o borrar el texto escrito."):t&&a==="abiertos"?(c="No hay proyectos activos",u="Cuando se cree un proyecto nuevo, aparecerá en esta pestaña."):t&&a==="cerrados"?(c="No hay proyectos cerrados",u="Cuando Gerardo asigne un estatus a un proyecto, aparecerá aquí."):t&&(c="Nada coincide con el filtro",u="Intenta quitar el filtro o cambiar la búsqueda."),b.jsxs("div",{className:"text-center py-24 rounded-2xl border border-dashed border-border bg-card/40",children:[b.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 mx-auto flex items-center justify-center mb-4",children:b.jsx(Cm,{className:"w-6 h-6 text-primary"})}),b.jsx("h3",{className:"text-lg font-semibold",children:c}),b.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-sm mx-auto",children:u}),!t&&b.jsxs(Xt,{onClick:e,className:"mt-5 gap-1.5 rounded-full",children:[b.jsx(Tm,{className:"w-4 h-4"})," Crear proyecto"]})]})}const B5=({...e})=>b.jsx(k5,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e});class I5 extends y.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,a){console.error("Uncaught error:",t,a)}render(){return this.state.hasError?b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:b.jsxs("div",{className:"max-w-md text-center",children:[b.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground",children:"Ocurrió un error al cargar el tablero."}),b.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Intenta recargar la página."}),b.jsx("div",{className:"mt-6",children:b.jsx("button",{onClick:()=>window.location.reload(),className:"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Recargar"})})]})}):this.props.children}}function $5(){const{user:e,loading:t}=Zo();return t?b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:b.jsxs("div",{className:"flex flex-col items-center gap-3",children:[b.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary flex items-center justify-center animate-pulse",children:b.jsxs("svg",{className:"w-4 h-4 text-primary-foreground",fill:"none",viewBox:"0 0 24 24",children:[b.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",fill:"currentColor"}),b.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.5"}),b.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.5"}),b.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",fill:"currentColor"})]})}),b.jsx("p",{className:"text-sm text-muted-foreground",children:"Cargando tablero…"})]})}):e?b.jsx(tR,{children:b.jsx(ow,{path:"/*",element:b.jsx(D5,{})})}):b.jsx(U2,{})}function H5(){return b.jsx(I5,{children:b.jsx(Hk,{children:b.jsxs(CR,{basename:"/tablero-cdc/",children:[b.jsx($5,{}),b.jsx(B5,{richColors:!0,position:"top-right"})]})})})}nT.createRoot(document.getElementById("root")).render(b.jsx(y.StrictMode,{children:b.jsx(H5,{})}));