@owox/web 0.11.0-next-20251030104310 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,745 +0,0 @@
|
|
|
1
|
-
var J6=Object.defineProperty;var ek=(e,t,n)=>t in e?J6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _s=(e,t,n)=>ek(e,typeof t!="symbol"?t+"":t,n);function tk(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function dj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qy={exports:{}},Ed={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var d2;function nk(){if(d2)return Ed;d2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:l}}return Ed.Fragment=t,Ed.jsx=n,Ed.jsxs=n,Ed}var f2;function rk(){return f2||(f2=1,Qy.exports=nk()),Qy.exports}var o=rk(),Xy={exports:{}},ct={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var h2;function ak(){if(h2)return ct;h2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function R(L,P,W){this.props=L,this.context=P,this.refs=E,this.updater=W||w}R.prototype.isReactComponent={},R.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,P,"setState")},R.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function T(){}T.prototype=R.prototype;function j(L,P,W){this.props=L,this.context=P,this.refs=E,this.updater=W||w}var O=j.prototype=new T;O.constructor=j,C(O,R.prototype),O.isPureReactComponent=!0;var D=Array.isArray;function _(){}var A={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function U(L,P,W){var ae=W.ref;return{$$typeof:e,type:L,key:P,ref:ae!==void 0?ae:null,props:W}}function B(L,P){return U(L.type,P,L.props)}function G(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function K(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(W){return P[W]})}var re=/\/+/g;function H(L,P){return typeof L=="object"&&L!==null&&L.key!=null?K(""+L.key):P.toString(36)}function $(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(_,_):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function I(L,P,W,ae,fe){var ge=typeof L;(ge==="undefined"||ge==="boolean")&&(L=null);var ue=!1;if(L===null)ue=!0;else switch(ge){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(L.$$typeof){case e:case t:ue=!0;break;case g:return ue=L._init,I(ue(L._payload),P,W,ae,fe)}}if(ue)return fe=fe(L),ue=ae===""?"."+H(L,0):ae,D(fe)?(W="",ue!=null&&(W=ue.replace(re,"$&/")+"/"),I(fe,P,W,"",function(xe){return xe})):fe!=null&&(G(fe)&&(fe=B(fe,W+(fe.key==null||L&&L.key===fe.key?"":(""+fe.key).replace(re,"$&/")+"/")+ue)),P.push(fe)),1;ue=0;var Ne=ae===""?".":ae+":";if(D(L))for(var Re=0;Re<L.length;Re++)ae=L[Re],ge=Ne+H(ae,Re),ue+=I(ae,P,W,ge,fe);else if(Re=b(L),typeof Re=="function")for(L=Re.call(L),Re=0;!(ae=L.next()).done;)ae=ae.value,ge=Ne+H(ae,Re++),ue+=I(ae,P,W,ge,fe);else if(ge==="object"){if(typeof L.then=="function")return I($(L),P,W,ae,fe);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return ue}function Y(L,P,W){if(L==null)return L;var ae=[],fe=0;return I(L,ae,"","",function(ge){return P.call(W,ge,fe++)}),ae}function Z(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(W){(L._status===0||L._status===-1)&&(L._status=1,L._result=W)},function(W){(L._status===0||L._status===-1)&&(L._status=2,L._result=W)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var ie=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},be={map:Y,forEach:function(L,P,W){Y(L,function(){P.apply(this,arguments)},W)},count:function(L){var P=0;return Y(L,function(){P++}),P},toArray:function(L){return Y(L,function(P){return P})||[]},only:function(L){if(!G(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return ct.Activity=v,ct.Children=be,ct.Component=R,ct.Fragment=n,ct.Profiler=s,ct.PureComponent=j,ct.StrictMode=r,ct.Suspense=h,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,ct.__COMPILER_RUNTIME={__proto__:null,c:function(L){return A.H.useMemoCache(L)}},ct.cache=function(L){return function(){return L.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(L,P,W){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ae=C({},L.props),fe=L.key;if(P!=null)for(ge in P.key!==void 0&&(fe=""+P.key),P)!M.call(P,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&P.ref===void 0||(ae[ge]=P[ge]);var ge=arguments.length-2;if(ge===1)ae.children=W;else if(1<ge){for(var ue=Array(ge),Ne=0;Ne<ge;Ne++)ue[Ne]=arguments[Ne+2];ae.children=ue}return U(L.type,fe,ae)},ct.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},ct.createElement=function(L,P,W){var ae,fe={},ge=null;if(P!=null)for(ae in P.key!==void 0&&(ge=""+P.key),P)M.call(P,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(fe[ae]=P[ae]);var ue=arguments.length-2;if(ue===1)fe.children=W;else if(1<ue){for(var Ne=Array(ue),Re=0;Re<ue;Re++)Ne[Re]=arguments[Re+2];fe.children=Ne}if(L&&L.defaultProps)for(ae in ue=L.defaultProps,ue)fe[ae]===void 0&&(fe[ae]=ue[ae]);return U(L,ge,fe)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(L){return{$$typeof:d,render:L}},ct.isValidElement=G,ct.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:Z}},ct.memo=function(L,P){return{$$typeof:m,type:L,compare:P===void 0?null:P}},ct.startTransition=function(L){var P=A.T,W={};A.T=W;try{var ae=L(),fe=A.S;fe!==null&&fe(W,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(_,ie)}catch(ge){ie(ge)}finally{P!==null&&W.types!==null&&(P.types=W.types),A.T=P}},ct.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},ct.use=function(L){return A.H.use(L)},ct.useActionState=function(L,P,W){return A.H.useActionState(L,P,W)},ct.useCallback=function(L,P){return A.H.useCallback(L,P)},ct.useContext=function(L){return A.H.useContext(L)},ct.useDebugValue=function(){},ct.useDeferredValue=function(L,P){return A.H.useDeferredValue(L,P)},ct.useEffect=function(L,P){return A.H.useEffect(L,P)},ct.useEffectEvent=function(L){return A.H.useEffectEvent(L)},ct.useId=function(){return A.H.useId()},ct.useImperativeHandle=function(L,P,W){return A.H.useImperativeHandle(L,P,W)},ct.useInsertionEffect=function(L,P){return A.H.useInsertionEffect(L,P)},ct.useLayoutEffect=function(L,P){return A.H.useLayoutEffect(L,P)},ct.useMemo=function(L,P){return A.H.useMemo(L,P)},ct.useOptimistic=function(L,P){return A.H.useOptimistic(L,P)},ct.useReducer=function(L,P,W){return A.H.useReducer(L,P,W)},ct.useRef=function(L){return A.H.useRef(L)},ct.useState=function(L){return A.H.useState(L)},ct.useSyncExternalStore=function(L,P,W){return A.H.useSyncExternalStore(L,P,W)},ct.useTransition=function(){return A.H.useTransition()},ct.version="19.2.0",ct}var m2;function ub(){return m2||(m2=1,Xy.exports=ak()),Xy.exports}var p=ub();const je=dj(p),fj=tk({__proto__:null,default:je},[p]);var Jy={exports:{}},Rd={},ex={exports:{}},tx={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var p2;function sk(){return p2||(p2=1,(function(e){function t(I,Y){var Z=I.length;I.push(Y);e:for(;0<Z;){var ie=Z-1>>>1,be=I[ie];if(0<s(be,Y))I[ie]=Y,I[Z]=be,Z=ie;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var Y=I[0],Z=I.pop();if(Z!==Y){I[0]=Z;e:for(var ie=0,be=I.length,L=be>>>1;ie<L;){var P=2*(ie+1)-1,W=I[P],ae=P+1,fe=I[ae];if(0>s(W,Z))ae<be&&0>s(fe,W)?(I[ie]=fe,I[ae]=Z,ie=ae):(I[ie]=W,I[P]=Z,ie=P);else if(ae<be&&0>s(fe,Z))I[ie]=fe,I[ae]=Z,ie=ae;else break e}}return Y}function s(I,Y){var Z=I.sortIndex-Y.sortIndex;return Z!==0?Z:I.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],g=1,v=null,x=3,b=!1,w=!1,C=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function O(I){for(var Y=n(m);Y!==null;){if(Y.callback===null)r(m);else if(Y.startTime<=I)r(m),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=n(m)}}function D(I){if(C=!1,O(I),!w)if(n(h)!==null)w=!0,_||(_=!0,K());else{var Y=n(m);Y!==null&&$(D,Y.startTime-I)}}var _=!1,A=-1,M=5,U=-1;function B(){return E?!0:!(e.unstable_now()-U<M)}function G(){if(E=!1,_){var I=e.unstable_now();U=I;var Y=!0;try{e:{w=!1,C&&(C=!1,T(A),A=-1),b=!0;var Z=x;try{t:{for(O(I),v=n(h);v!==null&&!(v.expirationTime>I&&B());){var ie=v.callback;if(typeof ie=="function"){v.callback=null,x=v.priorityLevel;var be=ie(v.expirationTime<=I);if(I=e.unstable_now(),typeof be=="function"){v.callback=be,O(I),Y=!0;break t}v===n(h)&&r(h),O(I)}else r(h);v=n(h)}if(v!==null)Y=!0;else{var L=n(m);L!==null&&$(D,L.startTime-I),Y=!1}}break e}finally{v=null,x=Z,b=!1}Y=void 0}}finally{Y?K():_=!1}}}var K;if(typeof j=="function")K=function(){j(G)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,H=re.port2;re.port1.onmessage=G,K=function(){H.postMessage(null)}}else K=function(){R(G,0)};function $(I,Y){A=R(function(){I(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(I){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var Z=x;x=Y;try{return I()}finally{x=Z}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(I,Y){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var Z=x;x=I;try{return Y()}finally{x=Z}},e.unstable_scheduleCallback=function(I,Y,Z){var ie=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?ie+Z:ie):Z=ie,I){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=Z+be,I={id:g++,callback:Y,priorityLevel:I,startTime:Z,expirationTime:be,sortIndex:-1},Z>ie?(I.sortIndex=Z,t(m,I),n(h)===null&&I===n(m)&&(C?(T(A),A=-1):C=!0,$(D,Z-ie))):(I.sortIndex=be,t(h,I),w||b||(w=!0,_||(_=!0,K()))),I},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(I){var Y=x;return function(){var Z=x;x=Y;try{return I.apply(this,arguments)}finally{x=Z}}}})(tx)),tx}var g2;function ok(){return g2||(g2=1,ex.exports=sk()),ex.exports}var nx={exports:{}},_r={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var v2;function ik(){if(v2)return _r;v2=1;var e=ub();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(h,m,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:h,containerInfo:m,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return _r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,_r.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(h,m,null,g)},_r.flushSync=function(h){var m=c.T,g=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=m,r.p=g,r.d.f()}},_r.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},_r.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},_r.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:b}):g==="script"&&r.d.X(h,{crossOrigin:v,integrity:x,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},_r.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},_r.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin);r.d.L(h,g,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},_r.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=d(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},_r.requestFormReset=function(h){r.d.r(h)},_r.unstable_batchedUpdates=function(h,m){return h(m)},_r.useFormState=function(h,m,g){return c.H.useFormState(h,m,g)},_r.useFormStatus=function(){return c.H.useHostTransitionStatus()},_r.version="19.2.0",_r}var y2;function hj(){if(y2)return nx.exports;y2=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(),nx.exports=ik(),nx.exports}/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var x2;function lk(){if(x2)return Rd;x2=1;var e=ok(),t=ub(),n=hj();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var i=a,u=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(u=i.return),a=i.return;while(a)}return i.tag===3?u:null}function c(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function d(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function h(a){if(l(a)!==a)throw Error(r(188))}function m(a){var i=a.alternate;if(!i){if(i=l(a),i===null)throw Error(r(188));return i!==a?null:a}for(var u=a,f=i;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(f=y.return,f!==null){u=f;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return h(y),a;if(S===f)return h(y),i;S=S.sibling}throw Error(r(188))}if(u.return!==f.return)u=y,f=S;else{for(var N=!1,k=y.child;k;){if(k===u){N=!0,u=y,f=S;break}if(k===f){N=!0,f=y,u=S;break}k=k.sibling}if(!N){for(k=S.child;k;){if(k===u){N=!0,u=S,f=y;break}if(k===f){N=!0,f=S,u=y;break}k=k.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==f)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:i}function g(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=g(a),i!==null)return i;a=a.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),j=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function K(a){return a===null||typeof a!="object"?null:(a=G&&a[G]||a["@@iterator"],typeof a=="function"?a:null)}var re=Symbol.for("react.client.reference");function H(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===re?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case C:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case _:return"SuspenseList";case U:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case j:return a.displayName||"Context";case T:return(a._context.displayName||"Context")+".Consumer";case O:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case A:return i=a.displayName||null,i!==null?i:H(a.type)||"Memo";case M:i=a._payload,a=a._init;try{return H(a(i))}catch{}}return null}var $=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},ie=[],be=-1;function L(a){return{current:a}}function P(a){0>be||(a.current=ie[be],ie[be]=null,be--)}function W(a,i){be++,ie[be]=a.current,a.current=i}var ae=L(null),fe=L(null),ge=L(null),ue=L(null);function Ne(a,i){switch(W(ge,i),W(fe,a),W(ae,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?kE(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=kE(i),a=IE(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}P(ae),W(ae,a)}function Re(){P(ae),P(fe),P(ge)}function xe(a){a.memoizedState!==null&&W(ue,a);var i=ae.current,u=IE(i,a.type);i!==u&&(W(fe,a),W(ae,u))}function et(a){fe.current===a&&(P(ae),P(fe)),ue.current===a&&(P(ue),bd._currentValue=Z)}var Xe,Bt;function ft(a){if(Xe===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Xe=i&&i[1]||"",Bt=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Xe+a+Bt}var gn=!1;function Ie(a,i){if(!a||gn)return"";gn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ce){var se=ce}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(ce){se=ce}a.call(pe.prototype)}}else{try{throw Error()}catch(ce){se=ce}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ce){if(ce&&se&&typeof ce.stack=="string")return[ce.stack,se.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=f.DetermineComponentFrameRoot(),N=S[0],k=S[1];if(N&&k){var z=N.split(`
|
|
44
|
-
`),ne=k.split(`
|
|
45
|
-
`);for(y=f=0;f<z.length&&!z[f].includes("DetermineComponentFrameRoot");)f++;for(;y<ne.length&&!ne[y].includes("DetermineComponentFrameRoot");)y++;if(f===z.length||y===ne.length)for(f=z.length-1,y=ne.length-1;1<=f&&0<=y&&z[f]!==ne[y];)y--;for(;1<=f&&0<=y;f--,y--)if(z[f]!==ne[y]){if(f!==1||y!==1)do if(f--,y--,0>y||z[f]!==ne[y]){var he=`
|
|
46
|
-
`+z[f].replace(" at new "," at ");return a.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",a.displayName)),he}while(1<=f&&0<=y);break}}}finally{gn=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?ft(u):""}function wt(a,i){switch(a.tag){case 26:case 27:case 5:return ft(a.type);case 16:return ft("Lazy");case 13:return a.child!==i&&i!==null?ft("Suspense Fallback"):ft("Suspense");case 19:return ft("SuspenseList");case 0:case 15:return Ie(a.type,!1);case 11:return Ie(a.type.render,!1);case 1:return Ie(a.type,!0);case 31:return ft("Activity");default:return""}}function Ot(a){try{var i="",u=null;do i+=wt(a,u),u=a,a=a.return;while(a);return i}catch(f){return`
|
|
47
|
-
Error generating stack: `+f.message+`
|
|
48
|
-
`+f.stack}}var tn=Object.prototype.hasOwnProperty,V=e.unstable_scheduleCallback,ee=e.unstable_cancelCallback,de=e.unstable_shouldYield,_e=e.unstable_requestPaint,ye=e.unstable_now,we=e.unstable_getCurrentPriorityLevel,Le=e.unstable_ImmediatePriority,st=e.unstable_UserBlockingPriority,ht=e.unstable_NormalPriority,bn=e.unstable_LowPriority,Hr=e.unstable_IdlePriority,Dn=e.log,Rr=e.unstable_setDisableYieldValue,$r=null,Sn=null;function mr(a){if(typeof Dn=="function"&&Rr(a),Sn&&typeof Sn.setStrictMode=="function")try{Sn.setStrictMode($r,a)}catch{}}var On=Math.clz32?Math.clz32:Ql,Po=Math.log,ja=Math.LN2;function Ql(a){return a>>>=0,a===0?32:31-(Po(a)/ja|0)|0}var bs=256,Uo=262144,hn=4194304;function vn(a){var i=a&42;if(i!==0)return i;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Mn(a,i,u){var f=a.pendingLanes;if(f===0)return 0;var y=0,S=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var k=f&134217727;return k!==0?(f=k&~S,f!==0?y=vn(f):(N&=k,N!==0?y=vn(N):u||(u=k&~a,u!==0&&(y=vn(u))))):(k=f&~S,k!==0?y=vn(k):N!==0?y=vn(N):u||(u=f&~a,u!==0&&(y=vn(u)))),y===0?0:i!==0&&i!==y&&(i&S)===0&&(S=y&-y,u=i&-i,S>=u||S===32&&(u&4194048)!==0)?i:y}function Qn(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function Xn(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 or(){var a=hn;return hn<<=1,(hn&62914560)===0&&(hn=4194304),a}function Tr(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function F(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Q(a,i,u,f,y,S){var N=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var k=a.entanglements,z=a.expirationTimes,ne=a.hiddenUpdates;for(u=N&~u;0<u;){var he=31-On(u),pe=1<<he;k[he]=0,z[he]=-1;var se=ne[he];if(se!==null)for(ne[he]=null,he=0;he<se.length;he++){var ce=se[he];ce!==null&&(ce.lane&=-536870913)}u&=~pe}f!==0&&oe(a,f,0),S!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=S&~(N&~i))}function oe(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var f=31-On(i);a.entangledLanes|=i,a.entanglements[f]=a.entanglements[f]|1073741824|u&261930}function ve(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var f=31-On(u),y=1<<f;y&i|a[f]&i&&(a[f]|=i),u&=~y}}function Ee(a,i){var u=i&-i;return u=(u&42)!==0?1:ze(u),(u&(a.suspendedLanes|i))!==0?0:u}function ze(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function He(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function ke(){var a=Y.p;return a!==0?a:(a=window.event,a===void 0?32:a2(a.type))}function Ze(a,i){var u=Y.p;try{return Y.p=a,i()}finally{Y.p=u}}var Ye=Math.random().toString(36).slice(2),Ue="__reactFiber$"+Ye,Me="__reactProps$"+Ye,ot="__reactContainer$"+Ye,Ht="__reactEvents$"+Ye,Fn="__reactListeners$"+Ye,pr="__reactHandles$"+Ye,cn="__reactResources$"+Ye,Ft="__reactMarker$"+Ye;function Wa(a){delete a[Ue],delete a[Me],delete a[Ht],delete a[Fn],delete a[pr]}function _a(a){var i=a[Ue];if(i)return i;for(var u=a.parentNode;u;){if(i=u[ot]||u[Ue]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=HE(a);a!==null;){if(u=a[Ue])return u;a=HE(a)}return i}a=u,u=a.parentNode}return null}function Lr(a){if(a=a[Ue]||a[ot]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function jr(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function Ss(a){var i=a[cn];return i||(i=a[cn]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function mn(a){a[Ft]=!0}var Cs=new Set,Ki={};function Na(a,i){gt(a,i),gt(a+"Capture",i)}function gt(a,i){for(Ki[a]=i,a=0;a<i.length;a++)Cs.add(i[a])}var ir=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]*$"),Zs={},ws={};function kn(a){return tn.call(ws,a)?!0:tn.call(Zs,a)?!1:ir.test(a)?ws[a]=!0:(Zs[a]=!0,!1)}function Ks(a,i,u){if(kn(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function Yi(a,i,u){if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+u)}}function Qa(a,i,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+f)}}function Aa(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function TS(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function q5(a,i,u){var f=Object.getOwnPropertyDescriptor(a.constructor.prototype,i);if(!a.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var y=f.get,S=f.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return y.call(this)},set:function(N){u=""+N,S.call(this,N)}}),Object.defineProperty(a,i,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function Bg(a){if(!a._valueTracker){var i=TS(a)?"checked":"value";a._valueTracker=q5(a,i,""+a[i])}}function jS(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return a&&(f=TS(a)?a.checked?"true":"false":a.value),a=f,a!==u?(i.setValue(a),!0):!1}function eh(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Z5=/[\n"\\]/g;function Da(a){return a.replace(Z5,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Gg(a,i,u,f,y,S,N,k){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),i!=null?N==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+Aa(i)):a.value!==""+Aa(i)&&(a.value=""+Aa(i)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),i!=null?qg(a,N,Aa(i)):u!=null?qg(a,N,Aa(u)):f!=null&&a.removeAttribute("value"),y==null&&S!=null&&(a.defaultChecked=!!S),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.name=""+Aa(k):a.removeAttribute("name")}function _S(a,i,u,f,y,S,N,k){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),i!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||i!=null)){Bg(a);return}u=u!=null?""+Aa(u):"",i=i!=null?""+Aa(i):u,k||i===a.value||(a.value=i),a.defaultValue=i}f=f??y,f=typeof f!="function"&&typeof f!="symbol"&&!!f,a.checked=k?a.checked:!!f,a.defaultChecked=!!f,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),Bg(a)}function qg(a,i,u){i==="number"&&eh(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function Xl(a,i,u,f){if(a=a.options,i){i={};for(var y=0;y<u.length;y++)i["$"+u[y]]=!0;for(u=0;u<a.length;u++)y=i.hasOwnProperty("$"+a[u].value),a[u].selected!==y&&(a[u].selected=y),y&&f&&(a[u].defaultSelected=!0)}else{for(u=""+Aa(u),i=null,y=0;y<a.length;y++){if(a[y].value===u){a[y].selected=!0,f&&(a[y].defaultSelected=!0);return}i!==null||a[y].disabled||(i=a[y])}i!==null&&(i.selected=!0)}}function NS(a,i,u){if(i!=null&&(i=""+Aa(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+Aa(u):""}function AS(a,i,u,f){if(i==null){if(f!=null){if(u!=null)throw Error(r(92));if($(f)){if(1<f.length)throw Error(r(93));f=f[0]}u=f}u==null&&(u=""),i=u}u=Aa(i),a.defaultValue=u,f=a.textContent,f===u&&f!==""&&f!==null&&(a.value=f),Bg(a)}function Jl(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var K5=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 DS(a,i,u){var f=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":f?a.setProperty(i,u):typeof u!="number"||u===0||K5.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function OS(a,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?a.setProperty(f,""):f==="float"?a.cssFloat="":a[f]="");for(var y in i)f=i[y],i.hasOwnProperty(y)&&u[y]!==f&&DS(a,y,f)}else for(var S in i)i.hasOwnProperty(S)&&DS(a,S,i[S])}function Zg(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Y5=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"]]),W5=/^[\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 th(a){return W5.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Ys(){}var Kg=null;function Yg(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ec=null,tc=null;function MS(a){var i=Lr(a);if(i&&(a=i.stateNode)){var u=a[Me]||null;e:switch(a=i.stateNode,i.type){case"input":if(Gg(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Da(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==a&&f.form===a.form){var y=f[Me]||null;if(!y)throw Error(r(90));Gg(f,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<u.length;i++)f=u[i],f.form===a.form&&jS(f)}break e;case"textarea":NS(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Xl(a,!!u.multiple,i,!1)}}}var Wg=!1;function kS(a,i,u){if(Wg)return a(i,u);Wg=!0;try{var f=a(i);return f}finally{if(Wg=!1,(ec!==null||tc!==null)&&(Hh(),ec&&(i=ec,a=tc,tc=ec=null,MS(i),a)))for(i=0;i<a.length;i++)MS(a[i])}}function Pu(a,i){var u=a.stateNode;if(u===null)return null;var f=u[Me]||null;if(f===null)return null;u=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(a=a.type,f=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!f;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var Ws=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qg=!1;if(Ws)try{var Uu={};Object.defineProperty(Uu,"passive",{get:function(){Qg=!0}}),window.addEventListener("test",Uu,Uu),window.removeEventListener("test",Uu,Uu)}catch{Qg=!1}var Fo=null,Xg=null,nh=null;function IS(){if(nh)return nh;var a,i=Xg,u=i.length,f,y="value"in Fo?Fo.value:Fo.textContent,S=y.length;for(a=0;a<u&&i[a]===y[a];a++);var N=u-a;for(f=1;f<=N&&i[u-f]===y[S-f];f++);return nh=y.slice(a,1<f?1-f:void 0)}function rh(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function ah(){return!0}function LS(){return!1}function Br(a){function i(u,f,y,S,N){this._reactName=u,this._targetInst=y,this.type=f,this.nativeEvent=S,this.target=N,this.currentTarget=null;for(var k in a)a.hasOwnProperty(k)&&(u=a[k],this[k]=u?u(S):S[k]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?ah:LS,this.isPropagationStopped=LS,this}return v(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=ah)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ah)},persist:function(){},isPersistent:ah}),i}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sh=Br(Wi),Fu=v({},Wi,{view:0,detail:0}),Q5=Br(Fu),Jg,ev,zu,oh=v({},Fu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==zu&&(zu&&a.type==="mousemove"?(Jg=a.screenX-zu.screenX,ev=a.screenY-zu.screenY):ev=Jg=0,zu=a),Jg)},movementY:function(a){return"movementY"in a?a.movementY:ev}}),PS=Br(oh),X5=v({},oh,{dataTransfer:0}),J5=Br(X5),eM=v({},Fu,{relatedTarget:0}),tv=Br(eM),tM=v({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),nM=Br(tM),rM=v({},Wi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),aM=Br(rM),sM=v({},Wi,{data:0}),US=Br(sM),oM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iM={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"},lM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cM(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=lM[a])?!!i[a]:!1}function nv(){return cM}var uM=v({},Fu,{key:function(a){if(a.key){var i=oM[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=rh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?iM[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nv,charCode:function(a){return a.type==="keypress"?rh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?rh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),dM=Br(uM),fM=v({},oh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),FS=Br(fM),hM=v({},Fu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nv}),mM=Br(hM),pM=v({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),gM=Br(pM),vM=v({},oh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),yM=Br(vM),xM=v({},Wi,{newState:0,oldState:0}),bM=Br(xM),SM=[9,13,27,32],rv=Ws&&"CompositionEvent"in window,Vu=null;Ws&&"documentMode"in document&&(Vu=document.documentMode);var CM=Ws&&"TextEvent"in window&&!Vu,zS=Ws&&(!rv||Vu&&8<Vu&&11>=Vu),VS=" ",HS=!1;function $S(a,i){switch(a){case"keyup":return SM.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function BS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var nc=!1;function wM(a,i){switch(a){case"compositionend":return BS(i);case"keypress":return i.which!==32?null:(HS=!0,VS);case"textInput":return a=i.data,a===VS&&HS?null:a;default:return null}}function EM(a,i){if(nc)return a==="compositionend"||!rv&&$S(a,i)?(a=IS(),nh=Xg=Fo=null,nc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return zS&&i.locale!=="ko"?null:i.data;default:return null}}var RM={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 GS(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!RM[a.type]:i==="textarea"}function qS(a,i,u,f){ec?tc?tc.push(f):tc=[f]:ec=f,i=Yh(i,"onChange"),0<i.length&&(u=new sh("onChange","change",null,u,f),a.push({event:u,listeners:i}))}var Hu=null,$u=null;function TM(a){_E(a,0)}function ih(a){var i=jr(a);if(jS(i))return a}function ZS(a,i){if(a==="change")return i}var KS=!1;if(Ws){var av;if(Ws){var sv="oninput"in document;if(!sv){var YS=document.createElement("div");YS.setAttribute("oninput","return;"),sv=typeof YS.oninput=="function"}av=sv}else av=!1;KS=av&&(!document.documentMode||9<document.documentMode)}function WS(){Hu&&(Hu.detachEvent("onpropertychange",QS),$u=Hu=null)}function QS(a){if(a.propertyName==="value"&&ih($u)){var i=[];qS(i,$u,a,Yg(a)),kS(TM,i)}}function jM(a,i,u){a==="focusin"?(WS(),Hu=i,$u=u,Hu.attachEvent("onpropertychange",QS)):a==="focusout"&&WS()}function _M(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ih($u)}function NM(a,i){if(a==="click")return ih(i)}function AM(a,i){if(a==="input"||a==="change")return ih(i)}function DM(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var na=typeof Object.is=="function"?Object.is:DM;function Bu(a,i){if(na(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var y=u[f];if(!tn.call(i,y)||!na(a[y],i[y]))return!1}return!0}function XS(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function JS(a,i){var u=XS(a);a=0;for(var f;u;){if(u.nodeType===3){if(f=a+u.textContent.length,a<=i&&f>=i)return{node:u,offset:i-a};a=f}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=XS(u)}}function eC(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?eC(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function tC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=eh(a.document);i instanceof a.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)a=i.contentWindow;else break;i=eh(a.document)}return i}function ov(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var OM=Ws&&"documentMode"in document&&11>=document.documentMode,rc=null,iv=null,Gu=null,lv=!1;function nC(a,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;lv||rc==null||rc!==eh(f)||(f=rc,"selectionStart"in f&&ov(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Gu&&Bu(Gu,f)||(Gu=f,f=Yh(iv,"onSelect"),0<f.length&&(i=new sh("onSelect","select",null,i,u),a.push({event:i,listeners:f}),i.target=rc)))}function Qi(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var ac={animationend:Qi("Animation","AnimationEnd"),animationiteration:Qi("Animation","AnimationIteration"),animationstart:Qi("Animation","AnimationStart"),transitionrun:Qi("Transition","TransitionRun"),transitionstart:Qi("Transition","TransitionStart"),transitioncancel:Qi("Transition","TransitionCancel"),transitionend:Qi("Transition","TransitionEnd")},cv={},rC={};Ws&&(rC=document.createElement("div").style,"AnimationEvent"in window||(delete ac.animationend.animation,delete ac.animationiteration.animation,delete ac.animationstart.animation),"TransitionEvent"in window||delete ac.transitionend.transition);function Xi(a){if(cv[a])return cv[a];if(!ac[a])return a;var i=ac[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in rC)return cv[a]=i[u];return a}var aC=Xi("animationend"),sC=Xi("animationiteration"),oC=Xi("animationstart"),MM=Xi("transitionrun"),kM=Xi("transitionstart"),IM=Xi("transitioncancel"),iC=Xi("transitionend"),lC=new Map,uv="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(" ");uv.push("scrollEnd");function Xa(a,i){lC.set(a,i),Na(i,[a])}var lh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Oa=[],sc=0,dv=0;function ch(){for(var a=sc,i=dv=sc=0;i<a;){var u=Oa[i];Oa[i++]=null;var f=Oa[i];Oa[i++]=null;var y=Oa[i];Oa[i++]=null;var S=Oa[i];if(Oa[i++]=null,f!==null&&y!==null){var N=f.pending;N===null?y.next=y:(y.next=N.next,N.next=y),f.pending=y}S!==0&&cC(u,y,S)}}function uh(a,i,u,f){Oa[sc++]=a,Oa[sc++]=i,Oa[sc++]=u,Oa[sc++]=f,dv|=f,a.lanes|=f,a=a.alternate,a!==null&&(a.lanes|=f)}function fv(a,i,u,f){return uh(a,i,u,f),dh(a)}function Ji(a,i){return uh(a,null,null,i),dh(a)}function cC(a,i,u){a.lanes|=u;var f=a.alternate;f!==null&&(f.lanes|=u);for(var y=!1,S=a.return;S!==null;)S.childLanes|=u,f=S.alternate,f!==null&&(f.childLanes|=u),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(y=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,y&&i!==null&&(y=31-On(u),a=S.hiddenUpdates,f=a[y],f===null?a[y]=[i]:f.push(i),i.lane=u|536870912),S):null}function dh(a){if(50<hd)throw hd=0,Sy=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var oc={};function LM(a,i,u,f){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ra(a,i,u,f){return new LM(a,i,u,f)}function hv(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Qs(a,i){var u=a.alternate;return u===null?(u=ra(a.tag,i,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=i,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,i=a.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function uC(a,i){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,i=u.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function fh(a,i,u,f,y,S){var N=0;if(f=a,typeof a=="function")hv(a)&&(N=1);else if(typeof a=="string")N=V6(a,u,ae.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case U:return a=ra(31,u,i,y),a.elementType=U,a.lanes=S,a;case C:return el(u.children,y,S,i);case E:N=8,y|=24;break;case R:return a=ra(12,u,i,y|2),a.elementType=R,a.lanes=S,a;case D:return a=ra(13,u,i,y),a.elementType=D,a.lanes=S,a;case _:return a=ra(19,u,i,y),a.elementType=_,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case j:N=10;break e;case T:N=9;break e;case O:N=11;break e;case A:N=14;break e;case M:N=16,f=null;break e}N=29,u=Error(r(130,a===null?"null":typeof a,"")),f=null}return i=ra(N,u,i,y),i.elementType=a,i.type=f,i.lanes=S,i}function el(a,i,u,f){return a=ra(7,a,f,i),a.lanes=u,a}function mv(a,i,u){return a=ra(6,a,null,i),a.lanes=u,a}function dC(a){var i=ra(18,null,null,0);return i.stateNode=a,i}function pv(a,i,u){return i=ra(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var fC=new WeakMap;function Ma(a,i){if(typeof a=="object"&&a!==null){var u=fC.get(a);return u!==void 0?u:(i={value:a,source:i,stack:Ot(i)},fC.set(a,i),i)}return{value:a,source:i,stack:Ot(i)}}var ic=[],lc=0,hh=null,qu=0,ka=[],Ia=0,zo=null,Es=1,Rs="";function Xs(a,i){ic[lc++]=qu,ic[lc++]=hh,hh=a,qu=i}function hC(a,i,u){ka[Ia++]=Es,ka[Ia++]=Rs,ka[Ia++]=zo,zo=a;var f=Es;a=Rs;var y=32-On(f)-1;f&=~(1<<y),u+=1;var S=32-On(i)+y;if(30<S){var N=y-y%5;S=(f&(1<<N)-1).toString(32),f>>=N,y-=N,Es=1<<32-On(i)+y|u<<y|f,Rs=S+a}else Es=1<<S|u<<y|f,Rs=a}function gv(a){a.return!==null&&(Xs(a,1),hC(a,1,0))}function vv(a){for(;a===hh;)hh=ic[--lc],ic[lc]=null,qu=ic[--lc],ic[lc]=null;for(;a===zo;)zo=ka[--Ia],ka[Ia]=null,Rs=ka[--Ia],ka[Ia]=null,Es=ka[--Ia],ka[Ia]=null}function mC(a,i){ka[Ia++]=Es,ka[Ia++]=Rs,ka[Ia++]=zo,Es=i.id,Rs=i.overflow,zo=a}var gr=null,dn=null,At=!1,Vo=null,La=!1,yv=Error(r(519));function Ho(a){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zu(Ma(i,a)),yv}function pC(a){var i=a.stateNode,u=a.type,f=a.memoizedProps;switch(i[Ue]=a,i[Me]=f,u){case"dialog":Ct("cancel",i),Ct("close",i);break;case"iframe":case"object":case"embed":Ct("load",i);break;case"video":case"audio":for(u=0;u<pd.length;u++)Ct(pd[u],i);break;case"source":Ct("error",i);break;case"img":case"image":case"link":Ct("error",i),Ct("load",i);break;case"details":Ct("toggle",i);break;case"input":Ct("invalid",i),_S(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Ct("invalid",i);break;case"textarea":Ct("invalid",i),AS(i,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||f.suppressHydrationWarning===!0||OE(i.textContent,u)?(f.popover!=null&&(Ct("beforetoggle",i),Ct("toggle",i)),f.onScroll!=null&&Ct("scroll",i),f.onScrollEnd!=null&&Ct("scrollend",i),f.onClick!=null&&(i.onclick=Ys),i=!0):i=!1,i||Ho(a,!0)}function gC(a){for(gr=a.return;gr;)switch(gr.tag){case 5:case 31:case 13:La=!1;return;case 27:case 3:La=!0;return;default:gr=gr.return}}function cc(a){if(a!==gr)return!1;if(!At)return gC(a),At=!0,!1;var i=a.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Ly(a.type,a.memoizedProps)),u=!u),u&&dn&&Ho(a),gC(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));dn=VE(a)}else if(i===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));dn=VE(a)}else i===27?(i=dn,ni(a.type)?(a=Vy,Vy=null,dn=a):dn=i):dn=gr?Ua(a.stateNode.nextSibling):null;return!0}function tl(){dn=gr=null,At=!1}function xv(){var a=Vo;return a!==null&&(Kr===null?Kr=a:Kr.push.apply(Kr,a),Vo=null),a}function Zu(a){Vo===null?Vo=[a]:Vo.push(a)}var bv=L(null),nl=null,Js=null;function $o(a,i,u){W(bv,i._currentValue),i._currentValue=u}function eo(a){a._currentValue=bv.current,P(bv)}function Sv(a,i,u){for(;a!==null;){var f=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),a===u)break;a=a.return}}function Cv(a,i,u,f){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var S=y.dependencies;if(S!==null){var N=y.child;S=S.firstContext;e:for(;S!==null;){var k=S;S=y;for(var z=0;z<i.length;z++)if(k.context===i[z]){S.lanes|=u,k=S.alternate,k!==null&&(k.lanes|=u),Sv(S.return,u,a),f||(N=null);break e}S=k.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=u,S=N.alternate,S!==null&&(S.lanes|=u),Sv(N,u,a),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===a){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function uc(a,i,u,f){a=null;for(var y=i,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var k=y.type;na(y.pendingProps.value,N.value)||(a!==null?a.push(k):a=[k])}}else if(y===ue.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(bd):a=[bd])}y=y.return}a!==null&&Cv(i,a,u,f),i.flags|=262144}function mh(a){for(a=a.firstContext;a!==null;){if(!na(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function rl(a){nl=a,Js=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function vr(a){return vC(nl,a)}function ph(a,i){return nl===null&&rl(a),vC(a,i)}function vC(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Js===null){if(a===null)throw Error(r(308));Js=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else Js=Js.next=i;return u}var PM=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,f){a.push(f)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},UM=e.unstable_scheduleCallback,FM=e.unstable_NormalPriority,zn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wv(){return{controller:new PM,data:new Map,refCount:0}}function Ku(a){a.refCount--,a.refCount===0&&UM(FM,function(){a.controller.abort()})}var Yu=null,Ev=0,dc=0,fc=null;function zM(a,i){if(Yu===null){var u=Yu=[];Ev=0,dc=jy(),fc={status:"pending",value:void 0,then:function(f){u.push(f)}}}return Ev++,i.then(yC,yC),i}function yC(){if(--Ev===0&&Yu!==null){fc!==null&&(fc.status="fulfilled");var a=Yu;Yu=null,dc=0,fc=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function VM(a,i){var u=[],f={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return a.then(function(){f.status="fulfilled",f.value=i;for(var y=0;y<u.length;y++)(0,u[y])(i)},function(y){for(f.status="rejected",f.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),f}var xC=I.S;I.S=function(a,i){nE=ye(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&zM(a,i),xC!==null&&xC(a,i)};var al=L(null);function Rv(){var a=al.current;return a!==null?a:nn.pooledCache}function gh(a,i){i===null?W(al,al.current):W(al,i.pool)}function bC(){var a=Rv();return a===null?null:{parent:zn._currentValue,pool:a}}var hc=Error(r(460)),Tv=Error(r(474)),vh=Error(r(542)),yh={then:function(){}};function SC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function CC(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(Ys,Ys),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,EC(a),a;default:if(typeof i.status=="string")i.then(Ys,Ys);else{if(a=nn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(f){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=f}},function(f){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,EC(a),a}throw ol=i,hc}}function sl(a){try{var i=a._init;return i(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(ol=u,hc):u}}var ol=null;function wC(){if(ol===null)throw Error(r(459));var a=ol;return ol=null,a}function EC(a){if(a===hc||a===vh)throw Error(r(483))}var mc=null,Wu=0;function xh(a){var i=Wu;return Wu+=1,mc===null&&(mc=[]),CC(mc,a,i)}function Qu(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function bh(a,i){throw i.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function RC(a){function i(X,q){if(a){var te=X.deletions;te===null?(X.deletions=[q],X.flags|=16):te.push(q)}}function u(X,q){if(!a)return null;for(;q!==null;)i(X,q),q=q.sibling;return null}function f(X){for(var q=new Map;X!==null;)X.key!==null?q.set(X.key,X):q.set(X.index,X),X=X.sibling;return q}function y(X,q){return X=Qs(X,q),X.index=0,X.sibling=null,X}function S(X,q,te){return X.index=te,a?(te=X.alternate,te!==null?(te=te.index,te<q?(X.flags|=67108866,q):te):(X.flags|=67108866,q)):(X.flags|=1048576,q)}function N(X){return a&&X.alternate===null&&(X.flags|=67108866),X}function k(X,q,te,me){return q===null||q.tag!==6?(q=mv(te,X.mode,me),q.return=X,q):(q=y(q,te),q.return=X,q)}function z(X,q,te,me){var Je=te.type;return Je===C?he(X,q,te.props.children,me,te.key):q!==null&&(q.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&sl(Je)===q.type)?(q=y(q,te.props),Qu(q,te),q.return=X,q):(q=fh(te.type,te.key,te.props,null,X.mode,me),Qu(q,te),q.return=X,q)}function ne(X,q,te,me){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=pv(te,X.mode,me),q.return=X,q):(q=y(q,te.children||[]),q.return=X,q)}function he(X,q,te,me,Je){return q===null||q.tag!==7?(q=el(te,X.mode,me,Je),q.return=X,q):(q=y(q,te),q.return=X,q)}function pe(X,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=mv(""+q,X.mode,te),q.return=X,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return te=fh(q.type,q.key,q.props,null,X.mode,te),Qu(te,q),te.return=X,te;case w:return q=pv(q,X.mode,te),q.return=X,q;case M:return q=sl(q),pe(X,q,te)}if($(q)||K(q))return q=el(q,X.mode,te,null),q.return=X,q;if(typeof q.then=="function")return pe(X,xh(q),te);if(q.$$typeof===j)return pe(X,ph(X,q),te);bh(X,q)}return null}function se(X,q,te,me){var Je=q!==null?q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Je!==null?null:k(X,q,""+te,me);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return te.key===Je?z(X,q,te,me):null;case w:return te.key===Je?ne(X,q,te,me):null;case M:return te=sl(te),se(X,q,te,me)}if($(te)||K(te))return Je!==null?null:he(X,q,te,me,null);if(typeof te.then=="function")return se(X,q,xh(te),me);if(te.$$typeof===j)return se(X,q,ph(X,te),me);bh(X,te)}return null}function ce(X,q,te,me,Je){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return X=X.get(te)||null,k(q,X,""+me,Je);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return X=X.get(me.key===null?te:me.key)||null,z(q,X,me,Je);case w:return X=X.get(me.key===null?te:me.key)||null,ne(q,X,me,Je);case M:return me=sl(me),ce(X,q,te,me,Je)}if($(me)||K(me))return X=X.get(te)||null,he(q,X,me,Je,null);if(typeof me.then=="function")return ce(X,q,te,xh(me),Je);if(me.$$typeof===j)return ce(X,q,te,ph(q,me),Je);bh(q,me)}return null}function $e(X,q,te,me){for(var Je=null,Pt=null,We=q,mt=q=0,Rt=null;We!==null&&mt<te.length;mt++){We.index>mt?(Rt=We,We=null):Rt=We.sibling;var Ut=se(X,We,te[mt],me);if(Ut===null){We===null&&(We=Rt);break}a&&We&&Ut.alternate===null&&i(X,We),q=S(Ut,q,mt),Pt===null?Je=Ut:Pt.sibling=Ut,Pt=Ut,We=Rt}if(mt===te.length)return u(X,We),At&&Xs(X,mt),Je;if(We===null){for(;mt<te.length;mt++)We=pe(X,te[mt],me),We!==null&&(q=S(We,q,mt),Pt===null?Je=We:Pt.sibling=We,Pt=We);return At&&Xs(X,mt),Je}for(We=f(We);mt<te.length;mt++)Rt=ce(We,X,mt,te[mt],me),Rt!==null&&(a&&Rt.alternate!==null&&We.delete(Rt.key===null?mt:Rt.key),q=S(Rt,q,mt),Pt===null?Je=Rt:Pt.sibling=Rt,Pt=Rt);return a&&We.forEach(function(ii){return i(X,ii)}),At&&Xs(X,mt),Je}function tt(X,q,te,me){if(te==null)throw Error(r(151));for(var Je=null,Pt=null,We=q,mt=q=0,Rt=null,Ut=te.next();We!==null&&!Ut.done;mt++,Ut=te.next()){We.index>mt?(Rt=We,We=null):Rt=We.sibling;var ii=se(X,We,Ut.value,me);if(ii===null){We===null&&(We=Rt);break}a&&We&&ii.alternate===null&&i(X,We),q=S(ii,q,mt),Pt===null?Je=ii:Pt.sibling=ii,Pt=ii,We=Rt}if(Ut.done)return u(X,We),At&&Xs(X,mt),Je;if(We===null){for(;!Ut.done;mt++,Ut=te.next())Ut=pe(X,Ut.value,me),Ut!==null&&(q=S(Ut,q,mt),Pt===null?Je=Ut:Pt.sibling=Ut,Pt=Ut);return At&&Xs(X,mt),Je}for(We=f(We);!Ut.done;mt++,Ut=te.next())Ut=ce(We,X,mt,Ut.value,me),Ut!==null&&(a&&Ut.alternate!==null&&We.delete(Ut.key===null?mt:Ut.key),q=S(Ut,q,mt),Pt===null?Je=Ut:Pt.sibling=Ut,Pt=Ut);return a&&We.forEach(function(X6){return i(X,X6)}),At&&Xs(X,mt),Je}function Wt(X,q,te,me){if(typeof te=="object"&&te!==null&&te.type===C&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case b:e:{for(var Je=te.key;q!==null;){if(q.key===Je){if(Je=te.type,Je===C){if(q.tag===7){u(X,q.sibling),me=y(q,te.props.children),me.return=X,X=me;break e}}else if(q.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===M&&sl(Je)===q.type){u(X,q.sibling),me=y(q,te.props),Qu(me,te),me.return=X,X=me;break e}u(X,q);break}else i(X,q);q=q.sibling}te.type===C?(me=el(te.props.children,X.mode,me,te.key),me.return=X,X=me):(me=fh(te.type,te.key,te.props,null,X.mode,me),Qu(me,te),me.return=X,X=me)}return N(X);case w:e:{for(Je=te.key;q!==null;){if(q.key===Je)if(q.tag===4&&q.stateNode.containerInfo===te.containerInfo&&q.stateNode.implementation===te.implementation){u(X,q.sibling),me=y(q,te.children||[]),me.return=X,X=me;break e}else{u(X,q);break}else i(X,q);q=q.sibling}me=pv(te,X.mode,me),me.return=X,X=me}return N(X);case M:return te=sl(te),Wt(X,q,te,me)}if($(te))return $e(X,q,te,me);if(K(te)){if(Je=K(te),typeof Je!="function")throw Error(r(150));return te=Je.call(te),tt(X,q,te,me)}if(typeof te.then=="function")return Wt(X,q,xh(te),me);if(te.$$typeof===j)return Wt(X,q,ph(X,te),me);bh(X,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,q!==null&&q.tag===6?(u(X,q.sibling),me=y(q,te),me.return=X,X=me):(u(X,q),me=mv(te,X.mode,me),me.return=X,X=me),N(X)):u(X,q)}return function(X,q,te,me){try{Wu=0;var Je=Wt(X,q,te,me);return mc=null,Je}catch(We){if(We===hc||We===vh)throw We;var Pt=ra(29,We,null,X.mode);return Pt.lanes=me,Pt.return=X,Pt}finally{}}}var il=RC(!0),TC=RC(!1),Bo=!1;function jv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _v(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Go(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function qo(a,i,u){var f=a.updateQueue;if(f===null)return null;if(f=f.shared,(zt&2)!==0){var y=f.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),f.pending=i,i=dh(a),cC(a,null,u),i}return uh(a,f,i,u),dh(a)}function Xu(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,ve(a,u)}}function Nv(a,i){var u=a.updateQueue,f=a.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=N:S=S.next=N,u=u.next}while(u!==null);S===null?y=S=i:S=S.next=i}else y=S=i;u={baseState:f.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:f.shared,callbacks:f.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var Av=!1;function Ju(){if(Av){var a=fc;if(a!==null)throw a}}function ed(a,i,u,f){Av=!1;var y=a.updateQueue;Bo=!1;var S=y.firstBaseUpdate,N=y.lastBaseUpdate,k=y.shared.pending;if(k!==null){y.shared.pending=null;var z=k,ne=z.next;z.next=null,N===null?S=ne:N.next=ne,N=z;var he=a.alternate;he!==null&&(he=he.updateQueue,k=he.lastBaseUpdate,k!==N&&(k===null?he.firstBaseUpdate=ne:k.next=ne,he.lastBaseUpdate=z))}if(S!==null){var pe=y.baseState;N=0,he=ne=z=null,k=S;do{var se=k.lane&-536870913,ce=se!==k.lane;if(ce?(Et&se)===se:(f&se)===se){se!==0&&se===dc&&(Av=!0),he!==null&&(he=he.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var $e=a,tt=k;se=i;var Wt=u;switch(tt.tag){case 1:if($e=tt.payload,typeof $e=="function"){pe=$e.call(Wt,pe,se);break e}pe=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=tt.payload,se=typeof $e=="function"?$e.call(Wt,pe,se):$e,se==null)break e;pe=v({},pe,se);break e;case 2:Bo=!0}}se=k.callback,se!==null&&(a.flags|=64,ce&&(a.flags|=8192),ce=y.callbacks,ce===null?y.callbacks=[se]:ce.push(se))}else ce={lane:se,tag:k.tag,payload:k.payload,callback:k.callback,next:null},he===null?(ne=he=ce,z=pe):he=he.next=ce,N|=se;if(k=k.next,k===null){if(k=y.shared.pending,k===null)break;ce=k,k=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);he===null&&(z=pe),y.baseState=z,y.firstBaseUpdate=ne,y.lastBaseUpdate=he,S===null&&(y.shared.lanes=0),Qo|=N,a.lanes=N,a.memoizedState=pe}}function jC(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function _C(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)jC(u[a],i)}var pc=L(null),Sh=L(0);function NC(a,i){a=co,W(Sh,a),W(pc,i),co=a|i.baseLanes}function Dv(){W(Sh,co),W(pc,pc.current)}function Ov(){co=Sh.current,P(pc),P(Sh)}var aa=L(null),Pa=null;function Zo(a){var i=a.alternate;W(In,In.current&1),W(aa,a),Pa===null&&(i===null||pc.current!==null||i.memoizedState!==null)&&(Pa=a)}function Mv(a){W(In,In.current),W(aa,a),Pa===null&&(Pa=a)}function AC(a){a.tag===22?(W(In,In.current),W(aa,a),Pa===null&&(Pa=a)):Ko()}function Ko(){W(In,In.current),W(aa,aa.current)}function sa(a){P(aa),Pa===a&&(Pa=null),P(In)}var In=L(0);function Ch(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Fy(u)||zy(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var to=0,ut=null,Kt=null,Vn=null,wh=!1,gc=!1,ll=!1,Eh=0,td=0,vc=null,HM=0;function Cn(){throw Error(r(321))}function kv(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!na(a[u],i[u]))return!1;return!0}function Iv(a,i,u,f,y,S){return to=S,ut=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=a===null||a.memoizedState===null?hw:Wv,ll=!1,S=u(f,y),ll=!1,gc&&(S=OC(i,u,f,y)),DC(a),S}function DC(a){I.H=ad;var i=Kt!==null&&Kt.next!==null;if(to=0,Vn=Kt=ut=null,wh=!1,td=0,vc=null,i)throw Error(r(300));a===null||Hn||(a=a.dependencies,a!==null&&mh(a)&&(Hn=!0))}function OC(a,i,u,f){ut=a;var y=0;do{if(gc&&(vc=null),td=0,gc=!1,25<=y)throw Error(r(301));if(y+=1,Vn=Kt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}I.H=mw,S=i(u,f)}while(gc);return S}function $M(){var a=I.H,i=a.useState()[0];return i=typeof i.then=="function"?nd(i):i,a=a.useState()[0],(Kt!==null?Kt.memoizedState:null)!==a&&(ut.flags|=1024),i}function Lv(){var a=Eh!==0;return Eh=0,a}function Pv(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Uv(a){if(wh){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}wh=!1}to=0,Vn=Kt=ut=null,gc=!1,td=Eh=0,vc=null}function Pr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?ut.memoizedState=Vn=a:Vn=Vn.next=a,Vn}function Ln(){if(Kt===null){var a=ut.alternate;a=a!==null?a.memoizedState:null}else a=Kt.next;var i=Vn===null?ut.memoizedState:Vn.next;if(i!==null)Vn=i,Kt=a;else{if(a===null)throw ut.alternate===null?Error(r(467)):Error(r(310));Kt=a,a={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},Vn===null?ut.memoizedState=Vn=a:Vn=Vn.next=a}return Vn}function Rh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function nd(a){var i=td;return td+=1,vc===null&&(vc=[]),a=CC(vc,a,i),i=ut,(Vn===null?i.memoizedState:Vn.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?hw:Wv),a}function Th(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return nd(a);if(a.$$typeof===j)return vr(a)}throw Error(r(438,String(a)))}function Fv(a){var i=null,u=ut.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var f=ut.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Rh(),ut.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),f=0;f<a;f++)u[f]=B;return i.index++,u}function no(a,i){return typeof i=="function"?i(a):i}function jh(a){var i=Ln();return zv(i,Kt,a)}function zv(a,i,u){var f=a.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=u;var y=a.baseQueue,S=f.pending;if(S!==null){if(y!==null){var N=y.next;y.next=S.next,S.next=N}i.baseQueue=y=S,f.pending=null}if(S=a.baseState,y===null)a.memoizedState=S;else{i=y.next;var k=N=null,z=null,ne=i,he=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(Et&pe)===pe:(to&pe)===pe){var se=ne.revertLane;if(se===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===dc&&(he=!0);else if((to&se)===se){ne=ne.next,se===dc&&(he=!0);continue}else pe={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},z===null?(k=z=pe,N=S):z=z.next=pe,ut.lanes|=se,Qo|=se;pe=ne.action,ll&&u(S,pe),S=ne.hasEagerState?ne.eagerState:u(S,pe)}else se={lane:pe,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},z===null?(k=z=se,N=S):z=z.next=se,ut.lanes|=pe,Qo|=pe;ne=ne.next}while(ne!==null&&ne!==i);if(z===null?N=S:z.next=k,!na(S,a.memoizedState)&&(Hn=!0,he&&(u=fc,u!==null)))throw u;a.memoizedState=S,a.baseState=N,a.baseQueue=z,f.lastRenderedState=S}return y===null&&(f.lanes=0),[a.memoizedState,f.dispatch]}function Vv(a){var i=Ln(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var f=u.dispatch,y=u.pending,S=i.memoizedState;if(y!==null){u.pending=null;var N=y=y.next;do S=a(S,N.action),N=N.next;while(N!==y);na(S,i.memoizedState)||(Hn=!0),i.memoizedState=S,i.baseQueue===null&&(i.baseState=S),u.lastRenderedState=S}return[S,f]}function MC(a,i,u){var f=ut,y=Ln(),S=At;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=i();var N=!na((Kt||y).memoizedState,u);if(N&&(y.memoizedState=u,Hn=!0),y=y.queue,Bv(LC.bind(null,f,y,a),[a]),y.getSnapshot!==i||N||Vn!==null&&Vn.memoizedState.tag&1){if(f.flags|=2048,yc(9,{destroy:void 0},IC.bind(null,f,y,u,i),null),nn===null)throw Error(r(349));S||(to&127)!==0||kC(f,i,u)}return u}function kC(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=ut.updateQueue,i===null?(i=Rh(),ut.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function IC(a,i,u,f){i.value=u,i.getSnapshot=f,PC(i)&&UC(a)}function LC(a,i,u){return u(function(){PC(i)&&UC(a)})}function PC(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!na(a,u)}catch{return!0}}function UC(a){var i=Ji(a,2);i!==null&&Yr(i,a,2)}function Hv(a){var i=Pr();if(typeof a=="function"){var u=a;if(a=u(),ll){mr(!0);try{u()}finally{mr(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:no,lastRenderedState:a},i}function FC(a,i,u,f){return a.baseState=u,zv(a,Kt,typeof f=="function"?f:no)}function BM(a,i,u,f,y){if(Ah(a))throw Error(r(485));if(a=i.action,a!==null){var S={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){S.listeners.push(N)}};I.T!==null?u(!0):S.isTransition=!1,f(S),u=i.pending,u===null?(S.next=i.pending=S,zC(i,S)):(S.next=u.next,i.pending=u.next=S)}}function zC(a,i){var u=i.action,f=i.payload,y=a.state;if(i.isTransition){var S=I.T,N={};I.T=N;try{var k=u(y,f),z=I.S;z!==null&&z(N,k),VC(a,i,k)}catch(ne){$v(a,i,ne)}finally{S!==null&&N.types!==null&&(S.types=N.types),I.T=S}}else try{S=u(y,f),VC(a,i,S)}catch(ne){$v(a,i,ne)}}function VC(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){HC(a,i,f)},function(f){return $v(a,i,f)}):HC(a,i,u)}function HC(a,i,u){i.status="fulfilled",i.value=u,$C(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,zC(a,u)))}function $v(a,i,u){var f=a.pending;if(a.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=u,$C(i),i=i.next;while(i!==f)}a.action=null}function $C(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function BC(a,i){return i}function GC(a,i){if(At){var u=nn.formState;if(u!==null){e:{var f=ut;if(At){if(dn){t:{for(var y=dn,S=La;y.nodeType!==8;){if(!S){y=null;break t}if(y=Ua(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){dn=Ua(y.nextSibling),f=y.data==="F!";break e}}Ho(f)}f=!1}f&&(i=u[0])}}return u=Pr(),u.memoizedState=u.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:BC,lastRenderedState:i},u.queue=f,u=uw.bind(null,ut,f),f.dispatch=u,f=Hv(!1),S=Yv.bind(null,ut,!1,f.queue),f=Pr(),y={state:i,dispatch:null,action:a,pending:null},f.queue=y,u=BM.bind(null,ut,y,S,u),y.dispatch=u,f.memoizedState=a,[i,u,!1]}function qC(a){var i=Ln();return ZC(i,Kt,a)}function ZC(a,i,u){if(i=zv(a,i,BC)[0],a=jh(no)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=nd(i)}catch(N){throw N===hc?vh:N}else f=i;i=Ln();var y=i.queue,S=y.dispatch;return u!==i.memoizedState&&(ut.flags|=2048,yc(9,{destroy:void 0},GM.bind(null,y,u),null)),[f,S,a]}function GM(a,i){a.action=i}function KC(a){var i=Ln(),u=Kt;if(u!==null)return ZC(i,u,a);Ln(),i=i.memoizedState,u=Ln();var f=u.queue.dispatch;return u.memoizedState=a,[i,f,!1]}function yc(a,i,u,f){return a={tag:a,create:u,deps:f,inst:i,next:null},i=ut.updateQueue,i===null&&(i=Rh(),ut.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(f=u.next,u.next=a,a.next=f,i.lastEffect=a),a}function YC(){return Ln().memoizedState}function _h(a,i,u,f){var y=Pr();ut.flags|=a,y.memoizedState=yc(1|i,{destroy:void 0},u,f===void 0?null:f)}function Nh(a,i,u,f){var y=Ln();f=f===void 0?null:f;var S=y.memoizedState.inst;Kt!==null&&f!==null&&kv(f,Kt.memoizedState.deps)?y.memoizedState=yc(i,S,u,f):(ut.flags|=a,y.memoizedState=yc(1|i,S,u,f))}function WC(a,i){_h(8390656,8,a,i)}function Bv(a,i){Nh(2048,8,a,i)}function qM(a){ut.flags|=4;var i=ut.updateQueue;if(i===null)i=Rh(),ut.updateQueue=i,i.events=[a];else{var u=i.events;u===null?i.events=[a]:u.push(a)}}function QC(a){var i=Ln().memoizedState;return qM({ref:i,nextImpl:a}),function(){if((zt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function XC(a,i){return Nh(4,2,a,i)}function JC(a,i){return Nh(4,4,a,i)}function ew(a,i){if(typeof i=="function"){a=a();var u=i(a);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function tw(a,i,u){u=u!=null?u.concat([a]):null,Nh(4,4,ew.bind(null,i,a),u)}function Gv(){}function nw(a,i){var u=Ln();i=i===void 0?null:i;var f=u.memoizedState;return i!==null&&kv(i,f[1])?f[0]:(u.memoizedState=[a,i],a)}function rw(a,i){var u=Ln();i=i===void 0?null:i;var f=u.memoizedState;if(i!==null&&kv(i,f[1]))return f[0];if(f=a(),ll){mr(!0);try{a()}finally{mr(!1)}}return u.memoizedState=[f,i],f}function qv(a,i,u){return u===void 0||(to&1073741824)!==0&&(Et&261930)===0?a.memoizedState=i:(a.memoizedState=u,a=aE(),ut.lanes|=a,Qo|=a,u)}function aw(a,i,u,f){return na(u,i)?u:pc.current!==null?(a=qv(a,u,f),na(a,i)||(Hn=!0),a):(to&42)===0||(to&1073741824)!==0&&(Et&261930)===0?(Hn=!0,a.memoizedState=u):(a=aE(),ut.lanes|=a,Qo|=a,i)}function sw(a,i,u,f,y){var S=Y.p;Y.p=S!==0&&8>S?S:8;var N=I.T,k={};I.T=k,Yv(a,!1,i,u);try{var z=y(),ne=I.S;if(ne!==null&&ne(k,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var he=VM(z,f);rd(a,i,he,la(a))}else rd(a,i,f,la(a))}catch(pe){rd(a,i,{then:function(){},status:"rejected",reason:pe},la())}finally{Y.p=S,N!==null&&k.types!==null&&(N.types=k.types),I.T=N}}function ZM(){}function Zv(a,i,u,f){if(a.tag!==5)throw Error(r(476));var y=ow(a).queue;sw(a,y,i,Z,u===null?ZM:function(){return iw(a),u(f)})}function ow(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:no,lastRenderedState:Z},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:no,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function iw(a){var i=ow(a);i.next===null&&(i=a.alternate.memoizedState),rd(a,i.next.queue,{},la())}function Kv(){return vr(bd)}function lw(){return Ln().memoizedState}function cw(){return Ln().memoizedState}function KM(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=la();a=Go(u);var f=qo(i,a,u);f!==null&&(Yr(f,i,u),Xu(f,i,u)),i={cache:wv()},a.payload=i;return}i=i.return}}function YM(a,i,u){var f=la();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Ah(a)?dw(i,u):(u=fv(a,i,u,f),u!==null&&(Yr(u,a,f),fw(u,i,f)))}function uw(a,i,u){var f=la();rd(a,i,u,f)}function rd(a,i,u,f){var y={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Ah(a))dw(i,y);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=i.lastRenderedReducer,S!==null))try{var N=i.lastRenderedState,k=S(N,u);if(y.hasEagerState=!0,y.eagerState=k,na(k,N))return uh(a,i,y,0),nn===null&&ch(),!1}catch{}finally{}if(u=fv(a,i,y,f),u!==null)return Yr(u,a,f),fw(u,i,f),!0}return!1}function Yv(a,i,u,f){if(f={lane:2,revertLane:jy(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Ah(a)){if(i)throw Error(r(479))}else i=fv(a,u,f,2),i!==null&&Yr(i,a,2)}function Ah(a){var i=a.alternate;return a===ut||i!==null&&i===ut}function dw(a,i){gc=wh=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function fw(a,i,u){if((u&4194048)!==0){var f=i.lanes;f&=a.pendingLanes,u|=f,i.lanes=u,ve(a,u)}}var ad={readContext:vr,use:Th,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useLayoutEffect:Cn,useInsertionEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useSyncExternalStore:Cn,useId:Cn,useHostTransitionStatus:Cn,useFormState:Cn,useActionState:Cn,useOptimistic:Cn,useMemoCache:Cn,useCacheRefresh:Cn};ad.useEffectEvent=Cn;var hw={readContext:vr,use:Th,useCallback:function(a,i){return Pr().memoizedState=[a,i===void 0?null:i],a},useContext:vr,useEffect:WC,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,_h(4194308,4,ew.bind(null,i,a),u)},useLayoutEffect:function(a,i){return _h(4194308,4,a,i)},useInsertionEffect:function(a,i){_h(4,2,a,i)},useMemo:function(a,i){var u=Pr();i=i===void 0?null:i;var f=a();if(ll){mr(!0);try{a()}finally{mr(!1)}}return u.memoizedState=[f,i],f},useReducer:function(a,i,u){var f=Pr();if(u!==void 0){var y=u(i);if(ll){mr(!0);try{u(i)}finally{mr(!1)}}}else y=i;return f.memoizedState=f.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},f.queue=a,a=a.dispatch=YM.bind(null,ut,a),[f.memoizedState,a]},useRef:function(a){var i=Pr();return a={current:a},i.memoizedState=a},useState:function(a){a=Hv(a);var i=a.queue,u=uw.bind(null,ut,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:Gv,useDeferredValue:function(a,i){var u=Pr();return qv(u,a,i)},useTransition:function(){var a=Hv(!1);return a=sw.bind(null,ut,a.queue,!0,!1),Pr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var f=ut,y=Pr();if(At){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),nn===null)throw Error(r(349));(Et&127)!==0||kC(f,i,u)}y.memoizedState=u;var S={value:u,getSnapshot:i};return y.queue=S,WC(LC.bind(null,f,S,a),[a]),f.flags|=2048,yc(9,{destroy:void 0},IC.bind(null,f,S,u,i),null),u},useId:function(){var a=Pr(),i=nn.identifierPrefix;if(At){var u=Rs,f=Es;u=(f&~(1<<32-On(f)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Eh++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=HM++,i="_"+i+"r_"+u.toString(32)+"_";return a.memoizedState=i},useHostTransitionStatus:Kv,useFormState:GC,useActionState:GC,useOptimistic:function(a){var i=Pr();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Yv.bind(null,ut,!0,u),u.dispatch=i,[a,i]},useMemoCache:Fv,useCacheRefresh:function(){return Pr().memoizedState=KM.bind(null,ut)},useEffectEvent:function(a){var i=Pr(),u={impl:a};return i.memoizedState=u,function(){if((zt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Wv={readContext:vr,use:Th,useCallback:nw,useContext:vr,useEffect:Bv,useImperativeHandle:tw,useInsertionEffect:XC,useLayoutEffect:JC,useMemo:rw,useReducer:jh,useRef:YC,useState:function(){return jh(no)},useDebugValue:Gv,useDeferredValue:function(a,i){var u=Ln();return aw(u,Kt.memoizedState,a,i)},useTransition:function(){var a=jh(no)[0],i=Ln().memoizedState;return[typeof a=="boolean"?a:nd(a),i]},useSyncExternalStore:MC,useId:lw,useHostTransitionStatus:Kv,useFormState:qC,useActionState:qC,useOptimistic:function(a,i){var u=Ln();return FC(u,Kt,a,i)},useMemoCache:Fv,useCacheRefresh:cw};Wv.useEffectEvent=QC;var mw={readContext:vr,use:Th,useCallback:nw,useContext:vr,useEffect:Bv,useImperativeHandle:tw,useInsertionEffect:XC,useLayoutEffect:JC,useMemo:rw,useReducer:Vv,useRef:YC,useState:function(){return Vv(no)},useDebugValue:Gv,useDeferredValue:function(a,i){var u=Ln();return Kt===null?qv(u,a,i):aw(u,Kt.memoizedState,a,i)},useTransition:function(){var a=Vv(no)[0],i=Ln().memoizedState;return[typeof a=="boolean"?a:nd(a),i]},useSyncExternalStore:MC,useId:lw,useHostTransitionStatus:Kv,useFormState:KC,useActionState:KC,useOptimistic:function(a,i){var u=Ln();return Kt!==null?FC(u,Kt,a,i):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Fv,useCacheRefresh:cw};mw.useEffectEvent=QC;function Qv(a,i,u,f){i=a.memoizedState,u=u(f,i),u=u==null?i:v({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var Xv={enqueueSetState:function(a,i,u){a=a._reactInternals;var f=la(),y=Go(f);y.payload=i,u!=null&&(y.callback=u),i=qo(a,y,f),i!==null&&(Yr(i,a,f),Xu(i,a,f))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var f=la(),y=Go(f);y.tag=1,y.payload=i,u!=null&&(y.callback=u),i=qo(a,y,f),i!==null&&(Yr(i,a,f),Xu(i,a,f))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=la(),f=Go(u);f.tag=2,i!=null&&(f.callback=i),i=qo(a,f,u),i!==null&&(Yr(i,a,u),Xu(i,a,u))}};function pw(a,i,u,f,y,S,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(f,S,N):i.prototype&&i.prototype.isPureReactComponent?!Bu(u,f)||!Bu(y,S):!0}function gw(a,i,u,f){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==a&&Xv.enqueueReplaceState(i,i.state,null)}function cl(a,i){var u=i;if("ref"in i){u={};for(var f in i)f!=="ref"&&(u[f]=i[f])}if(a=a.defaultProps){u===i&&(u=v({},u));for(var y in a)u[y]===void 0&&(u[y]=a[y])}return u}function vw(a){lh(a)}function yw(a){console.error(a)}function xw(a){lh(a)}function Dh(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function bw(a,i,u){try{var f=a.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Jv(a,i,u){return u=Go(u),u.tag=3,u.payload={element:null},u.callback=function(){Dh(a,i)},u}function Sw(a){return a=Go(a),a.tag=3,a}function Cw(a,i,u,f){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=f.value;a.payload=function(){return y(S)},a.callback=function(){bw(i,u,f)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){bw(i,u,f),typeof y!="function"&&(Xo===null?Xo=new Set([this]):Xo.add(this));var k=f.stack;this.componentDidCatch(f.value,{componentStack:k!==null?k:""})})}function WM(a,i,u,f,y){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=u.alternate,i!==null&&uc(i,u,y,!0),u=aa.current,u!==null){switch(u.tag){case 31:case 13:return Pa===null?$h():u.alternate===null&&wn===0&&(wn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,f===yh?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([f]):i.add(f),Ey(a,f,y)),!1;case 22:return u.flags|=65536,f===yh?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([f]):u.add(f)),Ey(a,f,y)),!1}throw Error(r(435,u.tag))}return Ey(a,f,y),$h(),!1}if(At)return i=aa.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,f!==yv&&(a=Error(r(422),{cause:f}),Zu(Ma(a,u)))):(f!==yv&&(i=Error(r(423),{cause:f}),Zu(Ma(i,u))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,f=Ma(f,u),y=Jv(a.stateNode,f,y),Nv(a,y),wn!==4&&(wn=2)),!1;var S=Error(r(520),{cause:f});if(S=Ma(S,u),fd===null?fd=[S]:fd.push(S),wn!==4&&(wn=2),i===null)return!0;f=Ma(f,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=y&-y,u.lanes|=a,a=Jv(u.stateNode,f,a),Nv(u,a),!1;case 1:if(i=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Xo===null||!Xo.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Sw(y),Cw(y,a,u,f),Nv(u,y),!1}u=u.return}while(u!==null);return!1}var ey=Error(r(461)),Hn=!1;function yr(a,i,u,f){i.child=a===null?TC(i,null,u,f):il(i,a.child,u,f)}function ww(a,i,u,f,y){u=u.render;var S=i.ref;if("ref"in f){var N={};for(var k in f)k!=="ref"&&(N[k]=f[k])}else N=f;return rl(i),f=Iv(a,i,u,N,S,y),k=Lv(),a!==null&&!Hn?(Pv(a,i,y),ro(a,i,y)):(At&&k&&gv(i),i.flags|=1,yr(a,i,f,y),i.child)}function Ew(a,i,u,f,y){if(a===null){var S=u.type;return typeof S=="function"&&!hv(S)&&S.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=S,Rw(a,i,S,f,y)):(a=fh(u.type,null,f,i,i.mode,y),a.ref=i.ref,a.return=i,i.child=a)}if(S=a.child,!ly(a,y)){var N=S.memoizedProps;if(u=u.compare,u=u!==null?u:Bu,u(N,f)&&a.ref===i.ref)return ro(a,i,y)}return i.flags|=1,a=Qs(S,f),a.ref=i.ref,a.return=i,i.child=a}function Rw(a,i,u,f,y){if(a!==null){var S=a.memoizedProps;if(Bu(S,f)&&a.ref===i.ref)if(Hn=!1,i.pendingProps=f=S,ly(a,y))(a.flags&131072)!==0&&(Hn=!0);else return i.lanes=a.lanes,ro(a,i,y)}return ty(a,i,u,f,y)}function Tw(a,i,u,f){var y=f.children,S=a!==null?a.memoizedState:null;if(a===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,a!==null){for(f=i.child=a.child,y=0;f!==null;)y=y|f.lanes|f.childLanes,f=f.sibling;f=y&~S}else f=0,i.child=null;return jw(a,i,S,u,f)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&gh(i,S!==null?S.cachePool:null),S!==null?NC(i,S):Dv(),AC(i);else return f=i.lanes=536870912,jw(a,i,S!==null?S.baseLanes|u:u,u,f)}else S!==null?(gh(i,S.cachePool),NC(i,S),Ko(),i.memoizedState=null):(a!==null&&gh(i,null),Dv(),Ko());return yr(a,i,y,u),i.child}function sd(a,i){return a!==null&&a.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function jw(a,i,u,f,y){var S=Rv();return S=S===null?null:{parent:zn._currentValue,pool:S},i.memoizedState={baseLanes:u,cachePool:S},a!==null&&gh(i,null),Dv(),AC(i),a!==null&&uc(a,i,f,!0),i.childLanes=y,null}function Oh(a,i){return i=kh({mode:i.mode,children:i.children},a.mode),i.ref=a.ref,a.child=i,i.return=a,i}function _w(a,i,u){return il(i,a.child,null,u),a=Oh(i,i.pendingProps),a.flags|=2,sa(i),i.memoizedState=null,a}function QM(a,i,u){var f=i.pendingProps,y=(i.flags&128)!==0;if(i.flags&=-129,a===null){if(At){if(f.mode==="hidden")return a=Oh(i,f),i.lanes=536870912,sd(null,a);if(Mv(i),(a=dn)?(a=zE(a,La),a=a!==null&&a.data==="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:zo!==null?{id:Es,overflow:Rs}:null,retryLane:536870912,hydrationErrors:null},u=dC(a),u.return=i,i.child=u,gr=i,dn=null)):a=null,a===null)throw Ho(i);return i.lanes=536870912,null}return Oh(i,f)}var S=a.memoizedState;if(S!==null){var N=S.dehydrated;if(Mv(i),y)if(i.flags&256)i.flags&=-257,i=_w(a,i,u);else if(i.memoizedState!==null)i.child=a.child,i.flags|=128,i=null;else throw Error(r(558));else if(Hn||uc(a,i,u,!1),y=(u&a.childLanes)!==0,Hn||y){if(f=nn,f!==null&&(N=Ee(f,u),N!==0&&N!==S.retryLane))throw S.retryLane=N,Ji(a,N),Yr(f,a,N),ey;$h(),i=_w(a,i,u)}else a=S.treeContext,dn=Ua(N.nextSibling),gr=i,At=!0,Vo=null,La=!1,a!==null&&mC(i,a),i=Oh(i,f),i.flags|=4096;return i}return a=Qs(a.child,{mode:f.mode,children:f.children}),a.ref=i.ref,i.child=a,a.return=i,a}function Mh(a,i){var u=i.ref;if(u===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(i.flags|=4194816)}}function ty(a,i,u,f,y){return rl(i),u=Iv(a,i,u,f,void 0,y),f=Lv(),a!==null&&!Hn?(Pv(a,i,y),ro(a,i,y)):(At&&f&&gv(i),i.flags|=1,yr(a,i,u,y),i.child)}function Nw(a,i,u,f,y,S){return rl(i),i.updateQueue=null,u=OC(i,f,u,y),DC(a),f=Lv(),a!==null&&!Hn?(Pv(a,i,S),ro(a,i,S)):(At&&f&&gv(i),i.flags|=1,yr(a,i,u,S),i.child)}function Aw(a,i,u,f,y){if(rl(i),i.stateNode===null){var S=oc,N=u.contextType;typeof N=="object"&&N!==null&&(S=vr(N)),S=new u(f,S),i.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Xv,i.stateNode=S,S._reactInternals=i,S=i.stateNode,S.props=f,S.state=i.memoizedState,S.refs={},jv(i),N=u.contextType,S.context=typeof N=="object"&&N!==null?vr(N):oc,S.state=i.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(Qv(i,u,N,f),S.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(N=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),N!==S.state&&Xv.enqueueReplaceState(S,S.state,null),ed(i,f,S,y),Ju(),S.state=i.memoizedState),typeof S.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(a===null){S=i.stateNode;var k=i.memoizedProps,z=cl(u,k);S.props=z;var ne=S.context,he=u.contextType;N=oc,typeof he=="object"&&he!==null&&(N=vr(he));var pe=u.getDerivedStateFromProps;he=typeof pe=="function"||typeof S.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,he||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(k||ne!==N)&&gw(i,S,f,N),Bo=!1;var se=i.memoizedState;S.state=se,ed(i,f,S,y),Ju(),ne=i.memoizedState,k||se!==ne||Bo?(typeof pe=="function"&&(Qv(i,u,pe,f),ne=i.memoizedState),(z=Bo||pw(i,u,z,f,se,ne,N))?(he||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(i.flags|=4194308)):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=ne),S.props=f,S.state=ne,S.context=N,f=z):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{S=i.stateNode,_v(a,i),N=i.memoizedProps,he=cl(u,N),S.props=he,pe=i.pendingProps,se=S.context,ne=u.contextType,z=oc,typeof ne=="object"&&ne!==null&&(z=vr(ne)),k=u.getDerivedStateFromProps,(ne=typeof k=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N!==pe||se!==z)&&gw(i,S,f,z),Bo=!1,se=i.memoizedState,S.state=se,ed(i,f,S,y),Ju();var ce=i.memoizedState;N!==pe||se!==ce||Bo||a!==null&&a.dependencies!==null&&mh(a.dependencies)?(typeof k=="function"&&(Qv(i,u,k,f),ce=i.memoizedState),(he=Bo||pw(i,u,he,f,se,ce,z)||a!==null&&a.dependencies!==null&&mh(a.dependencies))?(ne||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(f,ce,z),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(f,ce,z)),typeof S.componentDidUpdate=="function"&&(i.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&se===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&se===a.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=ce),S.props=f,S.state=ce,S.context=z,f=he):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&se===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&se===a.memoizedState||(i.flags|=1024),f=!1)}return S=f,Mh(a,i),f=(i.flags&128)!==0,S||f?(S=i.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:S.render(),i.flags|=1,a!==null&&f?(i.child=il(i,a.child,null,y),i.child=il(i,null,u,y)):yr(a,i,u,y),i.memoizedState=S.state,a=i.child):a=ro(a,i,y),a}function Dw(a,i,u,f){return tl(),i.flags|=256,yr(a,i,u,f),i.child}var ny={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ry(a){return{baseLanes:a,cachePool:bC()}}function ay(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=ia),a}function Ow(a,i,u){var f=i.pendingProps,y=!1,S=(i.flags&128)!==0,N;if((N=S)||(N=a!==null&&a.memoizedState===null?!1:(In.current&2)!==0),N&&(y=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,a===null){if(At){if(y?Zo(i):Ko(),(a=dn)?(a=zE(a,La),a=a!==null&&a.data!=="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:zo!==null?{id:Es,overflow:Rs}:null,retryLane:536870912,hydrationErrors:null},u=dC(a),u.return=i,i.child=u,gr=i,dn=null)):a=null,a===null)throw Ho(i);return zy(a)?i.lanes=32:i.lanes=536870912,null}var k=f.children;return f=f.fallback,y?(Ko(),y=i.mode,k=kh({mode:"hidden",children:k},y),f=el(f,y,u,null),k.return=i,f.return=i,k.sibling=f,i.child=k,f=i.child,f.memoizedState=ry(u),f.childLanes=ay(a,N,u),i.memoizedState=ny,sd(null,f)):(Zo(i),sy(i,k))}var z=a.memoizedState;if(z!==null&&(k=z.dehydrated,k!==null)){if(S)i.flags&256?(Zo(i),i.flags&=-257,i=oy(a,i,u)):i.memoizedState!==null?(Ko(),i.child=a.child,i.flags|=128,i=null):(Ko(),k=f.fallback,y=i.mode,f=kh({mode:"visible",children:f.children},y),k=el(k,y,u,null),k.flags|=2,f.return=i,k.return=i,f.sibling=k,i.child=f,il(i,a.child,null,u),f=i.child,f.memoizedState=ry(u),f.childLanes=ay(a,N,u),i.memoizedState=ny,i=sd(null,f));else if(Zo(i),zy(k)){if(N=k.nextSibling&&k.nextSibling.dataset,N)var ne=N.dgst;N=ne,f=Error(r(419)),f.stack="",f.digest=N,Zu({value:f,source:null,stack:null}),i=oy(a,i,u)}else if(Hn||uc(a,i,u,!1),N=(u&a.childLanes)!==0,Hn||N){if(N=nn,N!==null&&(f=Ee(N,u),f!==0&&f!==z.retryLane))throw z.retryLane=f,Ji(a,f),Yr(N,a,f),ey;Fy(k)||$h(),i=oy(a,i,u)}else Fy(k)?(i.flags|=192,i.child=a.child,i=null):(a=z.treeContext,dn=Ua(k.nextSibling),gr=i,At=!0,Vo=null,La=!1,a!==null&&mC(i,a),i=sy(i,f.children),i.flags|=4096);return i}return y?(Ko(),k=f.fallback,y=i.mode,z=a.child,ne=z.sibling,f=Qs(z,{mode:"hidden",children:f.children}),f.subtreeFlags=z.subtreeFlags&65011712,ne!==null?k=Qs(ne,k):(k=el(k,y,u,null),k.flags|=2),k.return=i,f.return=i,f.sibling=k,i.child=f,sd(null,f),f=i.child,k=a.child.memoizedState,k===null?k=ry(u):(y=k.cachePool,y!==null?(z=zn._currentValue,y=y.parent!==z?{parent:z,pool:z}:y):y=bC(),k={baseLanes:k.baseLanes|u,cachePool:y}),f.memoizedState=k,f.childLanes=ay(a,N,u),i.memoizedState=ny,sd(a.child,f)):(Zo(i),u=a.child,a=u.sibling,u=Qs(u,{mode:"visible",children:f.children}),u.return=i,u.sibling=null,a!==null&&(N=i.deletions,N===null?(i.deletions=[a],i.flags|=16):N.push(a)),i.child=u,i.memoizedState=null,u)}function sy(a,i){return i=kh({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function kh(a,i){return a=ra(22,a,null,i),a.lanes=0,a}function oy(a,i,u){return il(i,a.child,null,u),a=sy(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function Mw(a,i,u){a.lanes|=i;var f=a.alternate;f!==null&&(f.lanes|=i),Sv(a.return,i,u)}function iy(a,i,u,f,y,S){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:y,treeForkCount:S}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=f,N.tail=u,N.tailMode=y,N.treeForkCount=S)}function kw(a,i,u){var f=i.pendingProps,y=f.revealOrder,S=f.tail;f=f.children;var N=In.current,k=(N&2)!==0;if(k?(N=N&1|2,i.flags|=128):N&=1,W(In,N),yr(a,i,f,u),f=At?qu:0,!k&&a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Mw(a,u,i);else if(a.tag===19)Mw(a,u,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(u=i.child,y=null;u!==null;)a=u.alternate,a!==null&&Ch(a)===null&&(y=u),u=u.sibling;u=y,u===null?(y=i.child,i.child=null):(y=u.sibling,u.sibling=null),iy(i,!1,y,u,S,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=i.child,i.child=null;y!==null;){if(a=y.alternate,a!==null&&Ch(a)===null){i.child=y;break}a=y.sibling,y.sibling=u,u=y,y=a}iy(i,!0,u,null,S,f);break;case"together":iy(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function ro(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),Qo|=i.lanes,(u&i.childLanes)===0)if(a!==null){if(uc(a,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,u=Qs(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=Qs(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function ly(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&mh(a)))}function XM(a,i,u){switch(i.tag){case 3:Ne(i,i.stateNode.containerInfo),$o(i,zn,a.memoizedState.cache),tl();break;case 27:case 5:xe(i);break;case 4:Ne(i,i.stateNode.containerInfo);break;case 10:$o(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Mv(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Zo(i),i.flags|=128,null):(u&i.child.childLanes)!==0?Ow(a,i,u):(Zo(i),a=ro(a,i,u),a!==null?a.sibling:null);Zo(i);break;case 19:var y=(a.flags&128)!==0;if(f=(u&i.childLanes)!==0,f||(uc(a,i,u,!1),f=(u&i.childLanes)!==0),y){if(f)return kw(a,i,u);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),W(In,In.current),f)break;return null;case 22:return i.lanes=0,Tw(a,i,u,i.pendingProps);case 24:$o(i,zn,a.memoizedState.cache)}return ro(a,i,u)}function Iw(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)Hn=!0;else{if(!ly(a,u)&&(i.flags&128)===0)return Hn=!1,XM(a,i,u);Hn=(a.flags&131072)!==0}else Hn=!1,At&&(i.flags&1048576)!==0&&hC(i,qu,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(a=sl(i.elementType),i.type=a,typeof a=="function")hv(a)?(f=cl(a,f),i.tag=1,i=Aw(null,i,a,f,u)):(i.tag=0,i=ty(null,i,a,f,u));else{if(a!=null){var y=a.$$typeof;if(y===O){i.tag=11,i=ww(null,i,a,f,u);break e}else if(y===A){i.tag=14,i=Ew(null,i,a,f,u);break e}}throw i=H(a)||a,Error(r(306,i,""))}}return i;case 0:return ty(a,i,i.type,i.pendingProps,u);case 1:return f=i.type,y=cl(f,i.pendingProps),Aw(a,i,f,y,u);case 3:e:{if(Ne(i,i.stateNode.containerInfo),a===null)throw Error(r(387));f=i.pendingProps;var S=i.memoizedState;y=S.element,_v(a,i),ed(i,f,null,u);var N=i.memoizedState;if(f=N.cache,$o(i,zn,f),f!==S.cache&&Cv(i,[zn],u,!0),Ju(),f=N.element,S.isDehydrated)if(S={element:f,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=S,i.memoizedState=S,i.flags&256){i=Dw(a,i,f,u);break e}else if(f!==y){y=Ma(Error(r(424)),i),Zu(y),i=Dw(a,i,f,u);break e}else{switch(a=i.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(dn=Ua(a.firstChild),gr=i,At=!0,Vo=null,La=!0,u=TC(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(tl(),f===y){i=ro(a,i,u);break e}yr(a,i,f,u)}i=i.child}return i;case 26:return Mh(a,i),a===null?(u=qE(i.type,null,i.pendingProps,null))?i.memoizedState=u:At||(u=i.type,a=i.pendingProps,f=Wh(ge.current).createElement(u),f[Ue]=i,f[Me]=a,xr(f,u,a),mn(f),i.stateNode=f):i.memoizedState=qE(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return xe(i),a===null&&At&&(f=i.stateNode=$E(i.type,i.pendingProps,ge.current),gr=i,La=!0,y=dn,ni(i.type)?(Vy=y,dn=Ua(f.firstChild)):dn=y),yr(a,i,i.pendingProps.children,u),Mh(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&At&&((y=f=dn)&&(f=_6(f,i.type,i.pendingProps,La),f!==null?(i.stateNode=f,gr=i,dn=Ua(f.firstChild),La=!1,y=!0):y=!1),y||Ho(i)),xe(i),y=i.type,S=i.pendingProps,N=a!==null?a.memoizedProps:null,f=S.children,Ly(y,S)?f=null:N!==null&&Ly(y,N)&&(i.flags|=32),i.memoizedState!==null&&(y=Iv(a,i,$M,null,null,u),bd._currentValue=y),Mh(a,i),yr(a,i,f,u),i.child;case 6:return a===null&&At&&((a=u=dn)&&(u=N6(u,i.pendingProps,La),u!==null?(i.stateNode=u,gr=i,dn=null,a=!0):a=!1),a||Ho(i)),null;case 13:return Ow(a,i,u);case 4:return Ne(i,i.stateNode.containerInfo),f=i.pendingProps,a===null?i.child=il(i,null,f,u):yr(a,i,f,u),i.child;case 11:return ww(a,i,i.type,i.pendingProps,u);case 7:return yr(a,i,i.pendingProps,u),i.child;case 8:return yr(a,i,i.pendingProps.children,u),i.child;case 12:return yr(a,i,i.pendingProps.children,u),i.child;case 10:return f=i.pendingProps,$o(i,i.type,f.value),yr(a,i,f.children,u),i.child;case 9:return y=i.type._context,f=i.pendingProps.children,rl(i),y=vr(y),f=f(y),i.flags|=1,yr(a,i,f,u),i.child;case 14:return Ew(a,i,i.type,i.pendingProps,u);case 15:return Rw(a,i,i.type,i.pendingProps,u);case 19:return kw(a,i,u);case 31:return QM(a,i,u);case 22:return Tw(a,i,u,i.pendingProps);case 24:return rl(i),f=vr(zn),a===null?(y=Rv(),y===null&&(y=nn,S=wv(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),i.memoizedState={parent:f,cache:y},jv(i),$o(i,zn,y)):((a.lanes&u)!==0&&(_v(a,i),ed(i,null,null,u),Ju()),y=a.memoizedState,S=i.memoizedState,y.parent!==f?(y={parent:f,cache:f},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),$o(i,zn,f)):(f=S.cache,$o(i,zn,f),f!==y.cache&&Cv(i,[zn],u,!0))),yr(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function ao(a){a.flags|=4}function cy(a,i,u,f,y){if((i=(a.mode&32)!==0)&&(i=!1),i){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(lE())a.flags|=8192;else throw ol=yh,Tv}else a.flags&=-16777217}function Lw(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!QE(i))if(lE())a.flags|=8192;else throw ol=yh,Tv}function Ih(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?or():536870912,a.lanes|=i,Cc|=i)}function od(a,i){if(!At)switch(a.tailMode){case"hidden":i=a.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:f.sibling=null}}function fn(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,f=0;if(i)for(var y=a.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags&65011712,f|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)u|=y.lanes|y.childLanes,f|=y.subtreeFlags,f|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=f,a.childLanes=u,i}function JM(a,i,u){var f=i.pendingProps;switch(vv(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(i),null;case 1:return fn(i),null;case 3:return u=i.stateNode,f=null,a!==null&&(f=a.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),eo(zn),Re(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(cc(i)?ao(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,xv())),fn(i),null;case 26:var y=i.type,S=i.memoizedState;return a===null?(ao(i),S!==null?(fn(i),Lw(i,S)):(fn(i),cy(i,y,null,f,u))):S?S!==a.memoizedState?(ao(i),fn(i),Lw(i,S)):(fn(i),i.flags&=-16777217):(a=a.memoizedProps,a!==f&&ao(i),fn(i),cy(i,y,a,f,u)),null;case 27:if(et(i),u=ge.current,y=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==f&&ao(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return fn(i),null}a=ae.current,cc(i)?pC(i):(a=$E(y,f,u),i.stateNode=a,ao(i))}return fn(i),null;case 5:if(et(i),y=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==f&&ao(i);else{if(!f){if(i.stateNode===null)throw Error(r(166));return fn(i),null}if(S=ae.current,cc(i))pC(i);else{var N=Wh(ge.current);switch(S){case 1:S=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=N.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof f.is=="string"?N.createElement("select",{is:f.is}):N.createElement("select"),f.multiple?S.multiple=!0:f.size&&(S.size=f.size);break;default:S=typeof f.is=="string"?N.createElement(y,{is:f.is}):N.createElement(y)}}S[Ue]=i,S[Me]=f;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)S.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=S;e:switch(xr(S,y,f),y){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ao(i)}}return fn(i),cy(i,i.type,a===null?null:a.memoizedProps,i.pendingProps,u),null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==f&&ao(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(r(166));if(a=ge.current,cc(i)){if(a=i.stateNode,u=i.memoizedProps,f=null,y=gr,y!==null)switch(y.tag){case 27:case 5:f=y.memoizedProps}a[Ue]=i,a=!!(a.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||OE(a.nodeValue,u)),a||Ho(i,!0)}else a=Wh(a).createTextNode(f),a[Ue]=i,i.stateNode=a}return fn(i),null;case 31:if(u=i.memoizedState,a===null||a.memoizedState!==null){if(f=cc(i),u!==null){if(a===null){if(!f)throw Error(r(318));if(a=i.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[Ue]=i}else tl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;fn(i),a=!1}else u=xv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return i.flags&256?(sa(i),i):(sa(i),null);if((i.flags&128)!==0)throw Error(r(558))}return fn(i),null;case 13:if(f=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=cc(i),f!==null&&f.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Ue]=i}else tl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;fn(i),y=!1}else y=xv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(sa(i),i):(sa(i),null)}return sa(i),(i.flags&128)!==0?(i.lanes=u,i):(u=f!==null,a=a!==null&&a.memoizedState!==null,u&&(f=i.child,y=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(y=f.alternate.memoizedState.cachePool.pool),S=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(S=f.memoizedState.cachePool.pool),S!==y&&(f.flags|=2048)),u!==a&&u&&(i.child.flags|=8192),Ih(i,i.updateQueue),fn(i),null);case 4:return Re(),a===null&&Dy(i.stateNode.containerInfo),fn(i),null;case 10:return eo(i.type),fn(i),null;case 19:if(P(In),f=i.memoizedState,f===null)return fn(i),null;if(y=(i.flags&128)!==0,S=f.rendering,S===null)if(y)od(f,!1);else{if(wn!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(S=Ch(a),S!==null){for(i.flags|=128,od(f,!1),a=S.updateQueue,i.updateQueue=a,Ih(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)uC(u,a),u=u.sibling;return W(In,In.current&1|2),At&&Xs(i,f.treeForkCount),i.child}a=a.sibling}f.tail!==null&&ye()>zh&&(i.flags|=128,y=!0,od(f,!1),i.lanes=4194304)}else{if(!y)if(a=Ch(S),a!==null){if(i.flags|=128,y=!0,a=a.updateQueue,i.updateQueue=a,Ih(i,a),od(f,!0),f.tail===null&&f.tailMode==="hidden"&&!S.alternate&&!At)return fn(i),null}else 2*ye()-f.renderingStartTime>zh&&u!==536870912&&(i.flags|=128,y=!0,od(f,!1),i.lanes=4194304);f.isBackwards?(S.sibling=i.child,i.child=S):(a=f.last,a!==null?a.sibling=S:i.child=S,f.last=S)}return f.tail!==null?(a=f.tail,f.rendering=a,f.tail=a.sibling,f.renderingStartTime=ye(),a.sibling=null,u=In.current,W(In,y?u&1|2:u&1),At&&Xs(i,f.treeForkCount),a):(fn(i),null);case 22:case 23:return sa(i),Ov(),f=i.memoizedState!==null,a!==null?a.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(u&536870912)!==0&&(i.flags&128)===0&&(fn(i),i.subtreeFlags&6&&(i.flags|=8192)):fn(i),u=i.updateQueue,u!==null&&Ih(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048),a!==null&&P(al),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),eo(zn),fn(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function e6(a,i){switch(vv(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return eo(zn),Re(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return et(i),null;case 31:if(i.memoizedState!==null){if(sa(i),i.alternate===null)throw Error(r(340));tl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 13:if(sa(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));tl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return P(In),null;case 4:return Re(),null;case 10:return eo(i.type),null;case 22:case 23:return sa(i),Ov(),a!==null&&P(al),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return eo(zn),null;case 25:return null;default:return null}}function Pw(a,i){switch(vv(i),i.tag){case 3:eo(zn),Re();break;case 26:case 27:case 5:et(i);break;case 4:Re();break;case 31:i.memoizedState!==null&&sa(i);break;case 13:sa(i);break;case 19:P(In);break;case 10:eo(i.type);break;case 22:case 23:sa(i),Ov(),a!==null&&P(al);break;case 24:eo(zn)}}function id(a,i){try{var u=i.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var y=f.next;u=y;do{if((u.tag&a)===a){f=void 0;var S=u.create,N=u.inst;f=S(),N.destroy=f}u=u.next}while(u!==y)}}catch(k){qt(i,i.return,k)}}function Yo(a,i,u){try{var f=i.updateQueue,y=f!==null?f.lastEffect:null;if(y!==null){var S=y.next;f=S;do{if((f.tag&a)===a){var N=f.inst,k=N.destroy;if(k!==void 0){N.destroy=void 0,y=i;var z=u,ne=k;try{ne()}catch(he){qt(y,z,he)}}}f=f.next}while(f!==S)}}catch(he){qt(i,i.return,he)}}function Uw(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{_C(i,u)}catch(f){qt(a,a.return,f)}}}function Fw(a,i,u){u.props=cl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(f){qt(a,i,f)}}function ld(a,i){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var f=a.stateNode;break;case 30:f=a.stateNode;break;default:f=a.stateNode}typeof u=="function"?a.refCleanup=u(f):u.current=f}}catch(y){qt(a,i,y)}}function Ts(a,i){var u=a.ref,f=a.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(y){qt(a,i,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){qt(a,i,y)}else u.current=null}function zw(a){var i=a.type,u=a.memoizedProps,f=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break e;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(y){qt(a,a.return,y)}}function uy(a,i,u){try{var f=a.stateNode;C6(f,a.type,u,i),f[Me]=i}catch(y){qt(a,a.return,y)}}function Vw(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ni(a.type)||a.tag===4}function dy(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Vw(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&ni(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function fy(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(a),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Ys));else if(f!==4&&(f===27&&ni(a.type)&&(u=a.stateNode,i=null),a=a.child,a!==null))for(fy(a,i,u),a=a.sibling;a!==null;)fy(a,i,u),a=a.sibling}function Lh(a,i,u){var f=a.tag;if(f===5||f===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(f!==4&&(f===27&&ni(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Lh(a,i,u),a=a.sibling;a!==null;)Lh(a,i,u),a=a.sibling}function Hw(a){var i=a.stateNode,u=a.memoizedProps;try{for(var f=a.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);xr(i,f,u),i[Ue]=a,i[Me]=u}catch(S){qt(a,a.return,S)}}var so=!1,$n=!1,hy=!1,$w=typeof WeakSet=="function"?WeakSet:Set,lr=null;function t6(a,i){if(a=a.containerInfo,ky=rm,a=tC(a),ov(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var y=f.anchorOffset,S=f.focusNode;f=f.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var N=0,k=-1,z=-1,ne=0,he=0,pe=a,se=null;t:for(;;){for(var ce;pe!==u||y!==0&&pe.nodeType!==3||(k=N+y),pe!==S||f!==0&&pe.nodeType!==3||(z=N+f),pe.nodeType===3&&(N+=pe.nodeValue.length),(ce=pe.firstChild)!==null;)se=pe,pe=ce;for(;;){if(pe===a)break t;if(se===u&&++ne===y&&(k=N),se===S&&++he===f&&(z=N),(ce=pe.nextSibling)!==null)break;pe=se,se=pe.parentNode}pe=ce}u=k===-1||z===-1?null:{start:k,end:z}}else u=null}u=u||{start:0,end:0}}else u=null;for(Iy={focusedElem:a,selectionRange:u},rm=!1,lr=i;lr!==null;)if(i=lr,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,lr=a;else for(;lr!==null;){switch(i=lr,S=i.alternate,a=i.flags,i.tag){case 0:if((a&4)!==0&&(a=i.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)y=a[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,u=i,y=S.memoizedProps,S=S.memoizedState,f=u.stateNode;try{var $e=cl(u.type,y);a=f.getSnapshotBeforeUpdate($e,S),f.__reactInternalSnapshotBeforeUpdate=a}catch(tt){qt(u,u.return,tt)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)Uy(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Uy(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,lr=a;break}lr=i.return}}function Bw(a,i,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:io(a,u),f&4&&id(5,u);break;case 1:if(io(a,u),f&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(N){qt(u,u.return,N)}else{var y=cl(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(y,i,a.__reactInternalSnapshotBeforeUpdate)}catch(N){qt(u,u.return,N)}}f&64&&Uw(u),f&512&&ld(u,u.return);break;case 3:if(io(a,u),f&64&&(a=u.updateQueue,a!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{_C(a,i)}catch(N){qt(u,u.return,N)}}break;case 27:i===null&&f&4&&Hw(u);case 26:case 5:io(a,u),i===null&&f&4&&zw(u),f&512&&ld(u,u.return);break;case 12:io(a,u);break;case 31:io(a,u),f&4&&Zw(a,u);break;case 13:io(a,u),f&4&&Kw(a,u),f&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=u6.bind(null,u),A6(a,u))));break;case 22:if(f=u.memoizedState!==null||so,!f){i=i!==null&&i.memoizedState!==null||$n,y=so;var S=$n;so=f,($n=i)&&!S?lo(a,u,(u.subtreeFlags&8772)!==0):io(a,u),so=y,$n=S}break;case 30:break;default:io(a,u)}}function Gw(a){var i=a.alternate;i!==null&&(a.alternate=null,Gw(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&Wa(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var pn=null,Gr=!1;function oo(a,i,u){for(u=u.child;u!==null;)qw(a,i,u),u=u.sibling}function qw(a,i,u){if(Sn&&typeof Sn.onCommitFiberUnmount=="function")try{Sn.onCommitFiberUnmount($r,u)}catch{}switch(u.tag){case 26:$n||Ts(u,i),oo(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:$n||Ts(u,i);var f=pn,y=Gr;ni(u.type)&&(pn=u.stateNode,Gr=!1),oo(a,i,u),vd(u.stateNode),pn=f,Gr=y;break;case 5:$n||Ts(u,i);case 6:if(f=pn,y=Gr,pn=null,oo(a,i,u),pn=f,Gr=y,pn!==null)if(Gr)try{(pn.nodeType===9?pn.body:pn.nodeName==="HTML"?pn.ownerDocument.body:pn).removeChild(u.stateNode)}catch(S){qt(u,i,S)}else try{pn.removeChild(u.stateNode)}catch(S){qt(u,i,S)}break;case 18:pn!==null&&(Gr?(a=pn,UE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Ac(a)):UE(pn,u.stateNode));break;case 4:f=pn,y=Gr,pn=u.stateNode.containerInfo,Gr=!0,oo(a,i,u),pn=f,Gr=y;break;case 0:case 11:case 14:case 15:Yo(2,u,i),$n||Yo(4,u,i),oo(a,i,u);break;case 1:$n||(Ts(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Fw(u,i,f)),oo(a,i,u);break;case 21:oo(a,i,u);break;case 22:$n=(f=$n)||u.memoizedState!==null,oo(a,i,u),$n=f;break;default:oo(a,i,u)}}function Zw(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Ac(a)}catch(u){qt(i,i.return,u)}}}function Kw(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Ac(a)}catch(u){qt(i,i.return,u)}}function n6(a){switch(a.tag){case 31:case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new $w),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new $w),i;default:throw Error(r(435,a.tag))}}function Ph(a,i){var u=n6(a);i.forEach(function(f){if(!u.has(f)){u.add(f);var y=d6.bind(null,a,f);f.then(y,y)}})}function qr(a,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var y=u[f],S=a,N=i,k=N;e:for(;k!==null;){switch(k.tag){case 27:if(ni(k.type)){pn=k.stateNode,Gr=!1;break e}break;case 5:pn=k.stateNode,Gr=!1;break e;case 3:case 4:pn=k.stateNode.containerInfo,Gr=!0;break e}k=k.return}if(pn===null)throw Error(r(160));qw(S,N,y),pn=null,Gr=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Yw(i,a),i=i.sibling}var Ja=null;function Yw(a,i){var u=a.alternate,f=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:qr(i,a),Zr(a),f&4&&(Yo(3,a,a.return),id(3,a),Yo(5,a,a.return));break;case 1:qr(i,a),Zr(a),f&512&&($n||u===null||Ts(u,u.return)),f&64&&so&&(a=a.updateQueue,a!==null&&(f=a.callbacks,f!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var y=Ja;if(qr(i,a),Zr(a),f&512&&($n||u===null||Ts(u,u.return)),f&4){var S=u!==null?u.memoizedState:null;if(f=a.memoizedState,u===null)if(f===null)if(a.stateNode===null){e:{f=a.type,u=a.memoizedProps,y=y.ownerDocument||y;t:switch(f){case"title":S=y.getElementsByTagName("title")[0],(!S||S[Ft]||S[Ue]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(f),y.head.insertBefore(S,y.querySelector("head > title"))),xr(S,f,u),S[Ue]=a,mn(S),f=S;break e;case"link":var N=YE("link","href",y).get(f+(u.href||""));if(N){for(var k=0;k<N.length;k++)if(S=N[k],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(k,1);break t}}S=y.createElement(f),xr(S,f,u),y.head.appendChild(S);break;case"meta":if(N=YE("meta","content",y).get(f+(u.content||""))){for(k=0;k<N.length;k++)if(S=N[k],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(k,1);break t}}S=y.createElement(f),xr(S,f,u),y.head.appendChild(S);break;default:throw Error(r(468,f))}S[Ue]=a,mn(S),f=S}a.stateNode=f}else WE(y,a.type,a.stateNode);else a.stateNode=KE(y,f,a.memoizedProps);else S!==f?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,f===null?WE(y,a.type,a.stateNode):KE(y,f,a.memoizedProps)):f===null&&a.stateNode!==null&&uy(a,a.memoizedProps,u.memoizedProps)}break;case 27:qr(i,a),Zr(a),f&512&&($n||u===null||Ts(u,u.return)),u!==null&&f&4&&uy(a,a.memoizedProps,u.memoizedProps);break;case 5:if(qr(i,a),Zr(a),f&512&&($n||u===null||Ts(u,u.return)),a.flags&32){y=a.stateNode;try{Jl(y,"")}catch($e){qt(a,a.return,$e)}}f&4&&a.stateNode!=null&&(y=a.memoizedProps,uy(a,y,u!==null?u.memoizedProps:y)),f&1024&&(hy=!0);break;case 6:if(qr(i,a),Zr(a),f&4){if(a.stateNode===null)throw Error(r(162));f=a.memoizedProps,u=a.stateNode;try{u.nodeValue=f}catch($e){qt(a,a.return,$e)}}break;case 3:if(Jh=null,y=Ja,Ja=Qh(i.containerInfo),qr(i,a),Ja=y,Zr(a),f&4&&u!==null&&u.memoizedState.isDehydrated)try{Ac(i.containerInfo)}catch($e){qt(a,a.return,$e)}hy&&(hy=!1,Ww(a));break;case 4:f=Ja,Ja=Qh(a.stateNode.containerInfo),qr(i,a),Zr(a),Ja=f;break;case 12:qr(i,a),Zr(a);break;case 31:qr(i,a),Zr(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Ph(a,f)));break;case 13:qr(i,a),Zr(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Fh=ye()),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Ph(a,f)));break;case 22:y=a.memoizedState!==null;var z=u!==null&&u.memoizedState!==null,ne=so,he=$n;if(so=ne||y,$n=he||z,qr(i,a),$n=he,so=ne,Zr(a),f&8192)e:for(i=a.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(u===null||z||so||$n||ul(a)),u=null,i=a;;){if(i.tag===5||i.tag===26){if(u===null){z=u=i;try{if(S=z.stateNode,y)N=S.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{k=z.stateNode;var pe=z.memoizedProps.style,se=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;k.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch($e){qt(z,z.return,$e)}}}else if(i.tag===6){if(u===null){z=i;try{z.stateNode.nodeValue=y?"":z.memoizedProps}catch($e){qt(z,z.return,$e)}}}else if(i.tag===18){if(u===null){z=i;try{var ce=z.stateNode;y?FE(ce,!0):FE(z.stateNode,!1)}catch($e){qt(z,z.return,$e)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=a.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,Ph(a,u))));break;case 19:qr(i,a),Zr(a),f&4&&(f=a.updateQueue,f!==null&&(a.updateQueue=null,Ph(a,f)));break;case 30:break;case 21:break;default:qr(i,a),Zr(a)}}function Zr(a){var i=a.flags;if(i&2){try{for(var u,f=a.return;f!==null;){if(Vw(f)){u=f;break}f=f.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,S=dy(a);Lh(a,S,y);break;case 5:var N=u.stateNode;u.flags&32&&(Jl(N,""),u.flags&=-33);var k=dy(a);Lh(a,k,N);break;case 3:case 4:var z=u.stateNode.containerInfo,ne=dy(a);fy(a,ne,z);break;default:throw Error(r(161))}}catch(he){qt(a,a.return,he)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function Ww(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;Ww(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function io(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Bw(a,i.alternate,i),i=i.sibling}function ul(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:Yo(4,i,i.return),ul(i);break;case 1:Ts(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&Fw(i,i.return,u),ul(i);break;case 27:vd(i.stateNode);case 26:case 5:Ts(i,i.return),ul(i);break;case 22:i.memoizedState===null&&ul(i);break;case 30:ul(i);break;default:ul(i)}a=a.sibling}}function lo(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,y=a,S=i,N=S.flags;switch(S.tag){case 0:case 11:case 15:lo(y,S,u),id(4,S);break;case 1:if(lo(y,S,u),f=S,y=f.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ne){qt(f,f.return,ne)}if(f=S,y=f.updateQueue,y!==null){var k=f.stateNode;try{var z=y.shared.hiddenCallbacks;if(z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<z.length;y++)jC(z[y],k)}catch(ne){qt(f,f.return,ne)}}u&&N&64&&Uw(S),ld(S,S.return);break;case 27:Hw(S);case 26:case 5:lo(y,S,u),u&&f===null&&N&4&&zw(S),ld(S,S.return);break;case 12:lo(y,S,u);break;case 31:lo(y,S,u),u&&N&4&&Zw(y,S);break;case 13:lo(y,S,u),u&&N&4&&Kw(y,S);break;case 22:S.memoizedState===null&&lo(y,S,u),ld(S,S.return);break;case 30:break;default:lo(y,S,u)}i=i.sibling}}function my(a,i){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&Ku(u))}function py(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Ku(a))}function es(a,i,u,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Qw(a,i,u,f),i=i.sibling}function Qw(a,i,u,f){var y=i.flags;switch(i.tag){case 0:case 11:case 15:es(a,i,u,f),y&2048&&id(9,i);break;case 1:es(a,i,u,f);break;case 3:es(a,i,u,f),y&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Ku(a)));break;case 12:if(y&2048){es(a,i,u,f),a=i.stateNode;try{var S=i.memoizedProps,N=S.id,k=S.onPostCommit;typeof k=="function"&&k(N,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(z){qt(i,i.return,z)}}else es(a,i,u,f);break;case 31:es(a,i,u,f);break;case 13:es(a,i,u,f);break;case 23:break;case 22:S=i.stateNode,N=i.alternate,i.memoizedState!==null?S._visibility&2?es(a,i,u,f):cd(a,i):S._visibility&2?es(a,i,u,f):(S._visibility|=2,xc(a,i,u,f,(i.subtreeFlags&10256)!==0||!1)),y&2048&&my(N,i);break;case 24:es(a,i,u,f),y&2048&&py(i.alternate,i);break;default:es(a,i,u,f)}}function xc(a,i,u,f,y){for(y=y&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var S=a,N=i,k=u,z=f,ne=N.flags;switch(N.tag){case 0:case 11:case 15:xc(S,N,k,z,y),id(8,N);break;case 23:break;case 22:var he=N.stateNode;N.memoizedState!==null?he._visibility&2?xc(S,N,k,z,y):cd(S,N):(he._visibility|=2,xc(S,N,k,z,y)),y&&ne&2048&&my(N.alternate,N);break;case 24:xc(S,N,k,z,y),y&&ne&2048&&py(N.alternate,N);break;default:xc(S,N,k,z,y)}i=i.sibling}}function cd(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,f=i,y=f.flags;switch(f.tag){case 22:cd(u,f),y&2048&&my(f.alternate,f);break;case 24:cd(u,f),y&2048&&py(f.alternate,f);break;default:cd(u,f)}i=i.sibling}}var ud=8192;function bc(a,i,u){if(a.subtreeFlags&ud)for(a=a.child;a!==null;)Xw(a,i,u),a=a.sibling}function Xw(a,i,u){switch(a.tag){case 26:bc(a,i,u),a.flags&ud&&a.memoizedState!==null&&H6(u,Ja,a.memoizedState,a.memoizedProps);break;case 5:bc(a,i,u);break;case 3:case 4:var f=Ja;Ja=Qh(a.stateNode.containerInfo),bc(a,i,u),Ja=f;break;case 22:a.memoizedState===null&&(f=a.alternate,f!==null&&f.memoizedState!==null?(f=ud,ud=16777216,bc(a,i,u),ud=f):bc(a,i,u));break;default:bc(a,i,u)}}function Jw(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function dd(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];lr=f,tE(f,a)}Jw(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)eE(a),a=a.sibling}function eE(a){switch(a.tag){case 0:case 11:case 15:dd(a),a.flags&2048&&Yo(9,a,a.return);break;case 3:dd(a);break;case 12:dd(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,Uh(a)):dd(a);break;default:dd(a)}}function Uh(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];lr=f,tE(f,a)}Jw(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:Yo(8,i,i.return),Uh(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Uh(i));break;default:Uh(i)}a=a.sibling}}function tE(a,i){for(;lr!==null;){var u=lr;switch(u.tag){case 0:case 11:case 15:Yo(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Ku(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,lr=f;else e:for(u=a;lr!==null;){f=lr;var y=f.sibling,S=f.return;if(Gw(f),f===u){lr=null;break e}if(y!==null){y.return=S,lr=y;break e}lr=S}}}var r6={getCacheForType:function(a){var i=vr(zn),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u},cacheSignal:function(){return vr(zn).controller.signal}},a6=typeof WeakMap=="function"?WeakMap:Map,zt=0,nn=null,St=null,Et=0,Gt=0,oa=null,Wo=!1,Sc=!1,gy=!1,co=0,wn=0,Qo=0,dl=0,vy=0,ia=0,Cc=0,fd=null,Kr=null,yy=!1,Fh=0,nE=0,zh=1/0,Vh=null,Xo=null,Jn=0,Jo=null,wc=null,uo=0,xy=0,by=null,rE=null,hd=0,Sy=null;function la(){return(zt&2)!==0&&Et!==0?Et&-Et:I.T!==null?jy():ke()}function aE(){if(ia===0)if((Et&536870912)===0||At){var a=Uo;Uo<<=1,(Uo&3932160)===0&&(Uo=262144),ia=a}else ia=536870912;return a=aa.current,a!==null&&(a.flags|=32),ia}function Yr(a,i,u){(a===nn&&(Gt===2||Gt===9)||a.cancelPendingCommit!==null)&&(Ec(a,0),ei(a,Et,ia,!1)),F(a,u),((zt&2)===0||a!==nn)&&(a===nn&&((zt&2)===0&&(dl|=u),wn===4&&ei(a,Et,ia,!1)),js(a))}function sE(a,i,u){if((zt&6)!==0)throw Error(r(327));var f=!u&&(i&127)===0&&(i&a.expiredLanes)===0||Qn(a,i),y=f?i6(a,i):wy(a,i,!0),S=f;do{if(y===0){Sc&&!f&&ei(a,i,0,!1);break}else{if(u=a.current.alternate,S&&!s6(u)){y=wy(a,i,!1),S=!1;continue}if(y===2){if(S=i,a.errorRecoveryDisabledLanes&S)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var k=a;y=fd;var z=k.current.memoizedState.isDehydrated;if(z&&(Ec(k,N).flags|=256),N=wy(k,N,!1),N!==2){if(gy&&!z){k.errorRecoveryDisabledLanes|=S,dl|=S,y=4;break e}S=Kr,Kr=y,S!==null&&(Kr===null?Kr=S:Kr.push.apply(Kr,S))}y=N}if(S=!1,y!==2)continue}}if(y===1){Ec(a,0),ei(a,i,0,!0);break}e:{switch(f=a,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:ei(f,i,ia,!Wo);break e;case 2:Kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(y=Fh+300-ye(),10<y)){if(ei(f,i,ia,!Wo),Mn(f,0,!0)!==0)break e;uo=i,f.timeoutHandle=LE(oE.bind(null,f,u,Kr,Vh,yy,i,ia,dl,Cc,Wo,S,"Throttled",-0,0),y);break e}oE(f,u,Kr,Vh,yy,i,ia,dl,Cc,Wo,S,null,-0,0)}}break}while(!0);js(a)}function oE(a,i,u,f,y,S,N,k,z,ne,he,pe,se,ce){if(a.timeoutHandle=-1,pe=i.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ys},Xw(i,S,pe);var $e=(S&62914560)===S?Fh-ye():(S&4194048)===S?nE-ye():0;if($e=$6(pe,$e),$e!==null){uo=S,a.cancelPendingCommit=$e(mE.bind(null,a,i,S,u,f,y,N,k,z,he,pe,null,se,ce)),ei(a,S,N,!ne);return}}mE(a,i,S,u,f,y,N,k,z)}function s6(a){for(var i=a;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var y=u[f],S=y.getSnapshot;y=y.value;try{if(!na(S(),y))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ei(a,i,u,f){i&=~vy,i&=~dl,a.suspendedLanes|=i,a.pingedLanes&=~i,f&&(a.warmLanes|=i),f=a.expirationTimes;for(var y=i;0<y;){var S=31-On(y),N=1<<S;f[S]=-1,y&=~N}u!==0&&oe(a,u,i)}function Hh(){return(zt&6)===0?(md(0),!1):!0}function Cy(){if(St!==null){if(Gt===0)var a=St.return;else a=St,Js=nl=null,Uv(a),mc=null,Wu=0,a=St;for(;a!==null;)Pw(a.alternate,a),a=a.return;St=null}}function Ec(a,i){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,R6(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),uo=0,Cy(),nn=a,St=u=Qs(a.current,null),Et=i,Gt=0,oa=null,Wo=!1,Sc=Qn(a,i),gy=!1,Cc=ia=vy=dl=Qo=wn=0,Kr=fd=null,yy=!1,(i&8)!==0&&(i|=i&32);var f=a.entangledLanes;if(f!==0)for(a=a.entanglements,f&=i;0<f;){var y=31-On(f),S=1<<y;i|=a[y],f&=~S}return co=i,ch(),u}function iE(a,i){ut=null,I.H=ad,i===hc||i===vh?(i=wC(),Gt=3):i===Tv?(i=wC(),Gt=4):Gt=i===ey?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,oa=i,St===null&&(wn=1,Dh(a,Ma(i,a.current)))}function lE(){var a=aa.current;return a===null?!0:(Et&4194048)===Et?Pa===null:(Et&62914560)===Et||(Et&536870912)!==0?a===Pa:!1}function cE(){var a=I.H;return I.H=ad,a===null?ad:a}function uE(){var a=I.A;return I.A=r6,a}function $h(){wn=4,Wo||(Et&4194048)!==Et&&aa.current!==null||(Sc=!0),(Qo&134217727)===0&&(dl&134217727)===0||nn===null||ei(nn,Et,ia,!1)}function wy(a,i,u){var f=zt;zt|=2;var y=cE(),S=uE();(nn!==a||Et!==i)&&(Vh=null,Ec(a,i)),i=!1;var N=wn;e:do try{if(Gt!==0&&St!==null){var k=St,z=oa;switch(Gt){case 8:Cy(),N=6;break e;case 3:case 2:case 9:case 6:aa.current===null&&(i=!0);var ne=Gt;if(Gt=0,oa=null,Rc(a,k,z,ne),u&&Sc){N=0;break e}break;default:ne=Gt,Gt=0,oa=null,Rc(a,k,z,ne)}}o6(),N=wn;break}catch(he){iE(a,he)}while(!0);return i&&a.shellSuspendCounter++,Js=nl=null,zt=f,I.H=y,I.A=S,St===null&&(nn=null,Et=0,ch()),N}function o6(){for(;St!==null;)dE(St)}function i6(a,i){var u=zt;zt|=2;var f=cE(),y=uE();nn!==a||Et!==i?(Vh=null,zh=ye()+500,Ec(a,i)):Sc=Qn(a,i);e:do try{if(Gt!==0&&St!==null){i=St;var S=oa;t:switch(Gt){case 1:Gt=0,oa=null,Rc(a,i,S,1);break;case 2:case 9:if(SC(S)){Gt=0,oa=null,fE(i);break}i=function(){Gt!==2&&Gt!==9||nn!==a||(Gt=7),js(a)},S.then(i,i);break e;case 3:Gt=7;break e;case 4:Gt=5;break e;case 7:SC(S)?(Gt=0,oa=null,fE(i)):(Gt=0,oa=null,Rc(a,i,S,7));break;case 5:var N=null;switch(St.tag){case 26:N=St.memoizedState;case 5:case 27:var k=St;if(N?QE(N):k.stateNode.complete){Gt=0,oa=null;var z=k.sibling;if(z!==null)St=z;else{var ne=k.return;ne!==null?(St=ne,Bh(ne)):St=null}break t}}Gt=0,oa=null,Rc(a,i,S,5);break;case 6:Gt=0,oa=null,Rc(a,i,S,6);break;case 8:Cy(),wn=6;break e;default:throw Error(r(462))}}l6();break}catch(he){iE(a,he)}while(!0);return Js=nl=null,I.H=f,I.A=y,zt=u,St!==null?0:(nn=null,Et=0,ch(),wn)}function l6(){for(;St!==null&&!de();)dE(St)}function dE(a){var i=Iw(a.alternate,a,co);a.memoizedProps=a.pendingProps,i===null?Bh(a):St=i}function fE(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=Nw(u,i,i.pendingProps,i.type,void 0,Et);break;case 11:i=Nw(u,i,i.pendingProps,i.type.render,i.ref,Et);break;case 5:Uv(i);default:Pw(u,i),i=St=uC(i,co),i=Iw(u,i,co)}a.memoizedProps=a.pendingProps,i===null?Bh(a):St=i}function Rc(a,i,u,f){Js=nl=null,Uv(i),mc=null,Wu=0;var y=i.return;try{if(WM(a,y,i,u,Et)){wn=1,Dh(a,Ma(u,a.current)),St=null;return}}catch(S){if(y!==null)throw St=y,S;wn=1,Dh(a,Ma(u,a.current)),St=null;return}i.flags&32768?(At||f===1?a=!0:Sc||(Et&536870912)!==0?a=!1:(Wo=a=!0,(f===2||f===9||f===3||f===6)&&(f=aa.current,f!==null&&f.tag===13&&(f.flags|=16384))),hE(i,a)):Bh(i)}function Bh(a){var i=a;do{if((i.flags&32768)!==0){hE(i,Wo);return}a=i.return;var u=JM(i.alternate,i,co);if(u!==null){St=u;return}if(i=i.sibling,i!==null){St=i;return}St=i=a}while(i!==null);wn===0&&(wn=5)}function hE(a,i){do{var u=e6(a.alternate,a);if(u!==null){u.flags&=32767,St=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){St=a;return}St=a=u}while(a!==null);wn=6,St=null}function mE(a,i,u,f,y,S,N,k,z){a.cancelPendingCommit=null;do Gh();while(Jn!==0);if((zt&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(S=i.lanes|i.childLanes,S|=dv,Q(a,u,S,N,k,z),a===nn&&(St=nn=null,Et=0),wc=i,Jo=a,uo=u,xy=S,by=y,rE=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,f6(ht,function(){return xE(),null})):(a.callbackNode=null,a.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=I.T,I.T=null,y=Y.p,Y.p=2,N=zt,zt|=4;try{t6(a,i,u)}finally{zt=N,Y.p=y,I.T=f}}Jn=1,pE(),gE(),vE()}}function pE(){if(Jn===1){Jn=0;var a=Jo,i=wc,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var f=Y.p;Y.p=2;var y=zt;zt|=4;try{Yw(i,a);var S=Iy,N=tC(a.containerInfo),k=S.focusedElem,z=S.selectionRange;if(N!==k&&k&&k.ownerDocument&&eC(k.ownerDocument.documentElement,k)){if(z!==null&&ov(k)){var ne=z.start,he=z.end;if(he===void 0&&(he=ne),"selectionStart"in k)k.selectionStart=ne,k.selectionEnd=Math.min(he,k.value.length);else{var pe=k.ownerDocument||document,se=pe&&pe.defaultView||window;if(se.getSelection){var ce=se.getSelection(),$e=k.textContent.length,tt=Math.min(z.start,$e),Wt=z.end===void 0?tt:Math.min(z.end,$e);!ce.extend&&tt>Wt&&(N=Wt,Wt=tt,tt=N);var X=JS(k,tt),q=JS(k,Wt);if(X&&q&&(ce.rangeCount!==1||ce.anchorNode!==X.node||ce.anchorOffset!==X.offset||ce.focusNode!==q.node||ce.focusOffset!==q.offset)){var te=pe.createRange();te.setStart(X.node,X.offset),ce.removeAllRanges(),tt>Wt?(ce.addRange(te),ce.extend(q.node,q.offset)):(te.setEnd(q.node,q.offset),ce.addRange(te))}}}}for(pe=[],ce=k;ce=ce.parentNode;)ce.nodeType===1&&pe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<pe.length;k++){var me=pe[k];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}rm=!!ky,Iy=ky=null}finally{zt=y,Y.p=f,I.T=u}}a.current=i,Jn=2}}function gE(){if(Jn===2){Jn=0;var a=Jo,i=wc,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var f=Y.p;Y.p=2;var y=zt;zt|=4;try{Bw(a,i.alternate,i)}finally{zt=y,Y.p=f,I.T=u}}Jn=3}}function vE(){if(Jn===4||Jn===3){Jn=0,_e();var a=Jo,i=wc,u=uo,f=rE;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Jn=5:(Jn=0,wc=Jo=null,yE(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(Xo=null),He(u),i=i.stateNode,Sn&&typeof Sn.onCommitFiberRoot=="function")try{Sn.onCommitFiberRoot($r,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=I.T,y=Y.p,Y.p=2,I.T=null;try{for(var S=a.onRecoverableError,N=0;N<f.length;N++){var k=f[N];S(k.value,{componentStack:k.stack})}}finally{I.T=i,Y.p=y}}(uo&3)!==0&&Gh(),js(a),y=a.pendingLanes,(u&261930)!==0&&(y&42)!==0?a===Sy?hd++:(hd=0,Sy=a):hd=0,md(0)}}function yE(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,Ku(i)))}function Gh(){return pE(),gE(),vE(),xE()}function xE(){if(Jn!==5)return!1;var a=Jo,i=xy;xy=0;var u=He(uo),f=I.T,y=Y.p;try{Y.p=32>u?32:u,I.T=null,u=by,by=null;var S=Jo,N=uo;if(Jn=0,wc=Jo=null,uo=0,(zt&6)!==0)throw Error(r(331));var k=zt;if(zt|=4,eE(S.current),Qw(S,S.current,N,u),zt=k,md(0,!1),Sn&&typeof Sn.onPostCommitFiberRoot=="function")try{Sn.onPostCommitFiberRoot($r,S)}catch{}return!0}finally{Y.p=y,I.T=f,yE(a,i)}}function bE(a,i,u){i=Ma(u,i),i=Jv(a.stateNode,i,2),a=qo(a,i,2),a!==null&&(F(a,2),js(a))}function qt(a,i,u){if(a.tag===3)bE(a,a,u);else for(;i!==null;){if(i.tag===3){bE(i,a,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Xo===null||!Xo.has(f))){a=Ma(u,a),u=Sw(2),f=qo(i,u,2),f!==null&&(Cw(u,f,i,a),F(f,2),js(f));break}}i=i.return}}function Ey(a,i,u){var f=a.pingCache;if(f===null){f=a.pingCache=new a6;var y=new Set;f.set(i,y)}else y=f.get(i),y===void 0&&(y=new Set,f.set(i,y));y.has(u)||(gy=!0,y.add(u),a=c6.bind(null,a,i,u),i.then(a,a))}function c6(a,i,u){var f=a.pingCache;f!==null&&f.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,nn===a&&(Et&u)===u&&(wn===4||wn===3&&(Et&62914560)===Et&&300>ye()-Fh?(zt&2)===0&&Ec(a,0):vy|=u,Cc===Et&&(Cc=0)),js(a)}function SE(a,i){i===0&&(i=or()),a=Ji(a,i),a!==null&&(F(a,i),js(a))}function u6(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),SE(a,u)}function d6(a,i){var u=0;switch(a.tag){case 31:case 13:var f=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:f=a.stateNode;break;case 22:f=a.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(i),SE(a,u)}function f6(a,i){return V(a,i)}var qh=null,Tc=null,Ry=!1,Zh=!1,Ty=!1,ti=0;function js(a){a!==Tc&&a.next===null&&(Tc===null?qh=Tc=a:Tc=Tc.next=a),Zh=!0,Ry||(Ry=!0,m6())}function md(a,i){if(!Ty&&Zh){Ty=!0;do for(var u=!1,f=qh;f!==null;){if(a!==0){var y=f.pendingLanes;if(y===0)var S=0;else{var N=f.suspendedLanes,k=f.pingedLanes;S=(1<<31-On(42|a)+1)-1,S&=y&~(N&~k),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,RE(f,S))}else S=Et,S=Mn(f,f===nn?S:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(S&3)===0||Qn(f,S)||(u=!0,RE(f,S));f=f.next}while(u);Ty=!1}}function h6(){CE()}function CE(){Zh=Ry=!1;var a=0;ti!==0&&E6()&&(a=ti);for(var i=ye(),u=null,f=qh;f!==null;){var y=f.next,S=wE(f,i);S===0?(f.next=null,u===null?qh=y:u.next=y,y===null&&(Tc=u)):(u=f,(a!==0||(S&3)!==0)&&(Zh=!0)),f=y}Jn!==0&&Jn!==5||md(a),ti!==0&&(ti=0)}function wE(a,i){for(var u=a.suspendedLanes,f=a.pingedLanes,y=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var N=31-On(S),k=1<<N,z=y[N];z===-1?((k&u)===0||(k&f)!==0)&&(y[N]=Xn(k,i)):z<=i&&(a.expiredLanes|=k),S&=~k}if(i=nn,u=Et,u=Mn(a,a===i?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f=a.callbackNode,u===0||a===i&&(Gt===2||Gt===9)||a.cancelPendingCommit!==null)return f!==null&&f!==null&&ee(f),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||Qn(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(f!==null&&ee(f),He(u)){case 2:case 8:u=st;break;case 32:u=ht;break;case 268435456:u=Hr;break;default:u=ht}return f=EE.bind(null,a),u=V(u,f),a.callbackPriority=i,a.callbackNode=u,i}return f!==null&&f!==null&&ee(f),a.callbackPriority=2,a.callbackNode=null,2}function EE(a,i){if(Jn!==0&&Jn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Gh()&&a.callbackNode!==u)return null;var f=Et;return f=Mn(a,a===nn?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),f===0?null:(sE(a,f,i),wE(a,ye()),a.callbackNode!=null&&a.callbackNode===u?EE.bind(null,a):null)}function RE(a,i){if(Gh())return null;sE(a,i,!0)}function m6(){T6(function(){(zt&6)!==0?V(Le,h6):CE()})}function jy(){if(ti===0){var a=dc;a===0&&(a=bs,bs<<=1,(bs&261888)===0&&(bs=256)),ti=a}return ti}function TE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:th(""+a)}function jE(a,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,a.id&&u.setAttribute("form",a.id),i.parentNode.insertBefore(u,i),a=new FormData(a),u.parentNode.removeChild(u),a}function p6(a,i,u,f,y){if(i==="submit"&&u&&u.stateNode===y){var S=TE((y[Me]||null).action),N=f.submitter;N&&(i=(i=N[Me]||null)?TE(i.formAction):N.getAttribute("formAction"),i!==null&&(S=i,N=null));var k=new sh("action","action",null,f,y);a.push({event:k,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(ti!==0){var z=N?jE(y,N):new FormData(y);Zv(u,{pending:!0,data:z,method:y.method,action:S},null,z)}}else typeof S=="function"&&(k.preventDefault(),z=N?jE(y,N):new FormData(y),Zv(u,{pending:!0,data:z,method:y.method,action:S},S,z))},currentTarget:y}]})}}for(var _y=0;_y<uv.length;_y++){var Ny=uv[_y],g6=Ny.toLowerCase(),v6=Ny[0].toUpperCase()+Ny.slice(1);Xa(g6,"on"+v6)}Xa(aC,"onAnimationEnd"),Xa(sC,"onAnimationIteration"),Xa(oC,"onAnimationStart"),Xa("dblclick","onDoubleClick"),Xa("focusin","onFocus"),Xa("focusout","onBlur"),Xa(MM,"onTransitionRun"),Xa(kM,"onTransitionStart"),Xa(IM,"onTransitionCancel"),Xa(iC,"onTransitionEnd"),gt("onMouseEnter",["mouseout","mouseover"]),gt("onMouseLeave",["mouseout","mouseover"]),gt("onPointerEnter",["pointerout","pointerover"]),gt("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 pd="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(" "),y6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(pd));function _E(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var f=a[u],y=f.event;f=f.listeners;e:{var S=void 0;if(i)for(var N=f.length-1;0<=N;N--){var k=f[N],z=k.instance,ne=k.currentTarget;if(k=k.listener,z!==S&&y.isPropagationStopped())break e;S=k,y.currentTarget=ne;try{S(y)}catch(he){lh(he)}y.currentTarget=null,S=z}else for(N=0;N<f.length;N++){if(k=f[N],z=k.instance,ne=k.currentTarget,k=k.listener,z!==S&&y.isPropagationStopped())break e;S=k,y.currentTarget=ne;try{S(y)}catch(he){lh(he)}y.currentTarget=null,S=z}}}}function Ct(a,i){var u=i[Ht];u===void 0&&(u=i[Ht]=new Set);var f=a+"__bubble";u.has(f)||(NE(i,a,2,!1),u.add(f))}function Ay(a,i,u){var f=0;i&&(f|=4),NE(u,a,f,i)}var Kh="_reactListening"+Math.random().toString(36).slice(2);function Dy(a){if(!a[Kh]){a[Kh]=!0,Cs.forEach(function(u){u!=="selectionchange"&&(y6.has(u)||Ay(u,!1,a),Ay(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[Kh]||(i[Kh]=!0,Ay("selectionchange",!1,i))}}function NE(a,i,u,f){switch(a2(i)){case 2:var y=q6;break;case 8:y=Z6;break;default:y=qy}u=y.bind(null,i,u,a),y=void 0,!Qg||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),f?y!==void 0?a.addEventListener(i,u,{capture:!0,passive:y}):a.addEventListener(i,u,!0):y!==void 0?a.addEventListener(i,u,{passive:y}):a.addEventListener(i,u,!1)}function Oy(a,i,u,f,y){var S=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var N=f.tag;if(N===3||N===4){var k=f.stateNode.containerInfo;if(k===y)break;if(N===4)for(N=f.return;N!==null;){var z=N.tag;if((z===3||z===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;k!==null;){if(N=_a(k),N===null)return;if(z=N.tag,z===5||z===6||z===26||z===27){f=S=N;continue e}k=k.parentNode}}f=f.return}kS(function(){var ne=S,he=Yg(u),pe=[];e:{var se=lC.get(a);if(se!==void 0){var ce=sh,$e=a;switch(a){case"keypress":if(rh(u)===0)break e;case"keydown":case"keyup":ce=dM;break;case"focusin":$e="focus",ce=tv;break;case"focusout":$e="blur",ce=tv;break;case"beforeblur":case"afterblur":ce=tv;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=PS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=J5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=mM;break;case aC:case sC:case oC:ce=nM;break;case iC:ce=gM;break;case"scroll":case"scrollend":ce=Q5;break;case"wheel":ce=yM;break;case"copy":case"cut":case"paste":ce=aM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=FS;break;case"toggle":case"beforetoggle":ce=bM}var tt=(i&4)!==0,Wt=!tt&&(a==="scroll"||a==="scrollend"),X=tt?se!==null?se+"Capture":null:se;tt=[];for(var q=ne,te;q!==null;){var me=q;if(te=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||te===null||X===null||(me=Pu(q,X),me!=null&&tt.push(gd(q,me,te))),Wt)break;q=q.return}0<tt.length&&(se=new ce(se,$e,null,u,he),pe.push({event:se,listeners:tt}))}}if((i&7)===0){e:{if(se=a==="mouseover"||a==="pointerover",ce=a==="mouseout"||a==="pointerout",se&&u!==Kg&&($e=u.relatedTarget||u.fromElement)&&(_a($e)||$e[ot]))break e;if((ce||se)&&(se=he.window===he?he:(se=he.ownerDocument)?se.defaultView||se.parentWindow:window,ce?($e=u.relatedTarget||u.toElement,ce=ne,$e=$e?_a($e):null,$e!==null&&(Wt=l($e),tt=$e.tag,$e!==Wt||tt!==5&&tt!==27&&tt!==6)&&($e=null)):(ce=null,$e=ne),ce!==$e)){if(tt=PS,me="onMouseLeave",X="onMouseEnter",q="mouse",(a==="pointerout"||a==="pointerover")&&(tt=FS,me="onPointerLeave",X="onPointerEnter",q="pointer"),Wt=ce==null?se:jr(ce),te=$e==null?se:jr($e),se=new tt(me,q+"leave",ce,u,he),se.target=Wt,se.relatedTarget=te,me=null,_a(he)===ne&&(tt=new tt(X,q+"enter",$e,u,he),tt.target=te,tt.relatedTarget=Wt,me=tt),Wt=me,ce&&$e)t:{for(tt=x6,X=ce,q=$e,te=0,me=X;me;me=tt(me))te++;me=0;for(var Je=q;Je;Je=tt(Je))me++;for(;0<te-me;)X=tt(X),te--;for(;0<me-te;)q=tt(q),me--;for(;te--;){if(X===q||q!==null&&X===q.alternate){tt=X;break t}X=tt(X),q=tt(q)}tt=null}else tt=null;ce!==null&&AE(pe,se,ce,tt,!1),$e!==null&&Wt!==null&&AE(pe,Wt,$e,tt,!0)}}e:{if(se=ne?jr(ne):window,ce=se.nodeName&&se.nodeName.toLowerCase(),ce==="select"||ce==="input"&&se.type==="file")var Pt=ZS;else if(GS(se))if(KS)Pt=AM;else{Pt=_M;var We=jM}else ce=se.nodeName,!ce||ce.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ne&&Zg(ne.elementType)&&(Pt=ZS):Pt=NM;if(Pt&&(Pt=Pt(a,ne))){qS(pe,Pt,u,he);break e}We&&We(a,se,ne),a==="focusout"&&ne&&se.type==="number"&&ne.memoizedProps.value!=null&&qg(se,"number",se.value)}switch(We=ne?jr(ne):window,a){case"focusin":(GS(We)||We.contentEditable==="true")&&(rc=We,iv=ne,Gu=null);break;case"focusout":Gu=iv=rc=null;break;case"mousedown":lv=!0;break;case"contextmenu":case"mouseup":case"dragend":lv=!1,nC(pe,u,he);break;case"selectionchange":if(OM)break;case"keydown":case"keyup":nC(pe,u,he)}var mt;if(rv)e:{switch(a){case"compositionstart":var Rt="onCompositionStart";break e;case"compositionend":Rt="onCompositionEnd";break e;case"compositionupdate":Rt="onCompositionUpdate";break e}Rt=void 0}else nc?$S(a,u)&&(Rt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Rt="onCompositionStart");Rt&&(zS&&u.locale!=="ko"&&(nc||Rt!=="onCompositionStart"?Rt==="onCompositionEnd"&&nc&&(mt=IS()):(Fo=he,Xg="value"in Fo?Fo.value:Fo.textContent,nc=!0)),We=Yh(ne,Rt),0<We.length&&(Rt=new US(Rt,a,null,u,he),pe.push({event:Rt,listeners:We}),mt?Rt.data=mt:(mt=BS(u),mt!==null&&(Rt.data=mt)))),(mt=CM?wM(a,u):EM(a,u))&&(Rt=Yh(ne,"onBeforeInput"),0<Rt.length&&(We=new US("onBeforeInput","beforeinput",null,u,he),pe.push({event:We,listeners:Rt}),We.data=mt)),p6(pe,a,ne,u,he)}_E(pe,i)})}function gd(a,i,u){return{instance:a,listener:i,currentTarget:u}}function Yh(a,i){for(var u=i+"Capture",f=[];a!==null;){var y=a,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Pu(a,u),y!=null&&f.unshift(gd(a,y,S)),y=Pu(a,i),y!=null&&f.push(gd(a,y,S))),a.tag===3)return f;a=a.return}return[]}function x6(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function AE(a,i,u,f,y){for(var S=i._reactName,N=[];u!==null&&u!==f;){var k=u,z=k.alternate,ne=k.stateNode;if(k=k.tag,z!==null&&z===f)break;k!==5&&k!==26&&k!==27||ne===null||(z=ne,y?(ne=Pu(u,S),ne!=null&&N.unshift(gd(u,ne,z))):y||(ne=Pu(u,S),ne!=null&&N.push(gd(u,ne,z)))),u=u.return}N.length!==0&&a.push({event:i,listeners:N})}var b6=/\r\n?/g,S6=/\u0000|\uFFFD/g;function DE(a){return(typeof a=="string"?a:""+a).replace(b6,`
|
|
49
|
-
`).replace(S6,"")}function OE(a,i){return i=DE(i),DE(a)===i}function Yt(a,i,u,f,y,S){switch(u){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||Jl(a,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&Jl(a,""+f);break;case"className":Yi(a,"class",f);break;case"tabIndex":Yi(a,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Yi(a,u,f);break;case"style":OS(a,f,S);break;case"data":if(i!=="object"){Yi(a,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=th(""+f),a.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){a.setAttribute(u,"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 S=="function"&&(u==="formAction"?(i!=="input"&&Yt(a,i,"name",y.name,y,null),Yt(a,i,"formEncType",y.formEncType,y,null),Yt(a,i,"formMethod",y.formMethod,y,null),Yt(a,i,"formTarget",y.formTarget,y,null)):(Yt(a,i,"encType",y.encType,y,null),Yt(a,i,"method",y.method,y,null),Yt(a,i,"target",y.target,y,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){a.removeAttribute(u);break}f=th(""+f),a.setAttribute(u,f);break;case"onClick":f!=null&&(a.onclick=Ys);break;case"onScroll":f!=null&&Ct("scroll",a);break;case"onScrollEnd":f!=null&&Ct("scrollend",a);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":a.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){a.removeAttribute("xlink:href");break}u=th(""+f),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""+f):a.removeAttribute(u);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":f&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":f===!0?a.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?a.setAttribute(u,f):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?a.setAttribute(u,f):a.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?a.removeAttribute(u):a.setAttribute(u,f);break;case"popover":Ct("beforetoggle",a),Ct("toggle",a),Ks(a,"popover",f);break;case"xlinkActuate":Qa(a,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Qa(a,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Qa(a,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Qa(a,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Qa(a,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Qa(a,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Qa(a,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Qa(a,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Qa(a,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Ks(a,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Y5.get(u)||u,Ks(a,u,f))}}function My(a,i,u,f,y,S){switch(u){case"style":OS(a,f,S);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(u=f.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof f=="string"?Jl(a,f):(typeof f=="number"||typeof f=="bigint")&&Jl(a,""+f);break;case"onScroll":f!=null&&Ct("scroll",a);break;case"onScrollEnd":f!=null&&Ct("scrollend",a);break;case"onClick":f!=null&&(a.onclick=Ys);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ki.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),i=u.slice(2,y?u.length-7:void 0),S=a[Me]||null,S=S!=null?S[u]:null,typeof S=="function"&&a.removeEventListener(i,S,y),typeof f=="function")){typeof S!="function"&&S!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,f,y);break e}u in a?a[u]=f:f===!0?a.setAttribute(u,""):Ks(a,u,f)}}}function xr(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ct("error",a),Ct("load",a);var f=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var N=u[S];if(N!=null)switch(S){case"src":f=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Yt(a,i,S,N,u,null)}}y&&Yt(a,i,"srcSet",u.srcSet,u,null),f&&Yt(a,i,"src",u.src,u,null);return;case"input":Ct("invalid",a);var k=S=N=y=null,z=null,ne=null;for(f in u)if(u.hasOwnProperty(f)){var he=u[f];if(he!=null)switch(f){case"name":y=he;break;case"type":N=he;break;case"checked":z=he;break;case"defaultChecked":ne=he;break;case"value":S=he;break;case"defaultValue":k=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,i));break;default:Yt(a,i,f,he,u,null)}}_S(a,S,k,z,ne,N,y,!1);return;case"select":Ct("invalid",a),f=N=S=null;for(y in u)if(u.hasOwnProperty(y)&&(k=u[y],k!=null))switch(y){case"value":S=k;break;case"defaultValue":N=k;break;case"multiple":f=k;default:Yt(a,i,y,k,u,null)}i=S,u=N,a.multiple=!!f,i!=null?Xl(a,!!f,i,!1):u!=null&&Xl(a,!!f,u,!0);return;case"textarea":Ct("invalid",a),S=y=f=null;for(N in u)if(u.hasOwnProperty(N)&&(k=u[N],k!=null))switch(N){case"value":f=k;break;case"defaultValue":y=k;break;case"children":S=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:Yt(a,i,N,k,u,null)}AS(a,f,y,S);return;case"option":for(z in u)if(u.hasOwnProperty(z)&&(f=u[z],f!=null))switch(z){case"selected":a.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Yt(a,i,z,f,u,null)}return;case"dialog":Ct("beforetoggle",a),Ct("toggle",a),Ct("cancel",a),Ct("close",a);break;case"iframe":case"object":Ct("load",a);break;case"video":case"audio":for(f=0;f<pd.length;f++)Ct(pd[f],a);break;case"image":Ct("error",a),Ct("load",a);break;case"details":Ct("toggle",a);break;case"embed":case"source":case"link":Ct("error",a),Ct("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in u)if(u.hasOwnProperty(ne)&&(f=u[ne],f!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Yt(a,i,ne,f,u,null)}return;default:if(Zg(i)){for(he in u)u.hasOwnProperty(he)&&(f=u[he],f!==void 0&&My(a,i,he,f,u,void 0));return}}for(k in u)u.hasOwnProperty(k)&&(f=u[k],f!=null&&Yt(a,i,k,f,u,null))}function C6(a,i,u,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,N=null,k=null,z=null,ne=null,he=null;for(ce in u){var pe=u[ce];if(u.hasOwnProperty(ce)&&pe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":z=pe;default:f.hasOwnProperty(ce)||Yt(a,i,ce,null,f,pe)}}for(var se in f){var ce=f[se];if(pe=u[se],f.hasOwnProperty(se)&&(ce!=null||pe!=null))switch(se){case"type":S=ce;break;case"name":y=ce;break;case"checked":ne=ce;break;case"defaultChecked":he=ce;break;case"value":N=ce;break;case"defaultValue":k=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,i));break;default:ce!==pe&&Yt(a,i,se,ce,f,pe)}}Gg(a,N,k,z,ne,he,S,y);return;case"select":ce=N=k=se=null;for(S in u)if(z=u[S],u.hasOwnProperty(S)&&z!=null)switch(S){case"value":break;case"multiple":ce=z;default:f.hasOwnProperty(S)||Yt(a,i,S,null,f,z)}for(y in f)if(S=f[y],z=u[y],f.hasOwnProperty(y)&&(S!=null||z!=null))switch(y){case"value":se=S;break;case"defaultValue":k=S;break;case"multiple":N=S;default:S!==z&&Yt(a,i,y,S,f,z)}i=k,u=N,f=ce,se!=null?Xl(a,!!u,se,!1):!!f!=!!u&&(i!=null?Xl(a,!!u,i,!0):Xl(a,!!u,u?[]:"",!1));return;case"textarea":ce=se=null;for(k in u)if(y=u[k],u.hasOwnProperty(k)&&y!=null&&!f.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Yt(a,i,k,null,f,y)}for(N in f)if(y=f[N],S=u[N],f.hasOwnProperty(N)&&(y!=null||S!=null))switch(N){case"value":se=y;break;case"defaultValue":ce=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&Yt(a,i,N,y,f,S)}NS(a,se,ce);return;case"option":for(var $e in u)if(se=u[$e],u.hasOwnProperty($e)&&se!=null&&!f.hasOwnProperty($e))switch($e){case"selected":a.selected=!1;break;default:Yt(a,i,$e,null,f,se)}for(z in f)if(se=f[z],ce=u[z],f.hasOwnProperty(z)&&se!==ce&&(se!=null||ce!=null))switch(z){case"selected":a.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Yt(a,i,z,se,f,ce)}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 tt in u)se=u[tt],u.hasOwnProperty(tt)&&se!=null&&!f.hasOwnProperty(tt)&&Yt(a,i,tt,null,f,se);for(ne in f)if(se=f[ne],ce=u[ne],f.hasOwnProperty(ne)&&se!==ce&&(se!=null||ce!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,i));break;default:Yt(a,i,ne,se,f,ce)}return;default:if(Zg(i)){for(var Wt in u)se=u[Wt],u.hasOwnProperty(Wt)&&se!==void 0&&!f.hasOwnProperty(Wt)&&My(a,i,Wt,void 0,f,se);for(he in f)se=f[he],ce=u[he],!f.hasOwnProperty(he)||se===ce||se===void 0&&ce===void 0||My(a,i,he,se,f,ce);return}}for(var X in u)se=u[X],u.hasOwnProperty(X)&&se!=null&&!f.hasOwnProperty(X)&&Yt(a,i,X,null,f,se);for(pe in f)se=f[pe],ce=u[pe],!f.hasOwnProperty(pe)||se===ce||se==null&&ce==null||Yt(a,i,pe,se,f,ce)}function ME(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function w6(){if(typeof performance.getEntriesByType=="function"){for(var a=0,i=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var y=u[f],S=y.transferSize,N=y.initiatorType,k=y.duration;if(S&&k&&ME(N)){for(N=0,k=y.responseEnd,f+=1;f<u.length;f++){var z=u[f],ne=z.startTime;if(ne>k)break;var he=z.transferSize,pe=z.initiatorType;he&&ME(pe)&&(z=z.responseEnd,N+=he*(z<k?1:(k-ne)/(z-ne)))}if(--f,i+=8*(S+N)/(y.duration/1e3),a++,10<a)break}}if(0<a)return i/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var ky=null,Iy=null;function Wh(a){return a.nodeType===9?a:a.ownerDocument}function kE(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function IE(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function Ly(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Py=null;function E6(){var a=window.event;return a&&a.type==="popstate"?a===Py?!1:(Py=a,!0):(Py=null,!1)}var LE=typeof setTimeout=="function"?setTimeout:void 0,R6=typeof clearTimeout=="function"?clearTimeout:void 0,PE=typeof Promise=="function"?Promise:void 0,T6=typeof queueMicrotask=="function"?queueMicrotask:typeof PE<"u"?function(a){return PE.resolve(null).then(a).catch(j6)}:LE;function j6(a){setTimeout(function(){throw a})}function ni(a){return a==="head"}function UE(a,i){var u=i,f=0;do{var y=u.nextSibling;if(a.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(f===0){a.removeChild(y),Ac(i);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")vd(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,vd(u);for(var S=u.firstChild;S;){var N=S.nextSibling,k=S.nodeName;S[Ft]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=N}}else u==="body"&&vd(a.ownerDocument.body);u=y}while(u);Ac(i)}function FE(a,i){var u=a;a=0;do{var f=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=f}while(u)}function Uy(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Uy(u),Wa(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function _6(a,i,u,f){for(;a.nodeType===1;){var y=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(f){if(!a[Ft])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=Ua(a.nextSibling),a===null)break}return null}function N6(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Ua(a.nextSibling),a===null))return null;return a}function zE(a,i){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!i||(a=Ua(a.nextSibling),a===null))return null;return a}function Fy(a){return a.data==="$?"||a.data==="$~"}function zy(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function A6(a,i){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=i;else if(a.data!=="$?"||u.readyState!=="loading")i();else{var f=function(){i(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),a._reactRetry=f}}function Ua(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return a}var Vy=null;function VE(a){a=a.nextSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(i===0)return Ua(a.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}a=a.nextSibling}return null}function HE(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return a;i--}else u!=="/$"&&u!=="/&"||i++}a=a.previousSibling}return null}function $E(a,i,u){switch(i=Wh(u),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function vd(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);Wa(a)}var Fa=new Map,BE=new Set;function Qh(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var fo=Y.d;Y.d={f:D6,r:O6,D:M6,C:k6,L:I6,m:L6,X:U6,S:P6,M:F6};function D6(){var a=fo.f(),i=Hh();return a||i}function O6(a){var i=Lr(a);i!==null&&i.tag===5&&i.type==="form"?iw(i):fo.r(a)}var jc=typeof document>"u"?null:document;function GE(a,i,u){var f=jc;if(f&&typeof i=="string"&&i){var y=Da(i);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),BE.has(y)||(BE.add(y),a={rel:a,crossOrigin:u,href:i},f.querySelector(y)===null&&(i=f.createElement("link"),xr(i,"link",a),mn(i),f.head.appendChild(i)))}}function M6(a){fo.D(a),GE("dns-prefetch",a,null)}function k6(a,i){fo.C(a,i),GE("preconnect",a,i)}function I6(a,i,u){fo.L(a,i,u);var f=jc;if(f&&a&&i){var y='link[rel="preload"][as="'+Da(i)+'"]';i==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Da(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Da(u.imageSizes)+'"]')):y+='[href="'+Da(a)+'"]';var S=y;switch(i){case"style":S=_c(a);break;case"script":S=Nc(a)}Fa.has(S)||(a=v({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),Fa.set(S,a),f.querySelector(y)!==null||i==="style"&&f.querySelector(yd(S))||i==="script"&&f.querySelector(xd(S))||(i=f.createElement("link"),xr(i,"link",a),mn(i),f.head.appendChild(i)))}}function L6(a,i){fo.m(a,i);var u=jc;if(u&&a){var f=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Da(f)+'"][href="'+Da(a)+'"]',S=y;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Nc(a)}if(!Fa.has(S)&&(a=v({rel:"modulepreload",href:a},i),Fa.set(S,a),u.querySelector(y)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(xd(S)))return}f=u.createElement("link"),xr(f,"link",a),mn(f),u.head.appendChild(f)}}}function P6(a,i,u){fo.S(a,i,u);var f=jc;if(f&&a){var y=Ss(f).hoistableStyles,S=_c(a);i=i||"default";var N=y.get(S);if(!N){var k={loading:0,preload:null};if(N=f.querySelector(yd(S)))k.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":i},u),(u=Fa.get(S))&&Hy(a,u);var z=N=f.createElement("link");mn(z),xr(z,"link",a),z._p=new Promise(function(ne,he){z.onload=ne,z.onerror=he}),z.addEventListener("load",function(){k.loading|=1}),z.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Xh(N,i,f)}N={type:"stylesheet",instance:N,count:1,state:k},y.set(S,N)}}}function U6(a,i){fo.X(a,i);var u=jc;if(u&&a){var f=Ss(u).hoistableScripts,y=Nc(a),S=f.get(y);S||(S=u.querySelector(xd(y)),S||(a=v({src:a,async:!0},i),(i=Fa.get(y))&&$y(a,i),S=u.createElement("script"),mn(S),xr(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(y,S))}}function F6(a,i){fo.M(a,i);var u=jc;if(u&&a){var f=Ss(u).hoistableScripts,y=Nc(a),S=f.get(y);S||(S=u.querySelector(xd(y)),S||(a=v({src:a,async:!0,type:"module"},i),(i=Fa.get(y))&&$y(a,i),S=u.createElement("script"),mn(S),xr(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},f.set(y,S))}}function qE(a,i,u,f){var y=(y=ge.current)?Qh(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=_c(u.href),u=Ss(y).hoistableStyles,f=u.get(i),f||(f={type:"style",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=_c(u.href);var S=Ss(y).hoistableStyles,N=S.get(a);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,N),(S=y.querySelector(yd(a)))&&!S._p&&(N.instance=S,N.state.loading=5),Fa.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Fa.set(a,u),S||z6(y,a,u,N.state))),i&&f===null)throw Error(r(528,""));return N}if(i&&f!==null)throw Error(r(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Nc(u),u=Ss(y).hoistableScripts,f=u.get(i),f||(f={type:"script",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function _c(a){return'href="'+Da(a)+'"'}function yd(a){return'link[rel="stylesheet"]['+a+"]"}function ZE(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function z6(a,i,u,f){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=a.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),xr(i,"link",u),mn(i),a.head.appendChild(i))}function Nc(a){return'[src="'+Da(a)+'"]'}function xd(a){return"script[async]"+a}function KE(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var f=a.querySelector('style[data-href~="'+Da(u.href)+'"]');if(f)return i.instance=f,mn(f),f;var y=v({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(a.ownerDocument||a).createElement("style"),mn(f),xr(f,"style",y),Xh(f,u.precedence,a),i.instance=f;case"stylesheet":y=_c(u.href);var S=a.querySelector(yd(y));if(S)return i.state.loading|=4,i.instance=S,mn(S),S;f=ZE(u),(y=Fa.get(y))&&Hy(f,y),S=(a.ownerDocument||a).createElement("link"),mn(S);var N=S;return N._p=new Promise(function(k,z){N.onload=k,N.onerror=z}),xr(S,"link",f),i.state.loading|=4,Xh(S,u.precedence,a),i.instance=S;case"script":return S=Nc(u.src),(y=a.querySelector(xd(S)))?(i.instance=y,mn(y),y):(f=u,(y=Fa.get(S))&&(f=v({},u),$y(f,y)),a=a.ownerDocument||a,y=a.createElement("script"),mn(y),xr(y,"link",f),a.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,Xh(f,u.precedence,a));return i.instance}function Xh(a,i,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=f.length?f[f.length-1]:null,S=y,N=0;N<f.length;N++){var k=f[N];if(k.dataset.precedence===i)S=k;else if(S!==y)break}S?S.parentNode.insertBefore(a,S.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function Hy(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function $y(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var Jh=null;function YE(a,i,u){if(Jh===null){var f=new Map,y=Jh=new Map;y.set(u,f)}else y=Jh,f=y.get(u),f||(f=new Map,y.set(u,f));if(f.has(a))return f;for(f.set(a,null),u=u.getElementsByTagName(a),y=0;y<u.length;y++){var S=u[y];if(!(S[Ft]||S[Ue]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var N=S.getAttribute(i)||"";N=a+N;var k=f.get(N);k?k.push(S):f.set(N,[S])}}return f}function WE(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function V6(a,i,u){if(u===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function QE(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function H6(a,i,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=_c(f.href),S=i.querySelector(yd(y));if(S){i=S._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(a.count++,a=em.bind(a),i.then(a,a)),u.state.loading|=4,u.instance=S,mn(S);return}S=i.ownerDocument||i,f=ZE(f),(y=Fa.get(y))&&Hy(f,y),S=S.createElement("link"),mn(S);var N=S;N._p=new Promise(function(k,z){N.onload=k,N.onerror=z}),xr(S,"link",f),u.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=em.bind(a),i.addEventListener("load",u),i.addEventListener("error",u))}}var By=0;function $6(a,i){return a.stylesheets&&a.count===0&&nm(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var f=setTimeout(function(){if(a.stylesheets&&nm(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+i);0<a.imgBytes&&By===0&&(By=62500*w6());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&nm(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>By?50:800)+i);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(f),clearTimeout(y)}}:null}function em(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)nm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var tm=null;function nm(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,tm=new Map,i.forEach(B6,a),tm=null,em.call(a))}function B6(a,i){if(!(i.state.loading&4)){var u=tm.get(a);if(u)var f=u.get(null);else{u=new Map,tm.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var N=y[S];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),f=N)}f&&u.set(null,f)}y=i.instance,N=y.getAttribute("data-precedence"),S=u.get(N)||f,S===f&&u.set(null,y),u.set(N,y),this.count++,f=em.bind(this),y.addEventListener("load",f),y.addEventListener("error",f),S?S.parentNode.insertBefore(y,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),i.state.loading|=4}}var bd={$$typeof:j,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function G6(a,i,u,f,y,S,N,k,z){this.tag=1,this.containerInfo=a,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=Tr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tr(0),this.hiddenUpdates=Tr(null),this.identifierPrefix=f,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function XE(a,i,u,f,y,S,N,k,z,ne,he,pe){return a=new G6(a,i,u,N,z,ne,he,pe,k),i=1,S===!0&&(i|=24),S=ra(3,null,null,i),a.current=S,S.stateNode=a,i=wv(),i.refCount++,a.pooledCache=i,i.refCount++,S.memoizedState={element:f,isDehydrated:u,cache:i},jv(S),a}function JE(a){return a?(a=oc,a):oc}function e2(a,i,u,f,y,S){y=JE(y),f.context===null?f.context=y:f.pendingContext=y,f=Go(i),f.payload={element:u},S=S===void 0?null:S,S!==null&&(f.callback=S),u=qo(a,f,i),u!==null&&(Yr(u,a,i),Xu(u,a,i))}function t2(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function Gy(a,i){t2(a,i),(a=a.alternate)&&t2(a,i)}function n2(a){if(a.tag===13||a.tag===31){var i=Ji(a,67108864);i!==null&&Yr(i,a,67108864),Gy(a,67108864)}}function r2(a){if(a.tag===13||a.tag===31){var i=la();i=ze(i);var u=Ji(a,i);u!==null&&Yr(u,a,i),Gy(a,i)}}var rm=!0;function q6(a,i,u,f){var y=I.T;I.T=null;var S=Y.p;try{Y.p=2,qy(a,i,u,f)}finally{Y.p=S,I.T=y}}function Z6(a,i,u,f){var y=I.T;I.T=null;var S=Y.p;try{Y.p=8,qy(a,i,u,f)}finally{Y.p=S,I.T=y}}function qy(a,i,u,f){if(rm){var y=Zy(f);if(y===null)Oy(a,i,f,am,u),s2(a,f);else if(Y6(y,a,i,u,f))f.stopPropagation();else if(s2(a,f),i&4&&-1<K6.indexOf(a)){for(;y!==null;){var S=Lr(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var N=vn(S.pendingLanes);if(N!==0){var k=S;for(k.pendingLanes|=2,k.entangledLanes|=2;N;){var z=1<<31-On(N);k.entanglements[1]|=z,N&=~z}js(S),(zt&6)===0&&(zh=ye()+500,md(0))}}break;case 31:case 13:k=Ji(S,2),k!==null&&Yr(k,S,2),Hh(),Gy(S,2)}if(S=Zy(f),S===null&&Oy(a,i,f,am,u),S===y)break;y=S}y!==null&&f.stopPropagation()}else Oy(a,i,f,null,u)}}function Zy(a){return a=Yg(a),Ky(a)}var am=null;function Ky(a){if(am=null,a=_a(a),a!==null){var i=l(a);if(i===null)a=null;else{var u=i.tag;if(u===13){if(a=c(i),a!==null)return a;a=null}else if(u===31){if(a=d(i),a!==null)return a;a=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return am=a,null}function a2(a){switch(a){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(we()){case Le:return 2;case st:return 8;case ht:case bn:return 32;case Hr:return 268435456;default:return 32}default:return 32}}var Yy=!1,ri=null,ai=null,si=null,Sd=new Map,Cd=new Map,oi=[],K6="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 s2(a,i){switch(a){case"focusin":case"focusout":ri=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":si=null;break;case"pointerover":case"pointerout":Sd.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cd.delete(i.pointerId)}}function wd(a,i,u,f,y,S){return a===null||a.nativeEvent!==S?(a={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:S,targetContainers:[y]},i!==null&&(i=Lr(i),i!==null&&n2(i)),a):(a.eventSystemFlags|=f,i=a.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),a)}function Y6(a,i,u,f,y){switch(i){case"focusin":return ri=wd(ri,a,i,u,f,y),!0;case"dragenter":return ai=wd(ai,a,i,u,f,y),!0;case"mouseover":return si=wd(si,a,i,u,f,y),!0;case"pointerover":var S=y.pointerId;return Sd.set(S,wd(Sd.get(S)||null,a,i,u,f,y)),!0;case"gotpointercapture":return S=y.pointerId,Cd.set(S,wd(Cd.get(S)||null,a,i,u,f,y)),!0}return!1}function o2(a){var i=_a(a.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){a.blockedOn=i,Ze(a.priority,function(){r2(u)});return}}else if(i===31){if(i=d(u),i!==null){a.blockedOn=i,Ze(a.priority,function(){r2(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function sm(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=Zy(a.nativeEvent);if(u===null){u=a.nativeEvent;var f=new u.constructor(u.type,u);Kg=f,u.target.dispatchEvent(f),Kg=null}else return i=Lr(u),i!==null&&n2(i),a.blockedOn=u,!1;i.shift()}return!0}function i2(a,i,u){sm(a)&&u.delete(i)}function W6(){Yy=!1,ri!==null&&sm(ri)&&(ri=null),ai!==null&&sm(ai)&&(ai=null),si!==null&&sm(si)&&(si=null),Sd.forEach(i2),Cd.forEach(i2)}function om(a,i){a.blockedOn===i&&(a.blockedOn=null,Yy||(Yy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,W6)))}var im=null;function l2(a){im!==a&&(im=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){im===a&&(im=null);for(var i=0;i<a.length;i+=3){var u=a[i],f=a[i+1],y=a[i+2];if(typeof f!="function"){if(Ky(f||u)===null)continue;break}var S=Lr(u);S!==null&&(a.splice(i,3),i-=3,Zv(S,{pending:!0,data:y,method:u.method,action:f},f,y))}}))}function Ac(a){function i(z){return om(z,a)}ri!==null&&om(ri,a),ai!==null&&om(ai,a),si!==null&&om(si,a),Sd.forEach(i),Cd.forEach(i);for(var u=0;u<oi.length;u++){var f=oi[u];f.blockedOn===a&&(f.blockedOn=null)}for(;0<oi.length&&(u=oi[0],u.blockedOn===null);)o2(u),u.blockedOn===null&&oi.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var y=u[f],S=u[f+1],N=y[Me]||null;if(typeof S=="function")N||l2(u);else if(N){var k=null;if(S&&S.hasAttribute("formAction")){if(y=S,N=S[Me]||null)k=N.formAction;else if(Ky(y)!==null)continue}else k=N.action;typeof k=="function"?u[f+1]=k:(u.splice(f,3),f-=3),l2(u)}}}function c2(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function Wy(a){this._internalRoot=a}lm.prototype.render=Wy.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,f=la();e2(u,f,a,i,null,null)},lm.prototype.unmount=Wy.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;e2(a.current,2,null,a,null,null),Hh(),i[ot]=null}};function lm(a){this._internalRoot=a}lm.prototype.unstable_scheduleHydration=function(a){if(a){var i=ke();a={blockedOn:null,target:a,priority:i};for(var u=0;u<oi.length&&i!==0&&i<oi[u].priority;u++);oi.splice(u,0,a),u===0&&o2(a)}};var u2=t.version;if(u2!=="19.2.0")throw Error(r(527,u2,"19.2.0"));Y.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=m(i),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var Q6={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cm.isDisabled&&cm.supportsFiber)try{$r=cm.inject(Q6),Sn=cm}catch{}}return Rd.createRoot=function(a,i){if(!s(a))throw Error(r(299));var u=!1,f="",y=vw,S=yw,N=xw;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=XE(a,1,!1,null,null,u,f,null,y,S,N,c2),a[ot]=i.current,Dy(a),new Wy(i)},Rd.hydrateRoot=function(a,i,u){if(!s(a))throw Error(r(299));var f=!1,y="",S=vw,N=yw,k=xw,z=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(k=u.onRecoverableError),u.formState!==void 0&&(z=u.formState)),i=XE(a,1,!0,i,u??null,f,y,z,S,N,k,c2),i.context=JE(null),u=i.current,f=la(),f=ze(f),y=Go(f),y.callback=null,qo(u,y,f),u=f,i.current.lanes=u,F(i,u),js(i),a[ot]=i.current,Dy(a),new lm(i)},Rd.version="19.2.0",Rd}var b2;function ck(){if(b2)return Jy.exports;b2=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(),Jy.exports=lk(),Jy.exports}var uk=ck();/**
|
|
50
|
-
* react-router v7.9.4
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var mj=e=>{throw TypeError(e)},dk=(e,t,n)=>t.has(e)||mj("Cannot "+n),rx=(e,t,n)=>(dk(e,t,"read from private field"),n?n.call(e):t.get(e)),fk=(e,t,n)=>t.has(e)?mj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),S2="popstate";function hk(e={}){function t(r,s){let{pathname:l,search:c,hash:d}=r.location;return Qd("",{pathname:l,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Ei(s)}return pk(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _n(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mk(){return Math.random().toString(36).substring(2,10)}function C2(e,t){return{usr:e.state,key:e.key,idx:t}}function Qd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Oi(t):t,state:n,key:t&&t.key||r||mk()}}function Ei({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Oi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function pk(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,c=s.history,d="POP",h=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function v(){d="POP";let E=g(),R=E==null?null:E-m;m=E,h&&h({action:d,location:C.location,delta:R})}function x(E,R){d="PUSH";let T=Qd(C.location,E,R);m=g()+1;let j=C2(T,m),O=C.createHref(T);try{c.pushState(j,"",O)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(O)}l&&h&&h({action:d,location:C.location,delta:1})}function b(E,R){d="REPLACE";let T=Qd(C.location,E,R);m=g();let j=C2(T,m),O=C.createHref(T);c.replaceState(j,"",O),l&&h&&h({action:d,location:C.location,delta:0})}function w(E){return pj(E)}let C={get action(){return d},get location(){return e(s,c)},listen(E){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(S2,v),h=E,()=>{s.removeEventListener(S2,v),h=null}},createHref(E){return t(s,E)},createURL:w,encodeLocation(E){let R=w(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:b,go(E){return c.go(E)}};return C}function pj(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ei(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ud,w2=class{constructor(e){if(fk(this,Ud,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(rx(this,Ud).has(e))return rx(this,Ud).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){rx(this,Ud).set(e,t)}};Ud=new WeakMap;var gk=new Set(["lazy","caseSensitive","path","id","index","children"]);function vk(e){return gk.has(e)}var yk=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function xk(e){return yk.has(e)}function bk(e){return e.index===!0}function Xd(e,t,n=[],r={},s=!1){return e.map((l,c)=>{let d=[...n,String(c)],h=typeof l.id=="string"?l.id:d.join("-");if(xt(l.index!==!0||!l.children,"Cannot specify children on an index route"),xt(s||!r[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),bk(l)){let m={...l,...t(l),id:h};return r[h]=m,m}else{let m={...l,...t(l),id:h,children:void 0};return r[h]=m,l.children&&(m.children=Xd(l.children,t,d,r,s)),m}})}function hi(e,t,n="/"){return Im(e,t,n,!1)}function Im(e,t,n,r){let s=typeof t=="string"?Oi(t):t,l=$a(s.pathname||"/",n);if(l==null)return null;let c=gj(e);Ck(c);let d=null;for(let h=0;d==null&&h<c.length;++h){let m=Mk(l);d=Dk(c[h],m,r)}return d}function Sk(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function gj(e,t=[],n=[],r="",s=!1){let l=(c,d,h=s,m)=>{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&h)return;xt(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let v=Is([r,g.relativePath]),x=n.concat(g);c.children&&c.children.length>0&&(xt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),gj(c.children,t,x,v,h)),!(c.path==null&&!c.index)&&t.push({path:v,score:Nk(v,c.index),routesMeta:x})};return e.forEach((c,d)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))l(c,d);else for(let m of vj(c.path))l(c,d,!0,m)}),t}function vj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let c=vj(r.join("/")),d=[];return d.push(...c.map(h=>h===""?l:[l,h].join("/"))),s&&d.push(...c),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function Ck(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Ak(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var wk=/^:[\w-]+$/,Ek=3,Rk=2,Tk=1,jk=10,_k=-2,E2=e=>e==="*";function Nk(e,t){let n=e.split("/"),r=n.length;return n.some(E2)&&(r+=_k),t&&(r+=Rk),n.filter(s=>!E2(s)).reduce((s,l)=>s+(wk.test(l)?Ek:l===""?Tk:jk),r)}function Ak(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function Dk(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",c=[];for(let d=0;d<r.length;++d){let h=r[d],m=d===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",v=Ym({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},g),x=h.route;if(!v&&m&&n&&!r[r.length-1].route.index&&(v=Ym({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!v)return null;Object.assign(s,v.params),c.push({params:s,pathname:Is([l,v.pathname]),pathnameBase:Pk(Is([l,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(l=Is([l,v.pathnameBase]))}return c}function Ym(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ok(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:r.reduce((m,{paramName:g,isOptional:v},x)=>{if(g==="*"){let w=d[x]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[x];return v&&!b?m[g]=void 0:m[g]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function Ok(e,t=!1,n=!0){_n(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,h)=>(r.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function Mk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _n(!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 $a(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function kk({basename:e,pathname:t}){return t==="/"?e:Is([e,t])}function Ik(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Oi(e):e;return{pathname:n?n.startsWith("/")?n:Lk(n,t):t,search:Uk(r),hash:Fk(s)}}function Lk(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function ax(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Pp(e){let t=yj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Up(e,t,n,r=!1){let s;typeof e=="string"?s=Oi(e):(s={...e},xt(!s.pathname||!s.pathname.includes("?"),ax("?","pathname","search",s)),xt(!s.pathname||!s.pathname.includes("#"),ax("#","pathname","hash",s)),xt(!s.search||!s.search.includes("#"),ax("#","search","hash",s)));let l=e===""||s.pathname==="",c=l?"/":s.pathname,d;if(c==null)d=n;else{let v=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}d=v>=0?t[v]:"/"}let h=Ik(s,d),m=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||g)&&(h.pathname+="/"),h}var Is=e=>e.join("/").replace(/\/\/+/g,"/"),Pk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Uk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Fk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Wm=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Jd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var xj=["POST","PUT","PATCH","DELETE"],zk=new Set(xj),Vk=["GET",...xj],Hk=new Set(Vk),$k=new Set([301,302,303,307,308]),Bk=new Set([307,308]),sx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Gk={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Td={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},qk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,db=e=>qk.test(e),Zk=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),bj="remix-router-transitions",Sj=Symbol("ResetLoaderData");function Kk(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";xt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||Zk,l={},c=Xd(e.routes,s,void 0,l),d,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let m=e.dataStrategy||Jk,g={...e.future},v=null,x=new Set,b=null,w=null,C=null,E=e.hydrationData!=null,R=hi(c,e.history.location,h),T=!1,j=null,O;if(R==null&&!e.patchRoutesOnNavigation){let F=za(404,{pathname:e.history.location.pathname}),{matches:Q,route:oe}=um(c);O=!0,R=Q,j={[oe.id]:F}}else if(R&&!e.hydrationData&&Qn(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(F=>F.route.lazy))O=!1;else if(!R.some(F=>fb(F.route)))O=!0;else{let F=e.hydrationData?e.hydrationData.loaderData:null,Q=e.hydrationData?e.hydrationData.errors:null;if(Q){let oe=R.findIndex(ve=>Q[ve.route.id]!==void 0);O=R.slice(0,oe+1).every(ve=>!a0(ve.route,F,Q))}else O=R.every(oe=>!a0(oe.route,F,Q))}else{O=!1,R=[];let F=Qn(null,c,e.history.location.pathname);F.active&&F.matches&&(T=!0,R=F.matches)}let D,_={historyAction:e.history.action,location:e.history.location,matches:R,initialized:O,navigation:sx,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||j,fetchers:new Map,blockers:new Map},A="POP",M=!1,U,B=!1,G=new Map,K=null,re=!1,H=!1,$=new Set,I=new Map,Y=0,Z=-1,ie=new Map,be=new Set,L=new Map,P=new Map,W=new Set,ae=new Map,fe,ge=null;function ue(){if(v=e.history.listen(({action:F,location:Q,delta:oe})=>{if(fe){fe(),fe=void 0;return}_n(ae.size===0||oe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ve=Ql({currentLocation:_.location,nextLocation:Q,historyAction:F});if(ve&&oe!=null){let Ee=new Promise(ze=>{fe=ze});e.history.go(oe*-1),ja(ve,{state:"blocked",location:Q,proceed(){ja(ve,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),Ee.then(()=>e.history.go(oe))},reset(){let ze=new Map(_.blockers);ze.set(ve,Td),xe({blockers:ze})}});return}return ft(F,Q)}),n){m8(t,G);let F=()=>p8(t,G);t.addEventListener("pagehide",F),K=()=>t.removeEventListener("pagehide",F)}return _.initialized||ft("POP",_.location,{initialHydration:!0}),D}function Ne(){v&&v(),K&&K(),x.clear(),U&&U.abort(),_.fetchers.forEach((F,Q)=>Hr(Q)),_.blockers.forEach((F,Q)=>Po(Q))}function Re(F){return x.add(F),()=>x.delete(F)}function xe(F,Q={}){F.matches&&(F.matches=F.matches.map(Ee=>{let ze=l[Ee.route.id],He=Ee.route;return He.element!==ze.element||He.errorElement!==ze.errorElement||He.hydrateFallbackElement!==ze.hydrateFallbackElement?{...Ee,route:ze}:Ee})),_={..._,...F};let oe=[],ve=[];_.fetchers.forEach((Ee,ze)=>{Ee.state==="idle"&&(W.has(ze)?oe.push(ze):ve.push(ze))}),W.forEach(Ee=>{!_.fetchers.has(Ee)&&!I.has(Ee)&&oe.push(Ee)}),[...x].forEach(Ee=>Ee(_,{deletedFetchers:oe,viewTransitionOpts:Q.viewTransitionOpts,flushSync:Q.flushSync===!0})),oe.forEach(Ee=>Hr(Ee)),ve.forEach(Ee=>_.fetchers.delete(Ee))}function et(F,Q,{flushSync:oe}={}){var Ue,Me;let ve=_.actionData!=null&&_.navigation.formMethod!=null&&Xr(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Ue=F.state)==null?void 0:Ue._isRedirect)!==!0,Ee;Q.actionData?Object.keys(Q.actionData).length>0?Ee=Q.actionData:Ee=null:ve?Ee=_.actionData:Ee=null;let ze=Q.loaderData?k2(_.loaderData,Q.loaderData,Q.matches||[],Q.errors):_.loaderData,He=_.blockers;He.size>0&&(He=new Map(He),He.forEach((ot,Ht)=>He.set(Ht,Td)));let ke=re?!1:Mn(F,Q.matches||_.matches),Ze=M===!0||_.navigation.formMethod!=null&&Xr(_.navigation.formMethod)&&((Me=F.state)==null?void 0:Me._isRedirect)!==!0;d&&(c=d,d=void 0),re||A==="POP"||(A==="PUSH"?e.history.push(F,F.state):A==="REPLACE"&&e.history.replace(F,F.state));let Ye;if(A==="POP"){let ot=G.get(_.location.pathname);ot&&ot.has(F.pathname)?Ye={currentLocation:_.location,nextLocation:F}:G.has(F.pathname)&&(Ye={currentLocation:F,nextLocation:_.location})}else if(B){let ot=G.get(_.location.pathname);ot?ot.add(F.pathname):(ot=new Set([F.pathname]),G.set(_.location.pathname,ot)),Ye={currentLocation:_.location,nextLocation:F}}xe({...Q,actionData:Ee,loaderData:ze,historyAction:A,location:F,initialized:!0,navigation:sx,revalidation:"idle",restoreScrollPosition:ke,preventScrollReset:Ze,blockers:He},{viewTransitionOpts:Ye,flushSync:oe===!0}),A="POP",M=!1,B=!1,re=!1,H=!1,ge==null||ge.resolve(),ge=null}async function Xe(F,Q){if(typeof F=="number"){e.history.go(F);return}let oe=r0(_.location,_.matches,h,F,Q==null?void 0:Q.fromRouteId,Q==null?void 0:Q.relative),{path:ve,submission:Ee,error:ze}=R2(!1,oe,Q),He=_.location,ke=Qd(_.location,ve,Q&&Q.state);ke={...ke,...e.history.encodeLocation(ke)};let Ze=Q&&Q.replace!=null?Q.replace:void 0,Ye="PUSH";Ze===!0?Ye="REPLACE":Ze===!1||Ee!=null&&Xr(Ee.formMethod)&&Ee.formAction===_.location.pathname+_.location.search&&(Ye="REPLACE");let Ue=Q&&"preventScrollReset"in Q?Q.preventScrollReset===!0:void 0,Me=(Q&&Q.flushSync)===!0,ot=Ql({currentLocation:He,nextLocation:ke,historyAction:Ye});if(ot){ja(ot,{state:"blocked",location:ke,proceed(){ja(ot,{state:"proceeding",proceed:void 0,reset:void 0,location:ke}),Xe(F,Q)},reset(){let Ht=new Map(_.blockers);Ht.set(ot,Td),xe({blockers:Ht})}});return}await ft(Ye,ke,{submission:Ee,pendingError:ze,preventScrollReset:Ue,replace:Q&&Q.replace,enableViewTransition:Q&&Q.viewTransition,flushSync:Me})}function Bt(){ge||(ge=g8()),we(),xe({revalidation:"loading"});let F=ge.promise;return _.navigation.state==="submitting"?F:_.navigation.state==="idle"?(ft(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),F):(ft(A||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:B===!0}),F)}async function ft(F,Q,oe){U&&U.abort(),U=null,A=F,re=(oe&&oe.startUninterruptedRevalidation)===!0,vn(_.location,_.matches),M=(oe&&oe.preventScrollReset)===!0,B=(oe&&oe.enableViewTransition)===!0;let ve=d||c,Ee=oe&&oe.overrideNavigation,ze=oe!=null&&oe.initialHydration&&_.matches&&_.matches.length>0&&!T?_.matches:hi(ve,Q,h),He=(oe&&oe.flushSync)===!0;if(ze&&_.initialized&&!H&&i8(_.location,Q)&&!(oe&&oe.submission&&Xr(oe.submission.formMethod))){et(Q,{matches:ze},{flushSync:He});return}let ke=Qn(ze,ve,Q.pathname);if(ke.active&&ke.matches&&(ze=ke.matches),!ze){let{error:pr,notFoundMatches:cn,route:Ft}=bs(Q.pathname);et(Q,{matches:cn,loaderData:{},errors:{[Ft.id]:pr}},{flushSync:He});return}U=new AbortController;let Ze=Fc(e.history,Q,U.signal,oe&&oe.submission),Ye=e.getContext?await e.getContext():new w2,Ue;if(oe&&oe.pendingError)Ue=[mi(ze).route.id,{type:"error",error:oe.pendingError}];else if(oe&&oe.submission&&Xr(oe.submission.formMethod)){let pr=await gn(Ze,Q,oe.submission,ze,Ye,ke.active,oe&&oe.initialHydration===!0,{replace:oe.replace,flushSync:He});if(pr.shortCircuited)return;if(pr.pendingActionResult){let[cn,Ft]=pr.pendingActionResult;if(ca(Ft)&&Jd(Ft.error)&&Ft.error.status===404){U=null,et(Q,{matches:pr.matches,loaderData:{},errors:{[cn]:Ft.error}});return}}ze=pr.matches||ze,Ue=pr.pendingActionResult,Ee=ox(Q,oe.submission),He=!1,ke.active=!1,Ze=Fc(e.history,Ze.url,Ze.signal)}let{shortCircuited:Me,matches:ot,loaderData:Ht,errors:Fn}=await Ie(Ze,Q,ze,Ye,ke.active,Ee,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,He,Ue);Me||(U=null,et(Q,{matches:ot||ze,...I2(Ue),loaderData:Ht,errors:Fn}))}async function gn(F,Q,oe,ve,Ee,ze,He,ke={}){we();let Ze=f8(Q,oe);if(xe({navigation:Ze},{flushSync:ke.flushSync===!0}),ze){let Me=await Xn(ve,Q.pathname,F.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){if(Me.partialMatches.length===0){let{matches:Ht,route:Fn}=um(c);return{matches:Ht,pendingActionResult:[Fn.id,{type:"error",error:Me.error}]}}let ot=mi(Me.partialMatches).route.id;return{matches:Me.partialMatches,pendingActionResult:[ot,{type:"error",error:Me.error}]}}else if(Me.matches)ve=Me.matches;else{let{notFoundMatches:ot,error:Ht,route:Fn}=bs(Q.pathname);return{matches:ot,pendingActionResult:[Fn.id,{type:"error",error:Ht}]}}}let Ye,Ue=Lm(ve,Q);if(!Ue.route.action&&!Ue.route.lazy)Ye={type:"error",error:za(405,{method:F.method,pathname:Q.pathname,routeId:Ue.route.id})};else{let Me=Yc(s,l,F,ve,Ue,He?[]:r,Ee),ot=await _e(F,Me,Ee,null);if(Ye=ot[Ue.route.id],!Ye){for(let Ht of ve)if(ot[Ht.route.id]){Ye=ot[Ht.route.id];break}}if(F.signal.aborted)return{shortCircuited:!0}}if(vl(Ye)){let Me;return ke&&ke.replace!=null?Me=ke.replace:Me=D2(Ye.response.headers.get("Location"),new URL(F.url),h)===_.location.pathname+_.location.search,await de(F,Ye,!0,{submission:oe,replace:Me}),{shortCircuited:!0}}if(ca(Ye)){let Me=mi(ve,Ue.route.id);return(ke&&ke.replace)!==!0&&(A="PUSH"),{matches:ve,pendingActionResult:[Me.route.id,Ye,Ue.route.id]}}return{matches:ve,pendingActionResult:[Ue.route.id,Ye]}}async function Ie(F,Q,oe,ve,Ee,ze,He,ke,Ze,Ye,Ue,Me){let ot=ze||ox(Q,He),Ht=He||ke||P2(ot),Fn=!re&&!Ye;if(Ee){if(Fn){let ir=wt(Me);xe({navigation:ot,...ir!==void 0?{actionData:ir}:{}},{flushSync:Ue})}let gt=await Xn(oe,Q.pathname,F.signal);if(gt.type==="aborted")return{shortCircuited:!0};if(gt.type==="error"){if(gt.partialMatches.length===0){let{matches:Zs,route:ws}=um(c);return{matches:Zs,loaderData:{},errors:{[ws.id]:gt.error}}}let ir=mi(gt.partialMatches).route.id;return{matches:gt.partialMatches,loaderData:{},errors:{[ir]:gt.error}}}else if(gt.matches)oe=gt.matches;else{let{error:ir,notFoundMatches:Zs,route:ws}=bs(Q.pathname);return{matches:Zs,loaderData:{},errors:{[ws.id]:ir}}}}let pr=d||c,{dsMatches:cn,revalidatingFetchers:Ft}=T2(F,ve,s,l,e.history,_,oe,Ht,Q,Ye?[]:r,Ye===!0,H,$,W,L,be,pr,h,e.patchRoutesOnNavigation!=null,Me);if(Z=++Y,!e.dataStrategy&&!cn.some(gt=>gt.shouldLoad)&&!cn.some(gt=>gt.route.middleware&>.route.middleware.length>0)&&Ft.length===0){let gt=Sn();return et(Q,{matches:oe,loaderData:{},errors:Me&&ca(Me[1])?{[Me[0]]:Me[1].error}:null,...I2(Me),...gt?{fetchers:new Map(_.fetchers)}:{}},{flushSync:Ue}),{shortCircuited:!0}}if(Fn){let gt={};if(!Ee){gt.navigation=ot;let ir=wt(Me);ir!==void 0&&(gt.actionData=ir)}Ft.length>0&&(gt.fetchers=Ot(Ft)),xe(gt,{flushSync:Ue})}Ft.forEach(gt=>{Rr(gt.key),gt.controller&&I.set(gt.key,gt.controller)});let Wa=()=>Ft.forEach(gt=>Rr(gt.key));U&&U.signal.addEventListener("abort",Wa);let{loaderResults:_a,fetcherResults:Lr}=await ye(cn,Ft,F,ve);if(F.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",Wa),Ft.forEach(gt=>I.delete(gt.key));let jr=dm(_a);if(jr)return await de(F,jr.result,!0,{replace:Ze}),{shortCircuited:!0};if(jr=dm(Lr),jr)return be.add(jr.key),await de(F,jr.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:Ss,errors:mn}=M2(_,oe,_a,Me,Ft,Lr);Ye&&_.errors&&(mn={..._.errors,...mn});let Cs=Sn(),Ki=mr(Z),Na=Cs||Ki||Ft.length>0;return{matches:oe,loaderData:Ss,errors:mn,...Na?{fetchers:new Map(_.fetchers)}:{}}}function wt(F){if(F&&!ca(F[1]))return{[F[0]]:F[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function Ot(F){return F.forEach(Q=>{let oe=_.fetchers.get(Q.key),ve=jd(void 0,oe?oe.data:void 0);_.fetchers.set(Q.key,ve)}),new Map(_.fetchers)}async function tn(F,Q,oe,ve){Rr(F);let Ee=(ve&&ve.flushSync)===!0,ze=d||c,He=r0(_.location,_.matches,h,oe,Q,ve==null?void 0:ve.relative),ke=hi(ze,He,h),Ze=Qn(ke,ze,He);if(Ze.active&&Ze.matches&&(ke=Ze.matches),!ke){st(F,Q,za(404,{pathname:He}),{flushSync:Ee});return}let{path:Ye,submission:Ue,error:Me}=R2(!0,He,ve);if(Me){st(F,Q,Me,{flushSync:Ee});return}let ot=e.getContext?await e.getContext():new w2,Ht=(ve&&ve.preventScrollReset)===!0;if(Ue&&Xr(Ue.formMethod)){await V(F,Q,Ye,ke,ot,Ze.active,Ee,Ht,Ue);return}L.set(F,{routeId:Q,path:Ye}),await ee(F,Q,Ye,ke,ot,Ze.active,Ee,Ht,Ue)}async function V(F,Q,oe,ve,Ee,ze,He,ke,Ze){we(),L.delete(F);let Ye=_.fetchers.get(F);Le(F,h8(Ze,Ye),{flushSync:He});let Ue=new AbortController,Me=Fc(e.history,oe,Ue.signal,Ze);if(ze){let kn=await Xn(ve,new URL(Me.url).pathname,Me.signal,F);if(kn.type==="aborted")return;if(kn.type==="error"){st(F,Q,kn.error,{flushSync:He});return}else if(kn.matches)ve=kn.matches;else{st(F,Q,za(404,{pathname:oe}),{flushSync:He});return}}let ot=Lm(ve,oe);if(!ot.route.action&&!ot.route.lazy){let kn=za(405,{method:Ze.formMethod,pathname:oe,routeId:Q});st(F,Q,kn,{flushSync:He});return}I.set(F,Ue);let Ht=Y,Fn=Yc(s,l,Me,ve,ot,r,Ee),cn=(await _e(Me,Fn,Ee,F))[ot.route.id];if(Me.signal.aborted){I.get(F)===Ue&&I.delete(F);return}if(W.has(F)){if(vl(cn)||ca(cn)){Le(F,go(void 0));return}}else{if(vl(cn))if(I.delete(F),Z>Ht){Le(F,go(void 0));return}else return be.add(F),Le(F,jd(Ze)),de(Me,cn,!1,{fetcherSubmission:Ze,preventScrollReset:ke});if(ca(cn)){st(F,Q,cn.error);return}}let Ft=_.navigation.location||_.location,Wa=Fc(e.history,Ft,Ue.signal),_a=d||c,Lr=_.navigation.state!=="idle"?hi(_a,_.navigation.location,h):_.matches;xt(Lr,"Didn't find any matches after fetcher action");let jr=++Y;ie.set(F,jr);let Ss=jd(Ze,cn.data);_.fetchers.set(F,Ss);let{dsMatches:mn,revalidatingFetchers:Cs}=T2(Wa,Ee,s,l,e.history,_,Lr,Ze,Ft,r,!1,H,$,W,L,be,_a,h,e.patchRoutesOnNavigation!=null,[ot.route.id,cn]);Cs.filter(kn=>kn.key!==F).forEach(kn=>{let Ks=kn.key,Yi=_.fetchers.get(Ks),Qa=jd(void 0,Yi?Yi.data:void 0);_.fetchers.set(Ks,Qa),Rr(Ks),kn.controller&&I.set(Ks,kn.controller)}),xe({fetchers:new Map(_.fetchers)});let Ki=()=>Cs.forEach(kn=>Rr(kn.key));Ue.signal.addEventListener("abort",Ki);let{loaderResults:Na,fetcherResults:gt}=await ye(mn,Cs,Wa,Ee);if(Ue.signal.aborted)return;if(Ue.signal.removeEventListener("abort",Ki),ie.delete(F),I.delete(F),Cs.forEach(kn=>I.delete(kn.key)),_.fetchers.has(F)){let kn=go(cn.data);_.fetchers.set(F,kn)}let ir=dm(Na);if(ir)return de(Wa,ir.result,!1,{preventScrollReset:ke});if(ir=dm(gt),ir)return be.add(ir.key),de(Wa,ir.result,!1,{preventScrollReset:ke});let{loaderData:Zs,errors:ws}=M2(_,Lr,Na,void 0,Cs,gt);mr(jr),_.navigation.state==="loading"&&jr>Z?(xt(A,"Expected pending action"),U&&U.abort(),et(_.navigation.location,{matches:Lr,loaderData:Zs,errors:ws,fetchers:new Map(_.fetchers)})):(xe({errors:ws,loaderData:k2(_.loaderData,Zs,Lr,ws),fetchers:new Map(_.fetchers)}),H=!1)}async function ee(F,Q,oe,ve,Ee,ze,He,ke,Ze){let Ye=_.fetchers.get(F);Le(F,jd(Ze,Ye?Ye.data:void 0),{flushSync:He});let Ue=new AbortController,Me=Fc(e.history,oe,Ue.signal);if(ze){let Ft=await Xn(ve,new URL(Me.url).pathname,Me.signal,F);if(Ft.type==="aborted")return;if(Ft.type==="error"){st(F,Q,Ft.error,{flushSync:He});return}else if(Ft.matches)ve=Ft.matches;else{st(F,Q,za(404,{pathname:oe}),{flushSync:He});return}}let ot=Lm(ve,oe);I.set(F,Ue);let Ht=Y,Fn=Yc(s,l,Me,ve,ot,r,Ee),cn=(await _e(Me,Fn,Ee,F))[ot.route.id];if(I.get(F)===Ue&&I.delete(F),!Me.signal.aborted){if(W.has(F)){Le(F,go(void 0));return}if(vl(cn))if(Z>Ht){Le(F,go(void 0));return}else{be.add(F),await de(Me,cn,!1,{preventScrollReset:ke});return}if(ca(cn)){st(F,Q,cn.error);return}Le(F,go(cn.data))}}async function de(F,Q,oe,{submission:ve,fetcherSubmission:Ee,preventScrollReset:ze,replace:He}={}){Q.response.headers.has("X-Remix-Revalidate")&&(H=!0);let ke=Q.response.headers.get("Location");xt(ke,"Expected a Location header on the redirect Response"),ke=D2(ke,new URL(F.url),h);let Ze=Qd(_.location,ke,{_isRedirect:!0});if(n){let Fn=!1;if(Q.response.headers.has("X-Remix-Reload-Document"))Fn=!0;else if(db(ke)){const pr=pj(ke,!0);Fn=pr.origin!==t.location.origin||$a(pr.pathname,h)==null}if(Fn){He?t.location.replace(ke):t.location.assign(ke);return}}U=null;let Ye=He===!0||Q.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Me,formEncType:ot}=_.navigation;!ve&&!Ee&&Ue&&Me&&ot&&(ve=P2(_.navigation));let Ht=ve||Ee;if(Bk.has(Q.response.status)&&Ht&&Xr(Ht.formMethod))await ft(Ye,Ze,{submission:{...Ht,formAction:ke},preventScrollReset:ze||M,enableViewTransition:oe?B:void 0});else{let Fn=ox(Ze,ve);await ft(Ye,Ze,{overrideNavigation:Fn,fetcherSubmission:Ee,preventScrollReset:ze||M,enableViewTransition:oe?B:void 0})}}async function _e(F,Q,oe,ve){let Ee,ze={};try{Ee=await t8(m,F,Q,ve,oe,!1)}catch(He){return Q.filter(ke=>ke.shouldLoad).forEach(ke=>{ze[ke.route.id]={type:"error",error:He}}),ze}if(F.signal.aborted)return ze;for(let[He,ke]of Object.entries(Ee))if(u8(ke)){let Ze=ke.result;ze[He]={type:"redirect",response:s8(Ze,F,He,Q,h)}}else ze[He]=await a8(ke);return ze}async function ye(F,Q,oe,ve){let Ee=_e(oe,F,ve,null),ze=Promise.all(Q.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let Ue=(await _e(Ze.request,Ze.matches,ve,Ze.key))[Ze.match.route.id];return{[Ze.key]:Ue}}else return Promise.resolve({[Ze.key]:{type:"error",error:za(404,{pathname:Ze.path})}})})),He=await Ee,ke=(await ze).reduce((Ze,Ye)=>Object.assign(Ze,Ye),{});return{loaderResults:He,fetcherResults:ke}}function we(){H=!0,L.forEach((F,Q)=>{I.has(Q)&&$.add(Q),Rr(Q)})}function Le(F,Q,oe={}){_.fetchers.set(F,Q),xe({fetchers:new Map(_.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function st(F,Q,oe,ve={}){let Ee=mi(_.matches,Q);Hr(F),xe({errors:{[Ee.route.id]:oe},fetchers:new Map(_.fetchers)},{flushSync:(ve&&ve.flushSync)===!0})}function ht(F){return P.set(F,(P.get(F)||0)+1),W.has(F)&&W.delete(F),_.fetchers.get(F)||Gk}function bn(F,Q){Rr(F,Q==null?void 0:Q.reason),Le(F,go(null))}function Hr(F){let Q=_.fetchers.get(F);I.has(F)&&!(Q&&Q.state==="loading"&&ie.has(F))&&Rr(F),L.delete(F),ie.delete(F),be.delete(F),W.delete(F),$.delete(F),_.fetchers.delete(F)}function Dn(F){let Q=(P.get(F)||0)-1;Q<=0?(P.delete(F),W.add(F)):P.set(F,Q),xe({fetchers:new Map(_.fetchers)})}function Rr(F,Q){let oe=I.get(F);oe&&(oe.abort(Q),I.delete(F))}function $r(F){for(let Q of F){let oe=ht(Q),ve=go(oe.data);_.fetchers.set(Q,ve)}}function Sn(){let F=[],Q=!1;for(let oe of be){let ve=_.fetchers.get(oe);xt(ve,`Expected fetcher: ${oe}`),ve.state==="loading"&&(be.delete(oe),F.push(oe),Q=!0)}return $r(F),Q}function mr(F){let Q=[];for(let[oe,ve]of ie)if(ve<F){let Ee=_.fetchers.get(oe);xt(Ee,`Expected fetcher: ${oe}`),Ee.state==="loading"&&(Rr(oe),ie.delete(oe),Q.push(oe))}return $r(Q),Q.length>0}function On(F,Q){let oe=_.blockers.get(F)||Td;return ae.get(F)!==Q&&ae.set(F,Q),oe}function Po(F){_.blockers.delete(F),ae.delete(F)}function ja(F,Q){let oe=_.blockers.get(F)||Td;xt(oe.state==="unblocked"&&Q.state==="blocked"||oe.state==="blocked"&&Q.state==="blocked"||oe.state==="blocked"&&Q.state==="proceeding"||oe.state==="blocked"&&Q.state==="unblocked"||oe.state==="proceeding"&&Q.state==="unblocked",`Invalid blocker state transition: ${oe.state} -> ${Q.state}`);let ve=new Map(_.blockers);ve.set(F,Q),xe({blockers:ve})}function Ql({currentLocation:F,nextLocation:Q,historyAction:oe}){if(ae.size===0)return;ae.size>1&&_n(!1,"A router only supports one blocker at a time");let ve=Array.from(ae.entries()),[Ee,ze]=ve[ve.length-1],He=_.blockers.get(Ee);if(!(He&&He.state==="proceeding")&&ze({currentLocation:F,nextLocation:Q,historyAction:oe}))return Ee}function bs(F){let Q=za(404,{pathname:F}),oe=d||c,{matches:ve,route:Ee}=um(oe);return{notFoundMatches:ve,route:Ee,error:Q}}function Uo(F,Q,oe){if(b=F,C=Q,w=oe||null,!E&&_.navigation===sx){E=!0;let ve=Mn(_.location,_.matches);ve!=null&&xe({restoreScrollPosition:ve})}return()=>{b=null,C=null,w=null}}function hn(F,Q){return w&&w(F,Q.map(ve=>Sk(ve,_.loaderData)))||F.key}function vn(F,Q){if(b&&C){let oe=hn(F,Q);b[oe]=C()}}function Mn(F,Q){if(b){let oe=hn(F,Q),ve=b[oe];if(typeof ve=="number")return ve}return null}function Qn(F,Q,oe){if(e.patchRoutesOnNavigation)if(F){if(Object.keys(F[0].params).length>0)return{active:!0,matches:Im(Q,oe,h,!0)}}else return{active:!0,matches:Im(Q,oe,h,!0)||[]};return{active:!1,matches:null}}async function Xn(F,Q,oe,ve){if(!e.patchRoutesOnNavigation)return{type:"success",matches:F};let Ee=F;for(;;){let ze=d==null,He=d||c,ke=l;try{await e.patchRoutesOnNavigation({signal:oe,path:Q,matches:Ee,fetcherKey:ve,patch:(Ue,Me)=>{oe.aborted||j2(Ue,Me,He,ke,s,!1)}})}catch(Ue){return{type:"error",error:Ue,partialMatches:Ee}}finally{ze&&!oe.aborted&&(c=[...c])}if(oe.aborted)return{type:"aborted"};let Ze=hi(He,Q,h);if(Ze)return{type:"success",matches:Ze};let Ye=Im(He,Q,h,!0);if(!Ye||Ee.length===Ye.length&&Ee.every((Ue,Me)=>Ue.route.id===Ye[Me].route.id))return{type:"success",matches:null};Ee=Ye}}function or(F){l={},d=Xd(F,s,void 0,l)}function Tr(F,Q,oe=!1){let ve=d==null;j2(F,Q,d||c,l,s,oe),ve&&(c=[...c],xe({}))}return D={get basename(){return h},get future(){return g},get state(){return _},get routes(){return c},get window(){return t},initialize:ue,subscribe:Re,enableScrollRestoration:Uo,navigate:Xe,fetch:tn,revalidate:Bt,createHref:F=>e.history.createHref(F),encodeLocation:F=>e.history.encodeLocation(F),getFetcher:ht,resetFetcher:bn,deleteFetcher:Dn,dispose:Ne,getBlocker:On,deleteBlocker:Po,patchRoutes:Tr,_internalFetchControllers:I,_internalSetRoutes:or,_internalSetStateDoNotUseOrYouWillBreakYourApp(F){xe(F)}},D}function Yk(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function r0(e,t,n,r,s,l){let c,d;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){d=m;break}}else c=t,d=t[t.length-1];let h=Up(r||".",Pp(c),$a(e.pathname,n)||e.pathname,l==="path");if(r==null&&(h.search=e.search,h.hash=e.hash),(r==null||r===""||r===".")&&d){let m=hb(h.search);if(d.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&m){let g=new URLSearchParams(h.search),v=g.getAll("index");g.delete("index"),v.filter(b=>b).forEach(b=>g.append("index",b));let x=g.toString();h.search=x?`?${x}`:""}}return n!=="/"&&(h.pathname=kk({basename:n,pathname:h.pathname})),Ei(h)}function R2(e,t,n){if(!n||!Yk(n))return{path:t};if(n.formMethod&&!d8(n.formMethod))return{path:t,error:za(405,{method:n.formMethod})};let r=()=>({path:t,error:za(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=jj(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Xr(l))return r();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[b,w])=>`${x}${b}=${w}
|
|
59
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!Xr(l))return r();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return r()}}}xt(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=o0(n.formData),h=n.formData;else if(n.body instanceof FormData)d=o0(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=O2(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=O2(d)}catch{return r()}let m={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(Xr(m.formMethod))return{path:t,submission:m};let g=Oi(t);return e&&g.search&&hb(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Ei(g),submission:m}}function T2(e,t,n,r,s,l,c,d,h,m,g,v,x,b,w,C,E,R,T,j){var re;let O=j?ca(j[1])?j[1].error:j[1].data:void 0,D=s.createURL(l.location),_=s.createURL(h),A;if(g&&l.errors){let H=Object.keys(l.errors)[0];A=c.findIndex($=>$.route.id===H)}else if(j&&ca(j[1])){let H=j[0];A=c.findIndex($=>$.route.id===H)-1}let M=j?j[1].statusCode:void 0,U=M&&M>=400,B={currentUrl:D,currentParams:((re=l.matches[0])==null?void 0:re.params)||{},nextUrl:_,nextParams:c[0].params,...d,actionResult:O,actionStatus:M},G=c.map((H,$)=>{let{route:I}=H,Y=null;if(A!=null&&$>A?Y=!1:I.lazy?Y=!0:fb(I)?g?Y=a0(I,l.loaderData,l.errors):Wk(l.loaderData,l.matches[$],H)&&(Y=!0):Y=!1,Y!==null)return s0(n,r,e,H,m,t,Y);let Z=U?!1:v||D.pathname+D.search===_.pathname+_.search||D.search!==_.search||Qk(l.matches[$],H),ie={...B,defaultShouldRevalidate:Z},be=Qm(H,ie);return s0(n,r,e,H,m,t,be,ie)}),K=[];return w.forEach((H,$)=>{if(g||!c.some(W=>W.route.id===H.routeId)||b.has($))return;let I=l.fetchers.get($),Y=I&&I.state!=="idle"&&I.data===void 0,Z=hi(E,H.path,R);if(!Z){if(T&&Y)return;K.push({key:$,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(C.has($))return;let ie=Lm(Z,H.path),be=new AbortController,L=Fc(s,H.path,be.signal),P=null;if(x.has($))x.delete($),P=Yc(n,r,L,Z,ie,m,t);else if(Y)v&&(P=Yc(n,r,L,Z,ie,m,t));else{let W={...B,defaultShouldRevalidate:U?!1:v};Qm(ie,W)&&(P=Yc(n,r,L,Z,ie,m,t,W))}P&&K.push({key:$,routeId:H.routeId,path:H.path,matches:P,match:ie,request:L,controller:be})}),{dsMatches:G,revalidatingFetchers:K}}function fb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function a0(e,t,n){if(e.lazy)return!0;if(!fb(e))return!1;let r=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function Wk(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function Qk(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qm(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function j2(e,t,n,r,s,l){let c;if(e){let m=r[e];xt(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let d=[],h=[];if(t.forEach(m=>{let g=c.find(v=>Cj(m,v));g?h.push({existingRoute:g,newRoute:m}):d.push(m)}),d.length>0){let m=Xd(d,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...m)}if(l&&h.length>0)for(let m=0;m<h.length;m++){let{existingRoute:g,newRoute:v}=h[m],x=g,[b]=Xd([v],s,[],{},!0);Object.assign(x,{element:b.element?b.element:x.element,errorElement:b.errorElement?b.errorElement:x.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:x.hydrateFallbackElement})}}function Cj(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var s;return(s=t.children)==null?void 0:s.some(l=>Cj(n,l))}):!1}var _2=new WeakMap,wj=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(xt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let l=s.lazy[e];if(!l)return;let c=_2.get(s);c||(c={},_2.set(s,c));let d=c[e];if(d)return d;let h=(async()=>{let m=vk(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)_n(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(v)_n(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await l();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=h,h},N2=new WeakMap;function Xk(e,t,n,r,s){let l=n[e.id];if(xt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=N2.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{xt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),b={};for(let w in x){let C=x[w];if(C===void 0)continue;let E=xk(w),T=l[w]!==void 0&&w!=="hasErrorBoundary";E?_n(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?_n(!T,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=C}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return N2.set(l,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let c=Object.keys(e.lazy),d=[],h;for(let g of c){if(s&&s.includes(g))continue;let v=wj({key:g,route:e,manifest:n,mapRouteProperties:r});v&&(d.push(v),g===t&&(h=v))}let m=d.length>0?Promise.all(d).then(()=>{}):void 0;return m==null||m.catch(()=>{}),h==null||h.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:h}}async function A2(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,l)=>{n[t[l].route.id]=s}),n}async function Jk(e){return e.matches.some(t=>t.route.middleware)?Ej(e,()=>A2(e)):A2(e)}function Ej(e,t){return e8(e,t,r=>r,l8,n);function n(r,s,l){if(l)return Promise.resolve(Object.assign(l.value,{[s]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(m=>m.route.id===s),0),Math.max(c.findIndex(m=>m.unstable_shouldCallHandler()),0)),h=mi(c,c[d].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:r}})}}}async function e8(e,t,n,r,s){let{matches:l,request:c,params:d,context:h}=e,m=l.flatMap(v=>v.route.middleware?v.route.middleware.map(x=>[v.route.id,x]):[]);return await Rj({request:c,params:d,context:h},m,t,n,r,s)}async function Rj(e,t,n,r,s,l,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let h=t[c];if(!h)return await n();let[m,g]=h,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Rj(e,t,n,r,s,l,c+1)},v.value}catch(b){return v={value:await l(b,m,v)},v.value}};try{let b=await g(e,x),w=b!=null?r(b):void 0;return s(w)?w:v?w??v.value:(v={value:await x()},v.value)}catch(b){return await l(b,m,v)}}function Tj(e,t,n,r,s){let l=wj({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=Xk(r.route,Xr(n.method)?"action":"loader",t,e,s);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function s0(e,t,n,r,s,l,c,d=null){let h=!1,m=Tj(e,t,n,r,s);return{...r,_lazyPromises:m,shouldLoad:c,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler(g){return h=!0,d?typeof g=="boolean"?Qm(r,{...d,defaultShouldRevalidate:g}):Qm(r,d):c},resolve(g){let{lazy:v,loader:x,middleware:b}=r.route,w=h||c||g&&!Xr(n.method)&&(v||x),C=b&&b.length>0&&!x&&!v;return w&&!C?n8({request:n,match:r,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:g,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Yc(e,t,n,r,s,l,c,d=null){return r.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:Tj(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:s0(e,t,n,h,l,c,!0,d))}async function t8(e,t,n,r,s,l){n.some(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware}));let c={request:t,params:n[0].params,context:s,matches:n},h=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let g=c;return Ej(g,()=>m({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var g,v;return[(g=m._lazyPromises)==null?void 0:g.handler,(v=m._lazyPromises)==null?void 0:v.route]}))}catch{}return h}async function n8({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:s,scopedContext:l}){let c,d,h=Xr(e.method),m=h?"action":"loader",g=v=>{let x,b=new Promise((E,R)=>x=R);d=()=>x(),e.signal.addEventListener("abort",d);let w=E=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${t.route.id}]`)):v({request:e,params:t.params,context:l},...E!==void 0?[E]:[]),C=(async()=>{try{return{type:"data",result:await(s?s(R=>w(R)):w())}}catch(E){return{type:"error",result:E}}})();return Promise.race([C,b])};try{let v=h?t.route.action:t.route.loader;if(n||r)if(v){let x,[b]=await Promise.all([g(v).catch(w=>{x=w}),n,r]);if(x!==void 0)throw x;c=b}else{await n;let x=h?t.route.action:t.route.loader;if(x)[c]=await Promise.all([g(x),r]);else if(m==="action"){let b=new URL(e.url),w=b.pathname+b.search;throw za(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(v)c=await g(v);else{let x=new URL(e.url),b=x.pathname+x.search;throw za(404,{pathname:b})}}catch(v){return{type:"error",result:v}}finally{d&&e.signal.removeEventListener("abort",d)}return c}async function r8(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function a8(e){var r,s,l,c,d,h;let{result:t,type:n}=e;if(_j(t)){let m;try{m=await r8(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new Wm(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:"data",data:m,statusCode:t.status,headers:t.headers}}return n==="error"?L2(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Wm(((l=t.init)==null?void 0:l.status)||500,void 0,t.data),statusCode:Jd(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Jd(t)?t.status:void 0}:L2(t)?{type:"data",data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(h=t.init)!=null&&h.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function s8(e,t,n,r,s){let l=e.headers.get("Location");if(xt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!db(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=r0(new URL(t.url),c,s,l),e.headers.set("Location",l)}return e}function D2(e,t,n){if(db(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=$a(s.pathname,n)!=null;if(s.origin===t.origin&&l)return s.pathname+s.search+s.hash}return e}function Fc(e,t,n,r){let s=e.createURL(jj(t)).toString(),l={signal:n};if(r&&Xr(r.formMethod)){let{formMethod:c,formEncType:d}=r;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(r.json)):d==="text/plain"?l.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?l.body=o0(r.formData):l.body=r.formData}return new Request(s,l)}function o0(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function O2(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function o8(e,t,n,r=!1,s=!1){let l={},c=null,d,h=!1,m={},g=n&&ca(n[1])?n[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let x=v.route.id,b=t[x];if(xt(!vl(b),"Cannot handle redirect results in processLoaderData"),ca(b)){let w=b.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},s)c[x]=w;else{let C=mi(e,x);c[C.route.id]==null&&(c[C.route.id]=w)}r||(l[x]=Sj),h||(h=!0,d=Jd(b.error)?b.error.status:500),b.headers&&(m[x]=b.headers)}else l[x]=b.data,b.statusCode&&b.statusCode!==200&&!h&&(d=b.statusCode),b.headers&&(m[x]=b.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:m}}function M2(e,t,n,r,s,l){let{loaderData:c,errors:d}=o8(t,n,r);return s.filter(h=>!h.matches||h.matches.some(m=>m.shouldLoad)).forEach(h=>{let{key:m,match:g,controller:v}=h;if(v&&v.signal.aborted)return;let x=l[m];if(xt(x,"Did not find corresponding fetcher result"),ca(x)){let b=mi(e.matches,g==null?void 0:g.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(m)}else if(vl(x))xt(!1,"Unhandled fetcher revalidation redirect");else{let b=go(x.data);e.fetchers.set(m,b)}}),{loaderData:c,errors:d}}function k2(e,t,n,r){let s=Object.entries(t).filter(([,l])=>l!==Sj).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function I2(e){return e?ca(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function mi(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function um(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function za(e,{pathname:t,routeId:n,method:r,type:s,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new Wm(e||500,c,new Error(d),!0)}function dm(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(vl(s))return{key:r,result:s}}}function jj(e){let t=typeof e=="string"?Oi(e):e;return Ei({...t,hash:""})}function i8(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function l8(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&c8(n))}function c8(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function u8(e){return _j(e.result)&&$k.has(e.result.status)}function ca(e){return e.type==="error"}function vl(e){return(e&&e.type)==="redirect"}function L2(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function _j(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function d8(e){return Hk.has(e.toUpperCase())}function Xr(e){return zk.has(e.toUpperCase())}function hb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Lm(e,t){let n=typeof t=="string"?Oi(t).search:t.search;if(e[e.length-1].route.index&&hb(n||""))return e[e.length-1];let r=yj(e);return r[r.length-1]}function P2(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:l,json:c}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function ox(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function f8(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function jd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function h8(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function go(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function m8(e,t){try{let n=e.sessionStorage.getItem(bj);if(n){let r=JSON.parse(n);for(let[s,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(s,new Set(l||[]))}}catch{}}function p8(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(bj,JSON.stringify(n))}catch(r){_n(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function g8(){let e,t,n=new Promise((r,s)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{s(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Ul=p.createContext(null);Ul.displayName="DataRouter";var vf=p.createContext(null);vf.displayName="DataRouterState";p.createContext(!1);var mb=p.createContext({isTransitioning:!1});mb.displayName="ViewTransition";var Nj=p.createContext(new Map);Nj.displayName="Fetchers";var v8=p.createContext(null);v8.displayName="Await";var ps=p.createContext(null);ps.displayName="Navigation";var Fp=p.createContext(null);Fp.displayName="Location";var qa=p.createContext({outlet:null,matches:[],isDataRoute:!1});qa.displayName="Route";var pb=p.createContext(null);pb.displayName="RouteError";function y8(e,{relative:t}={}){xt(pu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext(ps),{hash:s,pathname:l,search:c}=yf(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:Is([n,l])),r.createHref({pathname:d,search:c,hash:s})}function pu(){return p.useContext(Fp)!=null}function $s(){return xt(pu(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Fp).location}var Aj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Dj(e){p.useContext(ps).static||p.useLayoutEffect(e)}function zp(){let{isDataRoute:e}=p.useContext(qa);return e?O8():x8()}function x8(){xt(pu(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(Ul),{basename:t,navigator:n}=p.useContext(ps),{matches:r}=p.useContext(qa),{pathname:s}=$s(),l=JSON.stringify(Pp(r)),c=p.useRef(!1);return Dj(()=>{c.current=!0}),p.useCallback((h,m={})=>{if(_n(c.current,Aj),!c.current)return;if(typeof h=="number"){n.go(h);return}let g=Up(h,JSON.parse(l),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Is([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,l,s,e])}var Oj=p.createContext(null);function gs(){return p.useContext(Oj)}function b8(e){let t=p.useContext(qa).outlet;return p.useMemo(()=>t&&p.createElement(Oj.Provider,{value:e},t),[t,e])}function Mj(){let{matches:e}=p.useContext(qa),t=e[e.length-1];return t?t.params:{}}function yf(e,{relative:t}={}){let{matches:n}=p.useContext(qa),{pathname:r}=$s(),s=JSON.stringify(Pp(n));return p.useMemo(()=>Up(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function S8(e,t,n,r,s){xt(pu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=p.useContext(ps),{matches:c}=p.useContext(qa),d=c[c.length-1],h=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",v=d&&d.route;{let T=v&&v.path||"";kj(m,!v||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (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.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let x=$s(),b;b=x;let w=b.pathname||"/",C=w;if(g!=="/"){let T=g.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let E=hi(e,{pathname:C});return _n(v||E!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),_n(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.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.`),T8(E&&E.map(T=>Object.assign({},T,{params:Object.assign({},h,T.params),pathname:Is([g,l.encodeLocation?l.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?g:Is([g,l.encodeLocation?l.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,n,r,s)}function C8(){let e=D8(),t=Jd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:l},"ErrorBoundary")," or"," ",p.createElement("code",{style:l},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,c)}var w8=p.createElement(C8,null),E8=class extends p.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.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?p.createElement(qa.Provider,{value:this.props.routeContext},p.createElement(pb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function R8({routeContext:e,match:t,children:n}){let r=p.useContext(Ul);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(qa.Provider,{value:e},n)}function T8(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,c=n==null?void 0:n.errors;if(c!=null){let m=l.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);xt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,m+1))}let d=!1,h=-1;if(n)for(let m=0;m<l.length;m++){let g=l[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(h=m),g.route.id){let{loaderData:v,errors:x}=n,b=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||b){d=!0,h>=0?l=l.slice(0,h+1):l=[l[0]];break}}}return l.reduceRight((m,g,v)=>{let x,b=!1,w=null,C=null;n&&(x=c&&g.route.id?c[g.route.id]:void 0,w=g.route.errorElement||w8,d&&(h<0&&v===0?(kj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,C=null):h===v&&(b=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,v+1)),R=()=>{let T;return x?T=w:b?T=C:g.route.Component?T=p.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=m,p.createElement(R8,{match:g,routeContext:{outlet:m,matches:E,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?p.createElement(E8,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},unstable_onError:r}):R()},null)}function gb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function j8(e){let t=p.useContext(Ul);return xt(t,gb(e)),t}function _8(e){let t=p.useContext(vf);return xt(t,gb(e)),t}function N8(e){let t=p.useContext(qa);return xt(t,gb(e)),t}function vb(e){let t=N8(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function A8(){return vb("useRouteId")}function D8(){var r;let e=p.useContext(pb),t=_8("useRouteError"),n=vb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function O8(){let{router:e}=j8("useNavigate"),t=vb("useNavigate"),n=p.useRef(!1);return Dj(()=>{n.current=!0}),p.useCallback(async(s,l={})=>{_n(n.current,Aj),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var U2={};function kj(e,t,n){!t&&!U2[e]&&(U2[e]=!0,_n(!1,n))}var F2={};function z2(e,t){!e&&!F2[t]&&(F2[t]=!0,console.warn(t))}function M8(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&_n(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&_n(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&_n(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var k8=["HydrateFallback","hydrateFallbackElement"],I8=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function L8({router:e,flushSync:t,unstable_onError:n}){let[r,s]=p.useState(e.state),[l,c]=p.useState(),[d,h]=p.useState({isTransitioning:!1}),[m,g]=p.useState(),[v,x]=p.useState(),[b,w]=p.useState(),C=p.useRef(new Map),E=p.useCallback(D=>{s(_=>(D.errors&&n&&Object.entries(D.errors).forEach(([A,M])=>{var U;((U=_.errors)==null?void 0:U[A])!==M&&n(M)}),D))},[n]),R=p.useCallback((D,{deletedFetchers:_,flushSync:A,viewTransitionOpts:M})=>{D.fetchers.forEach((B,G)=>{B.data!==void 0&&C.current.set(G,B.data)}),_.forEach(B=>C.current.delete(B)),z2(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let U=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(z2(M==null||U,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!M||!U){t&&A?t(()=>E(D)):p.startTransition(()=>E(D));return}if(t&&A){t(()=>{v&&(m&&m.resolve(),v.skipTransition()),h({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>E(D))});B.finished.finally(()=>{t(()=>{g(void 0),x(void 0),c(void 0),h({isTransitioning:!1})})}),t(()=>x(B));return}v?(m&&m.resolve(),v.skipTransition(),w({state:D,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(c(D),h({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[e.window,t,v,m,E]);p.useLayoutEffect(()=>e.subscribe(R),[e,R]),p.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new I8)},[d]),p.useEffect(()=>{if(m&&l&&e.window){let D=l,_=m.promise,A=e.window.document.startViewTransition(async()=>{p.startTransition(()=>E(D)),await _});A.finished.finally(()=>{g(void 0),x(void 0),c(void 0),h({isTransitioning:!1})}),x(A)}},[l,m,e.window,E]),p.useEffect(()=>{m&&l&&r.location.key===l.location.key&&m.resolve()},[m,v,r.location,l]),p.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),h({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]);let T=p.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:D=>e.navigate(D),push:(D,_,A)=>e.navigate(D,{state:_,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(D,_,A)=>e.navigate(D,{replace:!0,state:_,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),j=e.basename||"/",O=p.useMemo(()=>({router:e,navigator:T,static:!1,basename:j,unstable_onError:n}),[e,T,j,n]);return p.createElement(p.Fragment,null,p.createElement(Ul.Provider,{value:O},p.createElement(vf.Provider,{value:r},p.createElement(Nj.Provider,{value:C.current},p.createElement(mb.Provider,{value:d},p.createElement(z8,{basename:j,location:r.location,navigationType:r.historyAction,navigator:T},p.createElement(P8,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var P8=p.memo(U8);function U8({routes:e,future:t,state:n,unstable_onError:r}){return S8(e,void 0,n,r,t)}function F8({to:e,replace:t,state:n,relative:r}){xt(pu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext(ps);_n(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=p.useContext(qa),{pathname:c}=$s(),d=zp(),h=Up(e,Pp(l),c,r==="path"),m=JSON.stringify(h);return p.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:r})},[d,m,r,t,n]),null}function Ij(e){return b8(e.context)}function z8({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1}){xt(!pu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:s,static:l,future:{}}),[c,s,l]);typeof n=="string"&&(n=Oi(n));let{pathname:h="/",search:m="",hash:g="",state:v=null,key:x="default"}=n,b=p.useMemo(()=>{let w=$a(h,c);return w==null?null:{location:{pathname:w,search:m,hash:g,state:v,key:x},navigationType:r}},[c,h,m,g,v,x,r]);return _n(b!=null,`<Router basename="${c}"> is not able to match the URL "${h}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:p.createElement(ps.Provider,{value:d},p.createElement(Fp.Provider,{children:t,value:b}))}var Pm="get",Um="application/x-www-form-urlencoded";function Vp(e){return e!=null&&typeof e.tagName=="string"}function V8(e){return Vp(e)&&e.tagName.toLowerCase()==="button"}function H8(e){return Vp(e)&&e.tagName.toLowerCase()==="form"}function $8(e){return Vp(e)&&e.tagName.toLowerCase()==="input"}function B8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function G8(e,t){return e.button===0&&(!t||t==="_self")&&!B8(e)}function i0(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function q8(e,t){let n=i0(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(l=>{n.append(s,l)})}),n}var fm=null;function Z8(){if(fm===null)try{new FormData(document.createElement("form"),0),fm=!1}catch{fm=!0}return fm}var K8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ix(e){return e!=null&&!K8.has(e)?(_n(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Um}"`),null):e}function Y8(e,t){let n,r,s,l,c;if(H8(e)){let d=e.getAttribute("action");r=d?$a(d,t):null,n=e.getAttribute("method")||Pm,s=ix(e.getAttribute("enctype"))||Um,l=new FormData(e)}else if(V8(e)||$8(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(r=h?$a(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Pm,s=ix(e.getAttribute("formenctype"))||ix(d.getAttribute("enctype"))||Um,l=new FormData(d,e),!Z8()){let{name:m,type:g,value:v}=e;if(g==="image"){let x=m?`${m}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else m&&l.append(m,v)}}else{if(Vp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Pm,r=null,s=Um,c=e}return l&&s==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function yb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function W8(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&$a(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function Q8(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function X8(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 J8(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let c=await Q8(l,n);return c.links?c.links():[]}return[]}));return rI(r.flat(1).filter(X8).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function V2(e,t,n,r,s,l){let c=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>{var g;return n[m].pathname!==h.pathname||((g=n[m].route.path)==null?void 0:g.endsWith("*"))&&n[m].params["*"]!==h.params["*"]};return l==="assets"?t.filter((h,m)=>c(h,m)||d(h,m)):l==="data"?t.filter((h,m)=>{var v;let g=r.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(c(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let x=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((v=n[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function eI(e,t,{includeHydrateFallback:n}={}){return tI(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function tI(e){return[...new Set(e)]}function nI(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function rI(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(nI(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function Lj(){let e=p.useContext(Ul);return yb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function aI(){let e=p.useContext(vf);return yb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var xb=p.createContext(void 0);xb.displayName="FrameworkContext";function Pj(){let e=p.useContext(xb);return yb(e,"You must render this element inside a <HydratedRouter> element"),e}function sI(e,t){let n=p.useContext(xb),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:g,onTouchStart:v}=t,x=p.useRef(null);p.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=R=>{R.forEach(T=>{c(T.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),p.useEffect(()=>{if(r){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[r]);let b=()=>{s(!0)},w=()=>{s(!1),c(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:_d(d,b),onBlur:_d(h,w),onMouseEnter:_d(m,b),onMouseLeave:_d(g,w),onTouchStart:_d(v,b)}]:[!1,x,{}]}function _d(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oI({page:e,...t}){let{router:n}=Lj(),r=p.useMemo(()=>hi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(lI,{page:e,matches:r,...t}):null}function iI(e){let{manifest:t,routeModules:n}=Pj(),[r,s]=p.useState([]);return p.useEffect(()=>{let l=!1;return J8(e,t,n).then(c=>{l||s(c)}),()=>{l=!0}},[e,t,n]),r}function lI({page:e,matches:t,...n}){let r=$s(),{manifest:s,routeModules:l}=Pj(),{basename:c}=Lj(),{loaderData:d,matches:h}=aI(),m=p.useMemo(()=>V2(e,t,h,s,r,"data"),[e,t,h,s,r]),g=p.useMemo(()=>V2(e,t,h,s,r,"assets"),[e,t,h,s,r]),v=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(R=>{var j;let T=s.routes[R.route.id];!T||!T.hasLoader||(!m.some(O=>O.route.id===R.route.id)&&R.route.id in d&&((j=l[R.route.id])!=null&&j.shouldRevalidate)||T.hasClientLoader?C=!0:w.add(R.route.id))}),w.size===0)return[];let E=W8(e,c,"data");return C&&w.size>0&&E.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,d,r,s,m,t,e,l]),x=p.useMemo(()=>eI(g,s),[g,s]),b=iI(g);return p.createElement(p.Fragment,null,v.map(w=>p.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),x.map(w=>p.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:C})=>p.createElement("link",{key:w,nonce:n.nonce,...C})))}function cI(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Uj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Uj&&(window.__reactRouterVersion="7.9.4")}catch{}function uI(e,t){return Kk({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:hk({window:t==null?void 0:t.window}),hydrationData:dI(),routes:e,mapRouteProperties:M8,hydrationRouteProperties:k8,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function dI(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:fI(e.errors)}),e}function fI(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new Wm(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let l=window[s.__subType];if(typeof l=="function")try{let c=new l(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(s.message);l.stack="",n[r]=l}}else n[r]=s;return n}var Fj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ba=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:c,state:d,target:h,to:m,preventScrollReset:g,viewTransition:v,...x},b){let{basename:w}=p.useContext(ps),C=typeof m=="string"&&Fj.test(m),E,R=!1;if(typeof m=="string"&&C&&(E=m,Uj))try{let U=new URL(window.location.href),B=m.startsWith("//")?new URL(U.protocol+m):new URL(m),G=$a(B.pathname,w);B.origin===U.origin&&G!=null?m=G+B.search+B.hash:R=!0}catch{_n(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=y8(m,{relative:s}),[j,O,D]=sI(r,x),_=pI(m,{replace:c,state:d,target:h,preventScrollReset:g,relative:s,viewTransition:v});function A(U){t&&t(U),U.defaultPrevented||_(U)}let M=p.createElement("a",{...x,...D,href:E||T,onClick:R||l?t:A,ref:cI(b,O),target:h,"data-discover":!C&&n==="render"?"true":void 0});return j&&!C?p.createElement(p.Fragment,null,M,p.createElement(oI,{page:T})):M});Ba.displayName="Link";var xf=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:c,viewTransition:d,children:h,...m},g){let v=yf(c,{relative:m.relative}),x=$s(),b=p.useContext(vf),{navigator:w,basename:C}=p.useContext(ps),E=b!=null&&SI(v)&&d===!0,R=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,T=x.pathname,j=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),j=j?j.toLowerCase():null,R=R.toLowerCase()),j&&C&&(j=$a(j,C)||j);const O=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let D=T===R||!s&&T.startsWith(R)&&T.charAt(O)==="/",_=j!=null&&(j===R||!s&&j.startsWith(R)&&j.charAt(R.length)==="/"),A={isActive:D,isPending:_,isTransitioning:E},M=D?t:void 0,U;typeof r=="function"?U=r(A):U=[r,D?"active":null,_?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let B=typeof l=="function"?l(A):l;return p.createElement(Ba,{...m,"aria-current":M,className:U,ref:g,style:B,to:c,viewTransition:d},typeof h=="function"?h(A):h)});xf.displayName="NavLink";var hI=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:c=Pm,action:d,onSubmit:h,relative:m,preventScrollReset:g,viewTransition:v,...x},b)=>{let w=xI(),C=bI(d,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&Fj.test(d),T=j=>{if(h&&h(j),j.defaultPrevented)return;j.preventDefault();let O=j.nativeEvent.submitter,D=(O==null?void 0:O.getAttribute("formmethod"))||c;w(O||j.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:s,state:l,relative:m,preventScrollReset:g,viewTransition:v})};return p.createElement("form",{ref:b,method:E,action:C,onSubmit:r?h:T,...x,"data-discover":!R&&e==="render"?"true":void 0})});hI.displayName="Form";function mI(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zj(e){let t=p.useContext(Ul);return xt(t,mI(e)),t}function pI(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:l,viewTransition:c}={}){let d=zp(),h=$s(),m=yf(e,{relative:l});return p.useCallback(g=>{if(G8(g,t)){g.preventDefault();let v=n!==void 0?n:Ei(h)===Ei(m);d(e,{replace:v,state:r,preventScrollReset:s,relative:l,viewTransition:c})}},[h,d,m,n,r,t,e,s,l,c])}function gI(e){_n(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=p.useRef(i0(e)),n=p.useRef(!1),r=$s(),s=p.useMemo(()=>q8(r.search,n.current?null:t.current),[r.search]),l=zp(),c=p.useCallback((d,h)=>{const m=i0(typeof d=="function"?d(new URLSearchParams(s)):d);n.current=!0,l("?"+m,h)},[l,s]);return[s,c]}var vI=0,yI=()=>`__${String(++vI)}__`;function xI(){let{router:e}=zj("useSubmit"),{basename:t}=p.useContext(ps),n=A8();return p.useCallback(async(r,s={})=>{let{action:l,method:c,encType:d,formData:h,body:m}=Y8(r,t);if(s.navigate===!1){let g=s.fetcherKey||yI();await e.fetch(g,n,s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,flushSync:s.flushSync})}else await e.navigate(s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function bI(e,{relative:t}={}){let{basename:n}=p.useContext(ps),r=p.useContext(qa);xt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...yf(e||".",{relative:t})},c=$s();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(v=>v).forEach(v=>d.append("index",v));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:Is([n,l.pathname])),Ei(l)}function SI(e,{relative:t}={}){let n=p.useContext(mb);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=zj("useViewTransitionState"),s=yf(e,{relative:t});if(!n.isTransitioning)return!1;let l=$a(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=$a(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ym(s.pathname,c)!=null||Ym(s.pathname,l)!=null}var is=hj();const CI=dj(is);function wI(e){return p.createElement(L8,{flushSync:is.flushSync,...e})}function H2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function No(...e){return t=>{let n=!1;const r=e.map(s=>{const l=H2(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():H2(e[s],null)}}}}function vt(...e){return p.useCallback(No(...e),e)}function Ri(e){const t=EI(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),h=d.find(RI);if(h){const m=h.props.children,g=d.map(v=>v===h?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:v);return o.jsx(t,{...c,ref:s,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}var Hp=Ri("Slot");function EI(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=jI(s),d=TI(l,s.props);return s.type!==p.Fragment&&(d.ref=r?No(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vj=Symbol("radix.slottable");function Hj(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Vj,t}function RI(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vj}function TI(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const h=l(...d);return s(...d),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function jI(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function $j(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=$j(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Bj(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=$j(e))&&(r&&(r+=" "),r+=t);return r}const $2=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,B2=Bj,bf=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return B2(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,c=Object.keys(s).map(m=>{const g=n==null?void 0:n[m],v=l==null?void 0:l[m];if(g===null)return null;const x=$2(g)||$2(v);return s[m][x]}),d=n&&Object.entries(n).reduce((m,g)=>{let[v,x]=g;return x===void 0||(m[v]=x),m},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,g)=>{let{class:v,className:x,...b}=g;return Object.entries(b).every(w=>{let[C,E]=w;return Array.isArray(E)?E.includes({...l,...d}[C]):{...l,...d}[C]===E})?[...m,v,x]:m},[]);return B2(e,c,h,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
62
|
-
* @license lucide-react v0.475.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const _I=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gj=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
67
|
-
* @license lucide-react v0.475.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/var NI={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"};/**
|
|
72
|
-
* @license lucide-react v0.475.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const AI=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...d},h)=>p.createElement("svg",{ref:h,...NI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Gj("lucide",s),...d},[...c.map(([m,g])=>p.createElement(m,g)),...Array.isArray(l)?l:[l]]));/**
|
|
77
|
-
* @license lucide-react v0.475.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const De=(e,t)=>{const n=p.forwardRef(({className:r,...s},l)=>p.createElement(AI,{ref:l,iconNode:t,className:Gj(`lucide-${_I(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
82
|
-
* @license lucide-react v0.475.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const DI=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],bb=De("ArchiveRestore",DI);/**
|
|
87
|
-
* @license lucide-react v0.475.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const OI=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M15 4h5l-5 6h5",key:"8asdl1"}],["path",{d:"M15 20v-3.5a2.5 2.5 0 0 1 5 0V20",key:"r6l5cz"}],["path",{d:"M20 18h-5",key:"18j1r2"}]],G2=De("ArrowDownZA",OI);/**
|
|
92
|
-
* @license lucide-react v0.475.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const MI=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],kI=De("ArrowLeft",MI);/**
|
|
97
|
-
* @license lucide-react v0.475.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const II=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],LI=De("ArrowRightLeft",II);/**
|
|
102
|
-
* @license lucide-react v0.475.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const PI=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],q2=De("ArrowUpAZ",PI);/**
|
|
107
|
-
* @license lucide-react v0.475.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const UI=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Z2=De("ArrowUpDown",UI);/**
|
|
112
|
-
* @license lucide-react v0.475.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const FI=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],zI=De("Asterisk",FI);/**
|
|
117
|
-
* @license lucide-react v0.475.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const VI=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],HI=De("BadgeAlert",VI);/**
|
|
122
|
-
* @license lucide-react v0.475.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const $I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],BI=De("Ban",$I);/**
|
|
127
|
-
* @license lucide-react v0.475.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const GI=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],qI=De("BookOpen",GI);/**
|
|
132
|
-
* @license lucide-react v0.475.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const ZI=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Xm=De("Box",ZI);/**
|
|
137
|
-
* @license lucide-react v0.475.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const KI=[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2",key:"1ksdt3"}],["path",{d:"M22 13a18.15 18.15 0 0 1-20 0",key:"12hx5q"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],YI=De("BriefcaseBusiness",KI);/**
|
|
142
|
-
* @license lucide-react v0.475.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const WI=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],dr=De("Check",WI);/**
|
|
147
|
-
* @license lucide-react v0.475.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const QI=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Za=De("ChevronDown",QI);/**
|
|
152
|
-
* @license lucide-react v0.475.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const XI=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],JI=De("ChevronLeft",XI);/**
|
|
157
|
-
* @license lucide-react v0.475.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const e9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ra=De("ChevronRight",e9);/**
|
|
162
|
-
* @license lucide-react v0.475.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const t9=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Us=De("ChevronUp",t9);/**
|
|
167
|
-
* @license lucide-react v0.475.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const n9=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],r9=De("ChevronsDownUp",n9);/**
|
|
172
|
-
* @license lucide-react v0.475.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const a9=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Sb=De("ChevronsUpDown",a9);/**
|
|
177
|
-
* @license lucide-react v0.475.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const s9=[["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"}]],Sf=De("CircleAlert",s9);/**
|
|
182
|
-
* @license lucide-react v0.475.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const o9=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],qj=De("CircleCheckBig",o9);/**
|
|
187
|
-
* @license lucide-react v0.475.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const i9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],$p=De("CircleCheck",i9);/**
|
|
192
|
-
* @license lucide-react v0.475.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const l9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],c9=De("CircleStop",l9);/**
|
|
197
|
-
* @license lucide-react v0.475.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const u9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ef=De("CircleX",u9);/**
|
|
202
|
-
* @license lucide-react v0.475.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const d9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],f9=De("Circle",d9);/**
|
|
207
|
-
* @license lucide-react v0.475.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const h9=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Cb=De("Code",h9);/**
|
|
212
|
-
* @license lucide-react v0.475.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const m9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],p9=De("Columns3",m9);/**
|
|
217
|
-
* @license lucide-react v0.475.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const g9=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],tf=De("Copy",g9);/**
|
|
222
|
-
* @license lucide-react v0.475.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const v9=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],y9=De("DatabaseZap",v9);/**
|
|
227
|
-
* @license lucide-react v0.475.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const x9=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Jm=De("Database",x9);/**
|
|
232
|
-
* @license lucide-react v0.475.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const b9=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],S9=De("Download",b9);/**
|
|
237
|
-
* @license lucide-react v0.475.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const C9=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],w9=De("EllipsisVertical",C9);/**
|
|
242
|
-
* @license lucide-react v0.475.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const E9=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Ka=De("Ellipsis",E9);/**
|
|
247
|
-
* @license lucide-react v0.475.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const R9=[["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"}]],Tl=De("ExternalLink",R9);/**
|
|
252
|
-
* @license lucide-react v0.475.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const T9=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],j9=De("EyeOff",T9);/**
|
|
257
|
-
* @license lucide-react v0.475.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const _9=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Zj=De("Eye",_9);/**
|
|
262
|
-
* @license lucide-react v0.475.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const N9=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],A9=De("FileText",N9);/**
|
|
267
|
-
* @license lucide-react v0.475.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const D9=[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]],K2=De("Gem",D9);/**
|
|
272
|
-
* @license lucide-react v0.475.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const O9=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],M9=De("GraduationCap",O9);/**
|
|
277
|
-
* @license lucide-react v0.475.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const k9=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],I9=De("GripVertical",k9);/**
|
|
282
|
-
* @license lucide-react v0.475.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const L9=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],P9=De("Grip",L9);/**
|
|
287
|
-
* @license lucide-react v0.475.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const U9=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],F9=De("History",U9);/**
|
|
292
|
-
* @license lucide-react v0.475.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const z9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fr=De("Info",z9);/**
|
|
297
|
-
* @license lucide-react v0.475.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const V9=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],l0=De("KeyRound",V9);/**
|
|
302
|
-
* @license lucide-react v0.475.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const H9=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gu=De("LoaderCircle",H9);/**
|
|
307
|
-
* @license lucide-react v0.475.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const $9=[["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"}]],B9=De("Lock",$9);/**
|
|
312
|
-
* @license lucide-react v0.475.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const G9=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],q9=De("LogOut",G9);/**
|
|
317
|
-
* @license lucide-react v0.475.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const Z9=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],K9=De("Menu",Z9);/**
|
|
322
|
-
* @license lucide-react v0.475.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const Y9=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],W9=De("MessageCircleQuestion",Y9);/**
|
|
327
|
-
* @license lucide-react v0.475.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const Q9=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],X9=De("MessageCircle",Q9);/**
|
|
332
|
-
* @license lucide-react v0.475.0 - ISC
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the ISC license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const J9=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],eL=De("MessageSquare",J9);/**
|
|
337
|
-
* @license lucide-react v0.475.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const tL=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Kj=De("Monitor",tL);/**
|
|
342
|
-
* @license lucide-react v0.475.0 - ISC
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the ISC license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const nL=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Yj=De("Moon",nL);/**
|
|
347
|
-
* @license lucide-react v0.475.0 - ISC
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the ISC license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const rL=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],aL=De("OctagonAlert",rL);/**
|
|
352
|
-
* @license lucide-react v0.475.0 - ISC
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the ISC license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const sL=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],oL=De("OctagonX",sL);/**
|
|
357
|
-
* @license lucide-react v0.475.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const iL=[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]],lL=De("PackageSearch",iL);/**
|
|
362
|
-
* @license lucide-react v0.475.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const cL=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],uL=De("PenLine",cL);/**
|
|
367
|
-
* @license lucide-react v0.475.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const dL=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Cf=De("Pencil",dL);/**
|
|
372
|
-
* @license lucide-react v0.475.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const fL=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],wb=De("Play",fL);/**
|
|
377
|
-
* @license lucide-react v0.475.0 - ISC
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the ISC license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const hL=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],Eb=De("Plug",hL);/**
|
|
382
|
-
* @license lucide-react v0.475.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const mL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ta=De("Plus",mL);/**
|
|
387
|
-
* @license lucide-react v0.475.0 - ISC
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the ISC license.
|
|
390
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const pL=[["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"}]],gL=De("RefreshCw",pL);/**
|
|
392
|
-
* @license lucide-react v0.475.0 - ISC
|
|
393
|
-
*
|
|
394
|
-
* This source code is licensed under the ISC license.
|
|
395
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const vL=[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]],yL=De("Scale",vL);/**
|
|
397
|
-
* @license lucide-react v0.475.0 - ISC
|
|
398
|
-
*
|
|
399
|
-
* This source code is licensed under the ISC license.
|
|
400
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const xL=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Fl=De("Search",xL);/**
|
|
402
|
-
* @license lucide-react v0.475.0 - ISC
|
|
403
|
-
*
|
|
404
|
-
* This source code is licensed under the ISC license.
|
|
405
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/const bL=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Wj=De("Settings",bL);/**
|
|
407
|
-
* @license lucide-react v0.475.0 - ISC
|
|
408
|
-
*
|
|
409
|
-
* This source code is licensed under the ISC license.
|
|
410
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const SL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],CL=De("SquarePlay",SL);/**
|
|
412
|
-
* @license lucide-react v0.475.0 - ISC
|
|
413
|
-
*
|
|
414
|
-
* This source code is licensed under the ISC license.
|
|
415
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const wL=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Qj=De("Sun",wL);/**
|
|
417
|
-
* @license lucide-react v0.475.0 - ISC
|
|
418
|
-
*
|
|
419
|
-
* This source code is licensed under the ISC license.
|
|
420
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const EL=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],RL=De("Table",EL);/**
|
|
422
|
-
* @license lucide-react v0.475.0 - ISC
|
|
423
|
-
*
|
|
424
|
-
* This source code is licensed under the ISC license.
|
|
425
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/const TL=[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]],jL=De("Telescope",TL);/**
|
|
427
|
-
* @license lucide-react v0.475.0 - ISC
|
|
428
|
-
*
|
|
429
|
-
* This source code is licensed under the ISC license.
|
|
430
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
-
*/const _L=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Xj=De("Timer",_L);/**
|
|
432
|
-
* @license lucide-react v0.475.0 - ISC
|
|
433
|
-
*
|
|
434
|
-
* This source code is licensed under the ISC license.
|
|
435
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
-
*/const NL=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],ko=De("Trash2",NL);/**
|
|
437
|
-
* @license lucide-react v0.475.0 - ISC
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the ISC license.
|
|
440
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
-
*/const AL=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Bp=De("TriangleAlert",AL);/**
|
|
442
|
-
* @license lucide-react v0.475.0 - ISC
|
|
443
|
-
*
|
|
444
|
-
* This source code is licensed under the ISC license.
|
|
445
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
-
*/const DL=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],nf=De("Unplug",DL);/**
|
|
447
|
-
* @license lucide-react v0.475.0 - ISC
|
|
448
|
-
*
|
|
449
|
-
* This source code is licensed under the ISC license.
|
|
450
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
-
*/const OL=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Y2=De("Users",OL);/**
|
|
452
|
-
* @license lucide-react v0.475.0 - ISC
|
|
453
|
-
*
|
|
454
|
-
* This source code is licensed under the ISC license.
|
|
455
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
-
*/const ML=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],su=De("X",ML),lx=768;function kL(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${lx-1}px)`),r=()=>{t(window.innerWidth<lx)};return n.addEventListener("change",r),t(window.innerWidth<lx),()=>n.removeEventListener("change",r)},[]),!!e}const Rb="-",IL=e=>{const t=PL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const d=c.split(Rb);return d[0]===""&&d.length!==1&&d.shift(),Jj(d,t)||LL(c)},getConflictingClassGroupIds:(c,d)=>{const h=n[c]||[];return d&&r[c]?[...h,...r[c]]:h}}},Jj=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Jj(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const l=e.join(Rb);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},W2=/^\[(.+)\]$/,LL=e=>{if(W2.test(e)){const t=W2.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},PL=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)c0(n[s],r,s,t);return r},c0=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const l=s===""?t:Q2(t,s);l.classGroupId=n;return}if(typeof s=="function"){if(UL(s)){c0(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([l,c])=>{c0(c,Q2(t,l),n,r)})})},Q2=(e,t)=>{let n=e;return t.split(Rb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},UL=e=>e.isThemeGetter,FL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=r.get(l))!==void 0)return s(l,c),c},set(l,c){n.has(l)?n.set(l,c):s(l,c)}}},u0="!",d0=":",zL=d0.length,VL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let c=0,d=0,h=0,m;for(let w=0;w<s.length;w++){let C=s[w];if(c===0&&d===0){if(C===d0){l.push(s.slice(h,w)),h=w+zL;continue}if(C==="/"){m=w;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const g=l.length===0?s:s.substring(h),v=HL(g),x=v!==g,b=m&&m>h?m-h:void 0;return{modifiers:l,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}};if(t){const s=t+d0,l=r;r=c=>c.startsWith(s)?l(c.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},HL=e=>e.endsWith(u0)?e.substring(0,e.length-1):e.startsWith(u0)?e.substring(1):e,$L=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let l=[];return r.forEach(c=>{c[0]==="["||t[c]?(s.push(...l.sort(),c),l=[]):l.push(c)}),s.push(...l.sort()),s}},BL=e=>({cache:FL(e.cacheSize),parseClassName:VL(e),sortModifiers:$L(e),...IL(e)}),GL=/\s+/,qL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,c=[],d=e.trim().split(GL);let h="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:v,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:C}=n(g);if(v){h=g+(h.length>0?" "+h:h);continue}let E=!!C,R=r(E?w.substring(0,C):w);if(!R){if(!E){h=g+(h.length>0?" "+h:h);continue}if(R=r(w),!R){h=g+(h.length>0?" "+h:h);continue}E=!1}const T=l(x).join(":"),j=b?T+u0:T,O=j+R;if(c.includes(O))continue;c.push(O);const D=s(R,E);for(let _=0;_<D.length;++_){const A=D[_];c.push(j+A)}h=g+(h.length>0?" "+h:h)}return h};function ZL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=e_(t))&&(r&&(r+=" "),r+=n);return r}const e_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=e_(e[r]))&&(n&&(n+=" "),n+=t);return n};function KL(e,...t){let n,r,s,l=c;function c(h){const m=t.reduce((g,v)=>v(g),e());return n=BL(m),r=n.cache.get,s=n.cache.set,l=d,d(h)}function d(h){const m=r(h);if(m)return m;const g=qL(h,n);return s(h,g),g}return function(){return l(ZL.apply(null,arguments))}}const er=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},t_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,n_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,YL=/^\d+\/\d+$/,WL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QL=/\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$/,XL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,e7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Dc=e=>YL.test(e),yt=e=>!!e&&!Number.isNaN(Number(e)),li=e=>!!e&&Number.isInteger(Number(e)),cx=e=>e.endsWith("%")&&yt(e.slice(0,-1)),ho=e=>WL.test(e),t7=()=>!0,n7=e=>QL.test(e)&&!XL.test(e),r_=()=>!1,r7=e=>JL.test(e),a7=e=>e7.test(e),s7=e=>!Be(e)&&!Ge(e),o7=e=>vu(e,o_,r_),Be=e=>t_.test(e),fl=e=>vu(e,i_,n7),ux=e=>vu(e,d7,yt),X2=e=>vu(e,a_,r_),i7=e=>vu(e,s_,a7),hm=e=>vu(e,l_,r7),Ge=e=>n_.test(e),Nd=e=>yu(e,i_),l7=e=>yu(e,f7),J2=e=>yu(e,a_),c7=e=>yu(e,o_),u7=e=>yu(e,s_),mm=e=>yu(e,l_,!0),vu=(e,t,n)=>{const r=t_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},yu=(e,t,n=!1)=>{const r=n_.exec(e);return r?r[1]?t(r[1]):n:!1},a_=e=>e==="position"||e==="percentage",s_=e=>e==="image"||e==="url",o_=e=>e==="length"||e==="size"||e==="bg-size",i_=e=>e==="length",d7=e=>e==="number",f7=e=>e==="family-name",l_=e=>e==="shadow",h7=()=>{const e=er("color"),t=er("font"),n=er("text"),r=er("font-weight"),s=er("tracking"),l=er("leading"),c=er("breakpoint"),d=er("container"),h=er("spacing"),m=er("radius"),g=er("shadow"),v=er("inset-shadow"),x=er("text-shadow"),b=er("drop-shadow"),w=er("blur"),C=er("perspective"),E=er("aspect"),R=er("ease"),T=er("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...O(),Ge,Be],_=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],M=()=>[Ge,Be,h],U=()=>[Dc,"full","auto",...M()],B=()=>[li,"none","subgrid",Ge,Be],G=()=>["auto",{span:["full",li,Ge,Be]},li,Ge,Be],K=()=>[li,"auto",Ge,Be],re=()=>["auto","min","max","fr",Ge,Be],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...M()],Y=()=>[Dc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],Z=()=>[e,Ge,Be],ie=()=>[...O(),J2,X2,{position:[Ge,Be]}],be=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",c7,o7,{size:[Ge,Be]}],P=()=>[cx,Nd,fl],W=()=>["","none","full",m,Ge,Be],ae=()=>["",yt,Nd,fl],fe=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[yt,cx,J2,X2],Ne=()=>["","none",w,Ge,Be],Re=()=>["none",yt,Ge,Be],xe=()=>["none",yt,Ge,Be],et=()=>[yt,Ge,Be],Xe=()=>[Dc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ho],breakpoint:[ho],color:[t7],container:[ho],"drop-shadow":[ho],ease:["in","out","in-out"],font:[s7],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ho],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ho],shadow:[ho],spacing:["px",yt],text:[ho],"text-shadow":[ho],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Dc,Be,Ge,E]}],container:["container"],columns:[{columns:[yt,Be,Ge,d]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[li,"auto",Ge,Be]}],basis:[{basis:[Dc,"full","auto",d,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[yt,Dc,"auto","initial","none",Be]}],grow:[{grow:["",yt,Ge,Be]}],shrink:[{shrink:["",yt,Ge,Be]}],order:[{order:[li,"first","last","none",Ge,Be]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[d,"screen",...Y()]}],"min-w":[{"min-w":[d,"screen","none",...Y()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",n,Nd,fl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ge,ux]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cx,Be]}],"font-family":[{font:[l7,Be,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Ge,Be]}],"line-clamp":[{"line-clamp":[yt,"none",Ge,ux]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",Ge,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Z()}],"text-color":[{text:Z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[yt,"from-font","auto",Ge,fl]}],"text-decoration-color":[{decoration:Z()}],"underline-offset":[{"underline-offset":[yt,"auto",Ge,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,Be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ge,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:be()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},li,Ge,Be],radial:["",Ge,Be],conic:[li,Ge,Be]},u7,i7]}],"bg-color":[{bg:Z()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:Z()}],"gradient-via":[{via:Z()}],"gradient-to":[{to:Z()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Z()}],"border-color-x":[{"border-x":Z()}],"border-color-y":[{"border-y":Z()}],"border-color-s":[{"border-s":Z()}],"border-color-e":[{"border-e":Z()}],"border-color-t":[{"border-t":Z()}],"border-color-r":[{"border-r":Z()}],"border-color-b":[{"border-b":Z()}],"border-color-l":[{"border-l":Z()}],"divide-color":[{divide:Z()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[yt,Ge,Be]}],"outline-w":[{outline:["",yt,Nd,fl]}],"outline-color":[{outline:Z()}],shadow:[{shadow:["","none",g,mm,hm]}],"shadow-color":[{shadow:Z()}],"inset-shadow":[{"inset-shadow":["none",v,mm,hm]}],"inset-shadow-color":[{"inset-shadow":Z()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Z()}],"ring-offset-w":[{"ring-offset":[yt,fl]}],"ring-offset-color":[{"ring-offset":Z()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":Z()}],"text-shadow":[{"text-shadow":["none",x,mm,hm]}],"text-shadow-color":[{"text-shadow":Z()}],opacity:[{opacity:[yt,Ge,Be]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"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":[yt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":Z()}],"mask-image-linear-to-color":[{"mask-linear-to":Z()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":Z()}],"mask-image-t-to-color":[{"mask-t-to":Z()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":Z()}],"mask-image-r-to-color":[{"mask-r-to":Z()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":Z()}],"mask-image-b-to-color":[{"mask-b-to":Z()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":Z()}],"mask-image-l-to-color":[{"mask-l-to":Z()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":Z()}],"mask-image-x-to-color":[{"mask-x-to":Z()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":Z()}],"mask-image-y-to-color":[{"mask-y-to":Z()}],"mask-image-radial":[{"mask-radial":[Ge,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":Z()}],"mask-image-radial-to-color":[{"mask-radial-to":Z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[yt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":Z()}],"mask-image-conic-to-color":[{"mask-conic-to":Z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:be()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Be]}],filter:[{filter:["","none",Ge,Be]}],blur:[{blur:Ne()}],brightness:[{brightness:[yt,Ge,Be]}],contrast:[{contrast:[yt,Ge,Be]}],"drop-shadow":[{"drop-shadow":["","none",b,mm,hm]}],"drop-shadow-color":[{"drop-shadow":Z()}],grayscale:[{grayscale:["",yt,Ge,Be]}],"hue-rotate":[{"hue-rotate":[yt,Ge,Be]}],invert:[{invert:["",yt,Ge,Be]}],saturate:[{saturate:[yt,Ge,Be]}],sepia:[{sepia:["",yt,Ge,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Be]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[yt,Ge,Be]}],"backdrop-contrast":[{"backdrop-contrast":[yt,Ge,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",yt,Ge,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[yt,Ge,Be]}],"backdrop-invert":[{"backdrop-invert":["",yt,Ge,Be]}],"backdrop-opacity":[{"backdrop-opacity":[yt,Ge,Be]}],"backdrop-saturate":[{"backdrop-saturate":[yt,Ge,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",yt,Ge,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[yt,"initial",Ge,Be]}],ease:[{ease:["linear","initial",R,Ge,Be]}],delay:[{delay:[yt,Ge,Be]}],animate:[{animate:["none",T,Ge,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Ge,Be]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:et()}],"skew-x":[{"skew-x":et()}],"skew-y":[{"skew-y":et()}],transform:[{transform:[Ge,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],accent:[{accent:Z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge,Be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ge,Be]}],fill:[{fill:["none",...Z()]}],"stroke-w":[{stroke:[yt,Nd,fl,ux]}],stroke:[{stroke:["none",...Z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},m7=KL(h7);function J(...e){return m7(Bj(e))}const Tb=bf("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-white/4 dark:hover:bg-white/8",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-white/8",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Ce({className:e,variant:t,size:n,asChild:r=!1,...s}){const l=r?Hp:"button";return o.jsx(l,{"data-slot":"button",className:J(Tb({variant:t,size:n,className:e})),...s})}function $t({className:e,type:t,...n}){return o.jsx("input",{type:t,"data-slot":"input",className:J("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var p7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=p7.reduce((e,t)=>{const n=Ri(`Primitive.${t}`),r=p.forwardRef((s,l)=>{const{asChild:c,...d}=s,h=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(h,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function c_(e,t){e&&is.flushSync(()=>e.dispatchEvent(t))}var g7="Separator",eR="horizontal",v7=["horizontal","vertical"],u_=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=eR,...s}=e,l=y7(r)?r:eR,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return o.jsx(Ke.div,{"data-orientation":l,...d,...s,ref:t})});u_.displayName=g7;function y7(e){return v7.includes(e)}var x7=u_;function d_({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return o.jsx(x7,{"data-slot":"separator",decorative:n,orientation:t,className:J("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function b7(e,t){const n=p.createContext(t),r=l=>{const{children:c,...d}=l,h=p.useMemo(()=>d,Object.values(d));return o.jsx(n.Provider,{value:h,children:c})};r.displayName=e+"Provider";function s(l){const c=p.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function kr(e,t=[]){let n=[];function r(l,c){const d=p.createContext(c),h=n.length;n=[...n,c];const m=v=>{var R;const{scope:x,children:b,...w}=v,C=((R=x==null?void 0:x[e])==null?void 0:R[h])||d,E=p.useMemo(()=>w,Object.values(w));return o.jsx(C.Provider,{value:E,children:b})};m.displayName=l+"Provider";function g(v,x){var C;const b=((C=x==null?void 0:x[e])==null?void 0:C[h])||d,w=p.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[m,g]}const s=()=>{const l=n.map(c=>p.createContext(c));return function(d){const h=(d==null?void 0:d[e])||l;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return s.scopeName=e,[r,S7(s,...t)]}function S7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=r.reduce((d,{useScope:h,scopeName:m})=>{const v=h(l)[`__scope${m}`];return{...d,...v}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var br=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},C7=fj[" useId ".trim().toString()]||(()=>{}),w7=0;function Nn(e){const[t,n]=p.useState(C7());return br(()=>{n(r=>r??String(w7++))},[e]),e||(t?`radix-${t}`:"")}var E7=fj[" useInsertionEffect ".trim().toString()]||br;function zr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,c]=R7({defaultProp:t,onChange:n}),d=e!==void 0,h=d?e:s;{const g=p.useRef(e!==void 0);p.useEffect(()=>{const v=g.current;v!==d&&console.warn(`${r} is changing from ${v?"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.`),g.current=d},[d,r])}const m=p.useCallback(g=>{var v;if(d){const x=T7(g)?g(e):g;x!==e&&((v=c.current)==null||v.call(c,x))}else l(g)},[d,e,l,c]);return[h,m]}function R7({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),l=p.useRef(t);return E7(()=>{l.current=t},[t]),p.useEffect(()=>{var c;s.current!==n&&((c=l.current)==null||c.call(l,n),s.current=n)},[n,s]),[n,r,l]}function T7(e){return typeof e=="function"}function ds(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function j7(e,t=globalThis==null?void 0:globalThis.document){const n=ds(e);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var _7="DismissableLayer",f0="dismissableLayer.update",N7="dismissableLayer.pointerDownOutside",A7="dismissableLayer.focusOutside",tR,f_=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),zl=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...h}=e,m=p.useContext(f_),[g,v]=p.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),w=vt(t,A=>v(A)),C=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=C.indexOf(E),T=g?C.indexOf(g):-1,j=m.layersWithOutsidePointerEventsDisabled.size>0,O=T>=R,D=M7(A=>{const M=A.target,U=[...m.branches].some(B=>B.contains(M));!O||U||(s==null||s(A),c==null||c(A),A.defaultPrevented||d==null||d())},x),_=k7(A=>{const M=A.target;[...m.branches].some(B=>B.contains(M))||(l==null||l(A),c==null||c(A),A.defaultPrevented||d==null||d())},x);return j7(A=>{T===m.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&d&&(A.preventDefault(),d()))},x),p.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(tR=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),nR(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=tR)}},[g,x,n,m]),p.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),nR())},[g,m]),p.useEffect(()=>{const A=()=>b({});return document.addEventListener(f0,A),()=>document.removeEventListener(f0,A)},[]),o.jsx(Ke.div,{...h,ref:w,style:{pointerEvents:j?O?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,D.onPointerDownCapture)})});zl.displayName=_7;var D7="DismissableLayerBranch",O7=p.forwardRef((e,t)=>{const n=p.useContext(f_),r=p.useRef(null),s=vt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),o.jsx(Ke.div,{...e,ref:s})});O7.displayName=D7;function M7(e,t=globalThis==null?void 0:globalThis.document){const n=ds(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let h=function(){h_(N7,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function k7(e,t=globalThis==null?void 0:globalThis.document){const n=ds(e),r=p.useRef(!1);return p.useEffect(()=>{const s=l=>{l.target&&!r.current&&h_(A7,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nR(){const e=new CustomEvent(f0);document.dispatchEvent(e)}function h_(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?c_(s,l):s.dispatchEvent(l)}var dx="focusScope.autoFocusOnMount",fx="focusScope.autoFocusOnUnmount",rR={bubbles:!1,cancelable:!0},I7="FocusScope",wf=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[d,h]=p.useState(null),m=ds(s),g=ds(l),v=p.useRef(null),x=vt(t,C=>h(C)),b=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let C=function(j){if(b.paused||!d)return;const O=j.target;d.contains(O)?v.current=O:ci(v.current,{select:!0})},E=function(j){if(b.paused||!d)return;const O=j.relatedTarget;O!==null&&(d.contains(O)||ci(v.current,{select:!0}))},R=function(j){if(document.activeElement===document.body)for(const D of j)D.removedNodes.length>0&&ci(d)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),T.disconnect()}}},[r,d,b.paused]),p.useEffect(()=>{if(d){sR.add(b);const C=document.activeElement;if(!d.contains(C)){const R=new CustomEvent(dx,rR);d.addEventListener(dx,m),d.dispatchEvent(R),R.defaultPrevented||(L7(V7(m_(d)),{select:!0}),document.activeElement===C&&ci(d))}return()=>{d.removeEventListener(dx,m),setTimeout(()=>{const R=new CustomEvent(fx,rR);d.addEventListener(fx,g),d.dispatchEvent(R),R.defaultPrevented||ci(C??document.body,{select:!0}),d.removeEventListener(fx,g),sR.remove(b)},0)}}},[d,m,g,b]);const w=p.useCallback(C=>{if(!n&&!r||b.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,R=document.activeElement;if(E&&R){const T=C.currentTarget,[j,O]=P7(T);j&&O?!C.shiftKey&&R===O?(C.preventDefault(),n&&ci(j,{select:!0})):C.shiftKey&&R===j&&(C.preventDefault(),n&&ci(O,{select:!0})):R===T&&C.preventDefault()}},[n,r,b.paused]);return o.jsx(Ke.div,{tabIndex:-1,...c,ref:x,onKeyDown:w})});wf.displayName=I7;function L7(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ci(r,{select:t}),document.activeElement!==n)return}function P7(e){const t=m_(e),n=aR(t,e),r=aR(t.reverse(),e);return[n,r]}function m_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function aR(e,t){for(const n of e)if(!U7(n,{upTo:t}))return n}function U7(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 F7(e){return e instanceof HTMLInputElement&&"select"in e}function ci(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&F7(e)&&t&&e.select()}}var sR=z7();function z7(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=oR(e,t),e.unshift(t)},remove(t){var n;e=oR(e,t),(n=e[0])==null||n.resume()}}}function oR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function V7(e){return e.filter(t=>t.tagName!=="A")}var H7="Portal",Vl=p.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[s,l]=p.useState(!1);br(()=>l(!0),[]);const c=n||s&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?CI.createPortal(o.jsx(Ke.div,{...r,ref:t}),c):null});Vl.displayName=H7;function $7(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Sr=e=>{const{present:t,children:n}=e,r=B7(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),l=vt(r.ref,G7(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:l}):null};Sr.displayName="Presence";function B7(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),l=p.useRef("none"),c=e?"mounted":"unmounted",[d,h]=$7(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const m=pm(r.current);l.current=d==="mounted"?m:"none"},[d]),br(()=>{const m=r.current,g=s.current;if(g!==e){const x=l.current,b=pm(m);e?h("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?h("UNMOUNT"):h(g&&x!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),br(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,v=b=>{const C=pm(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&C&&(h("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},x=b=>{b.target===t&&(l.current=pm(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:p.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function pm(e){return(e==null?void 0:e.animationName)||"none"}function G7(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var hx=0;function Gp(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iR()),document.body.insertAdjacentElement("beforeend",e[1]??iR()),hx++,()=>{hx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hx--}},[])}function iR(){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 Ds=function(){return Ds=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Ds.apply(this,arguments)};function p_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function q7(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var Fm="right-scroll-bar-position",zm="width-before-scroll-bar",Z7="with-scroll-bars-hidden",K7="--removed-body-scroll-bar-size";function mx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Y7(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var W7=typeof window<"u"?p.useLayoutEffect:p.useEffect,lR=new WeakMap;function Q7(e,t){var n=Y7(null,function(r){return e.forEach(function(s){return mx(s,r)})});return W7(function(){var r=lR.get(n);if(r){var s=new Set(r),l=new Set(e),c=n.current;s.forEach(function(d){l.has(d)||mx(d,null)}),l.forEach(function(d){s.has(d)||mx(d,c)})}lR.set(n,e)},[e]),n}function X7(e){return e}function J7(e,t){t===void 0&&(t=X7);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var h=function(){var g=c;c=[],g.forEach(l)},m=function(){return Promise.resolve().then(h)};m(),n={push:function(g){c.push(g),m()},filter:function(g){return c=c.filter(g),n}}}};return s}function eP(e){e===void 0&&(e={});var t=J7(null);return t.options=Ds({async:!0,ssr:!1},e),t}var g_=function(e){var t=e.sideCar,n=p_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Ds({},n))};g_.isSideCarExport=!0;function tP(e,t){return e.useMedium(t),g_}var v_=eP(),px=function(){},qp=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:px,onWheelCapture:px,onTouchMoveCapture:px}),s=r[0],l=r[1],c=e.forwardProps,d=e.children,h=e.className,m=e.removeScrollBar,g=e.enabled,v=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,C=e.inert,E=e.allowPinchZoom,R=e.as,T=R===void 0?"div":R,j=e.gapMode,O=p_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=x,_=Q7([n,t]),A=Ds(Ds({},O),s);return p.createElement(p.Fragment,null,g&&p.createElement(D,{sideCar:v_,removeScrollBar:m,shards:v,noRelative:b,noIsolation:w,inert:C,setCallbacks:l,allowPinchZoom:!!E,lockRef:n,gapMode:j}),c?p.cloneElement(p.Children.only(d),Ds(Ds({},A),{ref:_})):p.createElement(T,Ds({},A,{className:h,ref:_}),d))});qp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};qp.classNames={fullWidth:zm,zeroRight:Fm};var nP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nP();return t&&e.setAttribute("nonce",t),e}function aP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var oP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rP())&&(aP(t,n),sP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iP=function(){var e=oP();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},y_=function(){var e=iP(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},lP={left:0,top:0,right:0,gap:0},gx=function(e){return parseInt(e||"",10)||0},cP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[gx(n),gx(r),gx(s)]},uP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lP;var t=cP(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dP=y_(),Wc="data-scroll-locked",fP=function(e,t,n,r){var s=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
457
|
-
.`.concat(Z7,` {
|
|
458
|
-
overflow: hidden `).concat(r,`;
|
|
459
|
-
padding-right: `).concat(d,"px ").concat(r,`;
|
|
460
|
-
}
|
|
461
|
-
body[`).concat(Wc,`] {
|
|
462
|
-
overflow: hidden `).concat(r,`;
|
|
463
|
-
overscroll-behavior: contain;
|
|
464
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
465
|
-
padding-left: `.concat(s,`px;
|
|
466
|
-
padding-top: `).concat(l,`px;
|
|
467
|
-
padding-right: `).concat(c,`px;
|
|
468
|
-
margin-left:0;
|
|
469
|
-
margin-top:0;
|
|
470
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
471
|
-
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
.`).concat(Fm,` {
|
|
475
|
-
right: `).concat(d,"px ").concat(r,`;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
.`).concat(zm,` {
|
|
479
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
.`).concat(Fm," .").concat(Fm,` {
|
|
483
|
-
right: 0 `).concat(r,`;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.`).concat(zm," .").concat(zm,` {
|
|
487
|
-
margin-right: 0 `).concat(r,`;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
body[`).concat(Wc,`] {
|
|
491
|
-
`).concat(K7,": ").concat(d,`px;
|
|
492
|
-
}
|
|
493
|
-
`)},cR=function(){var e=parseInt(document.body.getAttribute(Wc)||"0",10);return isFinite(e)?e:0},hP=function(){p.useEffect(function(){return document.body.setAttribute(Wc,(cR()+1).toString()),function(){var e=cR()-1;e<=0?document.body.removeAttribute(Wc):document.body.setAttribute(Wc,e.toString())}},[])},mP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;hP();var l=p.useMemo(function(){return uP(s)},[s]);return p.createElement(dP,{styles:fP(l,!t,s,n?"":"!important")})},h0=!1;if(typeof window<"u")try{var gm=Object.defineProperty({},"passive",{get:function(){return h0=!0,!0}});window.addEventListener("test",gm,gm),window.removeEventListener("test",gm,gm)}catch{h0=!1}var Oc=h0?{passive:!1}:!1,pP=function(e){return e.tagName==="TEXTAREA"},x_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pP(e)&&n[t]==="visible")},gP=function(e){return x_(e,"overflowY")},vP=function(e){return x_(e,"overflowX")},uR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=b_(e,r);if(s){var l=S_(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},xP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},b_=function(e,t){return e==="v"?gP(t):vP(t)},S_=function(e,t){return e==="v"?yP(t):xP(t)},bP=function(e,t){return e==="h"&&t==="rtl"?-1:1},SP=function(e,t,n,r,s){var l=bP(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,h=t.contains(d),m=!1,g=c>0,v=0,x=0;do{if(!d)break;var b=S_(e,d),w=b[0],C=b[1],E=b[2],R=C-E-l*w;(w||R)&&b_(e,d)&&(v+=R,x+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&d!==document.body||h&&(t.contains(d)||t===d));return(g&&Math.abs(v)<1||!g&&Math.abs(x)<1)&&(m=!0),m},vm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dR=function(e){return[e.deltaX,e.deltaY]},fR=function(e){return e&&"current"in e?e.current:e},CP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},wP=function(e){return`
|
|
494
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
495
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
496
|
-
`)},EP=0,Mc=[];function RP(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(EP++)[0],l=p.useState(y_)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=q7([e.lockRef.current],(e.shards||[]).map(fR),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var R=vm(C),T=n.current,j="deltaX"in C?C.deltaX:T[0]-R[0],O="deltaY"in C?C.deltaY:T[1]-R[1],D,_=C.target,A=Math.abs(j)>Math.abs(O)?"h":"v";if("touches"in C&&A==="h"&&_.type==="range")return!1;var M=uR(A,_);if(!M)return!0;if(M?D=A:(D=A==="v"?"h":"v",M=uR(A,_)),!M)return!1;if(!r.current&&"changedTouches"in C&&(j||O)&&(r.current=D),!D)return!0;var U=r.current||D;return SP(U,E,C,U==="h"?j:O)},[]),h=p.useCallback(function(C){var E=C;if(!(!Mc.length||Mc[Mc.length-1]!==l)){var R="deltaY"in E?dR(E):vm(E),T=t.current.filter(function(D){return D.name===E.type&&(D.target===E.target||E.target===D.shadowParent)&&CP(D.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var j=(c.current.shards||[]).map(fR).filter(Boolean).filter(function(D){return D.contains(E.target)}),O=j.length>0?d(E,j[0]):!c.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),m=p.useCallback(function(C,E,R,T){var j={name:C,delta:E,target:R,should:T,shadowParent:TP(R)};t.current.push(j),setTimeout(function(){t.current=t.current.filter(function(O){return O!==j})},1)},[]),g=p.useCallback(function(C){n.current=vm(C),r.current=void 0},[]),v=p.useCallback(function(C){m(C.type,dR(C),C.target,d(C,e.lockRef.current))},[]),x=p.useCallback(function(C){m(C.type,vm(C),C.target,d(C,e.lockRef.current))},[]);p.useEffect(function(){return Mc.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",h,Oc),document.addEventListener("touchmove",h,Oc),document.addEventListener("touchstart",g,Oc),function(){Mc=Mc.filter(function(C){return C!==l}),document.removeEventListener("wheel",h,Oc),document.removeEventListener("touchmove",h,Oc),document.removeEventListener("touchstart",g,Oc)}},[]);var b=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(l,{styles:wP(s)}):null,b?p.createElement(mP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function TP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jP=tP(v_,RP);var Ef=p.forwardRef(function(e,t){return p.createElement(qp,Ds({},e,{ref:t,sideCar:jP}))});Ef.classNames=qp.classNames;var _P=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},kc=new WeakMap,ym=new WeakMap,xm={},vx=0,C_=function(e){return e&&(e.host||C_(e.parentNode))},NP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=C_(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},AP=function(e,t,n,r){var s=NP(t,Array.isArray(e)?e:[e]);xm[n]||(xm[n]=new WeakMap);var l=xm[n],c=[],d=new Set,h=new Set(s),m=function(v){!v||d.has(v)||(d.add(v),m(v.parentNode))};s.forEach(m);var g=function(v){!v||h.has(v)||Array.prototype.forEach.call(v.children,function(x){if(d.has(x))g(x);else try{var b=x.getAttribute(r),w=b!==null&&b!=="false",C=(kc.get(x)||0)+1,E=(l.get(x)||0)+1;kc.set(x,C),l.set(x,E),c.push(x),C===1&&w&&ym.set(x,!0),E===1&&x.setAttribute(n,"true"),w||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return g(t),d.clear(),vx++,function(){c.forEach(function(v){var x=kc.get(v)-1,b=l.get(v)-1;kc.set(v,x),l.set(v,b),x||(ym.has(v)||v.removeAttribute(r),ym.delete(v)),b||v.removeAttribute(n)}),vx--,vx||(kc=new WeakMap,kc=new WeakMap,ym=new WeakMap,xm={})}},Zp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=_P(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),AP(r,s,n,"aria-hidden")):function(){return null}},Kp="Dialog",[w_,E_]=kr(Kp),[DP,vs]=w_(Kp),R_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=p.useRef(null),h=p.useRef(null),[m,g]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:Kp});return o.jsx(DP,{scope:t,triggerRef:d,contentRef:h,contentId:Nn(),titleId:Nn(),descriptionId:Nn(),open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(v=>!v),[g]),modal:c,children:n})};R_.displayName=Kp;var T_="DialogTrigger",j_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(T_,n),l=vt(t,s.triggerRef);return o.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Nb(s.open),...r,ref:l,onClick:Te(e.onClick,s.onOpenToggle)})});j_.displayName=T_;var jb="DialogPortal",[OP,__]=w_(jb,{forceMount:void 0}),N_=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=vs(jb,t);return o.jsx(OP,{scope:t,forceMount:n,children:p.Children.map(r,c=>o.jsx(Sr,{present:n||l.open,children:o.jsx(Vl,{asChild:!0,container:s,children:c})}))})};N_.displayName=jb;var ep="DialogOverlay",A_=p.forwardRef((e,t)=>{const n=__(ep,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=vs(ep,e.__scopeDialog);return l.modal?o.jsx(Sr,{present:r||l.open,children:o.jsx(kP,{...s,ref:t})}):null});A_.displayName=ep;var MP=Ri("DialogOverlay.RemoveScroll"),kP=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(ep,n);return o.jsx(Ef,{as:MP,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(Ke.div,{"data-state":Nb(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),jl="DialogContent",D_=p.forwardRef((e,t)=>{const n=__(jl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=vs(jl,e.__scopeDialog);return o.jsx(Sr,{present:r||l.open,children:l.modal?o.jsx(IP,{...s,ref:t}):o.jsx(LP,{...s,ref:t})})});D_.displayName=jl;var IP=p.forwardRef((e,t)=>{const n=vs(jl,e.__scopeDialog),r=p.useRef(null),s=vt(t,n.contentRef,r);return p.useEffect(()=>{const l=r.current;if(l)return Zp(l)},[]),o.jsx(O_,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault())})}),LP=p.forwardRef((e,t)=>{const n=vs(jl,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(O_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),O_=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,d=vs(jl,n),h=p.useRef(null),m=vt(t,h);return Gp(),o.jsxs(o.Fragment,{children:[o.jsx(wf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(zl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Nb(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(UP,{titleId:d.titleId}),o.jsx(zP,{contentRef:h,descriptionId:d.descriptionId})]})]})}),_b="DialogTitle",M_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(_b,n);return o.jsx(Ke.h2,{id:s.titleId,...r,ref:t})});M_.displayName=_b;var k_="DialogDescription",I_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(k_,n);return o.jsx(Ke.p,{id:s.descriptionId,...r,ref:t})});I_.displayName=k_;var L_="DialogClose",P_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(L_,n);return o.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});P_.displayName=L_;function Nb(e){return e?"open":"closed"}var U_="DialogTitleWarning",[PP,F_]=b7(U_,{contentName:jl,titleName:_b,docsSlug:"dialog"}),UP=({titleId:e})=>{const t=F_(U_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
497
|
-
|
|
498
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
499
|
-
|
|
500
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},FP="DialogDescriptionWarning",zP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${F_(FP).contentName}}.`;return p.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Yp=R_,VP=j_,Wp=N_,Qp=A_,Xp=D_,Ab=M_,Db=I_,Jp=P_;function Mi({...e}){return o.jsx(Yp,{"data-slot":"sheet",...e})}function HP({...e}){return o.jsx(Wp,{"data-slot":"sheet-portal",...e})}function $P({className:e,...t}){return o.jsx(Qp,{"data-slot":"sheet-overlay",className:J("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function ki({className:e,children:t,side:n="right",...r}){return o.jsxs(HP,{children:[o.jsx($P,{}),o.jsxs(Xp,{"data-slot":"sheet-content",className:J("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-0 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full min-w-[100%] border-l sm:max-w-sm sm:min-w-[600px]",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[100%] border-r sm:max-w-sm sm:min-w-[600px]",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,o.jsxs(Jp,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(su,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ii({className:e,...t}){return o.jsx("div",{"data-slot":"sheet-header",className:J("flex flex-col gap-1 border-b p-4",e),...t})}function Li({className:e,...t}){return o.jsx(Ab,{"data-slot":"sheet-title",className:J("text-foreground font-semibold",e),...t})}function Hl({className:e,...t}){return o.jsx(Db,{"data-slot":"sheet-description",className:J("text-muted-foreground text-sm",e),...t})}function as({className:e,...t}){return o.jsx("div",{"data-slot":"skeleton",className:J("bg-accent animate-pulse rounded-md",e),...t})}const BP=["top","right","bottom","left"],Ti=Math.min,fa=Math.max,tp=Math.round,bm=Math.floor,Ls=e=>({x:e,y:e}),GP={left:"right",right:"left",bottom:"top",top:"bottom"},qP={start:"end",end:"start"};function m0(e,t,n){return fa(e,Ti(t,n))}function Ao(e,t){return typeof e=="function"?e(t):e}function Do(e){return e.split("-")[0]}function xu(e){return e.split("-")[1]}function Ob(e){return e==="x"?"y":"x"}function Mb(e){return e==="y"?"height":"width"}const ZP=new Set(["top","bottom"]);function Os(e){return ZP.has(Do(e))?"y":"x"}function kb(e){return Ob(Os(e))}function KP(e,t,n){n===void 0&&(n=!1);const r=xu(e),s=kb(e),l=Mb(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=np(c)),[c,np(c)]}function YP(e){const t=np(e);return[p0(e),t,p0(t)]}function p0(e){return e.replace(/start|end/g,t=>qP[t])}const hR=["left","right"],mR=["right","left"],WP=["top","bottom"],QP=["bottom","top"];function XP(e,t,n){switch(e){case"top":case"bottom":return n?t?mR:hR:t?hR:mR;case"left":case"right":return t?WP:QP;default:return[]}}function JP(e,t,n,r){const s=xu(e);let l=XP(Do(e),n==="start",r);return s&&(l=l.map(c=>c+"-"+s),t&&(l=l.concat(l.map(p0)))),l}function np(e){return e.replace(/left|right|bottom|top/g,t=>GP[t])}function eU(e){return{top:0,right:0,bottom:0,left:0,...e}}function z_(e){return typeof e!="number"?eU(e):{top:e,right:e,bottom:e,left:e}}function rp(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function pR(e,t,n){let{reference:r,floating:s}=e;const l=Os(t),c=kb(t),d=Mb(c),h=Do(t),m=l==="y",g=r.x+r.width/2-s.width/2,v=r.y+r.height/2-s.height/2,x=r[d]/2-s[d]/2;let b;switch(h){case"top":b={x:g,y:r.y-s.height};break;case"bottom":b={x:g,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:v};break;case"left":b={x:r.x-s.width,y:v};break;default:b={x:r.x,y:r.y}}switch(xu(t)){case"start":b[c]-=x*(n&&m?-1:1);break;case"end":b[c]+=x*(n&&m?-1:1);break}return b}const tU=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:v}=pR(m,r,h),x=r,b={},w=0;for(let C=0;C<d.length;C++){const{name:E,fn:R}=d[C],{x:T,y:j,data:O,reset:D}=await R({x:g,y:v,initialPlacement:r,placement:x,strategy:s,middlewareData:b,rects:m,platform:c,elements:{reference:e,floating:t}});g=T??g,v=j??v,b={...b,[E]:{...b[E],...O}},D&&w<=50&&(w++,typeof D=="object"&&(D.placement&&(x=D.placement),D.rects&&(m=D.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):D.rects),{x:g,y:v}=pR(m,x,h)),C=-1)}return{x:g,y:v,placement:x,strategy:s,middlewareData:b}};async function rf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:c,elements:d,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:x=!1,padding:b=0}=Ao(t,e),w=z_(b),E=d[x?v==="floating"?"reference":"floating":v],R=rp(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(E)))==null||n?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:g,strategy:h})),T=v==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,j=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(j))?await(l.getScale==null?void 0:l.getScale(j))||{x:1,y:1}:{x:1,y:1},D=rp(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:j,strategy:h}):T);return{top:(R.top-D.top+w.top)/O.y,bottom:(D.bottom-R.bottom+w.bottom)/O.y,left:(R.left-D.left+w.left)/O.x,right:(D.right-R.right+w.right)/O.x}}const nU=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:c,elements:d,middlewareData:h}=t,{element:m,padding:g=0}=Ao(e,t)||{};if(m==null)return{};const v=z_(g),x={x:n,y:r},b=kb(s),w=Mb(b),C=await c.getDimensions(m),E=b==="y",R=E?"top":"left",T=E?"bottom":"right",j=E?"clientHeight":"clientWidth",O=l.reference[w]+l.reference[b]-x[b]-l.floating[w],D=x[b]-l.reference[b],_=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let A=_?_[j]:0;(!A||!await(c.isElement==null?void 0:c.isElement(_)))&&(A=d.floating[j]||l.floating[w]);const M=O/2-D/2,U=A/2-C[w]/2-1,B=Ti(v[R],U),G=Ti(v[T],U),K=B,re=A-C[w]-G,H=A/2-C[w]/2+M,$=m0(K,H,re),I=!h.arrow&&xu(s)!=null&&H!==$&&l.reference[w]/2-(H<K?B:G)-C[w]/2<0,Y=I?H<K?H-K:H-re:0;return{[b]:x[b]+Y,data:{[b]:$,centerOffset:H-$-Y,...I&&{alignmentOffset:Y}},reset:I}}}),rU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:c,initialPlacement:d,platform:h,elements:m}=t,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...E}=Ao(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const R=Do(s),T=Os(d),j=Do(d)===d,O=await(h.isRTL==null?void 0:h.isRTL(m.floating)),D=x||(j||!C?[np(d)]:YP(d)),_=w!=="none";!x&&_&&D.push(...JP(d,C,w,O));const A=[d,...D],M=await rf(t,E),U=[];let B=((r=l.flip)==null?void 0:r.overflows)||[];if(g&&U.push(M[R]),v){const H=KP(s,c,O);U.push(M[H[0]],M[H[1]])}if(B=[...B,{placement:s,overflows:U}],!U.every(H=>H<=0)){var G,K;const H=(((G=l.flip)==null?void 0:G.index)||0)+1,$=A[H];if($&&(!(v==="alignment"?T!==Os($):!1)||B.every(Z=>Os(Z.placement)===T?Z.overflows[0]>0:!0)))return{data:{index:H,overflows:B},reset:{placement:$}};let I=(K=B.filter(Y=>Y.overflows[0]<=0).sort((Y,Z)=>Y.overflows[1]-Z.overflows[1])[0])==null?void 0:K.placement;if(!I)switch(b){case"bestFit":{var re;const Y=(re=B.filter(Z=>{if(_){const ie=Os(Z.placement);return ie===T||ie==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(ie=>ie>0).reduce((ie,be)=>ie+be,0)]).sort((Z,ie)=>Z[1]-ie[1])[0])==null?void 0:re[0];Y&&(I=Y);break}case"initialPlacement":I=d;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function gR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vR(e){return BP.some(t=>e[t]>=0)}const aU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Ao(e,t);switch(r){case"referenceHidden":{const l=await rf(t,{...s,elementContext:"reference"}),c=gR(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:vR(c)}}}case"escaped":{const l=await rf(t,{...s,altBoundary:!0}),c=gR(l,n.floating);return{data:{escapedOffsets:c,escaped:vR(c)}}}default:return{}}}}},V_=new Set(["left","top"]);async function sU(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=Do(n),d=xu(n),h=Os(n)==="y",m=V_.has(c)?-1:1,g=l&&h?-1:1,v=Ao(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:w}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),h?{x:b*g,y:x*m}:{x:x*m,y:b*g}}const oU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:c,middlewareData:d}=t,h=await sU(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:c}}}}},iU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:E=>{let{x:R,y:T}=E;return{x:R,y:T}}},...h}=Ao(e,t),m={x:n,y:r},g=await rf(t,h),v=Os(Do(s)),x=Ob(v);let b=m[x],w=m[v];if(l){const E=x==="y"?"top":"left",R=x==="y"?"bottom":"right",T=b+g[E],j=b-g[R];b=m0(T,b,j)}if(c){const E=v==="y"?"top":"left",R=v==="y"?"bottom":"right",T=w+g[E],j=w-g[R];w=m0(T,w,j)}const C=d.fn({...t,[x]:b,[v]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:l,[v]:c}}}}}},lU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:h=!0,crossAxis:m=!0}=Ao(e,t),g={x:n,y:r},v=Os(s),x=Ob(v);let b=g[x],w=g[v];const C=Ao(d,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(h){const j=x==="y"?"height":"width",O=l.reference[x]-l.floating[j]+E.mainAxis,D=l.reference[x]+l.reference[j]-E.mainAxis;b<O?b=O:b>D&&(b=D)}if(m){var R,T;const j=x==="y"?"width":"height",O=V_.has(Do(s)),D=l.reference[v]-l.floating[j]+(O&&((R=c.offset)==null?void 0:R[v])||0)+(O?0:E.crossAxis),_=l.reference[v]+l.reference[j]+(O?0:((T=c.offset)==null?void 0:T[v])||0)-(O?E.crossAxis:0);w<D?w=D:w>_&&(w=_)}return{[x]:b,[v]:w}}}},cU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:c,elements:d}=t,{apply:h=()=>{},...m}=Ao(e,t),g=await rf(t,m),v=Do(s),x=xu(s),b=Os(s)==="y",{width:w,height:C}=l.floating;let E,R;v==="top"||v==="bottom"?(E=v,R=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=v,E=x==="end"?"top":"bottom");const T=C-g.top-g.bottom,j=w-g.left-g.right,O=Ti(C-g[E],T),D=Ti(w-g[R],j),_=!t.middlewareData.shift;let A=O,M=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=T),_&&!x){const B=fa(g.left,0),G=fa(g.right,0),K=fa(g.top,0),re=fa(g.bottom,0);b?M=w-2*(B!==0||G!==0?B+G:fa(g.left,g.right)):A=C-2*(K!==0||re!==0?K+re:fa(g.top,g.bottom))}await h({...t,availableWidth:M,availableHeight:A});const U=await c.getDimensions(d.floating);return w!==U.width||C!==U.height?{reset:{rects:!0}}:{}}}};function eg(){return typeof window<"u"}function bu(e){return H_(e)?(e.nodeName||"").toLowerCase():"#document"}function pa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bs(e){var t;return(t=(H_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function H_(e){return eg()?e instanceof Node||e instanceof pa(e).Node:!1}function fs(e){return eg()?e instanceof Element||e instanceof pa(e).Element:!1}function Fs(e){return eg()?e instanceof HTMLElement||e instanceof pa(e).HTMLElement:!1}function yR(e){return!eg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pa(e).ShadowRoot}const uU=new Set(["inline","contents"]);function Rf(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=hs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!uU.has(s)}const dU=new Set(["table","td","th"]);function fU(e){return dU.has(bu(e))}const hU=[":popover-open",":modal"];function tg(e){return hU.some(t=>{try{return e.matches(t)}catch{return!1}})}const mU=["transform","translate","scale","rotate","perspective"],pU=["transform","translate","scale","rotate","perspective","filter"],gU=["paint","layout","strict","content"];function Ib(e){const t=Lb(),n=fs(e)?hs(e):e;return mU.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||pU.some(r=>(n.willChange||"").includes(r))||gU.some(r=>(n.contain||"").includes(r))}function vU(e){let t=ji(e);for(;Fs(t)&&!ou(t);){if(Ib(t))return t;if(tg(t))return null;t=ji(t)}return null}function Lb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yU=new Set(["html","body","#document"]);function ou(e){return yU.has(bu(e))}function hs(e){return pa(e).getComputedStyle(e)}function ng(e){return fs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ji(e){if(bu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yR(e)&&e.host||Bs(e);return yR(t)?t.host:t}function $_(e){const t=ji(e);return ou(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fs(t)&&Rf(t)?t:$_(t)}function af(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=$_(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),c=pa(s);if(l){const d=g0(c);return t.concat(c,c.visualViewport||[],Rf(s)?s:[],d&&n?af(d):[])}return t.concat(s,af(s,[],n))}function g0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function B_(e){const t=hs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Fs(e),l=s?e.offsetWidth:n,c=s?e.offsetHeight:r,d=tp(n)!==l||tp(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function Pb(e){return fs(e)?e:e.contextElement}function Qc(e){const t=Pb(e);if(!Fs(t))return Ls(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=B_(t);let c=(l?tp(n.width):n.width)/r,d=(l?tp(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const xU=Ls(0);function G_(e){const t=pa(e);return!Lb()||!t.visualViewport?xU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pa(e)?!1:t}function _l(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=Pb(e);let c=Ls(1);t&&(r?fs(r)&&(c=Qc(r)):c=Qc(e));const d=bU(l,n,r)?G_(l):Ls(0);let h=(s.left+d.x)/c.x,m=(s.top+d.y)/c.y,g=s.width/c.x,v=s.height/c.y;if(l){const x=pa(l),b=r&&fs(r)?pa(r):r;let w=x,C=g0(w);for(;C&&r&&b!==w;){const E=Qc(C),R=C.getBoundingClientRect(),T=hs(C),j=R.left+(C.clientLeft+parseFloat(T.paddingLeft))*E.x,O=R.top+(C.clientTop+parseFloat(T.paddingTop))*E.y;h*=E.x,m*=E.y,g*=E.x,v*=E.y,h+=j,m+=O,w=pa(C),C=g0(w)}}return rp({width:g,height:v,x:h,y:m})}function rg(e,t){const n=ng(e).scrollLeft;return t?t.left+n:_l(Bs(e)).left+n}function q_(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rg(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function SU(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",c=Bs(r),d=t?tg(t.floating):!1;if(r===c||d&&l)return n;let h={scrollLeft:0,scrollTop:0},m=Ls(1);const g=Ls(0),v=Fs(r);if((v||!v&&!l)&&((bu(r)!=="body"||Rf(c))&&(h=ng(r)),Fs(r))){const b=_l(r);m=Qc(r),g.x=b.x+r.clientLeft,g.y=b.y+r.clientTop}const x=c&&!v&&!l?q_(c,h):Ls(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-h.scrollLeft*m.x+g.x+x.x,y:n.y*m.y-h.scrollTop*m.y+g.y+x.y}}function CU(e){return Array.from(e.getClientRects())}function wU(e){const t=Bs(e),n=ng(e),r=e.ownerDocument.body,s=fa(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=fa(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+rg(e);const d=-n.scrollTop;return hs(r).direction==="rtl"&&(c+=fa(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:c,y:d}}const xR=25;function EU(e,t){const n=pa(e),r=Bs(e),s=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,h=0;if(s){l=s.width,c=s.height;const g=Lb();(!g||g&&t==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}const m=rg(r);if(m<=0){const g=r.ownerDocument,v=g.body,x=getComputedStyle(v),b=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(r.clientWidth-v.clientWidth-b);w<=xR&&(l-=w)}else m<=xR&&(l+=m);return{width:l,height:c,x:d,y:h}}const RU=new Set(["absolute","fixed"]);function TU(e,t){const n=_l(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=Fs(e)?Qc(e):Ls(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,h=s*l.x,m=r*l.y;return{width:c,height:d,x:h,y:m}}function bR(e,t,n){let r;if(t==="viewport")r=EU(e,n);else if(t==="document")r=wU(Bs(e));else if(fs(t))r=TU(t,n);else{const s=G_(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return rp(r)}function Z_(e,t){const n=ji(e);return n===t||!fs(n)||ou(n)?!1:hs(n).position==="fixed"||Z_(n,t)}function jU(e,t){const n=t.get(e);if(n)return n;let r=af(e,[],!1).filter(d=>fs(d)&&bu(d)!=="body"),s=null;const l=hs(e).position==="fixed";let c=l?ji(e):e;for(;fs(c)&&!ou(c);){const d=hs(c),h=Ib(c);!h&&d.position==="fixed"&&(s=null),(l?!h&&!s:!h&&d.position==="static"&&!!s&&RU.has(s.position)||Rf(c)&&!h&&Z_(e,c))?r=r.filter(g=>g!==c):s=d,c=ji(c)}return t.set(e,r),r}function _U(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?tg(t)?[]:jU(t,this._c):[].concat(n),r],d=c[0],h=c.reduce((m,g)=>{const v=bR(t,g,s);return m.top=fa(v.top,m.top),m.right=Ti(v.right,m.right),m.bottom=Ti(v.bottom,m.bottom),m.left=fa(v.left,m.left),m},bR(t,d,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function NU(e){const{width:t,height:n}=B_(e);return{width:t,height:n}}function AU(e,t,n){const r=Fs(t),s=Bs(t),l=n==="fixed",c=_l(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const h=Ls(0);function m(){h.x=rg(s)}if(r||!r&&!l)if((bu(t)!=="body"||Rf(s))&&(d=ng(t)),r){const b=_l(t,!0,l,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else s&&m();l&&!r&&s&&m();const g=s&&!r&&!l?q_(s,d):Ls(0),v=c.left+d.scrollLeft-h.x-g.x,x=c.top+d.scrollTop-h.y-g.y;return{x:v,y:x,width:c.width,height:c.height}}function yx(e){return hs(e).position==="static"}function SR(e,t){if(!Fs(e)||hs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bs(e)===n&&(n=n.ownerDocument.body),n}function K_(e,t){const n=pa(e);if(tg(e))return n;if(!Fs(e)){let s=ji(e);for(;s&&!ou(s);){if(fs(s)&&!yx(s))return s;s=ji(s)}return n}let r=SR(e,t);for(;r&&fU(r)&&yx(r);)r=SR(r,t);return r&&ou(r)&&yx(r)&&!Ib(r)?n:r||vU(e)||n}const DU=async function(e){const t=this.getOffsetParent||K_,n=this.getDimensions,r=await n(e.floating);return{reference:AU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OU(e){return hs(e).direction==="rtl"}const MU={convertOffsetParentRelativeRectToViewportRelativeRect:SU,getDocumentElement:Bs,getClippingRect:_U,getOffsetParent:K_,getElementRects:DU,getClientRects:CU,getDimensions:NU,getScale:Qc,isElement:fs,isRTL:OU};function Y_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kU(e,t){let n=null,r;const s=Bs(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),l();const m=e.getBoundingClientRect(),{left:g,top:v,width:x,height:b}=m;if(d||t(),!x||!b)return;const w=bm(v),C=bm(s.clientWidth-(g+x)),E=bm(s.clientHeight-(v+b)),R=bm(g),j={rootMargin:-w+"px "+-C+"px "+-E+"px "+-R+"px",threshold:fa(0,Ti(1,h))||1};let O=!0;function D(_){const A=_[0].intersectionRatio;if(A!==h){if(!O)return c();A?c(!1,A):r=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!Y_(m,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(D,{...j,root:s.ownerDocument})}catch{n=new IntersectionObserver(D,j)}n.observe(e)}return c(!0),l}function IU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,m=Pb(e),g=s||l?[...m?af(m):[],...af(t)]:[];g.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),l&&R.addEventListener("resize",n)});const v=m&&d?kU(m,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(R=>{let[T]=R;T&&T.target===m&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var j;(j=b)==null||j.observe(t)})),n()}),m&&!h&&b.observe(m),b.observe(t));let w,C=h?_l(e):null;h&&E();function E(){const R=_l(e);C&&!Y_(C,R)&&n(),C=R,w=requestAnimationFrame(E)}return n(),()=>{var R;g.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),v==null||v(),(R=b)==null||R.disconnect(),b=null,h&&cancelAnimationFrame(w)}}const LU=oU,PU=iU,UU=rU,FU=cU,zU=aU,CR=nU,VU=lU,HU=(e,t,n)=>{const r=new Map,s={platform:MU,...n},l={...s.platform,_c:r};return tU(e,t,{...s,platform:l})};var $U=typeof document<"u",BU=function(){},Vm=$U?p.useLayoutEffect:BU;function ap(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ap(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!ap(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function W_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wR(e,t){const n=W_(e);return Math.round(t*n)/n}function xx(e){const t=p.useRef(e);return Vm(()=>{t.current=e}),t}function GU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:h,open:m}=e,[g,v]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=p.useState(r);ap(x,r)||b(r);const[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useCallback(Z=>{Z!==_.current&&(_.current=Z,C(Z))},[]),j=p.useCallback(Z=>{Z!==A.current&&(A.current=Z,R(Z))},[]),O=l||w,D=c||E,_=p.useRef(null),A=p.useRef(null),M=p.useRef(g),U=h!=null,B=xx(h),G=xx(s),K=xx(m),re=p.useCallback(()=>{if(!_.current||!A.current)return;const Z={placement:t,strategy:n,middleware:x};G.current&&(Z.platform=G.current),HU(_.current,A.current,Z).then(ie=>{const be={...ie,isPositioned:K.current!==!1};H.current&&!ap(M.current,be)&&(M.current=be,is.flushSync(()=>{v(be)}))})},[x,t,n,G,K]);Vm(()=>{m===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,v(Z=>({...Z,isPositioned:!1})))},[m]);const H=p.useRef(!1);Vm(()=>(H.current=!0,()=>{H.current=!1}),[]),Vm(()=>{if(O&&(_.current=O),D&&(A.current=D),O&&D){if(B.current)return B.current(O,D,re);re()}},[O,D,re,B,U]);const $=p.useMemo(()=>({reference:_,floating:A,setReference:T,setFloating:j}),[T,j]),I=p.useMemo(()=>({reference:O,floating:D}),[O,D]),Y=p.useMemo(()=>{const Z={position:n,left:0,top:0};if(!I.floating)return Z;const ie=wR(I.floating,g.x),be=wR(I.floating,g.y);return d?{...Z,transform:"translate("+ie+"px, "+be+"px)",...W_(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:be}},[n,d,I.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:re,refs:$,elements:I,floatingStyles:Y}),[g,re,$,I,Y])}const qU=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?CR({element:r.current,padding:s}).fn(n):{}:r?CR({element:r,padding:s}).fn(n):{}}}},ZU=(e,t)=>({...LU(e),options:[e,t]}),KU=(e,t)=>({...PU(e),options:[e,t]}),YU=(e,t)=>({...VU(e),options:[e,t]}),WU=(e,t)=>({...UU(e),options:[e,t]}),QU=(e,t)=>({...FU(e),options:[e,t]}),XU=(e,t)=>({...zU(e),options:[e,t]}),JU=(e,t)=>({...qU(e),options:[e,t]});var eF="Arrow",Q_=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return o.jsx(Ke.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});Q_.displayName=eF;var tF=Q_;function Ub(e){const[t,n]=p.useState(void 0);return br(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,d;if("borderBoxSize"in l){const h=l.borderBoxSize,m=Array.isArray(h)?h[0]:h;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Fb="Popper",[X_,Gs]=kr(Fb),[nF,J_]=X_(Fb),eN=e=>{const{__scopePopper:t,children:n}=e,[r,s]=p.useState(null);return o.jsx(nF,{scope:t,anchor:r,onAnchorChange:s,children:n})};eN.displayName=Fb;var tN="PopperAnchor",nN=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=J_(tN,n),c=p.useRef(null),d=vt(t,c),h=p.useRef(null);return p.useEffect(()=>{const m=h.current;h.current=(r==null?void 0:r.current)||c.current,m!==h.current&&l.onAnchorChange(h.current)}),r?null:o.jsx(Ke.div,{...s,ref:d})});nN.displayName=tN;var zb="PopperContent",[rF,aF]=X_(zb),rN=p.forwardRef((e,t)=>{var ue,Ne,Re,xe,et,Xe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:w,...C}=e,E=J_(zb,n),[R,T]=p.useState(null),j=vt(t,Bt=>T(Bt)),[O,D]=p.useState(null),_=Ub(O),A=(_==null?void 0:_.width)??0,M=(_==null?void 0:_.height)??0,U=r+(l!=="center"?"-"+l:""),B=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},G=Array.isArray(m)?m:[m],K=G.length>0,re={padding:B,boundary:G.filter(oF),altBoundary:K},{refs:H,floatingStyles:$,placement:I,isPositioned:Y,middlewareData:Z}=GU({strategy:"fixed",placement:U,whileElementsMounted:(...Bt)=>IU(...Bt,{animationFrame:b==="always"}),elements:{reference:E.anchor},middleware:[ZU({mainAxis:s+M,alignmentAxis:c}),h&&KU({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?YU():void 0,...re}),h&&WU({...re}),QU({...re,apply:({elements:Bt,rects:ft,availableWidth:gn,availableHeight:Ie})=>{const{width:wt,height:Ot}=ft.reference,tn=Bt.floating.style;tn.setProperty("--radix-popper-available-width",`${gn}px`),tn.setProperty("--radix-popper-available-height",`${Ie}px`),tn.setProperty("--radix-popper-anchor-width",`${wt}px`),tn.setProperty("--radix-popper-anchor-height",`${Ot}px`)}}),O&&JU({element:O,padding:d}),iF({arrowWidth:A,arrowHeight:M}),x&&XU({strategy:"referenceHidden",...re})]}),[ie,be]=oN(I),L=ds(w);br(()=>{Y&&(L==null||L())},[Y,L]);const P=(ue=Z.arrow)==null?void 0:ue.x,W=(Ne=Z.arrow)==null?void 0:Ne.y,ae=((Re=Z.arrow)==null?void 0:Re.centerOffset)!==0,[fe,ge]=p.useState();return br(()=>{R&&ge(window.getComputedStyle(R).zIndex)},[R]),o.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:Y?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(xe=Z.transformOrigin)==null?void 0:xe.x,(et=Z.transformOrigin)==null?void 0:et.y].join(" "),...((Xe=Z.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(rF,{scope:n,placedSide:ie,onArrowChange:D,arrowX:P,arrowY:W,shouldHideArrow:ae,children:o.jsx(Ke.div,{"data-side":ie,"data-align":be,...C,ref:j,style:{...C.style,animation:Y?void 0:"none"}})})})});rN.displayName=zb;var aN="PopperArrow",sF={top:"bottom",right:"left",bottom:"top",left:"right"},sN=p.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=aF(aN,r),c=sF[l.placedSide];return o.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:o.jsx(tF,{...s,ref:n,style:{...s.style,display:"block"}})})});sN.displayName=aN;function oF(e){return e!==null}var iF=e=>({name:"transformOrigin",options:e,fn(t){var E,R,T;const{placement:n,rects:r,middlewareData:s}=t,c=((E=s.arrow)==null?void 0:E.centerOffset)!==0,d=c?0:e.arrowWidth,h=c?0:e.arrowHeight,[m,g]=oN(n),v={start:"0%",center:"50%",end:"100%"}[g],x=(((R=s.arrow)==null?void 0:R.x)??0)+d/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+h/2;let w="",C="";return m==="bottom"?(w=c?v:`${x}px`,C=`${-h}px`):m==="top"?(w=c?v:`${x}px`,C=`${r.floating.height+h}px`):m==="right"?(w=`${-h}px`,C=c?v:`${b}px`):m==="left"&&(w=`${r.floating.width+h}px`,C=c?v:`${b}px`),{data:{x:w,y:C}}}});function oN(e){const[t,n="center"]=e.split("-");return[t,n]}var Su=eN,Cu=nN,Tf=rN,jf=sN,iN=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"}),lF="VisuallyHidden",lN=p.forwardRef((e,t)=>o.jsx(Ke.span,{...e,ref:t,style:{...iN,...e.style}}));lN.displayName=lF;var cF=lN,[ag]=kr("Tooltip",[Gs]),sg=Gs(),cN="TooltipProvider",uF=700,v0="tooltip.open",[dF,Vb]=ag(cN),uN=e=>{const{__scopeTooltip:t,delayDuration:n=uF,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,c=p.useRef(!0),d=p.useRef(!1),h=p.useRef(0);return p.useEffect(()=>{const m=h.current;return()=>window.clearTimeout(m)},[]),o.jsx(dF,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(h.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};uN.displayName=cN;var sf="Tooltip",[fF,_f]=ag(sf),dN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,h=Vb(sf,e.__scopeTooltip),m=sg(t),[g,v]=p.useState(null),x=Nn(),b=p.useRef(0),w=c??h.disableHoverableContent,C=d??h.delayDuration,E=p.useRef(!1),[R,T]=zr({prop:r,defaultProp:s??!1,onChange:A=>{A?(h.onOpen(),document.dispatchEvent(new CustomEvent(v0))):h.onClose(),l==null||l(A)},caller:sf}),j=p.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,T(!0)},[T]),D=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),_=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,T(!0),b.current=0},C)},[C,T]);return p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),o.jsx(Su,{...m,children:o.jsx(fF,{scope:t,contentId:x,open:R,stateAttribute:j,trigger:g,onTriggerChange:v,onTriggerEnter:p.useCallback(()=>{h.isOpenDelayedRef.current?_():O()},[h.isOpenDelayedRef,_,O]),onTriggerLeave:p.useCallback(()=>{w?D():(window.clearTimeout(b.current),b.current=0)},[D,w]),onOpen:O,onClose:D,disableHoverableContent:w,children:n})})};dN.displayName=sf;var y0="TooltipTrigger",fN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=_f(y0,n),l=Vb(y0,n),c=sg(n),d=p.useRef(null),h=vt(t,d,s.onTriggerChange),m=p.useRef(!1),g=p.useRef(!1),v=p.useCallback(()=>m.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(Cu,{asChild:!0,...c,children:o.jsx(Ke.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Te(e.onPointerMove,x=>{x.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Te(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});fN.displayName=y0;var Hb="TooltipPortal",[hF,mF]=ag(Hb,{forceMount:void 0}),hN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=_f(Hb,t);return o.jsx(hF,{scope:t,forceMount:n,children:o.jsx(Sr,{present:n||l.open,children:o.jsx(Vl,{asChild:!0,container:s,children:r})})})};hN.displayName=Hb;var iu="TooltipContent",mN=p.forwardRef((e,t)=>{const n=mF(iu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,c=_f(iu,e.__scopeTooltip);return o.jsx(Sr,{present:r||c.open,children:c.disableHoverableContent?o.jsx(pN,{side:s,...l,ref:t}):o.jsx(pF,{side:s,...l,ref:t})})}),pF=p.forwardRef((e,t)=>{const n=_f(iu,e.__scopeTooltip),r=Vb(iu,e.__scopeTooltip),s=p.useRef(null),l=vt(t,s),[c,d]=p.useState(null),{trigger:h,onClose:m}=n,g=s.current,{onPointerInTransitChange:v}=r,x=p.useCallback(()=>{d(null),v(!1)},[v]),b=p.useCallback((w,C)=>{const E=w.currentTarget,R={x:w.clientX,y:w.clientY},T=xF(R,E.getBoundingClientRect()),j=bF(R,T),O=SF(C.getBoundingClientRect()),D=wF([...j,...O]);d(D),v(!0)},[v]);return p.useEffect(()=>()=>x(),[x]),p.useEffect(()=>{if(h&&g){const w=E=>b(E,g),C=E=>b(E,h);return h.addEventListener("pointerleave",w),g.addEventListener("pointerleave",C),()=>{h.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",C)}}},[h,g,b,x]),p.useEffect(()=>{if(c){const w=C=>{const E=C.target,R={x:C.clientX,y:C.clientY},T=(h==null?void 0:h.contains(E))||(g==null?void 0:g.contains(E)),j=!CF(R,c);T?x():j&&(x(),m())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[h,g,c,m,x]),o.jsx(pN,{...e,ref:l})}),[gF,vF]=ag(sf,{isInside:!1}),yF=Hj("TooltipContent"),pN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,h=_f(iu,n),m=sg(n),{onClose:g}=h;return p.useEffect(()=>(document.addEventListener(v0,g),()=>document.removeEventListener(v0,g)),[g]),p.useEffect(()=>{if(h.trigger){const v=x=>{const b=x.target;b!=null&&b.contains(h.trigger)&&g()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[h.trigger,g]),o.jsx(zl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:g,children:o.jsxs(Tf,{"data-state":h.stateAttribute,...m,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(yF,{children:r}),o.jsx(gF,{scope:n,isInside:!0,children:o.jsx(cF,{id:h.contentId,role:"tooltip",children:s||r})})]})})});mN.displayName=iu;var gN="TooltipArrow",vN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=sg(n);return vF(gN,n).isInside?null:o.jsx(jf,{...s,...r,ref:t})});vN.displayName=gN;function xF(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function bF(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function SF(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function CF(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],h=t[c],m=d.x,g=d.y,v=h.x,x=h.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function wF(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),EF(t)}function EF(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var RF=uN,TF=dN,jF=fN,_F=hN,NF=mN,AF=vN;function ls({delayDuration:e=0,...t}){return o.jsx(RF,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Tt({...e}){return o.jsx(ls,{children:o.jsx(TF,{"data-slot":"tooltip",...e})})}function jt({...e}){return o.jsx(jF,{"data-slot":"tooltip-trigger",...e})}function _t({className:e,sideOffset:t=0,children:n,...r}){return o.jsx(_F,{children:o.jsxs(NF,{"data-slot":"tooltip-content",sideOffset:t,className:J("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-md bg-black px-3 py-1.5 text-xs text-balance text-white dark:bg-white dark:text-black",e),...r,children:[n,o.jsx(AF,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-black fill-black dark:bg-white dark:fill-white"})]})})}const DF="sidebar_state",OF=3600*24*7,MF="16rem",kF="18rem",IF="3rem",LF="b",yN=p.createContext(null);function Nf(){const e=p.useContext(yN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function PF({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:l,...c}){const d=kL(),[h,m]=p.useState(!1),[g,v]=p.useState(e),x=t??g,b=p.useCallback(R=>{const T=typeof R=="function"?R(x):R;n?n(T):v(T),document.cookie=`${DF}=${T}; path=/; max-age=${OF}`},[n,x]),w=p.useCallback(()=>d?m(R=>!R):b(R=>!R),[d,b,m]);p.useEffect(()=>{const R=T=>{T.key===LF&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const C=x?"expanded":"collapsed",E=p.useMemo(()=>({state:C,open:x,setOpen:b,isMobile:d,openMobile:h,setOpenMobile:m,toggleSidebar:w}),[C,x,b,d,h,m,w]);return o.jsx(yN.Provider,{value:E,children:o.jsx(ls,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":MF,"--sidebar-width-icon":IF,...s},className:J("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:l})})})}function UF({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...l}){const{isMobile:c,state:d,openMobile:h,setOpenMobile:m}=Nf();return n==="none"?o.jsx("div",{"data-slot":"sidebar",className:J("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:s}):c?o.jsx(Mi,{open:h,onOpenChange:m,...l,children:o.jsxs(ki,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) min-w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":kF},side:e,children:[o.jsxs(Ii,{className:"sr-only",children:[o.jsx(Li,{children:"Sidebar"}),o.jsx(Hl,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):o.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[o.jsx("div",{"data-slot":"sidebar-gap",className:J("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{"data-slot":"sidebar-container",className:J("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function FF({className:e,onClick:t,...n}){const{toggleSidebar:r}=Nf();return o.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:o.jsxs(Ce,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:J("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[o.jsx(K9,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function zF({className:e,...t}){const{toggleSidebar:n}=Nf();return o.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:J("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function VF({className:e,...t}){return o.jsx("main",{"data-slot":"sidebar-inset",className:J("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function HF({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:J("flex flex-col gap-2 p-2",e),...t})}function $F({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:J("flex flex-col gap-2 p-2",e),...t})}function BF({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:J("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function ER({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:J("relative flex w-full min-w-0 flex-col p-2",e),...t})}function RR({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:J("w-full text-sm",e),...t})}function GF({className:e,...t}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:J("flex w-full min-w-0 flex-col gap-1",e),...t})}function qF({className:e,...t}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:J("group/menu-item relative",e),...t})}const ZF=bf("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function KF({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:l,...c}){const d=e?Hp:"button",{isMobile:h,state:m}=Nf(),g=o.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:J(ZF({variant:n,size:r}),l),...c});return s?(typeof s=="string"&&(s={children:s}),o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:g}),o.jsx(_t,{side:"right",align:"center",hidden:m!=="collapsed"||h,...s})]})):g}function og(e){const t=e+"CollectionProvider",[n,r]=kr(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,T=je.useRef(null),j=je.useRef(new Map).current;return o.jsx(s,{scope:E,itemMap:j,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",h=Ri(d),m=je.forwardRef((C,E)=>{const{scope:R,children:T}=C,j=l(d,R),O=vt(E,j.collectionRef);return o.jsx(h,{ref:O,children:T})});m.displayName=d;const g=e+"CollectionItemSlot",v="data-radix-collection-item",x=Ri(g),b=je.forwardRef((C,E)=>{const{scope:R,children:T,...j}=C,O=je.useRef(null),D=vt(E,O),_=l(g,R);return je.useEffect(()=>(_.itemMap.set(O,{ref:O,...j}),()=>void _.itemMap.delete(O))),o.jsx(x,{[v]:"",ref:D,children:T})});b.displayName=g;function w(C){const E=l(e+"CollectionConsumer",C);return je.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const j=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((_,A)=>j.indexOf(_.ref.current)-j.indexOf(A.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},w,r]}var YF=p.createContext(void 0);function Af(e){const t=p.useContext(YF);return e||t||"ltr"}var bx="rovingFocusGroup.onEntryFocus",WF={bubbles:!1,cancelable:!0},Df="RovingFocusGroup",[x0,xN,QF]=og(Df),[XF,ig]=kr(Df,[QF]),[JF,ez]=XF(Df),bN=p.forwardRef((e,t)=>o.jsx(x0.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(x0.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(tz,{...e,ref:t})})}));bN.displayName=Df;var tz=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...v}=e,x=p.useRef(null),b=vt(t,x),w=Af(l),[C,E]=zr({prop:c,defaultProp:d??null,onChange:h,caller:Df}),[R,T]=p.useState(!1),j=ds(m),O=xN(n),D=p.useRef(!1),[_,A]=p.useState(0);return p.useEffect(()=>{const M=x.current;if(M)return M.addEventListener(bx,j),()=>M.removeEventListener(bx,j)},[j]),o.jsx(JF,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:C,onItemFocus:p.useCallback(M=>E(M),[E]),onItemShiftTab:p.useCallback(()=>T(!0),[]),onFocusableItemAdd:p.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:p.useCallback(()=>A(M=>M-1),[]),children:o.jsx(Ke.div,{tabIndex:R||_===0?-1:0,"data-orientation":r,...v,ref:b,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{D.current=!0}),onFocus:Te(e.onFocus,M=>{const U=!D.current;if(M.target===M.currentTarget&&U&&!R){const B=new CustomEvent(bx,WF);if(M.currentTarget.dispatchEvent(B),!B.defaultPrevented){const G=O().filter(I=>I.focusable),K=G.find(I=>I.active),re=G.find(I=>I.id===C),$=[K,re,...G].filter(Boolean).map(I=>I.ref.current);wN($,g)}}D.current=!1}),onBlur:Te(e.onBlur,()=>T(!1))})})}),SN="RovingFocusGroupItem",CN=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:c,...d}=e,h=Nn(),m=l||h,g=ez(SN,n),v=g.currentTabStopId===m,x=xN(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:C}=g;return p.useEffect(()=>{if(r)return b(),()=>w()},[r,b,w]),o.jsx(x0.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:o.jsx(Ke.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,E=>{r?g.onItemFocus(m):E.preventDefault()}),onFocus:Te(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:Te(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=az(E,g.orientation,g.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let j=x().filter(O=>O.focusable).map(O=>O.ref.current);if(R==="last")j.reverse();else if(R==="prev"||R==="next"){R==="prev"&&j.reverse();const O=j.indexOf(E.currentTarget);j=g.loop?sz(j,O+1):j.slice(O+1)}setTimeout(()=>wN(j))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:C!=null}):c})})});CN.displayName=SN;var nz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function rz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function az(e,t,n){const r=rz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return nz[r]}function wN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function sz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var EN=bN,RN=CN,b0=["Enter"," "],oz=["ArrowDown","PageUp","Home"],TN=["ArrowUp","PageDown","End"],iz=[...oz,...TN],lz={ltr:[...b0,"ArrowRight"],rtl:[...b0,"ArrowLeft"]},cz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Of="Menu",[of,uz,dz]=og(Of),[$l,jN]=kr(Of,[dz,Gs,ig]),Mf=Gs(),_N=ig(),[NN,Pi]=$l(Of),[fz,kf]=$l(Of),AN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:c=!0}=e,d=Mf(t),[h,m]=p.useState(null),g=p.useRef(!1),v=ds(l),x=Af(s);return p.useEffect(()=>{const b=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),o.jsx(Su,{...d,children:o.jsx(NN,{scope:t,open:n,onOpenChange:v,content:h,onContentChange:m,children:o.jsx(fz,{scope:t,onClose:p.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:g,dir:x,modal:c,children:r})})})};AN.displayName=Of;var hz="MenuAnchor",$b=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Mf(n);return o.jsx(Cu,{...s,...r,ref:t})});$b.displayName=hz;var Bb="MenuPortal",[mz,DN]=$l(Bb,{forceMount:void 0}),ON=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=Pi(Bb,t);return o.jsx(mz,{scope:t,forceMount:n,children:o.jsx(Sr,{present:n||l.open,children:o.jsx(Vl,{asChild:!0,container:s,children:r})})})};ON.displayName=Bb;var Ha="MenuContent",[pz,Gb]=$l(Ha),MN=p.forwardRef((e,t)=>{const n=DN(Ha,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Pi(Ha,e.__scopeMenu),c=kf(Ha,e.__scopeMenu);return o.jsx(of.Provider,{scope:e.__scopeMenu,children:o.jsx(Sr,{present:r||l.open,children:o.jsx(of.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(gz,{...s,ref:t}):o.jsx(vz,{...s,ref:t})})})})}),gz=p.forwardRef((e,t)=>{const n=Pi(Ha,e.__scopeMenu),r=p.useRef(null),s=vt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return Zp(l)},[]),o.jsx(qb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vz=p.forwardRef((e,t)=>{const n=Pi(Ha,e.__scopeMenu);return o.jsx(qb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yz=Ri("MenuContent.ScrollLock"),qb=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,disableOutsideScroll:w,...C}=e,E=Pi(Ha,n),R=kf(Ha,n),T=Mf(n),j=_N(n),O=uz(n),[D,_]=p.useState(null),A=p.useRef(null),M=vt(t,A,E.onContentChange),U=p.useRef(0),B=p.useRef(""),G=p.useRef(0),K=p.useRef(null),re=p.useRef("right"),H=p.useRef(0),$=w?Ef:p.Fragment,I=w?{as:yz,allowPinchZoom:!0}:void 0,Y=ie=>{var ue,Ne;const be=B.current+ie,L=O().filter(Re=>!Re.disabled),P=document.activeElement,W=(ue=L.find(Re=>Re.ref.current===P))==null?void 0:ue.textValue,ae=L.map(Re=>Re.textValue),fe=Az(ae,be,W),ge=(Ne=L.find(Re=>Re.textValue===fe))==null?void 0:Ne.ref.current;(function Re(xe){B.current=xe,window.clearTimeout(U.current),xe!==""&&(U.current=window.setTimeout(()=>Re(""),1e3))})(be),ge&&setTimeout(()=>ge.focus())};p.useEffect(()=>()=>window.clearTimeout(U.current),[]),Gp();const Z=p.useCallback(ie=>{var L,P;return re.current===((L=K.current)==null?void 0:L.side)&&Oz(ie,(P=K.current)==null?void 0:P.area)},[]);return o.jsx(pz,{scope:n,searchRef:B,onItemEnter:p.useCallback(ie=>{Z(ie)&&ie.preventDefault()},[Z]),onItemLeave:p.useCallback(ie=>{var be;Z(ie)||((be=A.current)==null||be.focus(),_(null))},[Z]),onTriggerLeave:p.useCallback(ie=>{Z(ie)&&ie.preventDefault()},[Z]),pointerGraceTimerRef:G,onPointerGraceIntentChange:p.useCallback(ie=>{K.current=ie},[]),children:o.jsx($,{...I,children:o.jsx(wf,{asChild:!0,trapped:s,onMountAutoFocus:Te(l,ie=>{var be;ie.preventDefault(),(be=A.current)==null||be.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx(zl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,children:o.jsx(EN,{asChild:!0,...j,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:D,onCurrentTabStopIdChange:_,onEntryFocus:Te(h,ie=>{R.isUsingKeyboardRef.current||ie.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Tf,{role:"menu","aria-orientation":"vertical","data-state":WN(E.open),"data-radix-menu-content":"",dir:R.dir,...T,...C,ref:M,style:{outline:"none",...C.style},onKeyDown:Te(C.onKeyDown,ie=>{const L=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,P=ie.ctrlKey||ie.altKey||ie.metaKey,W=ie.key.length===1;L&&(ie.key==="Tab"&&ie.preventDefault(),!P&&W&&Y(ie.key));const ae=A.current;if(ie.target!==ae||!iz.includes(ie.key))return;ie.preventDefault();const ge=O().filter(ue=>!ue.disabled).map(ue=>ue.ref.current);TN.includes(ie.key)&&ge.reverse(),_z(ge)}),onBlur:Te(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(U.current),B.current="")}),onPointerMove:Te(e.onPointerMove,lf(ie=>{const be=ie.target,L=H.current!==ie.clientX;if(ie.currentTarget.contains(be)&&L){const P=ie.clientX>H.current?"right":"left";re.current=P,H.current=ie.clientX}}))})})})})})})});MN.displayName=Ha;var xz="MenuGroup",Zb=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ke.div,{role:"group",...r,ref:t})});Zb.displayName=xz;var bz="MenuLabel",kN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ke.div,{...r,ref:t})});kN.displayName=bz;var sp="MenuItem",TR="menu.itemSelect",lg=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=p.useRef(null),c=kf(sp,e.__scopeMenu),d=Gb(sp,e.__scopeMenu),h=vt(t,l),m=p.useRef(!1),g=()=>{const v=l.current;if(!n&&v){const x=new CustomEvent(TR,{bubbles:!0,cancelable:!0});v.addEventListener(TR,b=>r==null?void 0:r(b),{once:!0}),c_(v,x),x.defaultPrevented?m.current=!1:c.onClose()}};return o.jsx(IN,{...s,ref:h,disabled:n,onClick:Te(e.onClick,g),onPointerDown:v=>{var x;(x=e.onPointerDown)==null||x.call(e,v),m.current=!0},onPointerUp:Te(e.onPointerUp,v=>{var x;m.current||(x=v.currentTarget)==null||x.click()}),onKeyDown:Te(e.onKeyDown,v=>{const x=d.searchRef.current!=="";n||x&&v.key===" "||b0.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});lg.displayName=sp;var IN=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,c=Gb(sp,n),d=_N(n),h=p.useRef(null),m=vt(t,h),[g,v]=p.useState(!1),[x,b]=p.useState("");return p.useEffect(()=>{const w=h.current;w&&b((w.textContent??"").trim())},[l.children]),o.jsx(of.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:o.jsx(RN,{asChild:!0,...d,focusable:!r,children:o.jsx(Ke.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:m,onPointerMove:Te(e.onPointerMove,lf(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,lf(w=>c.onItemLeave(w))),onFocus:Te(e.onFocus,()=>v(!0)),onBlur:Te(e.onBlur,()=>v(!1))})})})}),Sz="MenuCheckboxItem",LN=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsx(VN,{scope:e.__scopeMenu,checked:n,children:o.jsx(lg,{role:"menuitemcheckbox","aria-checked":op(n)?"mixed":n,...s,ref:t,"data-state":Wb(n),onSelect:Te(s.onSelect,()=>r==null?void 0:r(op(n)?!0:!n),{checkForDefaultPrevented:!1})})})});LN.displayName=Sz;var PN="MenuRadioGroup",[Cz,wz]=$l(PN,{value:void 0,onValueChange:()=>{}}),UN=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=ds(r);return o.jsx(Cz,{scope:e.__scopeMenu,value:n,onValueChange:l,children:o.jsx(Zb,{...s,ref:t})})});UN.displayName=PN;var FN="MenuRadioItem",zN=p.forwardRef((e,t)=>{const{value:n,...r}=e,s=wz(FN,e.__scopeMenu),l=n===s.value;return o.jsx(VN,{scope:e.__scopeMenu,checked:l,children:o.jsx(lg,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":Wb(l),onSelect:Te(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});zN.displayName=FN;var Kb="MenuItemIndicator",[VN,Ez]=$l(Kb,{checked:!1}),HN=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=Ez(Kb,n);return o.jsx(Sr,{present:r||op(l.checked)||l.checked===!0,children:o.jsx(Ke.span,{...s,ref:t,"data-state":Wb(l.checked)})})});HN.displayName=Kb;var Rz="MenuSeparator",$N=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});$N.displayName=Rz;var Tz="MenuArrow",BN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Mf(n);return o.jsx(jf,{...s,...r,ref:t})});BN.displayName=Tz;var Yb="MenuSub",[jz,GN]=$l(Yb),qN=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,l=Pi(Yb,t),c=Mf(t),[d,h]=p.useState(null),[m,g]=p.useState(null),v=ds(s);return p.useEffect(()=>(l.open===!1&&v(!1),()=>v(!1)),[l.open,v]),o.jsx(Su,{...c,children:o.jsx(NN,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:g,children:o.jsx(jz,{scope:t,contentId:Nn(),triggerId:Nn(),trigger:d,onTriggerChange:h,children:n})})})};qN.displayName=Yb;var Fd="MenuSubTrigger",ZN=p.forwardRef((e,t)=>{const n=Pi(Fd,e.__scopeMenu),r=kf(Fd,e.__scopeMenu),s=GN(Fd,e.__scopeMenu),l=Gb(Fd,e.__scopeMenu),c=p.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:h}=l,m={__scopeMenu:e.__scopeMenu},g=p.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return p.useEffect(()=>g,[g]),p.useEffect(()=>{const v=d.current;return()=>{window.clearTimeout(v),h(null)}},[d,h]),o.jsx($b,{asChild:!0,...m,children:o.jsx(IN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":WN(n.open),...e,ref:No(t,s.onTriggerChange),onClick:v=>{var x;(x=e.onClick)==null||x.call(e,v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,lf(v=>{l.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Te(e.onPointerLeave,lf(v=>{var b,w;g();const x=(b=n.content)==null?void 0:b.getBoundingClientRect();if(x){const C=(w=n.content)==null?void 0:w.dataset.side,E=C==="right",R=E?-5:5,T=x[E?"left":"right"],j=x[E?"right":"left"];l.onPointerGraceIntentChange({area:[{x:v.clientX+R,y:v.clientY},{x:T,y:x.top},{x:j,y:x.top},{x:j,y:x.bottom},{x:T,y:x.bottom}],side:C}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(v),v.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,v=>{var b;const x=l.searchRef.current!=="";e.disabled||x&&v.key===" "||lz[r.dir].includes(v.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),v.preventDefault())})})})});ZN.displayName=Fd;var KN="MenuSubContent",YN=p.forwardRef((e,t)=>{const n=DN(Ha,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Pi(Ha,e.__scopeMenu),c=kf(Ha,e.__scopeMenu),d=GN(KN,e.__scopeMenu),h=p.useRef(null),m=vt(t,h);return o.jsx(of.Provider,{scope:e.__scopeMenu,children:o.jsx(Sr,{present:r||l.open,children:o.jsx(of.Slot,{scope:e.__scopeMenu,children:o.jsx(qb,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var v;c.isUsingKeyboardRef.current&&((v=h.current)==null||v.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Te(e.onFocusOutside,g=>{g.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:Te(e.onKeyDown,g=>{var b;const v=g.currentTarget.contains(g.target),x=cz[c.dir].includes(g.key);v&&x&&(l.onOpenChange(!1),(b=d.trigger)==null||b.focus(),g.preventDefault())})})})})})});YN.displayName=KN;function WN(e){return e?"open":"closed"}function op(e){return e==="indeterminate"}function Wb(e){return op(e)?"indeterminate":e?"checked":"unchecked"}function _z(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Nz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Az(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=Nz(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function Dz(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],h=t[c],m=d.x,g=d.y,v=h.x,x=h.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function Oz(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Dz(n,t)}function lf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Mz=AN,kz=$b,Iz=ON,Lz=MN,Pz=Zb,Uz=kN,Fz=lg,zz=LN,Vz=UN,Hz=zN,$z=HN,Bz=$N,Gz=BN,qz=qN,Zz=ZN,Kz=YN,cg="DropdownMenu",[Yz]=kr(cg,[jN]),Ir=jN(),[Wz,QN]=Yz(cg),XN=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,h=Ir(t),m=p.useRef(null),[g,v]=zr({prop:s,defaultProp:l??!1,onChange:c,caller:cg});return o.jsx(Wz,{scope:t,triggerId:Nn(),triggerRef:m,contentId:Nn(),open:g,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(x=>!x),[v]),modal:d,children:o.jsx(Mz,{...h,open:g,onOpenChange:v,dir:r,modal:d,children:n})})};XN.displayName=cg;var JN="DropdownMenuTrigger",eA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,l=QN(JN,n),c=Ir(n);return o.jsx(kz,{asChild:!0,...c,children:o.jsx(Ke.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:No(t,l.triggerRef),onPointerDown:Te(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:Te(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});eA.displayName=JN;var Qz="DropdownMenuPortal",tA=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ir(t);return o.jsx(Iz,{...r,...n})};tA.displayName=Qz;var nA="DropdownMenuContent",rA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=QN(nA,n),l=Ir(n),c=p.useRef(!1);return o.jsx(Lz,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{var h;c.current||(h=s.triggerRef.current)==null||h.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0,g=h.button===2||m;(!s.modal||g)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rA.displayName=nA;var Xz="DropdownMenuGroup",Jz=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Pz,{...s,...r,ref:t})});Jz.displayName=Xz;var eV="DropdownMenuLabel",tV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Uz,{...s,...r,ref:t})});tV.displayName=eV;var nV="DropdownMenuItem",aA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Fz,{...s,...r,ref:t})});aA.displayName=nV;var rV="DropdownMenuCheckboxItem",aV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(zz,{...s,...r,ref:t})});aV.displayName=rV;var sV="DropdownMenuRadioGroup",oV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Vz,{...s,...r,ref:t})});oV.displayName=sV;var iV="DropdownMenuRadioItem",lV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Hz,{...s,...r,ref:t})});lV.displayName=iV;var cV="DropdownMenuItemIndicator",uV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx($z,{...s,...r,ref:t})});uV.displayName=cV;var dV="DropdownMenuSeparator",sA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Bz,{...s,...r,ref:t})});sA.displayName=dV;var fV="DropdownMenuArrow",hV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Gz,{...s,...r,ref:t})});hV.displayName=fV;var mV=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:l}=e,c=Ir(t),[d,h]=zr({prop:r,defaultProp:l??!1,onChange:s,caller:"DropdownMenuSub"});return o.jsx(qz,{...c,open:d,onOpenChange:h,children:n})},pV="DropdownMenuSubTrigger",oA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Zz,{...s,...r,ref:t})});oA.displayName=pV;var gV="DropdownMenuSubContent",iA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Kz,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});iA.displayName=gV;var vV=XN,yV=eA,lA=tA,xV=rA,bV=aA,SV=sA,CV=mV,wV=oA,EV=iA;function Cr({...e}){return o.jsx(vV,{"data-slot":"dropdown-menu",...e})}function RV({...e}){return o.jsx(lA,{"data-slot":"dropdown-menu-portal",...e})}function wr({...e}){return o.jsx(yV,{"data-slot":"dropdown-menu-trigger",...e})}function Er({className:e,sideOffset:t=4,...n}){return o.jsx(lA,{children:o.jsx(xV,{"data-slot":"dropdown-menu-content",sideOffset:t,className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function bt({className:e,inset:t,variant:n="default",...r}){return o.jsx(bV,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Ga({className:e,...t}){return o.jsx(SV,{"data-slot":"dropdown-menu-separator",className:J("bg-border -mx-1 my-1 h-px",e),...t})}function Qb({...e}){return o.jsx(CV,{"data-slot":"dropdown-menu-sub",...e})}function Xb({className:e,inset:t,children:n,...r}){return o.jsxs(wV,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:J("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,o.jsx(Ra,{className:"ml-auto size-4"})]})}function Jb({className:e,...t}){return o.jsx(EV,{"data-slot":"dropdown-menu-sub-content",className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...t})}const TV="data:image/svg+xml,%3csvg%20width='45'%20height='36'%20viewBox='0%200%2045%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1026_9)'%3e%3cpath%20d='M41.0124%202.70808C42.5841%204.28086%2043.2307%206.93134%2043.2307%206.93134C43.2307%206.93134%2044.1924%2012.2686%2044.1924%2019.5152C44.1924%209.25778%2040.7126%207.4971%2028.6169%207.4971H17.4622C11.2702%207.4971%2011.689%2013.72%2011.2702%2016.6815L10.7614%2021.156C10.5171%2025.8635%2011.3345%2028.7805%2016.1644%2028.7805C6.09372%2028.7805%200.499987%2030.4294%200.5%2016.2326C0.499994%209.80708%201.46893%206.93134%201.46893%206.93134C1.46893%206.93134%202.11548%204.28086%203.69048%202.70808C5.26549%201.13349%207.5998%200.975453%207.5998%200.975453C7.5998%200.975453%2012.4195%200.25%2021.9403%200.25C31.4612%200.25%2036.84%200.975453%2036.84%200.975453C36.84%200.975453%2039.4359%201.13349%2041.0124%202.70808Z'%20fill='url(%23paint0_linear_1026_9)'/%3e%3cpath%20d='M44.1907%2019.8412C44.1913%2019.9695%2044.1916%2020.0989%2044.1916%2020.2295C44.1916%2026.3837%2043.2754%2028.779%2043.2754%2028.779C43.2754%2028.779%2042.5584%2031.6808%2041.3343%2032.9343C39.3918%2034.9233%2037.3144%2035.0343%2037.3144%2035.0343C37.3144%2035.0343%2032.8453%2035.75%2023.229%2035.75C14.0031%2035.75%207.85921%2035.0387%207.85921%2035.0387C7.85921%2035.0387%205.26504%2034.8795%203.69004%2033.3064C2.11504%2031.7307%201.46849%2028.779%201.46849%2028.779C1.46849%2028.779%200.5%2022.7163%200.5%2016.0794C0.499988%2028.8752%205.0442%2028.7984%2013.3149%2028.6587H13.3149C14.2204%2028.6434%2015.1706%2028.6273%2016.1644%2028.6273H27.318C32.2013%2028.6273%2033.3039%2025.0731%2033.5164%2021.0028L34.0267%2014.7934C34.1626%2012.2409%2033.8337%2010.4287%2033.0336%209.26241C32.1612%207.99016%2030.6747%207.3439%2028.6169%207.3439C41.4253%207.3439%2044.1022%209.05998%2044.1907%2019.8412Z'%20fill='url(%23paint1_linear_1026_9)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1026_9'%20x1='22.2878'%20y1='0.25'%20x2='22.4818'%20y2='30.5768'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2305D2FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.72248'%20stop-color='%231E6EE5'/%3e%3cstop%20offset='1'%20stop-color='%23182FFF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1026_9'%20x1='3.17783'%20y1='35.6937'%20x2='37.9386'%20y2='5.41095'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2324D8FF'/%3e%3cstop%20offset='0.156227'%20stop-color='%2321A1F1'/%3e%3cstop%20offset='0.407114'%20stop-color='%231E88E5'/%3e%3cstop%20offset='0.749106'%20stop-color='%231E7AE5'/%3e%3cstop%20offset='1'%20stop-color='%230046F9'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1026_9'%3e%3crect%20width='45'%20height='36'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",jV=({width:e=45,height:t=36,className:n=""})=>o.jsx("img",{src:TV,alt:"OWOX Logo",width:e,height:t,className:n}),cA=p.createContext(null),uA=p.createContext(()=>{});function _V(){return p.useContext(uA)}function ip(e){const t=p.useContext(cA);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function dA(){return ip(e=>e.project)}function e1(){const{data:e,callState:t,error:n}=ip(r=>r.flags);return{flags:e,callState:t,error:n}}function NV({isOpen:e}){const{title:t}=dA();return o.jsx(wr,{asChild:!0,children:o.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[o.jsx("div",{className:"text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:o.jsx(jV,{width:24,height:24})}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[o.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),o.jsx(Za,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var Or=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Or||{});function fA(e,t){return function(){return e.apply(t,arguments)}}const{toString:AV}=Object.prototype,{getPrototypeOf:t1}=Object,{iterator:ug,toStringTag:hA}=Symbol,dg=(e=>t=>{const n=AV.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ys=e=>(e=e.toLowerCase(),t=>dg(t)===e),fg=e=>t=>typeof t===e,{isArray:wu}=Array,lu=fg("undefined");function If(e){return e!==null&&!lu(e)&&e.constructor!==null&&!lu(e.constructor)&&Jr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const mA=ys("ArrayBuffer");function DV(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mA(e.buffer),t}const OV=fg("string"),Jr=fg("function"),pA=fg("number"),Lf=e=>e!==null&&typeof e=="object",MV=e=>e===!0||e===!1,Hm=e=>{if(dg(e)!=="object")return!1;const t=t1(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(hA in e)&&!(ug in e)},kV=e=>{if(!Lf(e)||If(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},IV=ys("Date"),LV=ys("File"),PV=ys("Blob"),UV=ys("FileList"),FV=e=>Lf(e)&&Jr(e.pipe),zV=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Jr(e.append)&&((t=dg(e))==="formdata"||t==="object"&&Jr(e.toString)&&e.toString()==="[object FormData]"))},VV=ys("URLSearchParams"),[HV,$V,BV,GV]=["ReadableStream","Request","Response","Headers"].map(ys),qV=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),wu(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(If(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;let d;for(r=0;r<c;r++)d=l[r],t.call(null,e[d],d,e)}}function gA(e,t){if(If(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const yl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vA=e=>!lu(e)&&e!==yl;function S0(){const{caseless:e,skipUndefined:t}=vA(this)&&this||{},n={},r=(s,l)=>{const c=e&&gA(n,l)||l;Hm(n[c])&&Hm(s)?n[c]=S0(n[c],s):Hm(s)?n[c]=S0({},s):wu(s)?n[c]=s.slice():(!t||!lu(s))&&(n[c]=s)};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&Pf(arguments[s],r);return n}const ZV=(e,t,n,{allOwnKeys:r}={})=>(Pf(t,(s,l)=>{n&&Jr(s)?e[l]=fA(s,n):e[l]=s},{allOwnKeys:r}),e),KV=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),YV=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},WV=(e,t,n,r)=>{let s,l,c;const d={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)c=s[l],(!r||r(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&t1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},QV=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},XV=e=>{if(!e)return null;if(wu(e))return e;let t=e.length;if(!pA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},JV=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&t1(Uint8Array)),eH=(e,t)=>{const r=(e&&e[ug]).call(e);let s;for(;(s=r.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},tH=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},nH=ys("HTMLFormElement"),rH=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),jR=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),aH=ys("RegExp"),yA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Pf(n,(s,l)=>{let c;(c=t(s,l,e))!==!1&&(r[l]=c||s)}),Object.defineProperties(e,r)},sH=e=>{yA(e,(t,n)=>{if(Jr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Jr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},oH=(e,t)=>{const n={},r=s=>{s.forEach(l=>{n[l]=!0})};return wu(e)?r(e):r(String(e).split(t)),n},iH=()=>{},lH=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function cH(e){return!!(e&&Jr(e.append)&&e[hA]==="FormData"&&e[ug])}const uH=e=>{const t=new Array(10),n=(r,s)=>{if(Lf(r)){if(t.indexOf(r)>=0)return;if(If(r))return r;if(!("toJSON"in r)){t[s]=r;const l=wu(r)?[]:{};return Pf(r,(c,d)=>{const h=n(c,s+1);!lu(h)&&(l[d]=h)}),t[s]=void 0,l}}return r};return n(e,0)},dH=ys("AsyncFunction"),fH=e=>e&&(Lf(e)||Jr(e))&&Jr(e.then)&&Jr(e.catch),xA=((e,t)=>e?setImmediate:t?((n,r)=>(yl.addEventListener("message",({source:s,data:l})=>{s===yl&&l===n&&r.length&&r.shift()()},!1),s=>{r.push(s),yl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Jr(yl.postMessage)),hH=typeof queueMicrotask<"u"?queueMicrotask.bind(yl):typeof process<"u"&&process.nextTick||xA,mH=e=>e!=null&&Jr(e[ug]),le={isArray:wu,isArrayBuffer:mA,isBuffer:If,isFormData:zV,isArrayBufferView:DV,isString:OV,isNumber:pA,isBoolean:MV,isObject:Lf,isPlainObject:Hm,isEmptyObject:kV,isReadableStream:HV,isRequest:$V,isResponse:BV,isHeaders:GV,isUndefined:lu,isDate:IV,isFile:LV,isBlob:PV,isRegExp:aH,isFunction:Jr,isStream:FV,isURLSearchParams:VV,isTypedArray:JV,isFileList:UV,forEach:Pf,merge:S0,extend:ZV,trim:qV,stripBOM:KV,inherits:YV,toFlatObject:WV,kindOf:dg,kindOfTest:ys,endsWith:QV,toArray:XV,forEachEntry:eH,matchAll:tH,isHTMLForm:nH,hasOwnProperty:jR,hasOwnProp:jR,reduceDescriptors:yA,freezeMethods:sH,toObjectSet:oH,toCamelCase:rH,noop:iH,toFiniteNumber:lH,findKey:gA,global:yl,isContextDefined:vA,isSpecCompliantForm:cH,toJSONObject:uH,isAsyncFn:dH,isThenable:fH,setImmediate:xA,asap:hH,isIterable:mH};function dt(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}le.inherits(dt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:le.toJSONObject(this.config),code:this.code,status:this.status}}});const bA=dt.prototype,SA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{SA[e]={value:e}});Object.defineProperties(dt,SA);Object.defineProperty(bA,"isAxiosError",{value:!0});dt.from=(e,t,n,r,s,l)=>{const c=Object.create(bA);le.toFlatObject(e,c,function(g){return g!==Error.prototype},m=>m!=="isAxiosError");const d=e&&e.message?e.message:"Error",h=t==null&&e?e.code:t;return dt.call(c,d,h,n,r,s),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",l&&Object.assign(c,l),c};const pH=null;function C0(e){return le.isPlainObject(e)||le.isArray(e)}function CA(e){return le.endsWith(e,"[]")?e.slice(0,-2):e}function _R(e,t,n){return e?e.concat(t).map(function(s,l){return s=CA(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function gH(e){return le.isArray(e)&&!e.some(C0)}const vH=le.toFlatObject(le,{},null,function(t){return/^is[A-Z]/.test(t)});function hg(e,t,n){if(!le.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=le.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,E){return!le.isUndefined(E[C])});const r=n.metaTokens,s=n.visitor||g,l=n.dots,c=n.indexes,h=(n.Blob||typeof Blob<"u"&&Blob)&&le.isSpecCompliantForm(t);if(!le.isFunction(s))throw new TypeError("visitor must be a function");function m(w){if(w===null)return"";if(le.isDate(w))return w.toISOString();if(le.isBoolean(w))return w.toString();if(!h&&le.isBlob(w))throw new dt("Blob is not supported. Use a Buffer instead.");return le.isArrayBuffer(w)||le.isTypedArray(w)?h&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function g(w,C,E){let R=w;if(w&&!E&&typeof w=="object"){if(le.endsWith(C,"{}"))C=r?C:C.slice(0,-2),w=JSON.stringify(w);else if(le.isArray(w)&&gH(w)||(le.isFileList(w)||le.endsWith(C,"[]"))&&(R=le.toArray(w)))return C=CA(C),R.forEach(function(j,O){!(le.isUndefined(j)||j===null)&&t.append(c===!0?_R([C],O,l):c===null?C:C+"[]",m(j))}),!1}return C0(w)?!0:(t.append(_R(E,C,l),m(w)),!1)}const v=[],x=Object.assign(vH,{defaultVisitor:g,convertValue:m,isVisitable:C0});function b(w,C){if(!le.isUndefined(w)){if(v.indexOf(w)!==-1)throw Error("Circular reference detected in "+C.join("."));v.push(w),le.forEach(w,function(R,T){(!(le.isUndefined(R)||R===null)&&s.call(t,R,le.isString(T)?T.trim():T,C,x))===!0&&b(R,C?C.concat(T):[T])}),v.pop()}}if(!le.isObject(e))throw new TypeError("data must be an object");return b(e),t}function NR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function n1(e,t){this._pairs=[],e&&hg(e,this,t)}const wA=n1.prototype;wA.append=function(t,n){this._pairs.push([t,n])};wA.toString=function(t){const n=t?function(r){return t.call(this,r,NR)}:NR;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function yH(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function EA(e,t,n){if(!t)return e;const r=n&&n.encode||yH;le.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let l;if(s?l=s(t,n):l=le.isURLSearchParams(t)?t.toString():new n1(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class AR{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){le.forEach(this.handlers,function(r){r!==null&&t(r)})}}const RA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xH=typeof URLSearchParams<"u"?URLSearchParams:n1,bH=typeof FormData<"u"?FormData:null,SH=typeof Blob<"u"?Blob:null,CH={isBrowser:!0,classes:{URLSearchParams:xH,FormData:bH,Blob:SH},protocols:["http","https","file","blob","url","data"]},r1=typeof window<"u"&&typeof document<"u",w0=typeof navigator=="object"&&navigator||void 0,wH=r1&&(!w0||["ReactNative","NativeScript","NS"].indexOf(w0.product)<0),EH=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",RH=r1&&window.location.href||"http://localhost",TH=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:r1,hasStandardBrowserEnv:wH,hasStandardBrowserWebWorkerEnv:EH,navigator:w0,origin:RH},Symbol.toStringTag,{value:"Module"})),Dr={...TH,...CH};function jH(e,t){return hg(e,new Dr.classes.URLSearchParams,{visitor:function(n,r,s,l){return Dr.isNode&&le.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function _H(e){return le.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function NH(e){const t={},n=Object.keys(e);let r;const s=n.length;let l;for(r=0;r<s;r++)l=n[r],t[l]=e[l];return t}function TA(e){function t(n,r,s,l){let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),h=l>=n.length;return c=!c&&le.isArray(s)?s.length:c,h?(le.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!d):((!s[c]||!le.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],l)&&le.isArray(s[c])&&(s[c]=NH(s[c])),!d)}if(le.isFormData(e)&&le.isFunction(e.entries)){const n={};return le.forEachEntry(e,(r,s)=>{t(_H(r),s,n,0)}),n}return null}function AH(e,t,n){if(le.isString(e))try{return(t||JSON.parse)(e),le.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Uf={transitional:RA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,l=le.isObject(t);if(l&&le.isHTMLForm(t)&&(t=new FormData(t)),le.isFormData(t))return s?JSON.stringify(TA(t)):t;if(le.isArrayBuffer(t)||le.isBuffer(t)||le.isStream(t)||le.isFile(t)||le.isBlob(t)||le.isReadableStream(t))return t;if(le.isArrayBufferView(t))return t.buffer;if(le.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return jH(t,this.formSerializer).toString();if((d=le.isFileList(t))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return hg(d?{"files[]":t}:t,h&&new h,this.formSerializer)}}return l||s?(n.setContentType("application/json",!1),AH(t)):t}],transformResponse:[function(t){const n=this.transitional||Uf.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(le.isResponse(t)||le.isReadableStream(t))return t;if(t&&le.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?dt.from(d,dt.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dr.classes.FormData,Blob:Dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};le.forEach(["delete","get","head","post","put","patch"],e=>{Uf.headers[e]={}});const DH=le.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),OH=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
501
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&DH[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},DR=Symbol("internals");function Ad(e){return e&&String(e).trim().toLowerCase()}function $m(e){return e===!1||e==null?e:le.isArray(e)?e.map($m):String(e)}function MH(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const kH=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Sx(e,t,n,r,s){if(le.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!le.isString(t)){if(le.isString(r))return t.indexOf(r)!==-1;if(le.isRegExp(r))return r.test(t)}}function IH(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function LH(e,t){const n=le.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,l,c){return this[r].call(this,t,s,l,c)},configurable:!0})})}let ea=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function l(d,h,m){const g=Ad(h);if(!g)throw new Error("header name must be a non-empty string");const v=le.findKey(s,g);(!v||s[v]===void 0||m===!0||m===void 0&&s[v]!==!1)&&(s[v||h]=$m(d))}const c=(d,h)=>le.forEach(d,(m,g)=>l(m,g,h));if(le.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(le.isString(t)&&(t=t.trim())&&!kH(t))c(OH(t),n);else if(le.isObject(t)&&le.isIterable(t)){let d={},h,m;for(const g of t){if(!le.isArray(g))throw TypeError("Object iterator must return a key-value pair");d[m=g[0]]=(h=d[m])?le.isArray(h)?[...h,g[1]]:[h,g[1]]:g[1]}c(d,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=Ad(t),t){const r=le.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return MH(s);if(le.isFunction(n))return n.call(this,s,r);if(le.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ad(t),t){const r=le.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Sx(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function l(c){if(c=Ad(c),c){const d=le.findKey(r,c);d&&(!n||Sx(r,r[d],d,n))&&(delete r[d],s=!0)}}return le.isArray(t)?t.forEach(l):l(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const l=n[r];(!t||Sx(this,this[l],l,t,!0))&&(delete this[l],s=!0)}return s}normalize(t){const n=this,r={};return le.forEach(this,(s,l)=>{const c=le.findKey(r,l);if(c){n[c]=$m(s),delete n[l];return}const d=t?IH(l):String(l).trim();d!==l&&delete n[l],n[d]=$m(s),r[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return le.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&le.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
502
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[DR]=this[DR]={accessors:{}}).accessors,s=this.prototype;function l(c){const d=Ad(c);r[d]||(LH(s,c),r[d]=!0)}return le.isArray(t)?t.forEach(l):l(t),this}};ea.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);le.reduceDescriptors(ea.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});le.freezeMethods(ea);function Cx(e,t){const n=this||Uf,r=t||n,s=ea.from(r.headers);let l=r.data;return le.forEach(e,function(d){l=d.call(n,l,s.normalize(),t?t.status:void 0)}),s.normalize(),l}function jA(e){return!!(e&&e.__CANCEL__)}function Eu(e,t,n){dt.call(this,e??"canceled",dt.ERR_CANCELED,t,n),this.name="CanceledError"}le.inherits(Eu,dt,{__CANCEL__:!0});function _A(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new dt("Request failed with status code "+n.status,[dt.ERR_BAD_REQUEST,dt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function PH(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function UH(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,l=0,c;return t=t!==void 0?t:1e3,function(h){const m=Date.now(),g=r[l];c||(c=m),n[s]=h,r[s]=m;let v=l,x=0;for(;v!==s;)x+=n[v++],v=v%e;if(s=(s+1)%e,s===l&&(l=(l+1)%e),m-c<t)return;const b=g&&m-g;return b?Math.round(x*1e3/b):void 0}}function FH(e,t){let n=0,r=1e3/t,s,l;const c=(m,g=Date.now())=>{n=g,s=null,l&&(clearTimeout(l),l=null),e(...m)};return[(...m)=>{const g=Date.now(),v=g-n;v>=r?c(m,g):(s=m,l||(l=setTimeout(()=>{l=null,c(s)},r-v)))},()=>s&&c(s)]}const lp=(e,t,n=3)=>{let r=0;const s=UH(50,250);return FH(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,h=c-r,m=s(h),g=c<=d;r=c;const v={loaded:c,total:d,progress:d?c/d:void 0,bytes:h,rate:m||void 0,estimated:m&&d&&g?(d-c)/m:void 0,event:l,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(v)},n)},OR=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},MR=e=>(...t)=>le.asap(()=>e(...t)),zH=Dr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Dr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,VH=Dr.hasStandardBrowserEnv?{write(e,t,n,r,s,l){const c=[e+"="+encodeURIComponent(t)];le.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),le.isString(r)&&c.push("path="+r),le.isString(s)&&c.push("domain="+s),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function HH(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function $H(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function NA(e,t,n){let r=!HH(t);return e&&(r||n==!1)?$H(e,t):t}const kR=e=>e instanceof ea?{...e}:e;function Nl(e,t){t=t||{};const n={};function r(m,g,v,x){return le.isPlainObject(m)&&le.isPlainObject(g)?le.merge.call({caseless:x},m,g):le.isPlainObject(g)?le.merge({},g):le.isArray(g)?g.slice():g}function s(m,g,v,x){if(le.isUndefined(g)){if(!le.isUndefined(m))return r(void 0,m,v,x)}else return r(m,g,v,x)}function l(m,g){if(!le.isUndefined(g))return r(void 0,g)}function c(m,g){if(le.isUndefined(g)){if(!le.isUndefined(m))return r(void 0,m)}else return r(void 0,g)}function d(m,g,v){if(v in t)return r(m,g);if(v in e)return r(void 0,m)}const h={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(m,g,v)=>s(kR(m),kR(g),v,!0)};return le.forEach(Object.keys({...e,...t}),function(g){const v=h[g]||s,x=v(e[g],t[g],g);le.isUndefined(x)&&v!==d||(n[g]=x)}),n}const AA=e=>{const t=Nl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:l,headers:c,auth:d}=t;if(t.headers=c=ea.from(c),t.url=EA(NA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),le.isFormData(n)){if(Dr.hasStandardBrowserEnv||Dr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(le.isFunction(n.getHeaders)){const h=n.getHeaders(),m=["content-type","content-length"];Object.entries(h).forEach(([g,v])=>{m.includes(g.toLowerCase())&&c.set(g,v)})}}if(Dr.hasStandardBrowserEnv&&(r&&le.isFunction(r)&&(r=r(t)),r||r!==!1&&zH(t.url))){const h=s&&l&&VH.read(l);h&&c.set(s,h)}return t},BH=typeof XMLHttpRequest<"u",GH=BH&&function(e){return new Promise(function(n,r){const s=AA(e);let l=s.data;const c=ea.from(s.headers).normalize();let{responseType:d,onUploadProgress:h,onDownloadProgress:m}=s,g,v,x,b,w;function C(){b&&b(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function R(){if(!E)return;const j=ea.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),D={data:!d||d==="text"||d==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:j,config:e,request:E};_A(function(A){n(A),C()},function(A){r(A),C()},D),E=null}"onloadend"in E?E.onloadend=R:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(R)},E.onabort=function(){E&&(r(new dt("Request aborted",dt.ECONNABORTED,e,E)),E=null)},E.onerror=function(O){const D=O&&O.message?O.message:"Network Error",_=new dt(D,dt.ERR_NETWORK,e,E);_.event=O||null,r(_),E=null},E.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const D=s.transitional||RA;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new dt(O,D.clarifyTimeoutError?dt.ETIMEDOUT:dt.ECONNABORTED,e,E)),E=null},l===void 0&&c.setContentType(null),"setRequestHeader"in E&&le.forEach(c.toJSON(),function(O,D){E.setRequestHeader(D,O)}),le.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),d&&d!=="json"&&(E.responseType=s.responseType),m&&([x,w]=lp(m,!0),E.addEventListener("progress",x)),h&&E.upload&&([v,b]=lp(h),E.upload.addEventListener("progress",v),E.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(g=j=>{E&&(r(!j||j.type?new Eu(null,e,E):j),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const T=PH(s.url);if(T&&Dr.protocols.indexOf(T)===-1){r(new dt("Unsupported protocol "+T+":",dt.ERR_BAD_REQUEST,e));return}E.send(l||null)})},qH=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const l=function(m){if(!s){s=!0,d();const g=m instanceof Error?m:this.reason;r.abort(g instanceof dt?g:new Eu(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,l(new dt(`timeout ${t} of ms exceeded`,dt.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(l):m.removeEventListener("abort",l)}),e=null)};e.forEach(m=>m.addEventListener("abort",l));const{signal:h}=r;return h.unsubscribe=()=>le.asap(d),h}},ZH=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},KH=async function*(e,t){for await(const n of YH(e))yield*ZH(n,t)},YH=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},IR=(e,t,n,r)=>{const s=KH(e,t);let l=0,c,d=h=>{c||(c=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:g}=await s.next();if(m){d(),h.close();return}let v=g.byteLength;if(n){let x=l+=v;n(x)}h.enqueue(new Uint8Array(g))}catch(m){throw d(m),m}},cancel(h){return d(h),s.return()}},{highWaterMark:2})},LR=64*1024,{isFunction:Sm}=le,WH=(({Request:e,Response:t})=>({Request:e,Response:t}))(le.global),{ReadableStream:PR,TextEncoder:UR}=le.global,FR=(e,...t)=>{try{return!!e(...t)}catch{return!1}},QH=e=>{e=le.merge.call({skipUndefined:!0},WH,e);const{fetch:t,Request:n,Response:r}=e,s=t?Sm(t):typeof fetch=="function",l=Sm(n),c=Sm(r);if(!s)return!1;const d=s&&Sm(PR),h=s&&(typeof UR=="function"?(w=>C=>w.encode(C))(new UR):async w=>new Uint8Array(await new n(w).arrayBuffer())),m=l&&d&&FR(()=>{let w=!1;const C=new n(Dr.origin,{body:new PR,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!C}),g=c&&d&&FR(()=>le.isReadableStream(new r("").body)),v={stream:g&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!v[w]&&(v[w]=(C,E)=>{let R=C&&C[w];if(R)return R.call(C);throw new dt(`Response type '${w}' is not supported`,dt.ERR_NOT_SUPPORT,E)})});const x=async w=>{if(w==null)return 0;if(le.isBlob(w))return w.size;if(le.isSpecCompliantForm(w))return(await new n(Dr.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(le.isArrayBufferView(w)||le.isArrayBuffer(w))return w.byteLength;if(le.isURLSearchParams(w)&&(w=w+""),le.isString(w))return(await h(w)).byteLength},b=async(w,C)=>{const E=le.toFiniteNumber(w.getContentLength());return E??x(C)};return async w=>{let{url:C,method:E,data:R,signal:T,cancelToken:j,timeout:O,onDownloadProgress:D,onUploadProgress:_,responseType:A,headers:M,withCredentials:U="same-origin",fetchOptions:B}=AA(w),G=t||fetch;A=A?(A+"").toLowerCase():"text";let K=qH([T,j&&j.toAbortSignal()],O),re=null;const H=K&&K.unsubscribe&&(()=>{K.unsubscribe()});let $;try{if(_&&m&&E!=="get"&&E!=="head"&&($=await b(M,R))!==0){let L=new n(C,{method:"POST",body:R,duplex:"half"}),P;if(le.isFormData(R)&&(P=L.headers.get("content-type"))&&M.setContentType(P),L.body){const[W,ae]=OR($,lp(MR(_)));R=IR(L.body,LR,W,ae)}}le.isString(U)||(U=U?"include":"omit");const I=l&&"credentials"in n.prototype,Y={...B,signal:K,method:E.toUpperCase(),headers:M.normalize().toJSON(),body:R,duplex:"half",credentials:I?U:void 0};re=l&&new n(C,Y);let Z=await(l?G(re,B):G(C,Y));const ie=g&&(A==="stream"||A==="response");if(g&&(D||ie&&H)){const L={};["status","statusText","headers"].forEach(fe=>{L[fe]=Z[fe]});const P=le.toFiniteNumber(Z.headers.get("content-length")),[W,ae]=D&&OR(P,lp(MR(D),!0))||[];Z=new r(IR(Z.body,LR,W,()=>{ae&&ae(),H&&H()}),L)}A=A||"text";let be=await v[le.findKey(v,A)||"text"](Z,w);return!ie&&H&&H(),await new Promise((L,P)=>{_A(L,P,{data:be,headers:ea.from(Z.headers),status:Z.status,statusText:Z.statusText,config:w,request:re})})}catch(I){throw H&&H(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new dt("Network Error",dt.ERR_NETWORK,w,re),{cause:I.cause||I}):dt.from(I,I&&I.code,w,re)}}},XH=new Map,DA=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:s}=t,l=[r,s,n];let c=l.length,d=c,h,m,g=XH;for(;d--;)h=l[d],m=g.get(h),m===void 0&&g.set(h,m=d?new Map:QH(t)),g=m;return m};DA();const E0={http:pH,xhr:GH,fetch:{get:DA}};le.forEach(E0,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const zR=e=>`- ${e}`,JH=e=>le.isFunction(e)||e===null||e===!1,OA={getAdapter:(e,t)=>{e=le.isArray(e)?e:[e];const{length:n}=e;let r,s;const l={};for(let c=0;c<n;c++){r=e[c];let d;if(s=r,!JH(r)&&(s=E0[(d=String(r)).toLowerCase()],s===void 0))throw new dt(`Unknown adapter '${d}'`);if(s&&(le.isFunction(s)||(s=s.get(t))))break;l[d||"#"+c]=s}if(!s){const c=Object.entries(l).map(([h,m])=>`adapter ${h} `+(m===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
|
|
503
|
-
`+c.map(zR).join(`
|
|
504
|
-
`):" "+zR(c[0]):"as no adapter specified";throw new dt("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return s},adapters:E0};function wx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Eu(null,e)}function VR(e){return wx(e),e.headers=ea.from(e.headers),e.data=Cx.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),OA.getAdapter(e.adapter||Uf.adapter,e)(e).then(function(r){return wx(e),r.data=Cx.call(e,e.transformResponse,r),r.headers=ea.from(r.headers),r},function(r){return jA(r)||(wx(e),r&&r.response&&(r.response.data=Cx.call(e,e.transformResponse,r.response),r.response.headers=ea.from(r.response.headers))),Promise.reject(r)})}const MA="1.12.2",mg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const HR={};mg.transitional=function(t,n,r){function s(l,c){return"[Axios v"+MA+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,d)=>{if(t===!1)throw new dt(s(c," has been removed"+(n?" in "+n:"")),dt.ERR_DEPRECATED);return n&&!HR[c]&&(HR[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,d):!0}};mg.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function e$(e,t,n){if(typeof e!="object")throw new dt("options must be an object",dt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const l=r[s],c=t[l];if(c){const d=e[l],h=d===void 0||c(d,l,e);if(h!==!0)throw new dt("option "+l+" must be "+h,dt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new dt("Unknown option "+l,dt.ERR_BAD_OPTION)}}const Bm={assertOptions:e$,validators:mg},Ns=Bm.validators;let bl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new AR,response:new AR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const l=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
505
|
-
`+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Nl(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:l}=n;r!==void 0&&Bm.assertOptions(r,{silentJSONParsing:Ns.transitional(Ns.boolean),forcedJSONParsing:Ns.transitional(Ns.boolean),clarifyTimeoutError:Ns.transitional(Ns.boolean)},!1),s!=null&&(le.isFunction(s)?n.paramsSerializer={serialize:s}:Bm.assertOptions(s,{encode:Ns.function,serialize:Ns.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Bm.assertOptions(n,{baseUrl:Ns.spelling("baseURL"),withXsrfToken:Ns.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=l&&le.merge(l.common,l[n.method]);l&&le.forEach(["delete","get","head","post","put","patch","common"],w=>{delete l[w]}),n.headers=ea.concat(c,l);const d=[];let h=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(h=h&&C.synchronous,d.unshift(C.fulfilled,C.rejected))});const m=[];this.interceptors.response.forEach(function(C){m.push(C.fulfilled,C.rejected)});let g,v=0,x;if(!h){const w=[VR.bind(this),void 0];for(w.unshift(...d),w.push(...m),x=w.length,g=Promise.resolve(n);v<x;)g=g.then(w[v++],w[v++]);return g}x=d.length;let b=n;for(;v<x;){const w=d[v++],C=d[v++];try{b=w(b)}catch(E){C.call(this,E);break}}try{g=VR.call(this,b)}catch(w){return Promise.reject(w)}for(v=0,x=m.length;v<x;)g=g.then(m[v++],m[v++]);return g}getUri(t){t=Nl(this.defaults,t);const n=NA(t.baseURL,t.url,t.allowAbsoluteUrls);return EA(n,t.params,t.paramsSerializer)}};le.forEach(["delete","get","head","options"],function(t){bl.prototype[t]=function(n,r){return this.request(Nl(r||{},{method:t,url:n,data:(r||{}).data}))}});le.forEach(["post","put","patch"],function(t){function n(r){return function(l,c,d){return this.request(Nl(d||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}bl.prototype[t]=n(),bl.prototype[t+"Form"]=n(!0)});let t$=class kA{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(s=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const c=new Promise(d=>{r.subscribe(d),l=d}).then(s);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,d){r.reason||(r.reason=new Eu(l,c,d),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kA(function(s){t=s}),cancel:t}}};function n$(e){return function(n){return e.apply(null,n)}}function r$(e){return le.isObject(e)&&e.isAxiosError===!0}const R0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(R0).forEach(([e,t])=>{R0[t]=e});function IA(e){const t=new bl(e),n=fA(bl.prototype.request,t);return le.extend(n,bl.prototype,t,{allOwnKeys:!0}),le.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return IA(Nl(e,s))},n}const An=IA(Uf);An.Axios=bl;An.CanceledError=Eu;An.CancelToken=t$;An.isCancel=jA;An.VERSION=MA;An.toFormData=hg;An.AxiosError=dt;An.Cancel=An.CanceledError;An.all=function(t){return Promise.all(t)};An.spread=n$;An.isAxiosError=r$;An.mergeConfig=Nl;An.AxiosHeaders=ea;An.formToJSON=e=>TA(le.isHTMLForm(e)?new FormData(e):e);An.getAdapter=OA.getAdapter;An.HttpStatusCode=R0;An.default=An;const{Axios:moe,AxiosError:$R,CanceledError:poe,isCancel:goe,CancelToken:voe,VERSION:yoe,all:xoe,Cancel:boe,isAxiosError:Soe,spread:Coe,toFormData:woe,AxiosHeaders:a$,HttpStatusCode:Eoe,formToJSON:Roe,getAdapter:Toe,mergeConfig:joe}=An;function s$(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const cu={SIGN_IN:"/auth/sign-in",SIGN_OUT:"/auth/sign-out",ACCESS_TOKEN:"/auth/access-token",API_USER:"/auth/api/user",API_PROJECTS:"/auth/api/projects"};function o$(e){if(e&&typeof e=="object"&&"response"in e){const n=e,{status:r,data:s}=n.response;switch(r){case 401:return{message:(s==null?void 0:s.message)??"Invalid credentials or session expired",code:"UNAUTHORIZED",statusCode:401};case 403:return{message:(s==null?void 0:s.message)??"Access forbidden",code:"FORBIDDEN",statusCode:403};case 422:return{message:(s==null?void 0:s.message)??"Invalid request data",code:"VALIDATION_ERROR",statusCode:422};default:return{message:(s==null?void 0:s.message)??"Authentication error",code:"AUTH_ERROR",statusCode:r}}}return e&&typeof e=="object"&&"request"in e?{message:"Network error - please check your connection",code:"NETWORK_ERROR"}:{message:e instanceof Error?e.message:"Unknown authentication error",code:"UNKNOWN_ERROR"}}const a1=An.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function i$(){const e=window.location.pathname+window.location.search,t=new URL(cu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function l$(){const e=new URL(cu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",cu.SIGN_IN),window.location.href=e.toString()}async function c$(){try{return(await a1.post(cu.ACCESS_TOKEN,{})).data}catch(e){const t=o$(e);throw new Error(t.message)}}async function u$(e){const t=await a1.get(cu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return s$(t.data)}async function d$(e){return(await a1.get(cu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const LA=p.createContext(null);class f${constructor(t,n){_s(this,"getToken");_s(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let s1=null;function h$(e){s1=e}function o1(){return s1}function Cm(){s1=null}const m$=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Fe=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",PA(e)},p$=e=>{Fe({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},g$=()=>{Fe({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},PA=e=>{var t;if(typeof window<"u"){m$();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function v$(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Or.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Or.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Or.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Or.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const y$={status:Or.LOADING,session:null,user:null};function x$({children:e}){var g;const[t,n]=p.useReducer(v$,y$);p.useEffect(()=>{var v;if((v=t.session)!=null&&v.accessToken){const x=new f$(()=>{var b;return((b=t.session)==null?void 0:b.accessToken)??null},async()=>await s());h$(x)}else Cm()},[(g=t.session)==null?void 0:g.accessToken]);const r=p.useCallback(()=>{i$()},[]);async function s(){try{const x=(await c$()).accessToken;if(!x)throw new Error("Invalid token received");const b={accessToken:x},w=await u$(x);return n({type:"SET_USER",payload:{user:w}}),n({type:"SET_AUTHENTICATED",payload:{session:b}}),x}catch(v){throw Cm(),n({type:"SET_UNAUTHENTICATED"}),v}}const l=p.useCallback(async()=>{await s()},[]),c=p.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await l()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(v){console.error("Failed to initialize auth:",v),Cm(),n({type:"SET_UNAUTHENTICATED"})}},[l,r]),d=p.useCallback(()=>{try{g$()}finally{l$()}},[]),h=p.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t.user&&(PA({projectId:t.user.projectId}),p$({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),p.useEffect(()=>{const v=()=>{d()};return window.addEventListener("auth:logout",v),()=>{window.removeEventListener("auth:logout",v),Cm()}},[d]);const m={...t,signIn:r,signOut:d,refreshToken:l,clearError:h};return o.jsx(LA.Provider,{value:m,children:e})}function Ui(){const e=p.useContext(LA);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function UA(){const{status:e,session:t,user:n,error:r}=Ui();return{status:e,session:t,user:n,error:r,isLoading:e===Or.LOADING,isAuthenticated:e===Or.AUTHENTICATED,isUnauthenticated:e===Or.UNAUTHENTICATED,hasError:e===Or.ERROR}}function b$(){const{user:e}=Ui();return e}function Xc({fullScreen:e=!1,size:t="md",message:n}){const r={sm:"h-4 w-4 border-2",md:"h-8 w-8 border-4",lg:"h-12 w-12 border-4"},s=e?"flex h-screen items-center justify-center":"flex items-center justify-center p-4";return o.jsx("div",{className:s,children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&o.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function BR({message:e}){return o.jsx(Xc,{fullScreen:!0,message:e})}function GR(){return o.jsx("div",{className:"flex h-screen items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),o.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),o.jsx(Ce,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function S$({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:l}=UA();return r?o.jsx(BR,{}):s?o.jsx(o.Fragment,{children:e}):l?n?(window.location.href=n,o.jsx(BR,{})):t?o.jsx(o.Fragment,{children:t}):o.jsx(GR,{}):t?o.jsx(o.Fragment,{children:t}):o.jsx(GR,{})}const FA=p.createContext(null);function zA(){const e=p.useContext(FA);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const C$="/ui",w$=()=>C$,cp=(e,t)=>{const n=w$(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function E$(){const{projects:e,loadProjects:t,error:n,isLoading:r}=zA(),{user:s}=Ui();return o.jsxs(Qb,{children:[o.jsx(Ga,{}),o.jsxs(Xb,{className:"flex items-center gap-2",children:[o.jsx(LI,{className:"h-4 w-4"}),"Switch project"]}),o.jsx(RV,{children:o.jsxs(Jb,{children:[r&&o.jsx(bt,{disabled:!0,children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(gu,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&o.jsxs(o.Fragment,{children:[o.jsx(bt,{disabled:!0,children:"Unable to load projects. Please try again."}),o.jsx(bt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(l=>{const c=l.id===(s==null?void 0:s.projectId);return o.jsx(bt,{asChild:!0,children:o.jsxs(xf,{to:cp(encodeURIComponent(l.id),"/"),className:"flex items-center gap-2",children:[c?o.jsx(dr,{className:"h-4 w-4"}):o.jsx("span",{className:"h-4 w-4"}),l.title]})},l.id)})]})})]})}function R$(){return o.jsx(E$,{})}const T$=({className:e,size:t=24})=>o.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),VA=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M10.6842 44.2221L0.419465 26.278C-0.139822 25.3001 -0.139822 23.6999 0.419465 22.722L10.6842 4.77786C11.2435 3.79993 12.6166 3 13.7355 3H34.265C35.3838 3 36.7567 3.79993 37.3163 4.77786L47.5801 22.722C48.14 23.6999 48.14 25.3001 47.5801 26.278L37.3163 44.2221C36.7567 45.2001 35.3838 46 34.265 46H13.7355C12.6166 46 11.2435 45.2001 10.6842 44.2221Z",fill:"#4486FA"}),o.jsx("path",{d:"M30.6154 18.3848L43.6923 32.8463L37.3828 43.85C36.8268 44.8118 35.4628 45.5986 34.3511 45.5986L17.5385 30.0771L30.6154 18.3848Z",fill:"#3778ED"}),o.jsx("path",{d:"M24.1539 33.1537C28.997 33.1537 32.9231 29.2276 32.9231 24.3845C32.9231 19.5414 28.997 15.6152 24.1539 15.6152C19.3108 15.6152 15.3846 19.5414 15.3846 24.3845C15.3846 29.2276 19.3108 33.1537 24.1539 33.1537Z",fill:"white"}),o.jsx("path",{d:"M31.2681 29.2331L34.3825 32.3476C34.7428 32.7079 34.7428 33.2925 34.3825 33.6528L33.7296 34.3057C33.3693 34.666 32.7847 34.666 32.4244 34.3057L29.3099 31.1913C28.9496 30.831 28.9496 30.2464 29.3099 29.886L29.9628 29.2331C30.3231 28.8728 30.9077 28.8728 31.2681 29.2331Z",fill:"white"}),o.jsx("path",{d:"M24.1538 31.0003C27.8074 31.0003 30.7692 28.0385 30.7692 24.3849C30.7692 20.7313 27.8074 17.7695 24.1538 17.7695C20.5003 17.7695 17.5385 20.7313 17.5385 24.3849C17.5385 28.0385 20.5003 31.0003 24.1538 31.0003Z",fill:"#4486FA"}),o.jsx("path",{d:"M24.1538 29.4615C26.9577 29.4615 29.2308 27.1884 29.2308 24.3845C29.2308 21.5806 26.9577 19.3076 24.1538 19.3076C21.3499 19.3076 19.0769 21.5806 19.0769 24.3845C19.0769 27.1884 21.3499 29.4615 24.1538 29.4615Z",fill:"#4486FA"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3846 21.4619H25.2308V29.4619H23.3846V21.4619ZM26.4615 24.8465H28.3077V28.5388H26.4615V24.8465ZM21.8462 23.6158H20V28.5388H21.8462V23.6158Z",fill:"white"})]}),HA=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),o.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),o.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),o.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),o.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),o.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),o.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),o.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),o.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),o.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),o.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),o.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),o.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),o.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),o.jsx("path",{d:"M24 1.134L27.7974 2.3466V29.6562L24 30.4332V1.134ZM36.8118 9.6L31.179 8.4588V29.0142L36.8118 27.873V9.6ZM43.2144 3.06L39.1344 1.4196V27.381L43.2144 26.5248V3.06ZM48 1.5618L44.901 0V26.1684L48 25.5978V1.5618Z",fill:"#F58534"})]}),$A=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0C19.7661 0 12 0 10 0C8.19719 0 6 2.18498 6 4V44C6 45.815 8.18947 47.9993 10 47.9993H38C39.8105 47.9993 42 45.815 42 44C42 44 42 25.6447 42 14L28 0Z",fill:"#00A65F"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),j$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M23.7876 0C22.2395 0 20.8149 0.856389 20.0821 2.22332C19.3574 3.59024 19.4398 5.25361 20.3044 6.5382L22.0995 4.75131C22.0419 4.57015 22.009 4.38899 22.009 4.1996C22.009 3.21969 22.7995 2.42918 23.7794 2.42918C24.7593 2.42918 25.5498 3.21969 25.5498 4.1996C25.5498 5.1795 24.7593 5.97002 23.7794 5.97002C23.59 5.97002 23.4088 5.93708 23.2277 5.87944L21.4325 7.66632C22.923 8.67917 24.891 8.62153 26.3238 7.53457C27.7566 6.44762 28.3331 4.56192 27.7566 2.85737C27.1885 1.1446 25.5827 0 23.7876 0Z",fill:"#34A853"}),o.jsx("path",{d:"M22.1161 12.2282C22.1161 10.8118 21.6632 9.42842 20.8068 8.30029L18.4846 10.6224C19.2093 11.9564 18.954 13.6033 17.8506 14.6491L19.1187 17.737C20.9797 16.5266 22.1161 14.4515 22.1161 12.2282Z",fill:"#FBBC04"}),o.jsx("path",{d:"M15.6108 15.5637H15.5531C14.1286 15.5637 12.8604 14.6579 12.3993 13.3075C11.9382 11.957 12.3828 10.4666 13.511 9.58547C14.6391 8.70438 16.1954 8.64674 17.3894 9.43725L19.6951 7.13159C17.4553 5.31176 14.2932 5.17177 11.897 6.78574C9.50076 8.3997 8.44675 11.3806 9.28667 14.1392C10.1266 16.8977 12.671 18.7834 15.5531 18.7834C15.9978 18.7834 16.4425 18.7422 16.8789 18.6517L15.6108 15.5637Z",fill:"#EA4335"}),o.jsx("path",{d:"M23.87 18.231C22.4125 18.231 20.9632 18.4451 19.5716 18.8568L21.4161 23.3611C22.2148 23.1634 23.0383 23.0646 23.87 23.0646C28.6625 23.0646 32.7797 26.449 33.7184 31.1509C34.6489 35.8528 32.1374 40.5547 27.7155 42.3828C23.2936 44.2108 18.1882 42.6627 15.5284 38.6855C12.8687 34.7082 13.3792 29.3969 16.7636 26.0043C17.4718 25.2962 18.2787 24.7033 19.1598 24.2339L17.34 19.7461C10.5465 23.0728 7.32686 30.9697 9.86308 38.1008C12.3993 45.2319 19.8762 49.3244 27.2461 47.6117C34.616 45.9071 39.532 38.9407 38.6756 31.4226C37.8192 23.9045 31.454 18.231 23.8864 18.231H23.87Z",fill:"#4285F4"})]}),_$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M6.10815 8C6.10815 6.89543 7.00358 6 8.10815 6H40.1082C41.2127 6 42.1082 6.89543 42.1082 8V40C42.1082 41.1046 41.2127 42 40.1082 42H8.10816C7.00359 42 6.10815 41.1046 6.10815 40V8Z",fill:"#FF9800"}),o.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),o.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),o.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),o.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),o.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),o.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),o.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),o.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),o.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),o.jsx("path",{d:"M13 35C13 32.7909 14.7909 31 17 31C19.2091 31 21 32.7909 21 35C21 37.2091 19.2091 39 17 39C14.7909 39 13 37.2091 13 35Z",fill:"white"})]}),N$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M41.1492 36.5821L31.017 30.7288C29.5935 29.9092 27.7733 30.3966 26.9494 31.8201C26.6302 32.3808 26.5051 32.9976 26.5655 33.5972V45.0365C26.5655 46.6712 27.894 47.9998 29.5331 47.9998C31.1679 47.9998 32.4965 46.6712 32.4965 45.0365V38.4585L38.173 41.7367C39.5964 42.5605 41.421 42.0688 42.2405 40.6454C43.0644 39.2219 42.577 37.4017 41.1492 36.5821Z",fill:"#29B5E8"}),o.jsx("path",{d:"M15.949 24.039C15.9663 22.9822 15.4099 21.9987 14.4954 21.4682L4.36313 15.6192C3.92316 15.3647 3.41849 15.231 2.91381 15.231C1.87427 15.231 0.908061 15.7874 0.390448 16.6846C-0.411852 18.0735 0.0669408 19.855 1.45587 20.6573L7.29627 24.0261L1.45587 27.3992C0.782972 27.7874 0.299866 28.4128 0.101448 29.1634C-0.101284 29.9139 0.00223886 30.699 0.390448 31.3719C0.908061 32.2691 1.87427 32.8255 2.9095 32.8255C3.41849 32.8255 3.92316 32.6918 4.36313 32.4373L14.4954 26.5883C15.4012 26.062 15.9577 25.0872 15.949 24.039Z",fill:"#29B5E8"}),o.jsx("path",{d:"M6.6628 11.4738L16.7951 17.3228C17.977 18.0086 19.4349 17.7843 20.3666 16.8742C20.9576 16.3307 21.3242 15.5543 21.3242 14.6916V2.96765C21.3242 1.32854 19.9957 0 18.3609 0C16.7217 0 15.3932 1.32854 15.3932 2.96765V9.64054L9.63907 6.31919C8.21564 5.49532 6.39536 5.98274 5.5715 7.40618C4.74763 8.82962 5.23936 10.6499 6.6628 11.4738Z",fill:"#29B5E8"}),o.jsx("path",{d:"M29.4459 24.5131C29.4459 24.7374 29.3165 25.048 29.1569 25.2119L25.1411 29.2277C24.9815 29.3873 24.6666 29.5167 24.4423 29.5167H23.42C23.1957 29.5167 22.8808 29.3873 22.7212 29.2277L18.7011 25.2119C18.5415 25.048 18.4121 24.7374 18.4121 24.5131V23.4908C18.4121 23.2622 18.5415 22.9516 18.7011 22.792L22.7212 18.7719C22.8808 18.6123 23.1957 18.4829 23.42 18.4829H24.4423C24.6666 18.4829 24.9815 18.6123 25.1411 18.7719L29.1569 22.792C29.3165 22.9516 29.4459 23.2622 29.4459 23.4908V24.5131ZM25.8614 24.0214V23.9782C25.8614 23.8143 25.7665 23.5857 25.6501 23.4649L24.4639 22.2831C24.3474 22.1623 24.1188 22.0674 23.9506 22.0674H23.9074C23.7435 22.0674 23.5149 22.1623 23.3941 22.2831L22.2123 23.4649C22.0958 23.5814 22.0009 23.81 22.0009 23.9782V24.0214C22.0009 24.1896 22.0958 24.4182 22.2123 24.5347L23.3941 25.7209C23.5149 25.8373 23.7435 25.9322 23.9074 25.9322H23.9506C24.1188 25.9322 24.3474 25.8373 24.4639 25.7209L25.6501 24.5347C25.7665 24.4182 25.8614 24.1896 25.8614 24.0214Z",fill:"#29B5E8"}),o.jsx("path",{d:"M31.0158 17.3228L41.1481 11.4738C42.5715 10.6542 43.0632 8.82962 42.2394 7.40618C41.4155 5.98274 39.5952 5.49532 38.1718 6.31919L32.4953 9.59741V2.96765C32.4953 1.32854 31.1667 0 29.532 0C27.8928 0 26.5643 1.32854 26.5643 2.96765V14.4587C26.5082 15.0539 26.6247 15.675 26.9482 16.2358C27.7721 17.6592 29.5923 18.1467 31.0158 17.3228Z",fill:"#29B5E8"}),o.jsx("path",{d:"M18.8267 30.3841C18.1538 30.2546 17.4335 30.3625 16.7951 30.7291L6.6628 36.5825C5.23936 37.402 4.74763 39.2223 5.5715 40.6457C6.39536 42.0735 8.21564 42.5609 9.63907 41.737L15.3932 38.4157V45.0368C15.3932 46.6716 16.7217 48.0002 18.3609 48.0002C19.9957 48.0002 21.3242 46.6716 21.3242 45.0368V33.3129C21.3242 31.8334 20.2415 30.6083 18.8267 30.3841Z",fill:"#29B5E8"}),o.jsx("path",{d:"M47.4814 16.6501C46.6618 15.2223 44.8372 14.7349 43.4138 15.5588L33.2815 21.4078C32.311 21.9685 31.7761 22.9951 31.7934 24.039C31.7847 25.0785 32.3196 26.0922 33.2815 26.6443L43.4138 32.4977C44.8372 33.3172 46.6575 32.8298 47.4814 31.4064C48.3052 29.9829 47.8135 28.1626 46.3901 27.3388L40.6532 24.0261L46.3901 20.7133C47.8178 19.8938 48.3052 18.0735 47.4814 16.6501Z",fill:"#29B5E8"})]}),A$=({className:e,size:t=24})=>o.jsx("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:o.jsx("path",{d:"M45.8905 35.0619V26.9571L45.0149 26.4095L24 37.9095L4.0796 26.9571V22.2476L24 33.0905L46 21.1524V13.1571L45.1244 12.6095L24 24.219L4.84577 13.7048L24 3.19048L39.4328 11.6238L40.6368 10.9667V10.0905L24 1L2 12.9381V14.1429L24 26.1905L43.9204 15.2381V20.0571L24 31.0095L2.87562 19.4L2 19.9476V28.0524L24 39.9905L43.9204 29.1476V33.8571L24 44.8095L2.87562 33.3095L2 33.8571V35.0619L24 47L45.8905 35.0619Z",fill:"#FF3621"})}),D$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),o.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),o.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),o.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),o.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),o.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),o.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),O$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M23.9333 0L3 11.9733V35.8933L23.9333 48L44.8667 36.0267V12.0267L23.9333 0ZM41 33.52L23.9333 43.3867L6.86667 33.624V14.3467L23.9333 4.48L41 14.3733V33.52Z",fill:"#0078D4"}),o.jsx("path",{d:"M23.9333 0L3 11.9733L6.86667 14.3467L23.9333 4.48L41 14.3467L44.8667 11.9733L23.9333 0Z",fill:"url(#paint0_linear_19_1262)"}),o.jsx("path",{d:"M33.9068 27.9336C33.7031 27.5984 33.4028 27.3325 33.0454 27.1709C31.9608 24.8031 30.2991 22.7454 28.2128 21.1865C26.1265 19.6276 23.6822 18.6173 21.1041 18.2482L38.3761 8.26689L34.3601 5.96289L14.6908 17.3336C14.3087 17.5535 14.0099 17.8936 13.8411 18.3009C13.6722 18.7082 13.6426 19.1598 13.757 19.5857C13.8714 20.0115 14.1232 20.3876 14.4734 20.6554C14.8236 20.9233 15.2525 21.068 15.6934 21.0669C15.7747 21.0519 15.8549 21.0314 15.9334 21.0056L16.2668 22.4002C18.7745 21.8089 21.4081 22.0755 23.7464 23.1574C26.0848 24.2393 27.9928 26.074 29.1654 28.3682L9.56812 39.6936L13.5681 42.0029L33.1761 30.6669C33.4376 30.5106 33.6586 30.295 33.8214 30.0376L34.0214 29.9896C34.0028 29.9122 33.9734 29.8429 33.9548 29.7656C34.0967 29.4794 34.1665 29.1629 34.1581 28.8436C34.1497 28.5243 34.0634 28.2119 33.9068 27.9336Z",fill:"#50E6FF"}),o.jsx("path",{d:"M32.176 24.0347C31.2003 24.0347 30.2465 24.3241 29.4352 24.8662C28.6239 25.4082 27.9916 26.1787 27.6182 27.0802C27.2448 27.9816 27.1471 28.9735 27.3375 29.9305C27.5278 30.8875 27.9977 31.7665 28.6876 32.4565C29.3775 33.1464 30.2566 33.6163 31.2135 33.8066C32.1705 33.997 33.1625 33.8993 34.0639 33.5259C34.9653 33.1525 35.7358 32.5202 36.2779 31.7089C36.82 30.8976 37.1093 29.9438 37.1093 28.9681C37.1093 27.6597 36.5896 26.4049 35.6644 25.4797C34.7392 24.5545 33.4844 24.0347 32.176 24.0347ZM15.6907 14.0454C14.7149 14.0454 13.7611 14.3347 12.9498 14.8768C12.1386 15.4189 11.5062 16.1894 11.1329 17.0908C10.7595 17.9923 10.6618 18.9842 10.8521 19.9412C11.0425 20.8982 11.5123 21.7772 12.2023 22.4671C12.8922 23.1571 13.7712 23.6269 14.7282 23.8173C15.6852 24.0076 16.6771 23.9099 17.5786 23.5365C18.48 23.1632 19.2505 22.5308 19.7926 21.7196C20.3347 20.9083 20.624 19.9545 20.624 18.9787C20.624 17.6703 20.1042 16.4155 19.1791 15.4904C18.2539 14.5652 16.9991 14.0454 15.6907 14.0454Z",fill:"url(#paint1_linear_19_1262)"}),o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),o.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),o.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{"stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),Ff=({className:e="",size:t=24,base64:n})=>o.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),M$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{fill:"currentColor",d:"M12.455 21.73c-4.585 0-7.749-.347-7.964-.371-.164-.013-1.55-.141-2.44-1.037-.9-.907-1.26-2.518-1.274-2.586-.01-.044-.29-1.267-.432-3.389a61.23 61.23 0 0 1-.078-2.403c0-3.559.49-5.744.511-5.835.016-.068.377-1.522 1.273-2.423.873-.88 2.11-1.02 2.296-1.036.244-.036 2.712-.38 7.444-.38 1.422 0 3.843.082 3.867.083 2.365.106 3.696.274 3.86.296.186.014 1.554.149 2.437 1.037.895.9 1.255 2.355 1.27 2.417.018.069.508 1.963.508 5.743 0 .89-.065 2.337-.068 2.399-.131 2.248-.405 3.447-.416 3.497-.043.174-.422 1.66-1.123 2.383-1.035 1.066-2.154 1.212-2.356 1.23-.248.039-2.558.375-7.315.375Zm-.664-18.502c-4.815 0-7.295.367-7.32.371a.446.446 0 0 1-.038.004c-.009 0-1.04.086-1.711.76-.705.709-1.016 1.955-1.02 1.967-.003.015-.485 2.174-.485 5.614 0 .836.076 2.331.077 2.347.135 2.028.407 3.222.41 3.234.004.02.317 1.413 1.018 2.12.67.673 1.831.758 1.843.759l.024.002c.031.004 3.198.366 7.866.366 4.848 0 7.161-.362 7.184-.365a.484.484 0 0 1 .05-.005c.033-.003.91-.074 1.757-.947.441-.455.784-1.552.879-1.937 0-.004.265-1.173.391-3.323 0-.01.067-1.48.067-2.349 0-3.636-.475-5.488-.48-5.507-.005-.021-.316-1.267-1.02-1.976-.67-.674-1.832-.759-1.844-.76a.391.391 0 0 1-.033-.003c-.013-.002-1.362-.182-3.785-.29-.02 0-2.424-.082-3.83-.082Z"}),o.jsx("path",{fill:"currentColor",d:"M5.415 17.057V6.247h7.074c2.212 0 3.318.925 3.318 2.776 0 .74-.142 1.316-.425 1.732a1.476 1.476 0 0 1-.768.609c.201.052.398.155.59.311.585.477.878 1.213.878 2.209 0 1.162-.284 1.99-.85 2.489-.521.456-1.353.684-2.496.684H5.415Zm.987-9.722v3.531h6.482c.686 0 1.171-.114 1.456-.344.32-.26.48-.718.48-1.374 0-.615-.142-1.063-.425-1.344-.312-.313-.815-.469-1.511-.469H6.402Zm0 4.62v4.013h6.718c.658 0 1.152-.165 1.481-.498.33-.331.493-.86.493-1.586 0-.684-.173-1.177-.52-1.478-.348-.3-.86-.45-1.536-.45l-6.636-.001ZM19.282 17.057h-1.067V6.247h1.067v10.81Z"}),o.jsx("path",{fill:"currentColor",d:"M23.467 11.846c0-3.756-.488-5.627-.5-5.673l-.001-.006a6.188 6.188 0 0 0-.292-.852c-.197-.47-.494-1.022-.906-1.438-.4-.401-.917-.64-1.37-.779a4.392 4.392 0 0 0-.9-.18h-.015c-.156-.021-1.48-.19-3.837-.295-.114-.004-2.465-.082-3.855-.082-4.717 0-7.172.342-7.406.376l-.008.002H4.37c-.176.015-1.328.15-2.131.958-.414.416-.711.97-.909 1.44a6.178 6.178 0 0 0-.292.855c-.025.105-.505 2.264-.505 5.771 0 .84.073 2.278.078 2.386l.059.747c.105 1.173.243 1.982.316 2.358l.05.24.002.004c.006.028.096.432.292.937.199.512.497 1.1.909 1.515.402.405.925.644 1.38.783.453.137.82.17.891.176h.01l.685.069c1.19.107 3.82.301 7.25.301 4.744 0 7.041-.335 7.275-.371l.008-.001h.009c.167-.015 1.215-.149 2.188-1.152.312-.321.567-.832.752-1.307a8.15 8.15 0 0 0 .303-.951c.019-.085.282-1.266.409-3.448.005-.107.068-1.514.068-2.383Zm-.95 0c0-3.598-.469-5.426-.471-5.436l-.001-.005s-.02-.077-.059-.202a5.943 5.943 0 0 0-.177-.49c-.14-.341-.34-.73-.599-1.034l-.114-.124c-.289-.29-.697-.464-1.053-.564a3.79 3.79 0 0 0-.577-.114l-.048-.004a.677.677 0 0 1-.05-.005l-.062-.009-.186-.021a33.921 33.921 0 0 0-.727-.074 60.204 60.204 0 0 0-2.78-.185c-.022 0-2.421-.08-3.822-.08-2.401 0-4.218.091-5.437.183a37.894 37.894 0 0 0-1.725.169l-.087.011-.03.005h-.003a.744.744 0 0 1-.06.005h.001c.007 0-.23.02-.547.117-.32.099-.701.271-.994.566-.316.317-.553.769-.714 1.158-.145.35-.221.63-.234.678 0 0-.478 2.138-.478 5.552 0 .828.077 2.317.077 2.334.134 1.992.399 3.168.404 3.189a6.681 6.681 0 0 0 .235.763c.163.43.4.911.71 1.223.289.29.696.464 1.052.564.35.098.621.119.621.119h.002l.037.003H4.63c.007.002.017.002.03.004l.112.013a62.06 62.06 0 0 0 2.03.167c1.373.09 3.326.18 5.653.18 4.78 0 7.082-.353 7.142-.362l.077-.009c.067-.006.833-.094 1.581-.865.182-.188.363-.533.514-.908.147-.366.252-.724.297-.905.012-.054.263-1.201.384-3.274.004-.086.067-1.495.067-2.333ZM15.54 9.024c0-.869-.257-1.477-.733-1.875-.485-.406-1.243-.632-2.318-.633H5.68v10.27h7.055c1.118 0 1.872-.224 2.321-.618.483-.424.758-1.16.758-2.285 0-.94-.275-1.586-.778-1.997a1.303 1.303 0 0 0-.49-.26l-.881-.229.864-.29a1.21 1.21 0 0 0 .632-.503v-.002c.242-.354.379-.87.379-1.578Zm4.007-3.048v11.351h-1.6V5.976h1.6Zm-1.067 10.81h.534V6.517h-.534v10.27Zm-3.653-2.902c0-.643-.163-1.043-.427-1.272l-.114-.086c-.28-.19-.687-.3-1.248-.3l-6.37-.001v3.473h6.45c.618 0 1.032-.155 1.293-.419.258-.26.416-.703.416-1.395Zm-.275-4.737c0-.579-.134-.941-.345-1.15v-.001c-.24-.24-.659-.391-1.324-.391H6.67v2.99h6.215c.673 0 1.08-.115 1.29-.284.227-.185.38-.543.38-1.164Zm.808 4.737c0 .76-.17 1.374-.571 1.778-.397.4-.971.577-1.67.577H6.135v-4.555l6.904.001c.71 0 1.293.157 1.708.516.43.373.614.959.614 1.683Zm7.689-2.038c0 .44-.017 1.029-.033 1.506l-.024.605-.008.182-.002.05v.022c-.127 2.161-.393 3.345-.399 3.37v.003c-.05.203-.164.586-.322.979-.154.383-.366.814-.625 1.082-.907.935-1.856 1.02-1.929 1.026h-.005a.241.241 0 0 0-.023.003c-.053.008-2.382.368-7.225.368-3.51 0-6.175-.204-7.305-.308l-.593-.059v-.001h-.011a4.034 4.034 0 0 1-.727-.137c-.395-.111-.903-.317-1.285-.701-.39-.394-.662-.963-.832-1.412a6.672 6.672 0 0 1-.258-.84l-.004-.017-.01-.046a17.864 17.864 0 0 1-.145-.816 28.269 28.269 0 0 1-.257-2.396v-.011l-.002-.013-.002-.052-.008-.185c-.008-.156-.018-.371-.027-.612-.02-.48-.039-1.069-.039-1.493 0-3.459.485-5.638.493-5.674v-.006l.003-.005.003-.014.012-.046.048-.162c.043-.135.107-.323.194-.533.172-.414.442-.94.831-1.331.378-.38.849-.588 1.214-.7.365-.113.645-.137.668-.139h.002l.015-.002c.089-.013 2.58-.373 7.358-.373.706 0 1.662.02 2.441.04.39.01.737.02.988.028l.297.01c.035 0 .063.002.082.003h.033c1.216.055 2.164.128 2.81.187l1 .106.008.001h.01l.018.003.045.004a4.322 4.322 0 0 1 .663.13c.394.111.903.317 1.286.702.388.39.657.918.829 1.333.165.399.249.717.26.764l.08.374c.14.717.409 2.458.409 5.203Zm.95 0c0 .897-.066 2.35-.069 2.41v.004c-.132 2.26-.407 3.475-.423 3.543v.005c-.023.093-.132.52-.326 1.018-.19.492-.477 1.086-.866 1.488-1.073 1.106-2.236 1.281-2.507 1.308-.265.04-2.589.378-7.354.378-4.598 0-7.772-.348-7.994-.373a4.92 4.92 0 0 1-.994-.196c-.439-.134-.964-.36-1.416-.743l-.189-.174c-.488-.492-.82-1.162-1.029-1.7a7.404 7.404 0 0 1-.316-1.019c-.023-.1-.298-1.332-.438-3.43v-.003C.075 14.289 0 12.81 0 11.943c0-3.578.493-5.782.519-5.895v-.003c.01-.044.11-.439.32-.941.21-.5.54-1.125 1.024-1.61l.18-.169c.925-.8 2.096-.929 2.281-.945C4.65 2.333 7.127 2 11.791 2c.714 0 1.678.02 2.464.041a215.63 215.63 0 0 1 1.297.038l.082.002.023.001h.013c2.311.104 3.641.268 3.867.297.104.008.516.048 1.016.202.498.153 1.107.426 1.59.913l.174.188c.389.451.664.984.848 1.42.202.482.3.865.316.93.025.092.519 2.01.519 5.814Zm-8.914-2.699c0 .69-.167 1.25-.58 1.586v.001c-.359.289-.922.402-1.622.402H6.135v-4.07l6.75-.002c.725 0 1.312.162 1.696.546l.124.142c.268.348.381.827.381 1.395Zm.988-.123c0 .77-.147 1.407-.472 1.884a1.905 1.905 0 0 1-.396.435l.165.12v.002c.666.543.977 1.369.977 2.418 0 1.199-.292 2.123-.942 2.694-.592.519-1.502.75-2.67.75H5.148V5.976h7.342c1.135 0 2.037.236 2.658.756.63.528.926 1.31.926 2.292Z"})]}),k$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),I$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M21 9.99795V7.99795C20.9996 7.64722 20.9071 7.30276 20.7315 6.99911C20.556 6.69546 20.3037 6.44331 20 6.26795L13 2.26795C12.696 2.09241 12.3511 2 12 2C11.6489 2 11.304 2.09241 11 2.26795L4 6.26795C3.69626 6.44331 3.44398 6.69546 3.26846 6.99911C3.09294 7.30276 3.00036 7.64722 3 7.99795V15.9979C3.00036 16.3487 3.09294 16.6931 3.26846 16.9968C3.44398 17.3004 3.69626 17.5526 4 17.7279L11 21.7279C11.304 21.9035 11.6489 21.9959 12 21.9959C12.3511 21.9959 12.696 21.9035 13 21.7279L15 20.5879",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),L$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M24 12C24 5.37308 18.6269 0 12 0C5.37308 0 0 5.37308 0 12C0 17.989 4.38757 22.9537 10.1252 23.8549V15.4696H7.07749V12H10.1252V9.35565C10.1252 6.34847 11.9173 4.68626 14.6579 4.68626C15.9707 4.68626 17.3444 4.92083 17.3444 4.92083V7.874H15.8307C14.3406 7.874 13.8748 8.79876 13.8748 9.74884V12H17.2026L16.6711 15.4696H13.8748V23.8549C19.6124 22.9554 24 17.9907 24 12Z",fill:"#1977F3"}),o.jsx("path",{d:"M16.6717 15.4708L17.2033 12.0012H13.8755V9.75008C13.8755 8.80169 14.3396 7.87524 15.8313 7.87524H17.345V4.92207C17.345 4.92207 15.9714 4.6875 14.6585 4.6875C11.918 4.6875 10.1258 6.34803 10.1258 9.35689V12.0012H7.07812V15.4708H10.1258V23.8561C10.7367 23.9523 11.3628 24.0012 12.0006 24.0012C12.6385 24.0012 13.2646 23.9506 13.8755 23.8561V15.4708H16.6717Z",fill:"#FEFEFE"})]}),P$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),o.jsx("path",{d:"M20.4491 20.4496H16.8931V14.8805C16.8931 13.5525 16.8694 11.8429 15.0436 11.8429C13.1915 11.8429 12.9081 13.2899 12.9081 14.7838V20.4492H9.35203V8.99689H12.7658V10.562H12.8136C13.1553 9.97782 13.649 9.49726 14.2421 9.17149C14.8352 8.84572 15.5056 8.68693 16.1819 8.71203C19.7861 8.71203 20.4506 11.0828 20.4506 14.167L20.4491 20.4496ZM5.33963 7.43144C4.93148 7.43151 4.53247 7.31055 4.19307 7.08385C3.85367 6.85715 3.58913 6.53489 3.43287 6.15783C3.27661 5.78077 3.23566 5.36584 3.31521 4.96551C3.39477 4.56517 3.59125 4.19743 3.8798 3.90876C4.16835 3.6201 4.53602 3.42348 4.93631 3.34378C5.3366 3.26408 5.75152 3.30488 6.12863 3.46101C6.50573 3.61713 6.82807 3.88158 7.05489 4.22091C7.2817 4.56025 7.40281 4.95922 7.40288 5.36738C7.40293 5.63839 7.34959 5.90675 7.24593 6.15715C7.14227 6.40754 6.99032 6.63507 6.79873 6.82674C6.60714 7.0184 6.37966 7.17045 6.1293 7.27421C5.87895 7.37796 5.61062 7.43139 5.33963 7.43144ZM7.11765 20.4496H3.5579V8.99689H7.11765V20.4496ZM22.222 0.00163516H1.77099C1.30681 -0.00360329 0.859518 0.175663 0.52744 0.500042C0.195362 0.824421 0.00566506 1.26737 0 1.73156V22.2681C0.00547117 22.7325 0.195057 23.1758 0.527123 23.5005C0.85919 23.8252 1.30658 24.0048 1.77099 23.9999H22.222C22.6873 24.0057 23.1359 23.8266 23.4693 23.5019C23.8027 23.1772 23.9936 22.7334 24 22.2681V1.73008C23.9934 1.26497 23.8024 0.821515 23.469 0.497144C23.1356 0.172773 22.6871 -0.00598143 22.222 0.000152822",fill:"#0A66C2"})]}),U$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M2.4 0H21.6C22.9256 0 24 1.07443 24 2.4V21.6C24 22.9256 22.9256 24 21.6 24H2.4C1.07443 24 0 22.9256 0 21.6V2.4C0 1.07443 1.07443 0 2.4 0Z",fill:"#010101"}),o.jsx("path",{d:"M16.0971 9.46492C17.3375 10.3511 18.8571 10.8725 20.4981 10.8725V7.71605C20.1875 7.71617 19.8778 7.68377 19.5739 7.61937V10.104C17.9329 10.104 16.4136 9.58256 15.1729 8.69639V15.1378C15.1729 18.3601 12.5594 20.9721 9.33558 20.9721C8.13276 20.9721 7.01472 20.6087 6.08594 19.9853C7.14596 21.0686 8.62418 21.7407 10.2596 21.7407C13.4836 21.7407 16.0972 19.1286 16.0972 15.9062V9.46492H16.0971ZM17.2373 6.28044C16.6034 5.5883 16.1872 4.69375 16.0971 3.70479V3.29883H15.2213C15.4417 4.55571 16.1937 5.62956 17.2373 6.28044ZM8.12494 17.5127C7.77082 17.0486 7.5794 16.4808 7.58026 15.897C7.58026 14.4232 8.77571 13.2283 10.2505 13.2283C10.5254 13.2281 10.7986 13.2703 11.0605 13.3533V10.1263C10.7544 10.0844 10.4455 10.0666 10.1366 10.0732V12.5849C9.87454 12.5019 9.60122 12.4597 9.32629 12.4599C7.85147 12.4599 6.65612 13.6548 6.65612 15.1287C6.65612 16.1708 7.25362 17.0732 8.12494 17.5127Z",fill:"#EE1D52"}),o.jsx("path",{d:"M15.1726 8.69639C16.4133 9.58256 17.9326 10.104 19.5736 10.104V7.61937C18.6576 7.42444 17.8467 6.94594 17.237 6.28044C16.1934 5.62956 15.4414 4.55571 15.221 3.29883H12.9204V15.9061C12.9152 17.3758 11.7218 18.5658 10.2501 18.5658C9.38288 18.5658 8.61243 18.1527 8.12452 17.5127C7.2532 17.0732 6.6557 16.1708 6.6557 15.1287C6.6557 13.6548 7.85104 12.4599 9.32587 12.4599C9.60841 12.4599 9.88075 12.5039 10.1362 12.5849V10.0732C6.96907 10.1386 4.42188 12.7251 4.42188 15.9062C4.42188 17.4941 5.05621 18.9337 6.08563 19.9854C7.01441 20.6088 8.13245 20.9722 9.33528 20.9722C12.5591 20.9722 15.1726 18.3601 15.1726 15.1379V8.69639Z",fill:"white"}),o.jsx("path",{d:"M19.5758 7.6202V6.94836C18.7498 6.9496 17.9401 6.71839 17.2392 6.28116C17.8596 6.96001 18.6765 7.42815 19.5758 7.6202ZM15.2232 3.29966C15.2022 3.17955 15.186 3.05864 15.1748 2.93721V2.53125H11.9983V15.1386C11.9932 16.6082 10.7999 17.7982 9.32812 17.7982C8.89598 17.7982 8.48809 17.6958 8.12678 17.5135C8.61468 18.1535 9.38513 18.5666 10.2524 18.5666C11.7239 18.5666 12.9174 17.3766 12.9226 15.9069V3.29966H15.2232ZM10.1386 10.074V9.35876C9.87315 9.32247 9.60555 9.30433 9.33764 9.30447C6.1135 9.30447 3.5 11.9166 3.5 15.1386C3.5 17.1587 4.52715 18.9389 6.088 19.9862C5.05858 18.9344 4.42424 17.4948 4.42424 15.9069C4.42424 12.7259 6.97133 10.1394 10.1386 10.074Z",fill:"#69C9D0"})]}),F$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),o.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),o.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),o.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]});function Fi({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:J("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function z$({value:e,onChange:t,keysToMask:n=[],className:r,displayOnly:s=!1,showCopyButton:l=!1}){const c=(C,E)=>{if(!C||E.length===0)return!1;try{const R=JSON.parse(C),T=j=>typeof j!="object"||j===null?!1:Array.isArray(j)?j.some(O=>typeof O=="object"&&O!==null&&T(O)):Object.keys(j).some(O=>E.includes(O)||typeof j[O]=="object"&&j[O]!==null&&T(j[O]));return T(R)}catch{return!1}},d=s?!1:!e||n.length===0||!c(e,n),[h,m]=p.useState(d),[g,v]=p.useState(!1);p.useEffect(()=>{s?m(!1):(!e||n.length===0||!c(e,n))&&m(!0)},[e,n,s]),p.useEffect(()=>{if(g){const C=setTimeout(()=>{v(!1)},2e3);return()=>{clearTimeout(C)}}},[g]);const x=()=>{navigator.clipboard.writeText(e),v(!0)},b=C=>{if(!C)return"";try{const E=JSON.parse(C),R=O=>{if(typeof O!="object"||O===null)return O;const D=Array.isArray(O)?[...O]:{...O};return Array.isArray(D)?D.forEach((_,A)=>{typeof _=="object"&&_!==null&&(D[A]=R(_))}):Object.entries(D).forEach(([_,A])=>{if(n.includes(_))if(typeof A=="string"){const M=A.length;M>30?D[_]="*".repeat(Math.min(20,Math.ceil(M/3))):M>10?D[_]="*".repeat(Math.min(10,Math.ceil(M/2))):D[_]="*".repeat(M)}else D[_]="***";else typeof A=="object"&&A!==null&&(D[_]=R(A))}),D},j=R(typeof E=="object"?E:{});return JSON.stringify(j,null,2)}catch{return C}},w=e&&n.length>0&&c(e,n);return o.jsxs("div",{className:"relative",children:[!h&&w&&!s&&o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("div",{className:"absolute top-2 left-2 z-10",children:o.jsx(B9,{className:"h-4 w-4 text-gray-500"})})}),o.jsx(_t,{children:o.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),s?o.jsx("div",{className:`p-2 font-mono ${r??""} min-h-[150px] cursor-not-allowed whitespace-pre-wrap opacity-70`,children:b(e)}):o.jsx(Fi,{value:h?e:b(e),onChange:C=>{(h||!w)&&t&&t(C.target.value)},onFocus:C=>{!h&&w&&C.target.blur()},readOnly:!!(!h&&w),className:`font-mono ${r??""} ${!h&&w?"cursor-not-allowed opacity-70":""} min-h-[150px]`,rows:8}),w&&!s&&o.jsx(Ce,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{m(!h)},children:h?o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(j9,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),o.jsx(_t,{children:o.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Zj,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),o.jsx(_t,{children:o.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),l&&o.jsx(Ce,{type:"button",variant:"ghost",className:`absolute ${w&&!s?"top-2 right-24":"top-2 right-2"}`,onClick:x,children:o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("div",{className:"flex items-center gap-1",children:g?o.jsxs(o.Fragment,{children:[o.jsx(dr,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copied!"})]}):o.jsxs(o.Fragment,{children:[o.jsx(tf,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copy"})]})})}),o.jsx(_t,{children:o.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var It;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},e.getValidEnumValues=s=>{const l=e.objectKeys(s).filter(d=>typeof s[s[d]]!="number"),c={};for(const d of l)c[d]=s[d];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(l){return s[l]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},e.find=(s,l)=>{for(const c of s)if(l(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(It||(It={}));var qR;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(qR||(qR={}));const Ve=It.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),di=e=>{switch(typeof e){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(e)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(e)?Ve.array:e===null?Ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ve.promise:typeof Map<"u"&&e instanceof Map?Ve.map:typeof Set<"u"&&e instanceof Set?Ve.set:typeof Date<"u"&&e instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},Se=It.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Oo extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(l){return l.message},r={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let d=r,h=0;for(;h<c.path.length;){const m=c.path[h];h===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(n(c))):d[m]=d[m]||{_errors:[]},d=d[m],h++}}};return s(this),r}static assert(t){if(!(t instanceof Oo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,It.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const l=s.path[0];n[l]=n[l]||[],n[l].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Oo.create=e=>new Oo(e);const T0=(e,t)=>{let n;switch(e.code){case Se.invalid_type:e.received===Ve.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,It.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${It.joinValues(e.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${It.joinValues(e.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${It.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:It.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=t.defaultError,It.assertNever(e)}return{message:n}};let V$=T0;function H$(){return V$}const $$=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let d="";const h=r.filter(m=>!!m).slice().reverse();for(const m of h)d=m(c,{data:t,defaultError:d}).message;return{...s,path:l,message:d}};function Oe(e,t){const n=H$(),r=$$({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===T0?void 0:T0].filter(s=>!!s)});e.common.issues.push(r)}class Vr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return it;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const l=await s.key,c=await s.value;r.push({key:l,value:c})}return Vr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return it;l.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[l.value]=c.value)}return{status:t.value,value:r}}}const it=Object.freeze({status:"aborted"}),zd=e=>({status:"dirty",value:e}),Ya=e=>({status:"valid",value:e}),ZR=e=>e.status==="aborted",KR=e=>e.status==="dirty",uu=e=>e.status==="valid",up=e=>typeof Promise<"u"&&e instanceof Promise;var Qe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Qe||(Qe={}));class zs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const YR=(e,t)=>{if(uu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Oo(e.common.issues);return this._error=n,this._error}}};function pt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(c,d)=>{const{message:h}=e;return c.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:h??r??d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:h??n??d.defaultError}},description:s}}class Nt{get description(){return this._def.description}_getType(t){return di(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:di(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Vr,ctx:{common:t.parent.common,data:t.data,parsedType:di(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(up(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:di(t)},s=this._parseSync({data:t,path:r.path,parent:r});return YR(r,s)}"~validate"(t){var r,s;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:di(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return uu(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(s=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>uu(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:di(t)},s=this._parse({data:t,path:r.path,parent:r}),l=await(up(s)?s:Promise.resolve(s));return YR(r,l)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=t(s),d=()=>l.addIssue({code:Se.custom,...r(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Ol({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Eo.create(this,this._def)}nullable(){return Ml.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ps.create(this)}promise(){return yp.create(this,this._def)}or(t){return hp.create([this,t],this._def)}and(t){return mp.create(this,t,this._def)}transform(t){return new Ol({...pt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new xp({...pt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new ZA({typeName:lt.ZodBranded,type:this,...pt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new bp({...pt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return l1.create(this,t)}readonly(){return Sp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const B$=/^c[^\s-]{8,}$/i,G$=/^[0-9a-z]+$/,q$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Z$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,K$=/^[a-z0-9_-]{21}$/i,Y$=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,W$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Q$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,X$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ex;const J$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eB=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,tB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nB=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,BA="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sB=new RegExp(`^${BA}$`);function GA(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function oB(e){return new RegExp(`^${GA(e)}$`)}function iB(e){let t=`${BA}T${GA(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function lB(e,t){return!!((t==="v4"||!t)&&J$.test(e)||(t==="v6"||!t)&&tB.test(e))}function cB(e,t){if(!Y$.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function uB(e,t){return!!((t==="v4"||!t)&&eB.test(e)||(t==="v6"||!t)&&nB.test(e))}class Co extends Nt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ve.string){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_type,expected:Ve.string,received:l.parsedType}),it}const r=new Vr;let s;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const c=t.data.length>l.value,d=t.data.length<l.value;(c||d)&&(s=this._getOrReturnCtx(t,s),c?Oe(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&Oe(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")Q$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"email",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Ex||(Ex=new RegExp(X$,"u")),Ex.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"emoji",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")Z$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"uuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")K$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"nanoid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")B$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"cuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")G$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"cuid2",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")q$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"ulid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Oe(s,{validation:"url",code:Se.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"regex",code:Se.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?iB(l).test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?sB.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?oB(l).test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?W$.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"duration",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?lB(t.data,l.version)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"ip",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?cB(t.data,l.alg)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"jwt",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?uB(t.data,l.version)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"cidr",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?rB.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"base64",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?aB.test(t.data)||(s=this._getOrReturnCtx(t,s),Oe(s,{validation:"base64url",code:Se.invalid_string,message:l.message}),r.dirty()):It.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Se.invalid_string,...Qe.errToObj(r)})}_addCheck(t){return new Co({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Qe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Qe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Qe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Qe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Qe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Qe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Qe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Qe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Qe.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Qe.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Qe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Qe.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Qe.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Qe.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Qe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Qe.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Qe.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Qe.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Qe.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Qe.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Qe.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Qe.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Qe.errToObj(n)})}nonempty(t){return this.min(1,Qe.errToObj(t))}trim(){return new Co({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Co({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Co({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Co.create=e=>new Co({checks:[],typeName:lt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...pt(e)});function dB(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}class du extends Nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ve.number){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_type,expected:Ve.number,received:l.parsedType}),it}let r;const s=new Vr;for(const l of this._def.checks)l.kind==="int"?It.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?dB(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.not_finite,message:l.message}),s.dirty()):It.assertNever(l);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Qe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qe.toString(n))}setLimit(t,n,r,s){return new du({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new du({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Qe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Qe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Qe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Qe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Qe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qe.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Qe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Qe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Qe.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&It.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}du.create=e=>new du({checks:[],typeName:lt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...pt(e)});class cf extends Nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ve.bigint)return this._getInvalidInput(t);let r;const s=new Vr;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):It.assertNever(l);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Se.invalid_type,expected:Ve.bigint,received:n.parsedType}),it}gte(t,n){return this.setLimit("min",t,!0,Qe.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Qe.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Qe.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Qe.toString(n))}setLimit(t,n,r,s){return new cf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new cf({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Qe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Qe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Qe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Qe.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Qe.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}cf.create=e=>new cf({checks:[],typeName:lt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...pt(e)});class j0 extends Nt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ve.boolean){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:Ve.boolean,received:r.parsedType}),it}return Ya(t.data)}}j0.create=e=>new j0({typeName:lt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...pt(e)});class dp extends Nt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ve.date){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_type,expected:Ve.date,received:l.parsedType}),it}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return Oe(l,{code:Se.invalid_date}),it}const r=new Vr;let s;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(s=this._getOrReturnCtx(t,s),Oe(s,{code:Se.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):It.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new dp({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Qe.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Qe.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}dp.create=e=>new dp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:lt.ZodDate,...pt(e)});class WR extends Nt{_parse(t){if(this._getType(t)!==Ve.symbol){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:Ve.symbol,received:r.parsedType}),it}return Ya(t.data)}}WR.create=e=>new WR({typeName:lt.ZodSymbol,...pt(e)});class _0 extends Nt{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:Ve.undefined,received:r.parsedType}),it}return Ya(t.data)}}_0.create=e=>new _0({typeName:lt.ZodUndefined,...pt(e)});class fp extends Nt{_parse(t){if(this._getType(t)!==Ve.null){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:Ve.null,received:r.parsedType}),it}return Ya(t.data)}}fp.create=e=>new fp({typeName:lt.ZodNull,...pt(e)});class QR extends Nt{constructor(){super(...arguments),this._any=!0}_parse(t){return Ya(t.data)}}QR.create=e=>new QR({typeName:lt.ZodAny,...pt(e)});class N0 extends Nt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ya(t.data)}}N0.create=e=>new N0({typeName:lt.ZodUnknown,...pt(e)});class _i extends Nt{_parse(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Se.invalid_type,expected:Ve.never,received:n.parsedType}),it}}_i.create=e=>new _i({typeName:lt.ZodNever,...pt(e)});class XR extends Nt{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:Ve.void,received:r.parsedType}),it}return Ya(t.data)}}XR.create=e=>new XR({typeName:lt.ZodVoid,...pt(e)});class Ps extends Nt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ve.array)return Oe(n,{code:Se.invalid_type,expected:Ve.array,received:n.parsedType}),it;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,d=n.data.length<s.exactLength.value;(c||d)&&(Oe(n,{code:c?Se.too_big:Se.too_small,minimum:d?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(Oe(n,{code:Se.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(Oe(n,{code:Se.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>s.type._parseAsync(new zs(n,c,n.path,d)))).then(c=>Vr.mergeArray(r,c));const l=[...n.data].map((c,d)=>s.type._parseSync(new zs(n,c,n.path,d)));return Vr.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new Ps({...this._def,minLength:{value:t,message:Qe.toString(n)}})}max(t,n){return new Ps({...this._def,maxLength:{value:t,message:Qe.toString(n)}})}length(t,n){return new Ps({...this._def,exactLength:{value:t,message:Qe.toString(n)}})}nonempty(t){return this.min(1,t)}}Ps.create=(e,t)=>new Ps({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...pt(t)});function zc(e){if(e instanceof Gn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Eo.create(zc(r))}return new Gn({...e._def,shape:()=>t})}else return e instanceof Ps?new Ps({...e._def,type:zc(e.element)}):e instanceof Eo?Eo.create(zc(e.unwrap())):e instanceof Ml?Ml.create(zc(e.unwrap())):e instanceof Al?Al.create(e.items.map(t=>zc(t))):e}class Gn extends Nt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=It.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ve.object){const m=this._getOrReturnCtx(t);return Oe(m,{code:Se.invalid_type,expected:Ve.object,received:m.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(t),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof _i&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||d.push(m);const h=[];for(const m of c){const g=l[m],v=s.data[m];h.push({key:{status:"valid",value:m},value:g._parse(new zs(s,v,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof _i){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of d)h.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(m==="strict")d.length>0&&(Oe(s,{code:Se.unrecognized_keys,keys:d}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const g of d){const v=s.data[g];h.push({key:{status:"valid",value:g},value:m._parse(new zs(s,v,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const g of h){const v=await g.key,x=await g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m}).then(m=>Vr.mergeObjectSync(r,m)):Vr.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(t){return Qe.errToObj,new Gn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,c;const s=((c=(l=this._def).errorMap)==null?void 0:c.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Qe.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new Gn({...this._def,unknownKeys:"strip"})}passthrough(){return new Gn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Gn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Gn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:lt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Gn({...this._def,catchall:t})}pick(t){const n={};for(const r of It.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Gn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of It.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Gn({...this._def,shape:()=>n})}deepPartial(){return zc(this)}partial(t){const n={};for(const r of It.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new Gn({...this._def,shape:()=>n})}required(t){const n={};for(const r of It.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof Eo;)l=l._def.innerType;n[r]=l}return new Gn({...this._def,shape:()=>n})}keyof(){return qA(It.objectKeys(this.shape))}}Gn.create=(e,t)=>new Gn({shape:()=>e,unknownKeys:"strip",catchall:_i.create(),typeName:lt.ZodObject,...pt(t)});Gn.strictCreate=(e,t)=>new Gn({shape:()=>e,unknownKeys:"strict",catchall:_i.create(),typeName:lt.ZodObject,...pt(t)});Gn.lazycreate=(e,t)=>new Gn({shape:e,unknownKeys:"strip",catchall:_i.create(),typeName:lt.ZodObject,...pt(t)});class hp extends Nt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Oo(d.ctx.common.issues));return Oe(n,{code:Se.invalid_union,unionErrors:c}),it}if(n.common.async)return Promise.all(r.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const h of r){const m={...n,common:{...n.common,issues:[]},parent:null},g=h._parseSync({data:n.data,path:n.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!l&&(l={result:g,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(h=>new Oo(h));return Oe(n,{code:Se.invalid_union,unionErrors:d}),it}}get options(){return this._def.options}}hp.create=(e,t)=>new hp({options:e,typeName:lt.ZodUnion,...pt(t)});const vo=e=>e instanceof D0?vo(e.schema):e instanceof Ol?vo(e.innerType()):e instanceof gp?[e.value]:e instanceof Dl?e.options:e instanceof vp?It.objectValues(e.enum):e instanceof xp?vo(e._def.innerType):e instanceof _0?[void 0]:e instanceof fp?[null]:e instanceof Eo?[void 0,...vo(e.unwrap())]:e instanceof Ml?[null,...vo(e.unwrap())]:e instanceof ZA||e instanceof Sp?vo(e.unwrap()):e instanceof bp?vo(e._def.innerType):[];class i1 extends Nt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.object)return Oe(n,{code:Se.invalid_type,expected:Ve.object,received:n.parsedType}),it;const r=this.discriminator,s=n.data[r],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(Oe(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const l of n){const c=vo(l.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of c){if(s.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);s.set(d,l)}}return new i1({typeName:lt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...pt(r)})}}function A0(e,t){const n=di(e),r=di(t);if(e===t)return{valid:!0,data:e};if(n===Ve.object&&r===Ve.object){const s=It.objectKeys(t),l=It.objectKeys(e).filter(d=>s.indexOf(d)!==-1),c={...e,...t};for(const d of l){const h=A0(e[d],t[d]);if(!h.valid)return{valid:!1};c[d]=h.data}return{valid:!0,data:c}}else if(n===Ve.array&&r===Ve.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let l=0;l<e.length;l++){const c=e[l],d=t[l],h=A0(c,d);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return n===Ve.date&&r===Ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class mp extends Nt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(l,c)=>{if(ZR(l)||ZR(c))return it;const d=A0(l.value,c.value);return d.valid?((KR(l)||KR(c))&&n.dirty(),{status:n.value,value:d.data}):(Oe(r,{code:Se.invalid_intersection_types}),it)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}mp.create=(e,t,n)=>new mp({left:e,right:t,typeName:lt.ZodIntersection,...pt(n)});class Al extends Nt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.array)return Oe(r,{code:Se.invalid_type,expected:Ve.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return Oe(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(Oe(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...r.data].map((c,d)=>{const h=this._def.items[d]||this._def.rest;return h?h._parse(new zs(r,c,r.path,d)):null}).filter(c=>!!c);return r.common.async?Promise.all(l).then(c=>Vr.mergeArray(n,c)):Vr.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new Al({...this._def,rest:t})}}Al.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Al({items:e,typeName:lt.ZodTuple,rest:null,...pt(t)})};class pp extends Nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.object)return Oe(r,{code:Se.invalid_type,expected:Ve.object,received:r.parsedType}),it;const s=[],l=this._def.keyType,c=this._def.valueType;for(const d in r.data)s.push({key:l._parse(new zs(r,d,r.path,d)),value:c._parse(new zs(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?Vr.mergeObjectAsync(n,s):Vr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Nt?new pp({keyType:t,valueType:n,typeName:lt.ZodRecord,...pt(r)}):new pp({keyType:Co.create(),valueType:t,typeName:lt.ZodRecord,...pt(n)})}}class JR extends Nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.map)return Oe(r,{code:Se.invalid_type,expected:Ve.map,received:r.parsedType}),it;const s=this._def.keyType,l=this._def.valueType,c=[...r.data.entries()].map(([d,h],m)=>({key:s._parse(new zs(r,d,r.path,[m,"key"])),value:l._parse(new zs(r,h,r.path,[m,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const h of c){const m=await h.key,g=await h.value;if(m.status==="aborted"||g.status==="aborted")return it;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const h of c){const m=h.key,g=h.value;if(m.status==="aborted"||g.status==="aborted")return it;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}}}}JR.create=(e,t,n)=>new JR({valueType:t,keyType:e,typeName:lt.ZodMap,...pt(n)});class uf extends Nt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.set)return Oe(r,{code:Se.invalid_type,expected:Ve.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Oe(r,{code:Se.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(Oe(r,{code:Se.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(h){const m=new Set;for(const g of h){if(g.status==="aborted")return it;g.status==="dirty"&&n.dirty(),m.add(g.value)}return{status:n.value,value:m}}const d=[...r.data.values()].map((h,m)=>l._parse(new zs(r,h,r.path,m)));return r.common.async?Promise.all(d).then(h=>c(h)):c(d)}min(t,n){return new uf({...this._def,minSize:{value:t,message:Qe.toString(n)}})}max(t,n){return new uf({...this._def,maxSize:{value:t,message:Qe.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}uf.create=(e,t)=>new uf({valueType:e,minSize:null,maxSize:null,typeName:lt.ZodSet,...pt(t)});class D0 extends Nt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}D0.create=(e,t)=>new D0({getter:e,typeName:lt.ZodLazy,...pt(t)});class gp extends Nt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Oe(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:t.data}}get value(){return this._def.value}}gp.create=(e,t)=>new gp({value:e,typeName:lt.ZodLiteral,...pt(t)});function qA(e,t){return new Dl({values:e,typeName:lt.ZodEnum,...pt(t)})}class Dl extends Nt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{expected:It.joinValues(r),received:n.parsedType,code:Se.invalid_type}),it}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{received:n.data,code:Se.invalid_enum_value,options:r}),it}return Ya(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Dl.create(t,{...this._def,...n})}exclude(t,n=this._def){return Dl.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Dl.create=qA;class vp extends Nt{_parse(t){const n=It.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ve.string&&r.parsedType!==Ve.number){const s=It.objectValues(n);return Oe(r,{expected:It.joinValues(s),received:r.parsedType,code:Se.invalid_type}),it}if(this._cache||(this._cache=new Set(It.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=It.objectValues(n);return Oe(r,{received:r.data,code:Se.invalid_enum_value,options:s}),it}return Ya(t.data)}get enum(){return this._def.values}}vp.create=(e,t)=>new vp({values:e,typeName:lt.ZodNativeEnum,...pt(t)});class yp extends Nt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.promise&&n.common.async===!1)return Oe(n,{code:Se.invalid_type,expected:Ve.promise,received:n.parsedType}),it;const r=n.parsedType===Ve.promise?n.data:Promise.resolve(n.data);return Ya(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}yp.create=(e,t)=>new yp({type:e,typeName:lt.ZodPromise,...pt(t)});class Ol extends Nt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,l={addIssue:c=>{Oe(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(r.data,l);if(r.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return it;const h=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return h.status==="aborted"?it:h.status==="dirty"||n.value==="dirty"?zd(h.value):h});{if(n.value==="aborted")return it;const d=this._def.schema._parseSync({data:c,path:r.path,parent:r});return d.status==="aborted"?it:d.status==="dirty"||n.value==="dirty"?zd(d.value):d}}if(s.type==="refinement"){const c=d=>{const h=s.refinement(d,l);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?it:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?it:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(s.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!uu(c))return it;const d=s.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>uu(c)?Promise.resolve(s.transform(c.value,l)).then(d=>({status:n.value,value:d})):it);It.assertNever(s)}}Ol.create=(e,t,n)=>new Ol({schema:e,typeName:lt.ZodEffects,effect:t,...pt(n)});Ol.createWithPreprocess=(e,t,n)=>new Ol({schema:t,effect:{type:"preprocess",transform:e},typeName:lt.ZodEffects,...pt(n)});class Eo extends Nt{_parse(t){return this._getType(t)===Ve.undefined?Ya(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Eo.create=(e,t)=>new Eo({innerType:e,typeName:lt.ZodOptional,...pt(t)});class Ml extends Nt{_parse(t){return this._getType(t)===Ve.null?Ya(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ml.create=(e,t)=>new Ml({innerType:e,typeName:lt.ZodNullable,...pt(t)});class xp extends Nt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}xp.create=(e,t)=>new xp({innerType:e,typeName:lt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...pt(t)});class bp extends Nt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return up(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Oo(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Oo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}bp.create=(e,t)=>new bp({innerType:e,typeName:lt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...pt(t)});class eT extends Nt{_parse(t){if(this._getType(t)!==Ve.nan){const r=this._getOrReturnCtx(t);return Oe(r,{code:Se.invalid_type,expected:Ve.nan,received:r.parsedType}),it}return{status:"valid",value:t.data}}}eT.create=e=>new eT({typeName:lt.ZodNaN,...pt(e)});class ZA extends Nt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class l1 extends Nt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?it:l.status==="dirty"?(n.dirty(),zd(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?it:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new l1({in:t,out:n,typeName:lt.ZodPipeline})}}class Sp extends Nt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(uu(s)&&(s.value=Object.freeze(s.value)),s);return up(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Sp.create=(e,t)=>new Sp({innerType:e,typeName:lt.ZodReadonly,...pt(t)});var lt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(lt||(lt={}));const on=Co.create,fB=du.create,hB=j0.create,mB=fp.create,pB=N0.create;_i.create;const tT=Ps.create,sn=Gn.create,gB=hp.create,KA=i1.create;mp.create;Al.create;const vB=pp.create,qs=gp.create;Dl.create;const c1=vp.create;yp.create;Eo.create;const yB=Ml.create,Rx=it,YA=sn({serviceAccount:on().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON object"}),Rx):n.client_email?e:(t.addIssue({code:Se.custom,message:"Service Account must contain a client_email field"}),Rx)}catch(n){return console.error(n),t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON string"}),Rx}})}),xB=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:T$,visible:{flagKey:"MENU_GITHUB_COMMUNITY_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",title:"Discover Upgrade Options",href:"https://www.owox.com/pricing/?utm_source=bi_owox_com&utm_medium=community_edition&utm_campaign=pricing&utm_keyword=upgrade_options&utm_content=header_dropdown",icon:K2,visible:{flagKey:"MENU_UPGRADE_OPTIONS_VISIBLE",expectedValue:"true"},group:"community"},{type:"menu-item",title:"Project settings",href:"https://platform.owox.com/ui/p/none/settings/general",icon:Wj,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Credits consumption",href:"https://platform.owox.com/ui/p/none/settings/consumption",icon:K2,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:YI,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:Y2,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:Y2,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:X9,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:HI,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:k$,visible:{flagKey:"MENU_SLACK_COMMUNITY_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:yL,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:M$,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function nT(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function bB(){const{flags:e}=e1(),{loadProjects:t,projects:n}=zA(),{id:r}=dA(),s=nT("IDP_PROVIDER","owox",e);p.useEffect(()=>{s&&t()},[t,s]);const l=n.length>1;return{visibleMenuItems:p.useMemo(()=>{const h=xB.filter(x=>typeof x.visible=="boolean"?x.visible:nT(x.visible.flagKey,x.visible.expectedValue,e)).map(x=>{if(x.group==="project"&&x.href&&r)try{const b=x.href.replace("/p/none/",`/p/${r}/`);return{...x,href:b}}catch{return x}return x}),m=new Map;h.forEach(x=>{const b=x.group||"default";m.has(b)||m.set(b,[]);const w=m.get(b);w&&w.push(x)});const g=[],v=Array.from(m.entries()).filter(([,x])=>x.length>0);return v.forEach(([,x],b)=>{g.push(...x),b<v.length-1&&g.push({type:"separator",visible:!0})}),g},[e,r]),canSwitchProject:l}}function SB(){const{visibleMenuItems:e,canSwitchProject:t}=bB();return o.jsxs(Er,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return o.jsx(Ga,{},`separator-${String(r)}`);const s=n.icon;return o.jsx(bt,{asChild:!0,children:o.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[o.jsx(s,{className:"size-4"}),n.title]})},n.href)}),t&&o.jsx(R$,{},"switch-project")]})}var Mr=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(Mr||{});let CB={data:""},wB=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||CB},EB=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,RB=/\/\*[^]*?\*\/| +/g,rT=/\n+/g,pi=(e,t)=>{let n="",r="",s="";for(let l in e){let c=e[l];l[0]=="@"?l[1]=="i"?n=l+" "+c+";":r+=l[1]=="f"?pi(c,l):l+"{"+pi(c,l[1]=="k"?"":t)+"}":typeof c=="object"?r+=pi(c,t?t.replace(/([^,])+/g,d=>l.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,h=>/&/.test(h)?h.replace(/&/g,d):d?d+" "+h:h)):l):c!=null&&(l=/^--/.test(l)?l:l.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=pi.p?pi.p(l,c):l+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},mo={},WA=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+WA(e[n]);return t}return e},TB=(e,t,n,r,s)=>{let l=WA(e),c=mo[l]||(mo[l]=(h=>{let m=0,g=11;for(;m<h.length;)g=101*g+h.charCodeAt(m++)>>>0;return"go"+g})(l));if(!mo[c]){let h=l!==e?e:(m=>{let g,v,x=[{}];for(;g=EB.exec(m.replace(RB,""));)g[4]?x.shift():g[3]?(v=g[3].replace(rT," ").trim(),x.unshift(x[0][v]=x[0][v]||{})):x[0][g[1]]=g[2].replace(rT," ").trim();return x[0]})(e);mo[c]=pi(s?{["@keyframes "+c]:h}:h,n?"":"."+c)}let d=n&&mo.g?mo.g:null;return n&&(mo.g=mo[c]),((h,m,g,v)=>{v?m.data=m.data.replace(v,h):m.data.indexOf(h)===-1&&(m.data=g?h+m.data:m.data+h)})(mo[c],t,r,d),c},jB=(e,t,n)=>e.reduce((r,s,l)=>{let c=t[l];if(c&&c.call){let d=c(n),h=d&&d.props&&d.props.className||/^go/.test(d)&&d;c=h?"."+h:d&&typeof d=="object"?d.props?"":pi(d,""):d===!1?"":d}return r+s+(c??"")},"");function pg(e){let t=this||{},n=e.call?e(t.p):e;return TB(n.unshift?n.raw?jB(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,wB(t.target),t.g,t.o,t.k)}let QA,O0,M0;pg.bind({g:1});let Mo=pg.bind({k:1});function _B(e,t,n,r){pi.p=t,QA=e,O0=n,M0=r}function zi(e,t){let n=this||{};return function(){let r=arguments;function s(l,c){let d=Object.assign({},l),h=d.className||s.className;n.p=Object.assign({theme:O0&&O0()},d),n.o=/ *go\d+/.test(h),d.className=pg.apply(n,r)+(h?" "+h:"");let m=e;return e[0]&&(m=d.as||e,delete d.as),M0&&m[0]&&M0(d),QA(m,d)}return s}}var NB=e=>typeof e=="function",Cp=(e,t)=>NB(e)?e(t):e,AB=(()=>{let e=0;return()=>(++e).toString()})(),XA=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),DB=20,u1="default",JA=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(c=>c.id===t.toast.id?{...c,...t.toast}:c)};case 2:let{toast:r}=t;return JA(e,{type:e.toasts.find(c=>c.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(c=>c.id===s||s===void 0?{...c,dismissed:!0,visible:!1}:c)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(c=>c.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let l=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(c=>({...c,pauseDuration:c.pauseDuration+l}))}}},Gm=[],e4={toasts:[],pausedAt:void 0,settings:{toastLimit:DB}},Ms={},t4=(e,t=u1)=>{Ms[t]=JA(Ms[t]||e4,e),Gm.forEach(([n,r])=>{n===t&&r(Ms[t])})},n4=e=>Object.keys(Ms).forEach(t=>t4(e,t)),OB=e=>Object.keys(Ms).find(t=>Ms[t].toasts.some(n=>n.id===e)),gg=(e=u1)=>t=>{t4(t,e)},MB={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},kB=(e={},t=u1)=>{let[n,r]=p.useState(Ms[t]||e4),s=p.useRef(Ms[t]);p.useEffect(()=>(s.current!==Ms[t]&&r(Ms[t]),Gm.push([t,r]),()=>{let c=Gm.findIndex(([d])=>d===t);c>-1&&Gm.splice(c,1)}),[t]);let l=n.toasts.map(c=>{var d,h,m;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((d=e[c.type])==null?void 0:d.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((h=e[c.type])==null?void 0:h.duration)||(e==null?void 0:e.duration)||MB[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:l}},IB=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||AB()}),zf=e=>(t,n)=>{let r=IB(t,e,n);return gg(r.toasterId||OB(r.id))({type:2,toast:r}),r.id},an=(e,t)=>zf("blank")(e,t);an.error=zf("error");an.success=zf("success");an.loading=zf("loading");an.custom=zf("custom");an.dismiss=(e,t)=>{let n={type:3,toastId:e};t?gg(t)(n):n4(n)};an.dismissAll=e=>an.dismiss(void 0,e);an.remove=(e,t)=>{let n={type:4,toastId:e};t?gg(t)(n):n4(n)};an.removeAll=e=>an.remove(void 0,e);an.promise=(e,t,n)=>{let r=an.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let l=t.success?Cp(t.success,s):void 0;return l?an.success(l,{id:r,...n,...n==null?void 0:n.success}):an.dismiss(r),s}).catch(s=>{let l=t.error?Cp(t.error,s):void 0;l?an.error(l,{id:r,...n,...n==null?void 0:n.error}):an.dismiss(r)}),e};var LB=1e3,PB=(e,t="default")=>{let{toasts:n,pausedAt:r}=kB(e,t),s=p.useRef(new Map).current,l=p.useCallback((v,x=LB)=>{if(s.has(v))return;let b=setTimeout(()=>{s.delete(v),c({type:4,toastId:v})},x);s.set(v,b)},[]);p.useEffect(()=>{if(r)return;let v=Date.now(),x=n.map(b=>{if(b.duration===1/0)return;let w=(b.duration||0)+b.pauseDuration-(v-b.createdAt);if(w<0){b.visible&&an.dismiss(b.id);return}return setTimeout(()=>an.dismiss(b.id,t),w)});return()=>{x.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let c=p.useCallback(gg(t),[t]),d=p.useCallback(()=>{c({type:5,time:Date.now()})},[c]),h=p.useCallback((v,x)=>{c({type:1,toast:{id:v,height:x}})},[c]),m=p.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=p.useCallback((v,x)=>{let{reverseOrder:b=!1,gutter:w=8,defaultPosition:C}=x||{},E=n.filter(j=>(j.position||C)===(v.position||C)&&j.height),R=E.findIndex(j=>j.id===v.id),T=E.filter((j,O)=>O<R&&j.visible).length;return E.filter(j=>j.visible).slice(...b?[T+1]:[0,T]).reduce((j,O)=>j+(O.height||0)+w,0)},[n]);return p.useEffect(()=>{n.forEach(v=>{if(v.dismissed)l(v.id,v.removeDelay);else{let x=s.get(v.id);x&&(clearTimeout(x),s.delete(v.id))}})},[n,l]),{toasts:n,handlers:{updateHeight:h,startPause:d,endPause:m,calculateOffset:g}}},UB=Mo`
|
|
506
|
-
from {
|
|
507
|
-
transform: scale(0) rotate(45deg);
|
|
508
|
-
opacity: 0;
|
|
509
|
-
}
|
|
510
|
-
to {
|
|
511
|
-
transform: scale(1) rotate(45deg);
|
|
512
|
-
opacity: 1;
|
|
513
|
-
}`,FB=Mo`
|
|
514
|
-
from {
|
|
515
|
-
transform: scale(0);
|
|
516
|
-
opacity: 0;
|
|
517
|
-
}
|
|
518
|
-
to {
|
|
519
|
-
transform: scale(1);
|
|
520
|
-
opacity: 1;
|
|
521
|
-
}`,zB=Mo`
|
|
522
|
-
from {
|
|
523
|
-
transform: scale(0) rotate(90deg);
|
|
524
|
-
opacity: 0;
|
|
525
|
-
}
|
|
526
|
-
to {
|
|
527
|
-
transform: scale(1) rotate(90deg);
|
|
528
|
-
opacity: 1;
|
|
529
|
-
}`,VB=zi("div")`
|
|
530
|
-
width: 20px;
|
|
531
|
-
opacity: 0;
|
|
532
|
-
height: 20px;
|
|
533
|
-
border-radius: 10px;
|
|
534
|
-
background: ${e=>e.primary||"#ff4b4b"};
|
|
535
|
-
position: relative;
|
|
536
|
-
transform: rotate(45deg);
|
|
537
|
-
|
|
538
|
-
animation: ${UB} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
539
|
-
forwards;
|
|
540
|
-
animation-delay: 100ms;
|
|
541
|
-
|
|
542
|
-
&:after,
|
|
543
|
-
&:before {
|
|
544
|
-
content: '';
|
|
545
|
-
animation: ${FB} 0.15s ease-out forwards;
|
|
546
|
-
animation-delay: 150ms;
|
|
547
|
-
position: absolute;
|
|
548
|
-
border-radius: 3px;
|
|
549
|
-
opacity: 0;
|
|
550
|
-
background: ${e=>e.secondary||"#fff"};
|
|
551
|
-
bottom: 9px;
|
|
552
|
-
left: 4px;
|
|
553
|
-
height: 2px;
|
|
554
|
-
width: 12px;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
&:before {
|
|
558
|
-
animation: ${zB} 0.15s ease-out forwards;
|
|
559
|
-
animation-delay: 180ms;
|
|
560
|
-
transform: rotate(90deg);
|
|
561
|
-
}
|
|
562
|
-
`,HB=Mo`
|
|
563
|
-
from {
|
|
564
|
-
transform: rotate(0deg);
|
|
565
|
-
}
|
|
566
|
-
to {
|
|
567
|
-
transform: rotate(360deg);
|
|
568
|
-
}
|
|
569
|
-
`,$B=zi("div")`
|
|
570
|
-
width: 12px;
|
|
571
|
-
height: 12px;
|
|
572
|
-
box-sizing: border-box;
|
|
573
|
-
border: 2px solid;
|
|
574
|
-
border-radius: 100%;
|
|
575
|
-
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
576
|
-
border-right-color: ${e=>e.primary||"#616161"};
|
|
577
|
-
animation: ${HB} 1s linear infinite;
|
|
578
|
-
`,BB=Mo`
|
|
579
|
-
from {
|
|
580
|
-
transform: scale(0) rotate(45deg);
|
|
581
|
-
opacity: 0;
|
|
582
|
-
}
|
|
583
|
-
to {
|
|
584
|
-
transform: scale(1) rotate(45deg);
|
|
585
|
-
opacity: 1;
|
|
586
|
-
}`,GB=Mo`
|
|
587
|
-
0% {
|
|
588
|
-
height: 0;
|
|
589
|
-
width: 0;
|
|
590
|
-
opacity: 0;
|
|
591
|
-
}
|
|
592
|
-
40% {
|
|
593
|
-
height: 0;
|
|
594
|
-
width: 6px;
|
|
595
|
-
opacity: 1;
|
|
596
|
-
}
|
|
597
|
-
100% {
|
|
598
|
-
opacity: 1;
|
|
599
|
-
height: 10px;
|
|
600
|
-
}`,qB=zi("div")`
|
|
601
|
-
width: 20px;
|
|
602
|
-
opacity: 0;
|
|
603
|
-
height: 20px;
|
|
604
|
-
border-radius: 10px;
|
|
605
|
-
background: ${e=>e.primary||"#61d345"};
|
|
606
|
-
position: relative;
|
|
607
|
-
transform: rotate(45deg);
|
|
608
|
-
|
|
609
|
-
animation: ${BB} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
610
|
-
forwards;
|
|
611
|
-
animation-delay: 100ms;
|
|
612
|
-
&:after {
|
|
613
|
-
content: '';
|
|
614
|
-
box-sizing: border-box;
|
|
615
|
-
animation: ${GB} 0.2s ease-out forwards;
|
|
616
|
-
opacity: 0;
|
|
617
|
-
animation-delay: 200ms;
|
|
618
|
-
position: absolute;
|
|
619
|
-
border-right: 2px solid;
|
|
620
|
-
border-bottom: 2px solid;
|
|
621
|
-
border-color: ${e=>e.secondary||"#fff"};
|
|
622
|
-
bottom: 6px;
|
|
623
|
-
left: 6px;
|
|
624
|
-
height: 10px;
|
|
625
|
-
width: 6px;
|
|
626
|
-
}
|
|
627
|
-
`,ZB=zi("div")`
|
|
628
|
-
position: absolute;
|
|
629
|
-
`,KB=zi("div")`
|
|
630
|
-
position: relative;
|
|
631
|
-
display: flex;
|
|
632
|
-
justify-content: center;
|
|
633
|
-
align-items: center;
|
|
634
|
-
min-width: 20px;
|
|
635
|
-
min-height: 20px;
|
|
636
|
-
`,YB=Mo`
|
|
637
|
-
from {
|
|
638
|
-
transform: scale(0.6);
|
|
639
|
-
opacity: 0.4;
|
|
640
|
-
}
|
|
641
|
-
to {
|
|
642
|
-
transform: scale(1);
|
|
643
|
-
opacity: 1;
|
|
644
|
-
}`,WB=zi("div")`
|
|
645
|
-
position: relative;
|
|
646
|
-
transform: scale(0.6);
|
|
647
|
-
opacity: 0.4;
|
|
648
|
-
min-width: 20px;
|
|
649
|
-
animation: ${YB} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
650
|
-
forwards;
|
|
651
|
-
`,QB=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?p.createElement(WB,null,t):t:n==="blank"?null:p.createElement(KB,null,p.createElement($B,{...r}),n!=="loading"&&p.createElement(ZB,null,n==="error"?p.createElement(VB,{...r}):p.createElement(qB,{...r})))},XB=e=>`
|
|
652
|
-
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
653
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
654
|
-
`,JB=e=>`
|
|
655
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
656
|
-
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
657
|
-
`,eG="0%{opacity:0;} 100%{opacity:1;}",tG="0%{opacity:1;} 100%{opacity:0;}",nG=zi("div")`
|
|
658
|
-
display: flex;
|
|
659
|
-
align-items: center;
|
|
660
|
-
background: #fff;
|
|
661
|
-
color: #363636;
|
|
662
|
-
line-height: 1.3;
|
|
663
|
-
will-change: transform;
|
|
664
|
-
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
665
|
-
max-width: 350px;
|
|
666
|
-
pointer-events: auto;
|
|
667
|
-
padding: 8px 10px;
|
|
668
|
-
border-radius: 8px;
|
|
669
|
-
`,rG=zi("div")`
|
|
670
|
-
display: flex;
|
|
671
|
-
justify-content: center;
|
|
672
|
-
margin: 4px 10px;
|
|
673
|
-
color: inherit;
|
|
674
|
-
flex: 1 1 auto;
|
|
675
|
-
white-space: pre-line;
|
|
676
|
-
`,aG=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=XA()?[eG,tG]:[XB(n),JB(n)];return{animation:t?`${Mo(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Mo(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},sG=p.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?aG(e.position||t||"top-center",e.visible):{opacity:0},l=p.createElement(QB,{toast:e}),c=p.createElement(rG,{...e.ariaProps},Cp(e.message,e));return p.createElement(nG,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:l,message:c}):p.createElement(p.Fragment,null,l,c))});_B(p.createElement);var oG=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let l=p.useCallback(c=>{if(c){let d=()=>{let h=c.getBoundingClientRect().height;r(e,h)};d(),new MutationObserver(d).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return p.createElement("div",{ref:l,className:t,style:n},s)},iG=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:XA()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},lG=pg`
|
|
677
|
-
z-index: 9999;
|
|
678
|
-
> * {
|
|
679
|
-
pointer-events: auto;
|
|
680
|
-
}
|
|
681
|
-
`,wm=16,cG=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:l,containerStyle:c,containerClassName:d})=>{let{toasts:h,handlers:m}=PB(n,l);return p.createElement("div",{"data-rht-toaster":l||"",style:{position:"fixed",zIndex:9999,top:wm,left:wm,right:wm,bottom:wm,pointerEvents:"none",...c},className:d,onMouseEnter:m.startPause,onMouseLeave:m.endPause},h.map(g=>{let v=g.position||t,x=m.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),b=iG(v,x);return p.createElement(oG,{id:g.id,key:g.id,onHeightUpdate:m.updateHeight,className:g.visible?lG:"",style:b},g.type==="custom"?Cp(g.message,g):s?s(g):p.createElement(sG,{toast:g,position:v}))}))},Dt=an;const yn=e=>{var n;return(n=e.response)==null?void 0:n.data};function aT(e,t="Something went wrong"){var s,l;const n=yn(e);let r=n.message.trim()||t;(l=(s=n.errorDetails)==null?void 0:s.error)!=null&&l.trim()&&(r=`${r}. ${n.errorDetails.error}`),Dt.error(r)}class uG{constructor(){_s(this,"isRefreshingToken",!1);_s(this,"refreshTokenPromise",null);_s(this,"accessToken",null)}getAccessToken(){return this.accessToken}setAccessToken(t){this.accessToken=t}isRefreshing(){return this.isRefreshingToken}async refreshToken(t){if(this.isRefreshingToken&&this.refreshTokenPromise)return await this.refreshTokenPromise;this.isRefreshingToken=!0,this.refreshTokenPromise=this.performRefresh(t);try{const n=await this.refreshTokenPromise;return this.setAccessToken(n),n}finally{this.isRefreshingToken=!1,this.refreshTokenPromise=null}}clear(){this.accessToken=null,this.isRefreshingToken=!1,this.refreshTokenPromise=null}async performRefresh(t){try{return await t()}catch(n){throw this.clear(),n}}}const dG={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},ha=An.create(dG),k0=new uG;ha.interceptors.request.use(e=>{if(e.skipAuthHeader||new a$(e.headers).has("X-OWOX-Authorization"))return e;const n=o1(),r=(n==null?void 0:n.getAccessToken())??k0.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));ha.interceptors.response.use(e=>e,async e=>{var n,r,s;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const l=o1();if(!l)throw new Error("No token provider available");const c=await k0.refreshToken(()=>l.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await ha(t)}catch{return k0.clear(),window.dispatchEvent(new CustomEvent("auth:logout",{detail:{reason:"token_refresh_failed"}})),Promise.reject(new Error("Token refresh failed"))}}return((r=e.response)==null?void 0:r.status)===403&&aT(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&aT(e,"Bad request"),Promise.reject(e)});const r4={projects:[],callState:Mr.IDLE,error:null};function fG(e,t){switch(t.type){case"LOADING":return{...e,callState:Mr.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:Mr.LOADED,error:null};case"ERROR":return{...e,callState:Mr.ERROR,error:t.payload};case"RESET":return{...r4};default:return e}}function hG({children:e}){const[t,n]=p.useReducer(fG,r4),r=p.useCallback(async()=>{n({type:"LOADING"});try{const d=o1();if(!d){n({type:"ERROR",payload:yn(new $R("No token provider"))});return}const h=d.getAccessToken();if(!h){n({type:"ERROR",payload:yn(new $R("Unable to obtain access token"))});return}const m=await d$(h);n({type:"SUCCESS",payload:m})}catch(d){n({type:"ERROR",payload:yn(d)})}},[]),s=p.useCallback(()=>{n({type:"RESET"})},[]),l=t.callState===Mr.LOADING,c={...t,loadProjects:r,reset:s,isLoading:l};return o.jsx(FA.Provider,{value:c,children:e})}function mG(){const[e,t]=p.useState(!1);return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(Cr,{open:e,onOpenChange:t,children:[o.jsx(NV,{isOpen:e}),o.jsx(hG,{children:o.jsx(SB,{})})]})})})})}var pG=(e,t,n,r,s,l,c,d)=>{let h=document.documentElement,m=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(w=>{let C=w==="class",E=C&&l?s.map(R=>l[R]||R):s;C?(h.classList.remove(...E),h.classList.add(l&&l[b]?l[b]:b)):h.setAttribute(w,b)}),v(b)}function v(b){d&&m.includes(b)&&(h.style.colorScheme=b)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)g(r);else try{let b=localStorage.getItem(t)||n,w=c&&b==="system"?x():b;g(w)}catch{}},sT=["light","dark"],a4="(prefers-color-scheme: dark)",gG=typeof window>"u",d1=p.createContext(void 0),vG={setTheme:e=>{},themes:[]},s4=()=>{var e;return(e=p.useContext(d1))!=null?e:vG},yG=e=>p.useContext(d1)?p.createElement(p.Fragment,null,e.children):p.createElement(bG,{...e}),xG=["light","dark"],bG=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:l=xG,defaultTheme:c=n?"system":"light",attribute:d="data-theme",value:h,children:m,nonce:g,scriptProps:v})=>{let[x,b]=p.useState(()=>CG(s,c)),[w,C]=p.useState(()=>x==="system"?Tx():x),E=h?Object.values(h):l,R=p.useCallback(D=>{let _=D;if(!_)return;D==="system"&&n&&(_=Tx());let A=h?h[_]:_,M=t?wG(g):null,U=document.documentElement,B=G=>{G==="class"?(U.classList.remove(...E),A&&U.classList.add(A)):G.startsWith("data-")&&(A?U.setAttribute(G,A):U.removeAttribute(G))};if(Array.isArray(d)?d.forEach(B):B(d),r){let G=sT.includes(c)?c:null,K=sT.includes(_)?_:G;U.style.colorScheme=K}M==null||M()},[g]),T=p.useCallback(D=>{let _=typeof D=="function"?D(x):D;b(_);try{localStorage.setItem(s,_)}catch{}},[x]),j=p.useCallback(D=>{let _=Tx(D);C(_),x==="system"&&n&&!e&&R("system")},[x,e]);p.useEffect(()=>{let D=window.matchMedia(a4);return D.addListener(j),j(D),()=>D.removeListener(j)},[j]),p.useEffect(()=>{let D=_=>{_.key===s&&(_.newValue?b(_.newValue):T(c))};return window.addEventListener("storage",D),()=>window.removeEventListener("storage",D)},[T]),p.useEffect(()=>{R(e??x)},[e,x]);let O=p.useMemo(()=>({theme:x,setTheme:T,forcedTheme:e,resolvedTheme:x==="system"?w:x,themes:n?[...l,"system"]:l,systemTheme:n?w:void 0}),[x,T,e,w,n,l]);return p.createElement(d1.Provider,{value:O},p.createElement(SG,{forcedTheme:e,storageKey:s,attribute:d,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:h,themes:l,nonce:g,scriptProps:v}),m)},SG=p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:l,value:c,themes:d,nonce:h,scriptProps:m})=>{let g=JSON.stringify([n,t,l,e,d,c,r,s]).slice(1,-1);return p.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(${pG.toString()})(${g})`}})}),CG=(e,t)=>{if(gG)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},wG=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Tx=e=>(e||(e=window.matchMedia(a4)),e.matches?"dark":"light");const EG=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:RG(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:Kj},{value:"light",label:"Light",icon:Qj},{value:"dark",label:"Dark",icon:Yj}]}},{type:"separator"},{type:"item",title:"Sign out",icon:q9,onClick:n,className:"text-red-600 focus:text-red-600"}];function RG(e){switch(e){case"light":return Qj;case"dark":return Yj;case"system":default:return Kj}}function TG({avatar:e,initials:t,displayName:n}){return o.jsx("div",{className:"text-muted-foreground flex aspect-square size-8 items-center justify-center rounded-full border bg-white text-sm font-medium dark:bg-white/10",children:e?o.jsx("img",{src:e,alt:n,className:"size-full rounded-full object-cover"}):o.jsx("span",{children:t})})}function jG({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return o.jsx(wr,{asChild:!0,children:o.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:rounded-full group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[o.jsx(TG,{avatar:r,initials:s,displayName:t}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[o.jsx("span",{className:"truncate font-medium",children:t}),n&&o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),o.jsx(Za,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function _G({items:e}){return o.jsx(Er,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return o.jsx(Ga,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return o.jsxs(Qb,{children:[o.jsxs(Xb,{className:"flex items-center gap-2 px-2 py-1.5",children:[o.jsx(t.icon,{className:"size-4"}),t.title]}),o.jsx(Jb,{children:r.options.map(s=>o.jsxs(bt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&o.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&o.jsx(dr,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return o.jsxs(bt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[o.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function NG(e,t){var n,r,s,l;if(e){const c=e.trim().split(" ").filter(Boolean);return c.length>=2?`${((n=c[0])==null?void 0:n[0])??""}${((r=c[1])==null?void 0:r[0])??""}`.toUpperCase():((l=(s=c[0])==null?void 0:s[0])==null?void 0:l.toUpperCase())||""}if(t!=null&&t.includes("@")){const c=t.split("@")[0];return c.length>1?`${c[0]}${c[1]}`.toUpperCase():c[0].toUpperCase()}return"U"}function AG(){const{user:e,signOut:t}=Ui(),{setTheme:n,theme:r}=s4(),[s,l]=p.useState(!1);if(!e)return null;const{fullName:c,email:d,avatar:h}=e,m=c??d??"Unknown User",g=NG(c,d);return o.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(Cr,{open:s,onOpenChange:l,children:[o.jsx(jG,{isOpen:s,displayName:m,email:d,avatar:h,initials:g}),o.jsx(_G,{items:EG({theme:r,setTheme:n,signOut:t})})]})})}function DG(){const{user:e,status:t}=Ui();return t===Or.LOADING||t===Or.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function Io(){const e=zp(),t=DG(),n=p.useCallback((l,c)=>{if(!t){e("/",{replace:!0});return}const d=cp(t,l);e(d,c)},[e,t]),r=p.useCallback(l=>t?cp(t,l):l,[t]);return p.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function OG(){const{scope:e}=Io();return o.jsxs(xf,{to:e("/data-marts/create"),"data-sidebar":"menu-button","data-size":"md",className:"peer/menu-button ring-sidebar-ring bg-primary hover:bg-primary-hover text-primary-foreground hover:text-primary-foreground flex h-8 w-full items-center gap-2 overflow-hidden rounded-full p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[o.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:o.jsx(Ta,{className:"size-4 shrink-0"})}),o.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:o.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const MG=[{title:"Data Marts",url:"/data-marts",icon:Xm},{title:"Storages",url:"/data-storages",icon:Jm},{title:"Destinations",url:"/data-destinations",icon:bb}];function kG(){const{scope:e}=Io();return o.jsx(GF,{children:MG.map(t=>{const n=t.icon;return o.jsx(qF,{children:o.jsx(xf,{to:e(t.url),className:({isActive:r})=>`flex w-full items-center gap-2 rounded-md font-medium transition-colors ${r?"bg-sidebar-active text-sidebar-active-foreground font-medium shadow-sm":""}`,children:({isActive:r})=>o.jsxs(Tt,{delayDuration:500,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(KF,{className:`${r?"hover:bg-transparent":""}`,children:[o.jsx(n,{className:"size-4 shrink-0 transition-all"}),o.jsx("span",{children:t.title}),t.badge&&o.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),o.jsx(_t,{side:"right",children:t.title})]})})},t.title)})})}function IG({variant:e="inset",collapsible:t="icon"}){return o.jsxs(UF,{variant:e,collapsible:t,children:[o.jsx(HF,{children:o.jsx(mG,{})}),o.jsxs(BF,{children:[o.jsx(ER,{children:o.jsx(RR,{children:o.jsx(OG,{})})}),o.jsx(ER,{children:o.jsx(RR,{children:o.jsx(kG,{})})})]}),o.jsx($F,{children:o.jsx(AG,{})}),o.jsx(zF,{})]})}function LG({children:e,...t}){return o.jsx(yG,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class Bl{constructor(t){_s(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await ha.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await ha.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await ha.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await ha.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await ha.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class PG{set(t,n){try{const r=typeof n=="object"?JSON.stringify(n):String(n);localStorage.setItem(t,r)}catch(r){console.error(`Error setting localStorage key "${t}":`,r)}}get(t,n){try{const r=localStorage.getItem(t);if(r===null)return null;switch(n){case"boolean":return r==="true";case"json":{const s=JSON.parse(r);return typeof s=="object"?s:null}default:return r}}catch(r){return console.error(`Error getting localStorage key "${t}":`,r),null}}remove(t){try{localStorage.removeItem(t)}catch(n){console.error(`Error removing localStorage key "${t}":`,n)}}has(t){try{return localStorage.getItem(t)!==null}catch(n){return console.error(`Error checking localStorage key "${t}":`,n),!1}}clear(){try{localStorage.clear()}catch(t){console.error("Error clearing localStorage:",t)}}}const ks=new PG;class UG{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),l=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),d=this.getDisplayName(r,l);return{identifier:r,displayName:d,offsetMinutes:s,offsetString:l,isDST:c}})}getTimezoneOffset(t,n=new Date){try{const r=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),s=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),l=new Date(r.format(n)),c=new Date(s.format(n));return Math.round((c.getTime()-l.getTime())/(1e3*60))}catch(r){return console.warn(`Failed to get offset for timezone ${t}:`,r),0}}formatOffset(t){const n=t>=0?"+":"-",r=Math.abs(t),s=Math.floor(r/60),l=r%60;return`${n}${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const r=new Date(n.getFullYear(),0,1),s=new Date(n.getFullYear(),6,1),l=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),d=this.getTimezoneOffset(t,n),h=Math.min(l,c);return d>h}catch(r){return console.warn(`Failed to check DST for timezone ${t}:`,r),!1}}getDisplayName(t,n){return`${t} (${n})`}getBrowserTimezone(){const t=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Date,r=this.getTimezoneOffset(t,n),s=this.formatOffset(r),l=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:l}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const FG=new UG;function zG({isLoading:e,className:t}){const[n,r]=p.useState(0),[s,l]=p.useState(!1);return p.useEffect(()=>{let c,d;return e?(l(!0),r(0),c=setInterval(()=>{r(h=>h<90?h+(90-h)/10:h)},200)):(r(100),d=setTimeout(()=>{l(!1)},300)),()=>{clearInterval(c),clearTimeout(d)}},[e]),o.jsx("div",{className:J("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:o.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const o4=p.createContext({isLoading:!1});function VG({children:e}){const[t,n]=p.useState(0),r=t>0;return p.useEffect(()=>{const s=ha.interceptors.request.use(c=>(c.skipLoadingIndicator||n(d=>d+1),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c))),l=ha.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c)));return()=>{ha.interceptors.request.eject(s),ha.interceptors.response.eject(l)}},[]),o.jsx(o4.Provider,{value:{isLoading:r},children:e})}function HG(){return p.useContext(o4)}function $G(){return o.jsx(cG,{position:"top-center",toastOptions:{duration:3e3,style:{borderRadius:"32px",boxShadow:"none",padding:"0.4rem 1rem",maxWidth:"800px",fontSize:"0.875rem",borderBottomWidth:"1px",borderBottomStyle:"solid"},success:{style:{background:"#ECFDF5",color:"#166534",borderBottomColor:"#D6DFE6"}},error:{style:{background:"#FEE2E2",color:"#991B1B",borderBottomColor:"#EAD1D1"},duration:6e3},loading:{style:{background:"#E8EDFB",color:"#1D4ED8",borderBottomColor:"#CAD5F6",borderBottomWidth:"1px",borderBottomStyle:"solid"}}}})}function BG({children:e}){const{isLoading:t}=UA(),n=b$(),r=Mj(),s=$s();return p.useEffect(()=>{if(t)return;const l=r.projectId,c=n==null?void 0:n.projectId;if(l&&!s.pathname.startsWith("/auth")&&n&&c&&c!==l){const d=new URLSearchParams({projectId:l}).toString();window.location.href=`/auth/sign-in?${d}`}},[t,n,r.projectId,s.pathname]),o.jsx(o.Fragment,{children:e})}const oT="sidebar_state";function GG(){const{state:e,isMobile:t}=Nf(),r=t||e==="collapsed",{isLoading:s}=HG();return o.jsxs(o.Fragment,{children:[o.jsx($G,{}),o.jsx(zG,{isLoading:s}),o.jsxs(S$,{redirectTo:"/auth/sign-in",children:[o.jsx(IG,{variant:"inset",collapsible:"icon"}),o.jsxs(VF,{children:[r&&o.jsx(FF,{}),o.jsx(BG,{children:o.jsx(Ij,{})})]})]})]})}function qG(){const[e,t]=p.useState(()=>ks.get(oT,"boolean")??!0),n=r=>{t(r),ks.set(oT,r)};return o.jsx(LG,{children:o.jsx(VG,{children:o.jsx(PF,{open:e,onOpenChange:n,children:o.jsx(GG,{})})})})}function ZG(){return o.jsxs("div",{className:"app-container",children:[o.jsx("h1",{children:"About OWOX"}),o.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function iT(){return o.jsxs("div",{className:"dm-empty-state-404page",children:[o.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[o.jsx(jL,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),o.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",o.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",o.jsx("i",{children:"yesterday"}),".",o.jsx("br",{}),"Escape while you can!"]}),o.jsx(Ce,{variant:"default",asChild:!0,children:o.jsxs(Ba,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",o.jsx(Ra,{className:"h-4 w-4"})]})})]}),o.jsx("div",{className:"dm-empty-state-404page-background"})]})}const KG={items:[],loading:!1,error:null};function YG(e,t){switch(t.type){case"SET_ITEMS":return{...e,items:t.payload,loading:!1,error:null};case"SET_LOADING":return{...e,loading:!0,error:null};case"SET_ERROR":return{...e,loading:!1,error:t.payload};default:return e}}const i4=p.createContext(void 0);function WG({children:e}){const[t,n]=p.useReducer(YG,KG);return o.jsx(i4.Provider,{value:{state:t,dispatch:n},children:e})}function QG(){const e=p.useContext(i4);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class XG extends Bl{constructor(){super("/data-marts")}async getDataMarts(){return this.get("/")}async getDataMartById(t){return this.get(`/${t}`)}async createDataMart(t){return this.post("",t)}async updateDataMart(t,n){return this.patch(`/${t}`,n)}async deleteDataMart(t){return this.delete(`/${t}`)}async updateDataMartDescription(t,n){return this.put(`/${t}/description`,{description:n})}async updateDataMartTitle(t,n){return this.put(`/${t}/title`,{title:n})}async updateDataMartDefinition(t,n){return this.put(`/${t}/definition`,n,{timeout:18e4})}async publishDataMart(t){return this.put(`/${t}/publish`,void 0,{timeout:18e4})}async runDataMart(t,n){return this.post(`/${t}/manual-run`,{payload:n})}async cancelDataMartRun(t,n){await this.post(`/${t}/runs/${n}/cancel`)}async actualizeDataMartSchema(t){return this.post(`/${t}/actualize-schema`,void 0,{timeout:18e4})}async updateDataMartSchema(t,n){return this.put(`/${t}/schema`,n,{timeout:18e4})}async createSqlDryRunTrigger(t,n){return this.post(`/${t}/sql-dry-run-triggers`,{sql:n},{skipLoadingIndicator:!0})}async getSqlDryRunTriggerStatus(t,n){return(await this.get(`/${t}/sql-dry-run-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSqlDryRunTriggerResponse(t,n){return this.get(`/${t}/sql-dry-run-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSqlDryRunTrigger(t,n){await this.delete(`/${t}/sql-dry-run-triggers/${n}`,{skipLoadingIndicator:!0})}async createSchemaActualizeTrigger(t){return this.post(`/${t}/schema-actualize-triggers`,void 0,{skipLoadingIndicator:!0})}async getSchemaActualizeTriggerStatus(t,n){return(await this.get(`/${t}/schema-actualize-triggers/${n}/status`,void 0,{skipLoadingIndicator:!0})).status}async getSchemaActualizeTriggerResponse(t,n){return this.get(`/${t}/schema-actualize-triggers/${n}`,void 0,{skipLoadingIndicator:!0})}async abortSchemaActualizeTrigger(t,n){await this.delete(`/${t}/schema-actualize-triggers/${n}`,{skipLoadingIndicator:!0})}async getDataMartRuns(t,n=5,r=0,s){return(await this.get(`/${t}/runs`,{limit:n,offset:r},s)).runs}async getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const rn=new XG;var ur=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(ur||{}),qe=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(qe||{}),qm=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(qm||{});const JG={ALREADY_PUBLISHED:"Data mart is already published",INVALID_STORAGE:"Data mart must have a valid storage",MISSING_DEFINITION:"Data Mart must have an input source configured"},l4={statuses:{[ur.DRAFT]:{code:ur.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[ur.PUBLISHED]:{code:ur.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},c4=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,u4=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,eq=e=>e?c4(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",tq=e=>e?u4(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",d4=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/;return t.test(e)||n.test(e)},f4=e=>{if(!e)return!1;const t=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/,n=/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/;return t.test(e)||n.test(e)},nq=e=>e?d4(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",rq=e=>e?f4(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required",aq=[{value:"US",label:"US (multiple regions)",group:"North America"},{value:"northamerica-northeast1",label:"northamerica-northeast1 (Montréal)",group:"North America"},{value:"northamerica-northeast2",label:"northamerica-northeast2 (Toronto)",group:"North America"},{value:"us-central1",label:"us-central1 (Iowa)",group:"North America"},{value:"us-east1",label:"us-east1 (South Carolina)",group:"North America"},{value:"us-east4",label:"us-east4 (Northern Virginia)",group:"North America"},{value:"us-east5",label:"us-east5 (Columbus)",group:"North America"},{value:"us-west1",label:"us-west1 (Oregon)",group:"North America"},{value:"us-west2",label:"us-west2 (Los Angeles)",group:"North America"},{value:"us-west3",label:"us-west3 (Salt Lake City)",group:"North America"},{value:"us-west4",label:"us-west4 (Las Vegas)",group:"North America"},{value:"EU",label:"EU (multiple regions)",group:"Europe"},{value:"europe-central2",label:"europe-central2 (Warsaw)",group:"Europe"},{value:"europe-north1",label:"europe-north1 (Finland)",group:"Europe"},{value:"europe-southwest1",label:"europe-southwest1 (Madrid)",group:"Europe"},{value:"europe-west1",label:"europe-west1 (Belgium)",group:"Europe"},{value:"europe-west2",label:"europe-west2 (London)",group:"Europe"},{value:"europe-west3",label:"europe-west3 (Frankfurt)",group:"Europe"},{value:"europe-west4",label:"europe-west4 (Netherlands)",group:"Europe"},{value:"europe-west6",label:"europe-west6 (Zurich)",group:"Europe"},{value:"europe-west8",label:"europe-west8 (Milan)",group:"Europe"},{value:"europe-west9",label:"europe-west9 (Paris)",group:"Europe"},{value:"europe-west12",label:"europe-west12 (Turin)",group:"Europe"},{value:"asia-east1",label:"asia-east1 (Taiwan)",group:"Asia Pacific"},{value:"asia-east2",label:"asia-east2 (Hong Kong)",group:"Asia Pacific"},{value:"asia-northeast1",label:"asia-northeast1 (Tokyo)",group:"Asia Pacific"},{value:"asia-northeast2",label:"asia-northeast2 (Osaka)",group:"Asia Pacific"},{value:"asia-northeast3",label:"asia-northeast3 (Seoul)",group:"Asia Pacific"},{value:"asia-south1",label:"asia-south1 (Mumbai)",group:"Asia Pacific"},{value:"asia-south2",label:"asia-south2 (Delhi)",group:"Asia Pacific"},{value:"asia-southeast1",label:"asia-southeast1 (Singapore)",group:"Asia Pacific"},{value:"asia-southeast2",label:"asia-southeast2 (Jakarta)",group:"Asia Pacific"},{value:"australia-southeast1",label:"australia-southeast1 (Sydney)",group:"Asia Pacific"},{value:"australia-southeast2",label:"australia-southeast2 (Melbourne)",group:"Asia Pacific"},{value:"southamerica-east1",label:"southamerica-east1 (São Paulo)",group:"Other"},{value:"southamerica-west1",label:"southamerica-west1 (Santiago)",group:"Other"},{value:"me-central1",label:"me-central1 (Doha)",group:"Other"},{value:"me-central2",label:"me-central2 (Dammam)",group:"Other"},{value:"me-west1",label:"me-west1 (Tel Aviv)",group:"Other"},{value:"africa-south1",label:"africa-south1 (Johannesburg)",group:"Other"}];function sq(e){return"projectId"in e}function oq(e){return"outputBucket"in e}var Pe=(e=>(e.GOOGLE_BIGQUERY="GOOGLE_BIGQUERY",e.AWS_ATHENA="AWS_ATHENA",e.SNOWFLAKE="SNOWFLAKE",e.DATABRICKS="DATABRICKS",e.AWS_REDSHIFT="AWS_REDSHIFT",e.AZURE_SYNAPSE="AZURE_SYNAPSE",e))(Pe||{}),bo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(bo||{});const iq=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return o.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[o.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?o.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):o.jsx("span",{className:"text-sm",children:s||r===void 0?o.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},lq=({type:e,config:t})=>{const n={[Pe.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Pe.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Pe.SNOWFLAKE]:[],[Pe.DATABRICKS]:[],[Pe.AWS_REDSHIFT]:[],[Pe.AZURE_SYNAPSE]:[]},r=t&&(e===Pe.GOOGLE_BIGQUERY&&sq(t)||e===Pe.AWS_ATHENA&&oq(t));return o.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:l})=>{let c;return r&&(c=(e===Pe.GOOGLE_BIGQUERY,t[l])),o.jsx(iq,{label:s,value:c},l)})})},cq=({type:e,config:t})=>o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),o.jsx(lq,{type:e,config:t})]})}),uq=bf("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Ar({className:e,variant:t,asChild:n=!1,...r}){const s=n?Hp:"span";return o.jsx(s,{"data-slot":"badge",className:J(uq({variant:t}),e),...r})}function h4(e){return e.type===Pe.GOOGLE_BIGQUERY}function m4(e){return e.type===Pe.AWS_ATHENA}const Vi={types:{[Pe.GOOGLE_BIGQUERY]:{type:Pe.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:VA,status:bo.ACTIVE},[Pe.AWS_ATHENA]:{type:Pe.AWS_ATHENA,displayName:"AWS Athena",icon:HA,status:bo.ACTIVE},[Pe.SNOWFLAKE]:{type:Pe.SNOWFLAKE,displayName:"Snowflake",icon:N$,status:bo.COMING_SOON},[Pe.DATABRICKS]:{type:Pe.DATABRICKS,displayName:"Databricks",icon:A$,status:bo.COMING_SOON},[Pe.AWS_REDSHIFT]:{type:Pe.AWS_REDSHIFT,displayName:"AWS Redshift",icon:D$,status:bo.COMING_SOON},[Pe.AZURE_SYNAPSE]:{type:Pe.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:O$,status:bo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function dq({dataStorage:e,isLoading:t=!1}){if(t)return o.jsx("div",{className:"space-y-4",children:o.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,d)=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(as,{className:"h-5 w-24"}),o.jsx(as,{className:"h-6 w-40"})]},d))})});if(!e)return o.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:l}=e;return o.jsx("div",{className:"space-y-2",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:e.title}),o.jsx(Ar,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:d}=Vi.getInfo(n);return o.jsxs(o.Fragment,{children:[o.jsx(d,{}),c]})})()})]}),o.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:o.jsx(cq,{type:n,config:r})}),o.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(s))]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(l))]})]})]})})}function fq(e){const t=e.split(".");return t.length!==2?(console.error("Invalid fully qualified name format:",e),null):{dataset:t[0],table:t[1]}}function hq(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),l=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${l}`}function mq(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function pq(e,t){const n=fq(t);if(!n)return null;const{dataset:r,table:s}=n;return h4(e)?hq(e.config.projectId,r,s):m4(e)?mq(e.config.region):null}function gq(e,t){const n=pq(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function vq(e){return h4(e)?"Open table in Google BigQuery":m4(e)?"Open region in AWS Athena":"Open data in storage"}function p4(e){switch(e.type){case Pe.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Pe.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);default:return!1}}const yq=sn({accessKeyId:on().min(1,"Access Key ID is required"),secretAccessKey:on().min(1,"Secret Access Key is required")}),xq=sn({projectId:on().min(1,"Project ID is required"),location:on().min(1,"Location is required")}),bq=sn({region:on().min(1,"Region is required"),outputBucket:on().min(1,"Output Bucket is required")}),g4=sn({title:on().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),Sq=g4.extend({type:qs(Pe.GOOGLE_BIGQUERY),credentials:YA,config:xq}),Cq=g4.extend({type:qs(Pe.AWS_ATHENA),credentials:yq,config:bq}),wq=KA("type",[Sq,Cq]),Eq=(e,t)=>{if(!e)return!1;switch(t){case Pe.GOOGLE_BIGQUERY:return c4(e);case Pe.AWS_ATHENA:return d4(e);default:return!1}},Rq=(e,t)=>{if(!e)return!1;switch(t){case Pe.GOOGLE_BIGQUERY:return u4(e);case Pe.AWS_ATHENA:return f4(e);default:return!1}},Tq=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Pe.GOOGLE_BIGQUERY:return eq(e);case Pe.AWS_ATHENA:return nq(e);default:return"Unsupported storage type"}},jq=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Pe.GOOGLE_BIGQUERY:return tq(e);case Pe.AWS_ATHENA:return rq(e);default:return"Unsupported storage type"}},v4=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"project.dataset.table";case Pe.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},_q=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Pe.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},y4=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Pe.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},Nq=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Pe.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var Tn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Tn||{});const Aq={solid:"px-2.5 py-0.5 rounded-full",subtle:"px-2.5 py-0.5 rounded-full",outline:"px-2.5 py-0.5 rounded-full border",ghost:""},Dq=e=>Aq[e],Oq={[Tn.SUCCESS]:{icon:$p,colors:{solid:"bg-green-500 text-white",subtle:"bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-400",outline:"border-green-500 text-green-700 dark:text-green-400",ghost:"text-green-500 dark:text-green-400"}},[Tn.ERROR]:{icon:oL,colors:{solid:"bg-red-500 text-white",subtle:"bg-red-50 text-red-700 dark:bg-red-950 dark:text-red-400",outline:"border-red-500 text-red-700 dark:text-red-400",ghost:"text-red-500 dark:text-red-400"}},[Tn.WARNING]:{icon:Bp,colors:{solid:"bg-yellow-500 text-white",subtle:"bg-yellow-50 text-yellow-700 dark:bg-yellow-950 dark:text-yellow-400",outline:"border-yellow-500 text-yellow-700 dark:text-yellow-400",ghost:"text-yellow-500 dark:text-yellow-400"}},[Tn.INFO]:{icon:Fr,colors:{solid:"bg-blue-500 text-white",subtle:"bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-400",outline:"border-blue-500 text-blue-700 dark:text-blue-400",ghost:"text-blue-500 dark:text-blue-400"}},[Tn.NEUTRAL]:{icon:Fr,colors:{solid:"bg-gray-500 text-white",subtle:"bg-gray-50 text-gray-700 dark:bg-gray-950 dark:text-gray-400",outline:"border-gray-500 text-gray-700 dark:text-gray-400",ghost:"text-muted-foreground"}}};function Vf({type:e=Tn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:l,colors:c}=Oq[e],d=h=>{const m="inline-flex items-center gap-1 text-sm",g=Dq(h),v=c[h];return J(m,g,v,s)};return o.jsxs("span",{className:d(t),children:[n&&o.jsx(l,{className:"h-4 w-4","data-testid":"icon"}),r]})}var Ur=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(Ur||{}),jn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e))(jn||{}),ns=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(ns||{});const x4=e=>{if(!e)return"—";let t;if(typeof e=="string"){if(t=new Date(e),isNaN(t.getTime()))return"—"}else if(t=e,isNaN(t.getTime()))return"—";const r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(t),s=new Map(r.map(v=>[v.type,v.value])),l=s.get("year")??"",c=s.get("month")??"",d=s.get("day")??"",h=s.get("hour")??"",m=s.get("minute")??"",g=s.get("second")??"";return`${l}-${c}-${d} ${h}:${m}:${g}`},Mq=e=>{const t=e.trim();if(t.includes("T")||t.includes("Z")){const s=new Date(t);if(!isNaN(s.getTime()))return s}let n=/^(\d{4})[-/](\d{1,2})[-/](\d{1,2})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t);if(n)return new Date(Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));if(n=/^(\d{1,2})[./](\d{1,2})[./](\d{4})\s+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/.exec(t),n)return new Date(Date.UTC(parseInt(n[3],10),parseInt(n[2],10)-1,parseInt(n[1],10),parseInt(n[4],10),parseInt(n[5],10),n[6]?parseInt(n[6],10):0));const r=new Date(t);return isNaN(r.getTime())?(console.warn(`Failed to parse date string: "${e}", using current date as fallback`),new Date):r},hl=e=>x4(Mq(e).toISOString()),lT=(e,t,n=!1)=>{var c,d,h,m;const r=e.split(`
|
|
682
|
-
`).filter(g=>g.trim()!=="");if(r.length>=3){const g=r[0],v=r[1],x=r.slice(2).join(`
|
|
683
|
-
`);if(g.includes("T")&&g.includes("Z")){const b=jx(x);return{id:`log-${t.toString()}`,timestamp:hl(g),level:n?Ur.ERROR:Ur.INFO,message:b.message,metadata:{at:(c=b.metadata)!=null&&c.at?hl(b.metadata.at):hl(g),type:((d=b.metadata)==null?void 0:d.type)??(v!=="unknown"?v:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const g=jx(s[3]);return{id:`log-${t.toString()}`,timestamp:hl(s[1]),level:n?Ur.ERROR:s[2],message:g.message,metadata:(h=g.metadata)!=null&&h.at?{...g.metadata,at:hl(g.metadata.at)}:g.metadata}}const l=jx(e);return{id:`log-${t.toString()}`,timestamp:hl(new Date().toISOString()),level:n?Ur.ERROR:Ur.INFO,message:l.message,metadata:(m=l.metadata)!=null&&m.at?{...l.metadata,at:hl(l.metadata.at)}:l.metadata}},jx=e=>{try{const t=JSON.parse(e);if(typeof t=="object"){const n={},r={...t};"type"in r&&(n.type=r.type,delete r.type),"at"in r&&(n.at=r.at,delete r.at);const s=Object.keys(r);if(s.length===1){const l=s[0],c=r[l];return{message:typeof c=="string"?c:JSON.stringify(c),metadata:Object.keys(n).length>0?n:void 0}}return{message:JSON.stringify(r,null,2),metadata:Object.keys(n).length>0?n:void 0}}}catch{}return{message:e}},b4=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},kq=e=>{const t=e.logs.length,n=e.errors.length,r=t+n,s=[`Run #${e.id.slice(-8)}`,`${String(r)} messages`];return n>0&&s.push(`${String(n)} errors`),s.join(" • ")},Iq=e=>{const t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`datamart-run-${e.id.slice(0,8)}-logs.json`,r.click(),URL.revokeObjectURL(n)};function Lq(e){return o.jsx("div",{className:"flex items-center gap-2",children:(()=>{switch(e){case jn.SUCCESS:return o.jsx(qj,{className:"h-4 w-4 text-green-500"});case jn.FAILED:return o.jsx(ef,{className:"h-4 w-4 text-red-500"});case jn.RUNNING:return o.jsx(gu,{className:"text-primary h-4 w-4 animate-spin"});case jn.CANCELLED:return o.jsx(BI,{className:"h-4 w-4 text-gray-500"});case jn.INTERRUPTED:return o.jsx(c9,{className:"h-4 w-4 text-gray-500"});default:return o.jsx(f9,{className:"h-4 w-4 text-gray-500"})}})()})}function Pq(e){switch(e){case Ur.INFO:return o.jsx(Fr,{className:"h-3 w-3 text-blue-500"});case Ur.WARNING:return o.jsx(Bp,{className:"h-3 w-3 text-yellow-500"});case Ur.ERROR:return o.jsx(ef,{className:"h-3 w-3 text-red-500"});case Ur.SYSTEM:return o.jsx(Sf,{className:"text-muted-foreground h-3 w-3"});default:return o.jsx(Fr,{className:"text-muted-foreground h-3 w-3"})}}function Uq(e){switch(e){case Ur.INFO:return"text-blue-600 dark:text-blue-400";case Ur.WARNING:return"text-yellow-600 dark:text-yellow-400";case Ur.ERROR:return"text-red-600 dark:text-red-400";case Ur.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function Fq({status:e}){switch(e){case jn.RUNNING:return o.jsx(Ar,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case jn.SUCCESS:return o.jsx(Ar,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case jn.FAILED:return o.jsx(Ar,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case jn.CANCELLED:return o.jsx(Ar,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case jn.INTERRUPTED:return o.jsx(Ar,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});default:return o.jsx(Ar,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}function zq({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:l,dataMartId:c}){const d=g=>{g.stopPropagation()},h=async g=>{if(g.stopPropagation(),c)try{await l(c,s.id),an.success("Data mart run cancelled successfully")}catch(v){an.error(v instanceof Error?v.message:"Failed to cancel data mart run")}},m=g=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${g?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return o.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ns.STRUCTURED)},className:`${m(e===ns.STRUCTURED)} rounded-l-lg`,children:"Structured"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ns.RAW)},className:`${m(e===ns.RAW)} rounded-none`,children:"Raw"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ns.CONFIGURATION)},className:`${m(e===ns.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==ns.CONFIGURATION&&o.jsxs("div",{className:"relative",children:[o.jsx(Fl,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),o.jsx($t,{type:"text",placeholder:"Search logs...",value:n,onChange:g=>{r(g.target.value)},onClick:d,className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus:ring-ring rounded-md border py-2 pr-4 pl-8 text-xs focus:border-transparent focus:ring-2 focus:outline-none"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[s.status===jn.RUNNING&&o.jsxs(Ce,{variant:"destructive",size:"sm",onClick:g=>void h(g),children:[o.jsx(su,{className:"h-4 w-4"}),"Cancel"]}),o.jsxs(Ce,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),Iq(s)},className:"flex items-center gap-2",children:[o.jsx(S9,{className:"h-4 w-4"}),"JSON"]})]})]})}function Vq({logs:e}){const t=r=>{r.stopPropagation()},n=r=>{var s;return(s=r.metadata)!=null&&s.at?r.metadata.at:r.timestamp};return e.length===0?o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No logs found"})}):o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,s)=>o.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-sm text-xs ${s===e.length-1?"border-b-0":""}`,onClick:t,children:[o.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),o.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[Pq(r.level),o.jsx("span",{className:`text-xs font-medium ${Uq(r.level)}`,children:b4(r)})]}),o.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===Ur.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
684
|
-
`)?o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):o.jsx("span",{children:r.message})})]},r.id))})})}var wp=(e=>(e.ERROR="error",e.DEFAULT="default",e))(wp||{});function Ep({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,iconOnly:l=!1}){const c=n==="error",d=r===t,h="flex items-center gap-1 px-2 py-1 text-xs rounded transition-colors cursor-pointer",m=c?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40":"text-foreground hover:bg-muted";return o.jsx("button",{onClick:g=>{s(e,t),g.stopPropagation()},className:`${h} ${m}`,title:`Copy ${t} to clipboard`,children:l?o.jsx(o.Fragment,{children:d?o.jsx(dr,{className:"h-3 w-3"}):o.jsx(tf,{className:"h-3 w-3"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(dr,{className:"h-3 w-3"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(tf,{className:"h-3 w-3"}),"Copy"]})})}function f1(){const[e,t]=p.useState(null),n=async(s,l)=>{try{await navigator.clipboard.writeText(s),t(l),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,l)=>{n(s,l)}}}function Hq({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=f1(),s=l=>{l.stopPropagation()};return o.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[o.jsx(Sf,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),o.jsx(Ep,{text:t.join(`
|
|
685
|
-
`),section:"errors",variant:wp.ERROR,copiedSection:n,onCopy:r})]}),o.jsx("div",{className:"max-h-96 overflow-y-auto rounded-md bg-red-50 p-3 font-mono text-xs dark:border-red-800 dark:bg-red-950/40",children:t.map((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:l},c))})]}),e.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[o.jsx(Fr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),o.jsx(Ep,{text:e.join(`
|
|
686
|
-
`),section:"logs",variant:wp.DEFAULT,copiedSection:n,onCopy:r})]}),o.jsx("div",{className:"bg-muted max-h-96 overflow-y-auto rounded-md p-3 font-mono text-xs dark:bg-white/3",children:e.map((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed",children:l},c))})]})]})}function $q({definitionRun:e}){const{copiedSection:t,handleCopy:n}=f1(),r=s=>{s.stopPropagation()};return o.jsx("div",{className:"border-border rounded-lg border",onClick:r,children:e!=null?o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[o.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),o.jsx(Ep,{text:JSON.stringify(e,null,2),section:"configuration",variant:wp.DEFAULT,copiedSection:t,onCopy:n})]}),o.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(e,null,2)})]}):o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}function Bq({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,cancelDataMartRun:d,dataMartId:h}){const{copiedSection:m,handleCopy:g}=f1(),v=()=>{if(e.logs.length===0&&e.errors.length===0)return[];const b=e.logs.map((E,R)=>lT(E,R)),w=e.errors.map((E,R)=>lT(E,e.logs.length+R,!0));return[...b,...w].filter(E=>{const R=b4(E);return l===""||E.message.toLowerCase().includes(l.toLowerCase())||R.toLowerCase().includes(l.toLowerCase())})},x=()=>{if(r===ns.STRUCTURED){const b=v();return o.jsx(Vq,{logs:b})}else return r===ns.RAW?o.jsx(Hq,{logs:e.logs,errors:e.errors}):o.jsx($q,{definitionRun:e.definitionRun})};return o.jsxs("div",{className:"dm-card-block",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[Lq(e.status),o.jsx("div",{className:"text-foreground font-mono text-sm font-medium",children:x4(e.createdAt instanceof Date?e.createdAt.toISOString():e.createdAt)}),o.jsxs("div",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[o.jsx(eL,{className:"h-3 w-3"}),kq(e)]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Fq,{status:e.status}),o.jsx(Ra,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&o.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),o.jsx(Ep,{text:e.id,section:"run-id",onCopy:g,copiedSection:m,iconOnly:!0})]}),o.jsx(zq,{logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,run:e,cancelDataMartRun:d,dataMartId:h}),x()]})]})}const S4=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,Gq=/[#&]gid=([0-9]+)/;function C4(e){return S4.test(e)}function qq(e){const t=S4.exec(e);return t?t[2]:""}function Zq(e){const t=Gq.exec(e);return t?t[1]:"0"}function Kq(e){return{spreadsheetId:qq(e),sheetId:parseInt(Zq(e),10)}}function h1(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function Yq(e,t,n){try{const r=JSON.parse(e);return t in r?r[t]:n}catch(r){return console.error(`Error parsing service account JSON: ${String(r)}`),n}}function _x(e){return Yq(e,"client_email")}const w4=p.createContext(void 0);var nt=(e=>(e.FETCH_REPORTS_START="FETCH_REPORTS_START",e.FETCH_REPORTS_SUCCESS="FETCH_REPORTS_SUCCESS",e.FETCH_REPORTS_ERROR="FETCH_REPORTS_ERROR",e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_REPORT_START="FETCH_REPORT_START",e.FETCH_REPORT_SUCCESS="FETCH_REPORT_SUCCESS",e.FETCH_REPORT_ERROR="FETCH_REPORT_ERROR",e.CLEAR_CURRENT_REPORT="CLEAR_CURRENT_REPORT",e.CREATE_REPORT_START="CREATE_REPORT_START",e.CREATE_REPORT_SUCCESS="CREATE_REPORT_SUCCESS",e.CREATE_REPORT_ERROR="CREATE_REPORT_ERROR",e.UPDATE_REPORT_START="UPDATE_REPORT_START",e.UPDATE_REPORT_SUCCESS="UPDATE_REPORT_SUCCESS",e.UPDATE_REPORT_ERROR="UPDATE_REPORT_ERROR",e.DELETE_REPORT_START="DELETE_REPORT_START",e.DELETE_REPORT_SUCCESS="DELETE_REPORT_SUCCESS",e.DELETE_REPORT_ERROR="DELETE_REPORT_ERROR",e.START_POLLING_REPORT="START_POLLING_REPORT",e.STOP_POLLING_REPORT="STOP_POLLING_REPORT",e.UPDATE_POLLED_REPORT="UPDATE_POLLED_REPORT",e.STOP_ALL_POLLING="STOP_ALL_POLLING",e.CLEAR_ERROR="CLEAR_ERROR",e))(nt||{}),ga=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e))(ga||{}),un=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(un||{}),Un=(e=>(e.EDIT="edit",e.CREATE="create",e))(Un||{});const Wq={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function Qq(e,t){switch(t.type){case nt.FETCH_REPORTS_START:case nt.FETCH_REPORT_START:case nt.CREATE_REPORT_START:case nt.UPDATE_REPORT_START:case nt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case nt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case nt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case nt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case nt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case nt.UPDATE_REPORT_SUCCESS:return{...e,currentReport:t.payload,reports:e.reports.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case nt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case nt.FETCH_REPORTS_ERROR:case nt.FETCH_REPORT_ERROR:case nt.FETCH_DESTINATIONS_ERROR:case nt.CREATE_REPORT_ERROR:case nt.UPDATE_REPORT_ERROR:case nt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case nt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case nt.CLEAR_ERROR:return{...e,error:null};case nt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case nt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case nt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case nt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==un.RUNNING||(n==null?void 0:n.lastRunStatus)!==un.RUNNING?{...e,reports:e.reports.map(r=>r.id===t.payload.id?{...r,lastRunStatus:t.payload.lastRunStatus}:r),polledReportIds:e.polledReportIds.filter(r=>r!==t.payload.id)}:e}default:return e}}function E4({children:e}){const[t,n]=p.useReducer(Qq,Wq);return o.jsx(w4.Provider,{value:{state:t,dispatch:n},children:e})}function Xq(){const e=p.useContext(w4);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class Jq extends Bl{constructor(){super("/reports")}async createReport(t){return this.post("",t)}async getReportById(t){return this.get(`/${t}`)}async getReportsByDataMartId(t,n){return this.get(`/data-mart/${t}`,void 0,n)}async getReportsByProject(){return this.get("/")}async updateReport(t,n){return this.put(`/${t}`,n)}async deleteReport(t){return this.delete(`/${t}`)}async runReport(t){return this.post(`/${t}/run`)}}const yo=new Jq,eZ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class tZ{constructor(){_s(this,"pollingTimers",new Map);_s(this,"pollCounters",new Map);_s(this,"config",eZ)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const r=async()=>{try{const s=this.pollCounters.get(t)??0;this.pollCounters.set(t,s+1);const l=await yo.getReportById(t);if(n(l),l.lastRunStatus!==un.RUNNING){this.stopPolling(t);return}const d=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,h=setTimeout(()=>{r()},d);this.pollingTimers.set(t,h)}catch(s){console.error(`Error polling report status for ${t}:`,s),this.stopPolling(t)}};return r(),()=>{this.stopPolling(t)}}stopPolling(t){const n=this.pollingTimers.get(t);n&&(clearTimeout(n),this.pollingTimers.delete(t),this.pollCounters.delete(t))}stopAllPolling(){for(const t of this.pollingTimers.keys())this.stopPolling(t)}isPolling(t){return this.pollingTimers.has(t)}}const Em=new tZ;var Lt=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e))(Lt||{}),Jc=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e))(Jc||{}),Sl=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e))(Sl||{});class nZ extends Bl{constructor(){super("/data-destinations")}async getDataDestinations(){return this.get("/")}async getDataDestinationById(t){return this.get(`/${t}`)}async createDataDestination(t){return this.post("",t)}async updateDataDestination(t,n){return this.put(`/${t}`,n)}async deleteDataDestination(t){return this.delete(`/${t}`)}async rotateSecretKey(t){return this.post(`/${t}/rotate-secret-key`)}}const pl=new nZ,df={types:{[Lt.GOOGLE_SHEETS]:{type:Lt.GOOGLE_SHEETS,displayName:"Google Sheets",icon:$A,status:Jc.ACTIVE},[Lt.LOOKER_STUDIO]:{type:Lt.LOOKER_STUDIO,displayName:"Looker Studio",icon:j$,status:Jc.ACTIVE},[Lt.ODATA]:{type:Lt.ODATA,displayName:"OData",icon:_$,status:Jc.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},rZ=sn({deploymentUrl:on().optional(),destinationId:on().optional(),destinationSecretKey:on().optional()}),R4=sn({title:on().min(1,"Title is required"),type:c1(Lt)}),aZ=R4.extend({type:qs(Lt.GOOGLE_SHEETS),credentials:YA}),sZ=R4.extend({type:qs(Lt.LOOKER_STUDIO),credentials:rZ.optional()}),oZ=KA("type",[aZ,sZ]),T4=p.createContext(void 0);var Mt=(e=>(e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_DESTINATION_START="FETCH_DESTINATION_START",e.FETCH_DESTINATION_SUCCESS="FETCH_DESTINATION_SUCCESS",e.FETCH_DESTINATION_ERROR="FETCH_DESTINATION_ERROR",e.CLEAR_CURRENT_DESTINATION="CLEAR_CURRENT_DESTINATION",e.CREATE_DESTINATION_START="CREATE_DESTINATION_START",e.CREATE_DESTINATION_SUCCESS="CREATE_DESTINATION_SUCCESS",e.CREATE_DESTINATION_ERROR="CREATE_DESTINATION_ERROR",e.UPDATE_DESTINATION_START="UPDATE_DESTINATION_START",e.UPDATE_DESTINATION_SUCCESS="UPDATE_DESTINATION_SUCCESS",e.UPDATE_DESTINATION_ERROR="UPDATE_DESTINATION_ERROR",e.DELETE_DESTINATION_START="DELETE_DESTINATION_START",e.DELETE_DESTINATION_SUCCESS="DELETE_DESTINATION_SUCCESS",e.DELETE_DESTINATION_ERROR="DELETE_DESTINATION_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(Mt||{});const iZ={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function lZ(e,t){switch(t.type){case Mt.FETCH_DESTINATIONS_START:case Mt.FETCH_DESTINATION_START:case Mt.CREATE_DESTINATION_START:case Mt.UPDATE_DESTINATION_START:case Mt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case Mt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case Mt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case Mt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case Mt.UPDATE_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,dataDestinations:e.dataDestinations.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case Mt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case Mt.FETCH_DESTINATIONS_ERROR:case Mt.FETCH_DESTINATION_ERROR:case Mt.CREATE_DESTINATION_ERROR:case Mt.UPDATE_DESTINATION_ERROR:case Mt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case Mt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case Mt.CLEAR_ERROR:return{...e,error:null};default:return e}}function vg({children:e}){const[t,n]=p.useReducer(lZ,iZ);return o.jsx(T4.Provider,{value:{state:t,dispatch:n},children:e})}function cZ(){const e=p.useContext(T4);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class uZ{mapFromDto(t){let n="";try{t.credentials.type===Sl.GOOGLE_SHEETS_CREDENTIALS&&(n=JSON.stringify(t.credentials.serviceAccountKey,null,2))}catch(r){console.error(r,"Error parsing service account key")}return{id:t.id,title:t.title,type:Lt.GOOGLE_SHEETS,projectId:t.projectId,credentials:{serviceAccount:n},createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};return n.credentials&&(r.credentials={serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:Sl.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Lt.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:Sl.GOOGLE_SHEETS_CREDENTIALS}}}}class dZ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Lt.LOOKER_STUDIO,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){return{title:t.title??"",credentials:{type:Sl.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Lt.LOOKER_STUDIO,credentials:{type:Sl.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===Sl.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const j4={getMapper(e){switch(e){case Lt.GOOGLE_SHEETS:return new uZ;case Lt.LOOKER_STUDIO:return new dZ;default:throw new Error(`Unknown destination type: ${e}`)}}};function Vc(e){return j4.getMapper(e.type).mapFromDto(e)}function yg(){const{state:e,dispatch:t}=cZ(),n=p.useCallback(async()=>{t({type:Mt.FETCH_DESTINATIONS_START});try{const g=(await pl.getDataDestinations()).map(Vc);t({type:Mt.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(m){const g=m instanceof Error?m.message:"Failed to load destinations";t({type:Mt.FETCH_DESTINATIONS_ERROR,payload:g}),Fe({event:"data_destination_error",category:"DataDestination",action:"ListError",label:g})}},[t]),r=p.useCallback(async m=>{try{const g=await pl.getDataDestinationById(m),v=Vc(g);t({type:Mt.FETCH_DESTINATION_SUCCESS,payload:v})}catch(g){const v=g instanceof Error?g.message:"Failed to load destination";t({type:Mt.FETCH_DESTINATION_ERROR,payload:v}),Fe({event:"data_destination_error",category:"DataDestination",action:"GetError",label:v})}},[t]),s=p.useCallback(async m=>{t({type:Mt.CREATE_DESTINATION_START});try{const g=await pl.createDataDestination(m),v=Vc(g);return t({type:Mt.CREATE_DESTINATION_SUCCESS,payload:v}),Fe({event:"data_destination_created",category:"DataDestination",action:"Create",label:v.type}),Dt.success("Destination created"),v}catch(g){const v=g instanceof Error?g.message:"Failed to create destination";return t({type:Mt.CREATE_DESTINATION_ERROR,payload:v}),Fe({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type}),null}},[t]),l=p.useCallback(async(m,g)=>{t({type:Mt.UPDATE_DESTINATION_START});try{const v=await pl.updateDataDestination(m,g),x=Vc(v);return t({type:Mt.UPDATE_DESTINATION_SUCCESS,payload:x}),Fe({event:"data_destination_updated",category:"DataDestination",action:"Update",label:x.type}),Dt.success("Destination updated"),x}catch(v){const x=v instanceof Error?v.message:"Failed to update destination";return t({type:Mt.UPDATE_DESTINATION_ERROR,payload:x}),Fe({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:x}),null}},[t]),c=p.useCallback(async m=>{t({type:Mt.DELETE_DESTINATION_START});try{await pl.deleteDataDestination(m),t({type:Mt.DELETE_DESTINATION_SUCCESS,payload:m}),Fe({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),Dt.success("Destination deleted")}catch(g){const v=g instanceof Error?g.message:"Failed to delete destination";throw t({type:Mt.DELETE_DESTINATION_ERROR,payload:v}),Fe({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:v}),g}},[t]),d=p.useCallback(()=>{t({type:Mt.CLEAR_CURRENT_DESTINATION})},[t]),h=p.useCallback(async m=>{try{const g=await pl.rotateSecretKey(m),v=Vc(g);return Fe({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:v.type}),v}catch(g){const v=g instanceof Error?g.message:"Failed to rotate secret key";throw Fe({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",label:v}),console.error("Failed to rotate secret key:",g),g}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:l,deleteDataDestination:c,clearCurrentDataDestination:d,rotateSecretKey:h}}function fZ(e){const t=df.getInfo(e.type),n=t.status===Jc.ACTIVE;return{destinationInfo:t,isVisible:n}}function hZ(){const{dataMart:e}=gs(),{fetchReportsByDataMartId:t}=Gl(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=yg(),[l,c]=p.useState(!0);return p.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(m){console.error("Failed to fetch Data Mart destinations or reports:",m)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:l||s}}function m1(e){return JSON.stringify(e,null,2)}class mZ{mapFromDto(t){if(t.type!==ga.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:ga.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class pZ{mapFromDto(t){if(t.type!==ga.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:ga.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const gZ={getMapper(e){switch(e){case ga.GOOGLE_SHEETS_CONFIG:return new mZ;case ga.LOOKER_STUDIO_CONFIG:return new pZ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function vZ(e){return gZ.getMapper(e.type).mapFromDto(e)}function gl(e){const t=vZ(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:Vc(e.dataDestinationAccess),destinationConfig:t,lastRunDate:e.lastRunAt?new Date(e.lastRunAt):null,lastRunStatus:e.lastRunStatus,lastRunError:e.lastRunError,runsCount:e.runsCount,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Gl(){const{state:e,dispatch:t}=Xq(),n=p.useCallback(async()=>{t({type:nt.FETCH_DESTINATIONS_START});try{const E=await pl.getDataDestinations();t({type:nt.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch destinations";t({type:nt.FETCH_DESTINATIONS_ERROR,payload:R}),Fe({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=p.useCallback(async()=>{t({type:nt.FETCH_REPORTS_START});try{const R=(await yo.getReportsByProject()).map(gl);t({type:nt.FETCH_REPORTS_SUCCESS,payload:R})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch reports";t({type:nt.FETCH_REPORTS_ERROR,payload:R}),Fe({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),s=p.useCallback(async(E,R)=>{R!=null&&R.silent||t({type:nt.FETCH_REPORTS_START});try{const j=(await yo.getReportsByDataMartId(E,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(gl);t({type:nt.FETCH_REPORTS_SUCCESS,payload:j})}catch(T){const j=T instanceof Error?T.message:"Failed to fetch reports";t({type:nt.FETCH_REPORTS_ERROR,payload:j}),Fe({event:"report_error",category:"Report",action:"ListError",label:j})}},[t]),l=p.useCallback(async E=>{t({type:nt.FETCH_REPORT_START});try{const R=await yo.getReportById(E),T=gl(R);t({type:nt.FETCH_REPORT_SUCCESS,payload:T})}catch(R){const T=R instanceof Error?R.message:"Failed to fetch report";t({type:nt.FETCH_REPORT_ERROR,payload:T}),Fe({event:"report_error",category:"Report",action:"GetError",label:T})}},[t]),c=p.useCallback(async E=>{t({type:nt.CREATE_REPORT_START});try{const R=await yo.createReport(E),T=gl(R);return t({type:nt.CREATE_REPORT_SUCCESS,payload:T}),Fe({event:"report_created",category:"Report",action:"Create",label:T.dataDestination.type}),Dt.success("Report created"),T}catch(R){const T=R instanceof Error?R.message:"Failed to create report";return t({type:nt.CREATE_REPORT_ERROR,payload:T}),Fe({event:"report_error",category:"Report",action:"CreateError",label:E.destinationConfig.type}),null}},[t]),d=p.useCallback(async(E,R)=>{t({type:nt.UPDATE_REPORT_START});try{const T=await yo.updateReport(E,R),j=gl(T);return t({type:nt.UPDATE_REPORT_SUCCESS,payload:j}),Fe({event:"report_updated",category:"Report",action:"Update",label:j.dataDestination.type}),Dt.success("Report updated"),j}catch(T){const j=T instanceof Error?T.message:"Failed to update report";return t({type:nt.UPDATE_REPORT_ERROR,payload:j}),Fe({event:"report_error",category:"Report",action:"UpdateError",label:j}),null}},[t]),h=p.useCallback(async E=>{t({type:nt.DELETE_REPORT_START});try{await yo.deleteReport(E),t({type:nt.DELETE_REPORT_SUCCESS,payload:E}),Fe({event:"report_deleted",category:"Report",action:"Delete"}),Dt.success("Report deleted")}catch(R){const T=R instanceof Error?R.message:"Failed to delete report";t({type:nt.DELETE_REPORT_ERROR,payload:T}),Fe({event:"report_error",category:"Report",action:"DeleteError",label:T})}},[t]),m=p.useCallback(()=>{t({type:nt.CLEAR_CURRENT_REPORT})},[t]),g=p.useCallback(()=>{t({type:nt.CLEAR_ERROR})},[t]),v=p.useCallback(E=>{Em.stopPolling(E),t({type:nt.STOP_POLLING_REPORT,payload:E})},[t]),x=p.useCallback(E=>{e.polledReportIds.includes(E)&&v(E),t({type:nt.START_POLLING_REPORT,payload:E}),Em.startPolling(E,R=>{const T=gl(R);t({type:nt.UPDATE_POLLED_REPORT,payload:T})})},[t,e.polledReportIds,v]),b=p.useCallback(()=>{Em.stopAllPolling(),t({type:nt.STOP_ALL_POLLING})},[t]),w=p.useCallback(E=>{Em.setConfig(E)},[]),C=p.useCallback(async E=>{try{v(E),await yo.runReport(E),await l(E),x(E),Fe({event:"report_run_started",category:"Report",action:"Run",label:E}),Dt.success("Report run started")}catch(R){const T=R instanceof Error?R.message:"Failed to run report";Fe({event:"report_error",category:"Report",action:"RunError",label:T}),console.error("Failed to run report:",R)}},[l,x,v]);return p.useEffect(()=>()=>{b()},[b]),{destinations:e.destinations,reports:e.reports,currentReport:e.currentReport,loading:e.loading,error:e.error,polledReportIds:e.polledReportIds,fetchDestinations:n,fetchReports:r,fetchReportsByDataMartId:s,fetchReportById:l,createReport:c,updateReport:d,deleteReport:h,runReport:C,startPollingReport:x,stopPollingReport:v,stopAllPolling:b,setPollingConfig:w,clearCurrentReport:m,clearError:g}}un.SUCCESS+"",un.SUCCESS,un.RUNNING+"",un.RUNNING,un.ERROR+"",un.ERROR,un.CANCELLED+"",un.CANCELLED;var Nx,xg="HoverCard",[_4]=kr(xg,[Gs]),bg=Gs(),[yZ,Sg]=_4(xg),N4=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:l,openDelay:c=700,closeDelay:d=300}=e,h=bg(t),m=p.useRef(0),g=p.useRef(0),v=p.useRef(!1),x=p.useRef(!1),[b,w]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:xg}),C=p.useCallback(()=>{clearTimeout(g.current),m.current=window.setTimeout(()=>w(!0),c)},[c,w]),E=p.useCallback(()=>{clearTimeout(m.current),!v.current&&!x.current&&(g.current=window.setTimeout(()=>w(!1),d))},[d,w]),R=p.useCallback(()=>w(!1),[w]);return p.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(g.current)},[]),o.jsx(yZ,{scope:t,open:b,onOpenChange:w,onOpen:C,onClose:E,onDismiss:R,hasSelectionRef:v,isPointerDownOnContentRef:x,children:o.jsx(Su,{...h,children:n})})};N4.displayName=xg;var A4="HoverCardTrigger",D4=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Sg(A4,n),l=bg(n);return o.jsx(Cu,{asChild:!0,...l,children:o.jsx(Ke.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,Tp(s.onOpen)),onPointerLeave:Te(e.onPointerLeave,Tp(s.onClose)),onFocus:Te(e.onFocus,s.onOpen),onBlur:Te(e.onBlur,s.onClose),onTouchStart:Te(e.onTouchStart,c=>c.preventDefault())})})});D4.displayName=A4;var p1="HoverCardPortal",[xZ,bZ]=_4(p1,{forceMount:void 0}),O4=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,l=Sg(p1,t);return o.jsx(xZ,{scope:t,forceMount:n,children:o.jsx(Sr,{present:n||l.open,children:o.jsx(Vl,{asChild:!0,container:s,children:r})})})};O4.displayName=p1;var Rp="HoverCardContent",M4=p.forwardRef((e,t)=>{const n=bZ(Rp,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,l=Sg(Rp,e.__scopeHoverCard);return o.jsx(Sr,{present:r||l.open,children:o.jsx(SZ,{"data-state":l.open?"open":"closed",...s,onPointerEnter:Te(e.onPointerEnter,Tp(l.onOpen)),onPointerLeave:Te(e.onPointerLeave,Tp(l.onClose)),ref:t})})});M4.displayName=Rp;var SZ=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,...d}=e,h=Sg(Rp,n),m=bg(n),g=p.useRef(null),v=vt(t,g),[x,b]=p.useState(!1);return p.useEffect(()=>{if(x){const w=document.body;return Nx=w.style.userSelect||w.style.webkitUserSelect,w.style.userSelect="none",w.style.webkitUserSelect="none",()=>{w.style.userSelect=Nx,w.style.webkitUserSelect=Nx}}},[x]),p.useEffect(()=>{if(g.current){const w=()=>{b(!1),h.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var E;((E=document.getSelection())==null?void 0:E.toString())!==""&&(h.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",w),()=>{document.removeEventListener("pointerup",w),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!1}}},[h.isPointerDownOnContentRef,h.hasSelectionRef]),p.useEffect(()=>{g.current&&EZ(g.current).forEach(C=>C.setAttribute("tabindex","-1"))}),o.jsx(zl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Te(l,w=>{w.preventDefault()}),onDismiss:h.onDismiss,children:o.jsx(Tf,{...m,...d,onPointerDown:Te(d.onPointerDown,w=>{w.currentTarget.contains(w.target)&&b(!0),h.hasSelectionRef.current=!1,h.isPointerDownOnContentRef.current=!0}),ref:v,style:{...d.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),CZ="HoverCardArrow",wZ=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=bg(n);return o.jsx(jf,{...s,...r,ref:t})});wZ.displayName=CZ;function Tp(e){return t=>t.pointerType==="touch"?void 0:e()}function EZ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var RZ=N4,TZ=D4,jZ=O4,_Z=M4;const g1=({...e})=>o.jsx(RZ,{"data-slot":"hover-card",...e});g1.displayName="HoverCard";const v1=p.forwardRef(({...e},t)=>o.jsx(TZ,{"data-slot":"hover-card-trigger",ref:t,...e}));v1.displayName="HoverCardTrigger";const y1=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},l)=>{const c=d=>{d.stopPropagation(),r&&r(d)};return o.jsx(jZ,{children:o.jsx(_Z,{ref:l,align:t,sideOffset:n,className:J("bg-popover text-popover-foreground z-50 w-110 rounded-lg border px-6 py-4 shadow-md outline-none","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",e),onClick:c,...s})})});y1.displayName="HoverCardContent";const x1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("border-border flex gap-4 border-b pb-4",e),...t}));x1.displayName="HoverCardHeader";const b1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));b1.displayName="HoverCardHeaderIcon";const S1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("flex flex-col space-y-1",e),...t}));S1.displayName="HoverCardHeaderText";const C1=p.forwardRef(({className:e,...t},n)=>o.jsx("h2",{ref:n,className:J("text-md pt-1 leading-snug font-semibold",e),...t}));C1.displayName="HoverCardHeaderTitle";const w1=p.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:J("text-muted-foreground text-sm",e),...t}));w1.displayName="HoverCardHeaderDescription";const E1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("flex flex-col",e),...t}));E1.displayName="HoverCardBody";const gi=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("border-border flex items-center justify-between border-b py-4",e),...t}));gi.displayName="HoverCardItem";const vi=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:J("text-muted-foreground text-sm",e),...t}));vi.displayName="HoverCardItemLabel";const yi=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:J("text-sm",e),...t}));yi.displayName="HoverCardItemValue";const R1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("pt-4 pb-2",e),...t}));R1.displayName="HoverCardFooter";function Cg(e){return e.type===ga.GOOGLE_SHEETS_CONFIG}function k4(e){return e.type===ga.LOOKER_STUDIO_CONFIG}function kl({date:e,className:t=""}){const n=p.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),l=Math.abs(s),c=s<0,d=Math.floor(l/(1e3*60)),h=Math.floor(l/(1e3*60*60)),m=Math.floor(l/(1e3*60*60*24)),g=Math.floor(m/7),v=Math.floor(m/30),x=Math.floor(m/365),b=C=>C.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),w=C=>C.toLocaleDateString("en-US",{weekday:"long"});if(d<1)return c?"Just now":"In a moment";if(d<60)return c?d===1?"1 minute ago":`${d} minutes ago`:d===1?"In 1 minute":`In ${d} minutes`;if(h<24)return c?h===1?"1 hour ago":`${h} hours ago`:h===1?"In 1 hour":`In ${h} hours`;if(m===1){const C=b(e);return c?`Yesterday at ${C}`:`Tomorrow at ${C}`}if(m<7){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`This ${C} at ${E}`}if(m<14){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`Next ${C} at ${E}`}return g<4?c?g===2?"2 weeks ago":"3 weeks ago":g===2?"In 2 weeks":"In 3 weeks":v<12?c?v===1?"1 month ago":`${v} months ago`:v===1?"In 1 month":`In ${v} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return o.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const NZ=()=>{const e=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},AZ=je.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=NZ(),l=p.useMemo(()=>t.lastRunStatus?{statusType:MZ(t.lastRunStatus),statusText:IZ(t.lastRunStatus)}:null,[t.lastRunStatus]),c=p.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),d=p.useMemo(()=>Cg(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),h=p.useCallback(()=>{if(!d.isGoogleSheets||!d.spreadsheetId||!d.sheetId)return;const m=h1(d.spreadsheetId,d.sheetId);window.open(m,"_blank","noopener,noreferrer")},[d]);return o.jsxs(g1,{children:[o.jsx(v1,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(y1,{children:[o.jsxs(x1,{children:[o.jsx(b1,{children:o.jsx($A,{size:20})}),o.jsxs(S1,{children:[o.jsx(C1,{children:t.title||"Unnamed Report"}),o.jsxs(w1,{children:["Last modified ",o.jsx(kl,{date:new Date(t.modifiedAt)})]})]})]}),o.jsxs(E1,{children:[o.jsxs(gi,{children:[o.jsx(vi,{children:"Last run status:"}),o.jsx(yi,{children:l?o.jsx(Vf,{type:l.statusType,variant:"ghost",children:l.statusText}):"Not run yet"})]}),o.jsxs(gi,{children:[o.jsx(vi,{children:"Last run date:"}),o.jsx(yi,{children:t.lastRunDate?o.jsx(kl,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&o.jsxs(gi,{children:[o.jsx(vi,{children:"Error message:"}),o.jsx(yi,{children:t.lastRunError})]}),o.jsxs(gi,{children:[o.jsx(vi,{children:"Total runs:"}),o.jsxs(yi,{children:[t.runsCount||0," runs",c.createdAt&&o.jsxs(o.Fragment,{children:[", since ",c.createdAt]})]})]})]}),d.isGoogleSheets&&o.jsx(R1,{children:o.jsxs(Ce,{className:"w-full",variant:"default",onClick:h,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",o.jsx(Tl,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.report.id===t.report.id&&e.report.title===t.report.title&&e.report.modifiedAt===t.report.modifiedAt&&e.report.lastRunStatus===t.report.lastRunStatus&&e.report.lastRunDate===t.report.lastRunDate&&e.report.lastRunError===t.report.lastRunError&&e.report.runsCount===t.report.runsCount&&e.report.createdAt===t.report.createdAt&&JSON.stringify(e.report.destinationConfig)===JSON.stringify(t.report.destinationConfig)),DZ=e=>{switch(e){case ur.DRAFT:return Tn.NEUTRAL;case ur.PUBLISHED:return Tn.SUCCESS;default:return Tn.NEUTRAL}},OZ=e=>{switch(e){case jn.SUCCESS:return Tn.SUCCESS;case jn.RUNNING:return Tn.INFO;case jn.FAILED:case jn.CANCELLED:case jn.INTERRUPTED:return Tn.ERROR;default:return Tn.NEUTRAL}},MZ=e=>{switch(e){case un.SUCCESS:return Tn.SUCCESS;case un.RUNNING:return Tn.INFO;case un.ERROR:return Tn.ERROR;default:return Tn.NEUTRAL}},kZ=e=>{switch(e){case jn.SUCCESS:return"Success";case jn.RUNNING:return"Running";case jn.FAILED:return"Failed";case jn.CANCELLED:return"Cancelled";case jn.INTERRUPTED:return"Interrupted";default:return"Unknown"}},IZ=e=>{switch(e){case un.SUCCESS:return"Success";case un.RUNNING:return"Running";case un.ERROR:return"Failed";default:return"Unknown"}},I4=e=>sn({fullyQualifiedName:on().min(1,"Fully qualified name is required").refine(t=>Eq(t,e),t=>({message:Tq(t,e)}))}),LZ=e=>sn({pattern:on().min(1,"Table pattern is required").refine(t=>Rq(t,e),t=>({message:jq(t,e)}))}),PZ=e=>{const t=[];return e.status.code===ur.PUBLISHED&&t.push(qm.ALREADY_PUBLISHED),p4(e.storage)||t.push(qm.INVALID_STORAGE),e.definition||t.push(qm.MISSING_DEFINITION),t},UZ=e=>e.map(t=>JG[t]);function FZ(e){return e.map(t=>({id:t.id,title:t.title,status:l4.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function L4(){const{state:e,dispatch:t}=QG(),n=p.useCallback(async()=>{t({type:"SET_LOADING"});try{const l=await rn.getDataMarts(),c=FZ(l);t({type:"SET_ITEMS",payload:c})}catch(l){t({type:"SET_ERROR",payload:l instanceof Error?l.message:"Failed to load data marts"})}},[t]),r=p.useCallback(async l=>{t({type:"SET_LOADING"});try{await rn.deleteDataMart(l),Fe({event:"data_mart_deleted",category:"DataMart",action:"Delete"})}catch(c){const d=c instanceof Error?c.message:"Failed to delete data mart";throw t({type:"SET_ERROR",payload:d}),Fe({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:d}),c}},[t]),s=p.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,deleteDataMart:r}}/**
|
|
687
|
-
* table-core
|
|
688
|
-
*
|
|
689
|
-
* Copyright (c) TanStack
|
|
690
|
-
*
|
|
691
|
-
* This source code is licensed under the MIT license found in the
|
|
692
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
693
|
-
*
|
|
694
|
-
* @license MIT
|
|
695
|
-
*/function xi(e,t){return typeof e=="function"?e(t):e}function va(e,t){return n=>{t.setState(r=>({...r,[e]:xi(n,r[e])}))}}function wg(e){return e instanceof Function}function zZ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function VZ(e,t){const n=[],r=s=>{s.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function rt(e,t,n){let r=[],s;return l=>{let c;n.key&&n.debug&&(c=Date.now());const d=e(l);if(!(d.length!==r.length||d.some((g,v)=>r[v]!==g)))return s;r=d;let m;if(n.key&&n.debug&&(m=Date.now()),s=t(...d),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-c)*100)/100,v=Math.round((Date.now()-m)*100)/100,x=v/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(v,5)} /${b(g,5)} ms`,`
|
|
696
|
-
font-size: .6rem;
|
|
697
|
-
font-weight: bold;
|
|
698
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function at(e,t,n,r){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function HZ(e,t,n,r){const s=()=>{var c;return(c=l.getValue())!=null?c:e.options.renderFallbackValue},l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:rt(()=>[e,n,t,l],(c,d,h,m)=>({table:c,column:d,row:h,cell:m,getValue:m.getValue,renderValue:m.renderValue}),at(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function $Z(e,t,n,r){var s,l;const d={...e._getDefaultColumnDef(),...t},h=d.accessorKey;let m=(s=(l=d.id)!=null?l:h?typeof String.prototype.replaceAll=="function"?h.replaceAll(".","_"):h.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,g;if(d.accessorFn?g=d.accessorFn:h&&(h.includes(".")?g=x=>{let b=x;for(const C of h.split(".")){var w;b=(w=b)==null?void 0:w[C]}return b}:g=x=>x[d.accessorKey]),!m)throw new Error;let v={id:`${String(m)}`,accessorFn:g,parent:r,depth:n,columnDef:d,columns:[],getFlatColumns:rt(()=>[!0],()=>{var x;return[v,...(x=v.columns)==null?void 0:x.flatMap(b=>b.getFlatColumns())]},at(e.options,"debugColumns")),getLeafColumns:rt(()=>[e._getOrderColumnsFn()],x=>{var b;if((b=v.columns)!=null&&b.length){let w=v.columns.flatMap(C=>C.getLeafColumns());return x(w)}return[v]},at(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(v,e);return v}const Nr="debugHeaders";function cT(e,t,n){var r;let l={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const c=[],d=h=>{h.subHeaders&&h.subHeaders.length&&h.subHeaders.map(d),c.push(h)};return d(l),c},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(l,e)}),l}const BZ={createTable:e=>{e.getHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var l,c;const d=(l=r==null?void 0:r.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?l:[],h=(c=s==null?void 0:s.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?c:[],m=n.filter(v=>!(r!=null&&r.includes(v.id))&&!(s!=null&&s.includes(v.id)));return Rm(t,[...d,...m,...h],e)},at(e.options,Nr)),e.getCenterHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id))),Rm(t,n,e,"center")),at(e.options,Nr)),e.getLeftHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Rm(t,l,e,"left")},at(e.options,Nr)),e.getRightHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Rm(t,l,e,"right")},at(e.options,Nr)),e.getFooterGroups=rt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getLeftFooterGroups=rt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getCenterFooterGroups=rt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getRightFooterGroups=rt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,Nr)),e.getFlatHeaders=rt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getLeftFlatHeaders=rt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getCenterFlatHeaders=rt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getRightFlatHeaders=rt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Nr)),e.getCenterLeafHeaders=rt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Nr)),e.getLeftLeafHeaders=rt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Nr)),e.getRightLeafHeaders=rt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Nr)),e.getLeafHeaders=rt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,l,c,d,h,m;return[...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[],...(h=(m=r[0])==null?void 0:m.headers)!=null?h:[]].map(g=>g.getLeafHeaders()).flat()},at(e.options,Nr))}};function Rm(e,t,n,r){var s,l;let c=0;const d=function(x,b){b===void 0&&(b=1),c=Math.max(c,b),x.filter(w=>w.getIsVisible()).forEach(w=>{var C;(C=w.columns)!=null&&C.length&&d(w.columns,b+1)},0)};d(e);let h=[];const m=(x,b)=>{const w={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},C=[];x.forEach(E=>{const R=[...C].reverse()[0],T=E.column.depth===w.depth;let j,O=!1;if(T&&E.column.parent?j=E.column.parent:(j=E.column,O=!0),R&&(R==null?void 0:R.column)===j)R.subHeaders.push(E);else{const D=cT(n,j,{id:[r,b,j.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${C.filter(_=>_.column===j).length}`:void 0,depth:b,index:C.length});D.subHeaders.push(E),C.push(D)}w.headers.push(E),E.headerGroup=w}),h.push(w),b>0&&m(C,b-1)},g=t.map((x,b)=>cT(n,x,{depth:c,index:b}));m(g,c-1),h.reverse();const v=x=>x.filter(w=>w.column.getIsVisible()).map(w=>{let C=0,E=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],v(w.subHeaders).forEach(j=>{let{colSpan:O,rowSpan:D}=j;C+=O,R.push(D)})):C=1;const T=Math.min(...R);return E=E+T,w.colSpan=C,w.rowSpan=E,{colSpan:C,rowSpan:E}});return v((s=(l=h[0])==null?void 0:l.headers)!=null?s:[]),h}const T1=(e,t,n,r,s,l,c)=>{let d={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:h=>{if(d._valuesCache.hasOwnProperty(h))return d._valuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return d._valuesCache[h]=m.accessorFn(d.original,r),d._valuesCache[h]},getUniqueValues:h=>{if(d._uniqueValuesCache.hasOwnProperty(h))return d._uniqueValuesCache[h];const m=e.getColumn(h);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[h]=m.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[h]):(d._uniqueValuesCache[h]=[d.getValue(h)],d._uniqueValuesCache[h])},renderValue:h=>{var m;return(m=d.getValue(h))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>VZ(d.subRows,h=>h.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let h=[],m=d;for(;;){const g=m.getParentRow();if(!g)break;h.push(g),m=g}return h.reverse()},getAllCells:rt(()=>[e.getAllLeafColumns()],h=>h.map(m=>HZ(e,d,m,m.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:rt(()=>[d.getAllCells()],h=>h.reduce((m,g)=>(m[g.column.id]=g,m),{}),at(e.options,"debugRows"))};for(let h=0;h<e._features.length;h++){const m=e._features[h];m==null||m.createRow==null||m.createRow(d,e)}return d},GZ={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},P4=(e,t,n)=>{var r,s;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};P4.autoRemove=e=>cs(e);const U4=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};U4.autoRemove=e=>cs(e);const F4=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};F4.autoRemove=e=>cs(e);const z4=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};z4.autoRemove=e=>cs(e);const V4=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});V4.autoRemove=e=>cs(e)||!(e!=null&&e.length);const H4=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});H4.autoRemove=e=>cs(e)||!(e!=null&&e.length);const $4=(e,t,n)=>e.getValue(t)===n;$4.autoRemove=e=>cs(e);const B4=(e,t,n)=>e.getValue(t)==n;B4.autoRemove=e=>cs(e);const j1=(e,t,n)=>{let[r,s]=n;const l=e.getValue(t);return l>=r&&l<=s};j1.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(l>c){const d=l;l=c,c=d}return[l,c]};j1.autoRemove=e=>cs(e)||cs(e[0])&&cs(e[1]);const xo={includesString:P4,includesStringSensitive:U4,equalsString:F4,arrIncludes:z4,arrIncludesAll:V4,arrIncludesSome:H4,equals:$4,weakEquals:B4,inNumberRange:j1};function cs(e){return e==null||e===""}const qZ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:va("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?xo.includesString:typeof r=="number"?xo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?xo.equals:Array.isArray(r)?xo.arrIncludes:xo.weakEquals},e.getFilterFn=()=>{var n,r;return wg(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:xo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),l=r==null?void 0:r.find(g=>g.id===e.id),c=xi(n,l?l.value:void 0);if(uT(s,c,e)){var d;return(d=r==null?void 0:r.filter(g=>g.id!==e.id))!=null?d:[]}const h={id:e.id,value:c};if(l){var m;return(m=r==null?void 0:r.map(g=>g.id===e.id?h:g))!=null?m:[]}return r!=null&&r.length?[...r,h]:[h]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var l;return(l=xi(t,s))==null?void 0:l.filter(c=>{const d=n.find(h=>h.id===c.id);if(d){const h=d.getFilterFn();if(uT(h,c.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function uT(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const ZZ=(e,t,n)=>n.reduce((r,s)=>{const l=s.getValue(e);return r+(typeof l=="number"?l:0)},0),KZ=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},YZ=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},WZ=(e,t,n)=>{let r,s;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},QZ=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},XZ=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!zZ(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((l,c)=>l-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},JZ=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),eK=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,tK=(e,t)=>t.length,Ax={sum:ZZ,min:KZ,max:YZ,extent:WZ,mean:QZ,median:XZ,unique:JZ,uniqueCount:eK,count:tK},nK={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:va("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Ax.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Ax.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return wg(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Ax[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var s;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((s=n.subRows)!=null&&s.length)}}};function rK(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(l=>!t.includes(l.id));return n==="remove"?r:[...t.map(l=>e.find(c=>c.id===l)).filter(Boolean),...r]}const aK={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:va("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=rt(n=>[Bd(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Bd(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Bd(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=rt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let l=[];if(!(t!=null&&t.length))l=s;else{const c=[...t],d=[...s];for(;d.length&&c.length;){const h=c.shift(),m=d.findIndex(g=>g.id===h);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return rK(l,n,r)},at(e.options,"debugTable"))}},Dx=()=>({left:[],right:[]}),sK={getInitialState:e=>({columnPinning:Dx(),...e}),getDefaultOptions:e=>({onColumnPinningChange:va("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var l,c;if(n==="right"){var d,h;return{left:((d=s==null?void 0:s.left)!=null?d:[]).filter(v=>!(r!=null&&r.includes(v))),right:[...((h=s==null?void 0:s.right)!=null?h:[]).filter(v=>!(r!=null&&r.includes(v))),...r]}}if(n==="left"){var m,g;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(v=>!(r!=null&&r.includes(v))),...r],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(v=>!(r!=null&&r.includes(v)))}}return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(v=>!(r!=null&&r.includes(v))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(v=>!(r!=null&&r.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,l,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((l=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(d=>d.id),{left:r,right:s}=t.getState().columnPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const l=[...r??[],...s??[]];return n.filter(c=>!l.includes(c.column.id))},at(t.options,"debugRows")),e.getLeftVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),at(t.options,"debugRows")),e.getRightVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),at(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Dx():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Dx())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,l;return!!((s=r.left)!=null&&s.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getRightLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getCenterLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(l=>!s.includes(l.id))},at(e.options,"debugColumns"))}};function oK(e){return e||(typeof document<"u"?document:null)}const Tm={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ox=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),iK={getDefaultColumnDef:()=>Tm,getInitialState:e=>({columnSizing:{},columnSizingInfo:Ox(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:va("columnSizing",e),onColumnSizingInfoChange:va("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Tm.minSize,(r=l??e.columnDef.size)!=null?r:Tm.size),(s=e.columnDef.maxSize)!=null?s:Tm.maxSize)},e.getStart=rt(n=>[n,Bd(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,l)=>s+l.getSize(),0),at(t.options,"debugColumns")),e.getAfter=rt(n=>[n,Bd(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,l)=>s+l.getSize(),0),at(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var l;n+=(l=s.column.getSize())!=null?l:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return l=>{if(!r||!s||(l.persist==null||l.persist(),Mx(l)&&l.touches&&l.touches.length>1))return;const c=e.getSize(),d=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],h=Mx(l)?Math.round(l.touches[0].clientX):l.clientX,m={},g=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(j=>{var O,D;const _=t.options.columnResizeDirection==="rtl"?-1:1,A=(T-((O=j==null?void 0:j.startOffset)!=null?O:0))*_,M=Math.max(A/((D=j==null?void 0:j.startSize)!=null?D:0),-.999999);return j.columnSizingStart.forEach(U=>{let[B,G]=U;m[B]=Math.round(Math.max(G+G*M,0)*100)/100}),{...j,deltaOffset:A,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(j=>({...j,...m})))},v=R=>g("move",R),x=R=>{g("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=oK(n),w={moveHandler:R=>v(R.clientX),upHandler:R=>{b==null||b.removeEventListener("mousemove",w.moveHandler),b==null||b.removeEventListener("mouseup",w.upHandler),x(R.clientX)}},C={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),v(R.touches[0].clientX),!1),upHandler:R=>{var T;b==null||b.removeEventListener("touchmove",C.moveHandler),b==null||b.removeEventListener("touchend",C.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((T=R.touches[0])==null?void 0:T.clientX)}},E=lK()?{passive:!1}:!1;Mx(l)?(b==null||b.addEventListener("touchmove",C.moveHandler,E),b==null||b.addEventListener("touchend",C.upHandler,E)):(b==null||b.addEventListener("mousemove",w.moveHandler,E),b==null||b.addEventListener("mouseup",w.upHandler,E)),t.setColumnSizingInfo(R=>({...R,startOffset:h,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Ox():(n=e.initialState.columnSizingInfo)!=null?n:Ox())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,s)=>r+s.getSize(),0))!=null?t:0}}};let jm=null;function lK(){if(typeof jm=="boolean")return jm;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return jm=e,jm}function Mx(e){return e.type==="touchstart"}const cK={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:va("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(l=>l.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=rt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),at(t.options,"debugRows")),e.getVisibleCells=rt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],at(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>rt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),at(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Bd(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const uK={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},dK={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:va("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>xo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return wg(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:xo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},fK={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:va("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,l;e.setExpanded(r?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const c=l.split(".");r=Math.max(r,c.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const l=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(d=>{c[d]=!0}):c=r,n=(s=n)!=null?s:!l,!l&&n)return{...c,[e.id]:!0};if(l&&!n){const{[e.id]:d,...h}=c;return h}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,s;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((s=e.subRows)!=null&&s.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},I0=0,L0=10,kx=()=>({pageIndex:I0,pageSize:L0}),hK={getInitialState:e=>({...e,pagination:{...kx(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:va("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=l=>xi(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?kx():(s=e.initialState.pagination)!=null?s:kx())},e.setPageIndex=r=>{e.setPagination(s=>{let l=xi(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,c)),{...s,pageIndex:l}})},e.resetPageIndex=r=>{var s,l;e.setPageIndex(r?I0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:I0)},e.resetPageSize=r=>{var s,l;e.setPageSize(r?L0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:L0)},e.setPageSize=r=>{e.setPagination(s=>{const l=Math.max(1,xi(r,s.pageSize)),c=s.pageSize*s.pageIndex,d=Math.floor(c/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(s=>{var l;let c=xi(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=rt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((l,c)=>c)),s},at(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},Ix=()=>({top:[],bottom:[]}),mK={getInitialState:e=>({rowPinning:Ix(),...e}),getDefaultOptions:e=>({onRowPinningChange:va("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const l=r?e.getLeafRows().map(h=>{let{id:m}=h;return m}):[],c=s?e.getParentRows().map(h=>{let{id:m}=h;return m}):[],d=new Set([...c,e.id,...l]);t.setRowPinning(h=>{var m,g;if(n==="bottom"){var v,x;return{top:((v=h==null?void 0:h.top)!=null?v:[]).filter(C=>!(d!=null&&d.has(C))),bottom:[...((x=h==null?void 0:h.bottom)!=null?x:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)]}}if(n==="top"){var b,w;return{top:[...((b=h==null?void 0:h.top)!=null?b:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)],bottom:((w=h==null?void 0:h.bottom)!=null?w:[]).filter(C=>!(d!=null&&d.has(C)))}}return{top:((m=h==null?void 0:h.top)!=null?m:[]).filter(C=>!(d!=null&&d.has(C))),bottom:((g=h==null?void 0:h.bottom)!=null?g:[]).filter(C=>!(d!=null&&d.has(C)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const l=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:d}=c;return d});return(r=l==null?void 0:l.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?Ix():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Ix())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,l;return!!((s=r.top)!=null&&s.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(c=>{const d=e.getRow(c,!0);return d.getIsAllParentsExpanded()?d:null}):(n??[]).map(c=>t.find(d=>d.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),at(e.options,"debugRows")),e.getBottomRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),at(e.options,"debugRows")),e.getCenterRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(l=>!s.has(l.id))},at(e.options,"debugRows"))}},pK={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:va("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):s.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(l=>{P0(s,l.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Lx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Lx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Lx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(l=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return l;const d={...l};return P0(d,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return _1(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return U0(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return U0(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var s;n&&e.toggleSelected((s=r.target)==null?void 0:s.checked)}}}},P0=(e,t,n,r,s)=>{var l;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(l=c.subRows)!=null&&l.length&&c.getCanSelectSubRows()&&c.subRows.forEach(d=>P0(e,d.id,n,r,s))};function Lx(e,t){const n=e.getState().rowSelection,r=[],s={},l=function(c,d){return c.map(h=>{var m;const g=_1(h,n);if(g&&(r.push(h),s[h.id]=h),(m=h.subRows)!=null&&m.length&&(h={...h,subRows:l(h.subRows)}),g)return h}).filter(Boolean)};return{rows:l(t.rows),flatRows:r,rowsById:s}}function _1(e,t){var n;return(n=t[e.id])!=null?n:!1}function U0(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!s)&&(c.getCanSelect()&&(_1(c,t)?l=!0:s=!1),c.subRows&&c.subRows.length)){const d=U0(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const F0=/([0-9]+)/gm,gK=(e,t,n)=>G4(Ni(e.getValue(n)).toLowerCase(),Ni(t.getValue(n)).toLowerCase()),vK=(e,t,n)=>G4(Ni(e.getValue(n)),Ni(t.getValue(n))),yK=(e,t,n)=>N1(Ni(e.getValue(n)).toLowerCase(),Ni(t.getValue(n)).toLowerCase()),xK=(e,t,n)=>N1(Ni(e.getValue(n)),Ni(t.getValue(n))),bK=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},SK=(e,t,n)=>N1(e.getValue(n),t.getValue(n));function N1(e,t){return e===t?0:e>t?1:-1}function Ni(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function G4(e,t){const n=e.split(F0).filter(Boolean),r=t.split(F0).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),l=r.shift(),c=parseInt(s,10),d=parseInt(l,10),h=[c,d].sort();if(isNaN(h[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(h[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}return n.length-r.length}const Dd={alphanumeric:gK,alphanumericCaseSensitive:vK,text:yK,textCaseSensitive:xK,datetime:bK,basic:SK},CK={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:va("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const l=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Dd.datetime;if(typeof l=="string"&&(r=!0,l.split(F0).length>1))return Dd.alphanumeric}return r?Dd.text:Dd.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return wg(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Dd[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),l=typeof n<"u"&&n!==null;t.setSorting(c=>{const d=c==null?void 0:c.find(b=>b.id===e.id),h=c==null?void 0:c.findIndex(b=>b.id===e.id);let m=[],g,v=l?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?d?g="toggle":g="add":c!=null&&c.length&&h!==c.length-1?g="replace":d?g="toggle":g="replace",g==="toggle"&&(l||s||(g="remove")),g==="add"){var x;m=[...c,{id:e.id,desc:v}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else g==="toggle"?m=c.map(b=>b.id===e.id?{...b,desc:v}:b):g==="remove"?m=c.filter(b=>b.id!==e.id):m=[{id:e.id,desc:v}];return m})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":l},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},wK=[BZ,cK,aK,sK,GZ,qZ,uK,dK,CK,nK,fK,hK,mK,pK,iK];function EK(e){var t,n;const r=[...wK,...(t=e._features)!=null?t:[]];let s={_features:r};const l=s._features.reduce((x,b)=>Object.assign(x,b.getDefaultOptions==null?void 0:b.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(l,x):{...l,...x};let h={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var b;h=(b=x.getInitialState==null?void 0:x.getInitialState(h))!=null?b:h});const m=[];let g=!1;const v={_features:r,options:{...l,...e},initialState:h,_queue:x=>{m.push(x),g||(g=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();g=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const b=xi(x,s.options);s.options=c(b)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,b,w)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(x,b,w))!=null?C:`${w?[w.id,b].join("."):b}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,b)=>{let w=(b?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!w&&(w=s.getCoreRowModel().rowsById[x],!w))throw new Error;return w},_getDefaultColumnDef:rt(()=>[s.options.defaultColumn],x=>{var b;return x=(b=x)!=null?b:{},{header:w=>{const C=w.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:w=>{var C,E;return(C=(E=w.renderValue())==null||E.toString==null?void 0:E.toString())!=null?C:null},...s._features.reduce((w,C)=>Object.assign(w,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...x}},at(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:rt(()=>[s._getColumnDefs()],x=>{const b=function(w,C,E){return E===void 0&&(E=0),w.map(R=>{const T=$Z(s,R,E,C),j=R;return T.columns=j.columns?b(j.columns,T,E+1):[],T})};return b(x)},at(e,"debugColumns")),getAllFlatColumns:rt(()=>[s.getAllColumns()],x=>x.flatMap(b=>b.getFlatColumns()),at(e,"debugColumns")),_getAllFlatColumnsById:rt(()=>[s.getAllFlatColumns()],x=>x.reduce((b,w)=>(b[w.id]=w,b),{}),at(e,"debugColumns")),getAllLeafColumns:rt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,b)=>{let w=x.flatMap(C=>C.getLeafColumns());return b(w)},at(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,v);for(let x=0;x<s._features.length;x++){const b=s._features[x];b==null||b.createTable==null||b.createTable(s)}return s}function Ru(){return e=>rt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,l,c){l===void 0&&(l=0);const d=[];for(let m=0;m<s.length;m++){const g=T1(e,e._getRowId(s[m],m,c),s[m],m,l,void 0,c==null?void 0:c.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,d.push(g),e.options.getSubRows){var h;g.originalSubRows=e.options.getSubRows(s[m],m),(h=g.originalSubRows)!=null&&h.length&&(g.subRows=r(g.originalSubRows,l+1,g))}}return d};return n.rows=r(t),n},at(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function RK(e){const t=[],n=r=>{var s;t.push(r),(s=r.subRows)!=null&&s.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function TK(e,t,n){return n.options.filterFromLeafRows?jK(e,t,n):_K(e,t,n)}function jK(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(h,m){m===void 0&&(m=0);const g=[];for(let x=0;x<h.length;x++){var v;let b=h[x];const w=T1(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(w.columnFilters=b.columnFilters,(v=b.subRows)!=null&&v.length&&m<c){if(w.subRows=d(b.subRows,m+1),b=w,t(b)&&!w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}if(t(b)||w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}}else b=w,t(b)&&(g.push(b),l[b.id]=b,s.push(b))}return g};return{rows:d(e),flatRows:s,rowsById:l}}function _K(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(h,m){m===void 0&&(m=0);const g=[];for(let x=0;x<h.length;x++){let b=h[x];if(t(b)){var v;if((v=b.subRows)!=null&&v.length&&m<c){const C=T1(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);C.subRows=d(b.subRows,m+1),b=C}g.push(b),s.push(b),l[b.id]=b}}return g};return{rows:d(e),flatRows:s,rowsById:l}}function Hf(){return e=>rt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let x=0;x<t.flatRows.length;x++)t.flatRows[x].columnFilters={},t.flatRows[x].columnFiltersMeta={};return t}const s=[],l=[];(n??[]).forEach(x=>{var b;const w=e.getColumn(x.id);if(!w)return;const C=w.getFilterFn();C&&s.push({id:x.id,filterFn:C,resolvedValue:(b=C.resolveFilterValue==null?void 0:C.resolveFilterValue(x.value))!=null?b:x.value})});const c=(n??[]).map(x=>x.id),d=e.getGlobalFilterFn(),h=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&d&&h.length&&(c.push("__global__"),h.forEach(x=>{var b;l.push({id:x.id,filterFn:d,resolvedValue:(b=d.resolveFilterValue==null?void 0:d.resolveFilterValue(r))!=null?b:r})}));let m,g;for(let x=0;x<t.flatRows.length;x++){const b=t.flatRows[x];if(b.columnFilters={},s.length)for(let w=0;w<s.length;w++){m=s[w];const C=m.id;b.columnFilters[C]=m.filterFn(b,C,m.resolvedValue,E=>{b.columnFiltersMeta[C]=E})}if(l.length){for(let w=0;w<l.length;w++){g=l[w];const C=g.id;if(g.filterFn(b,C,g.resolvedValue,E=>{b.columnFiltersMeta[C]=E})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const v=x=>{for(let b=0;b<c.length;b++)if(x.columnFilters[c[b]]===!1)return!1;return!0};return TK(t.rows,v,e)},at(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Eg(e){return t=>rt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:s,pageIndex:l}=n;let{rows:c,flatRows:d,rowsById:h}=r;const m=s*l,g=m+s;c=c.slice(m,g);let v;t.options.paginateExpandedRows?v={rows:c,flatRows:d,rowsById:h}:v=RK({rows:c,flatRows:d,rowsById:h}),v.flatRows=[];const x=b=>{v.flatRows.push(b),b.subRows.length&&b.subRows.forEach(x)};return v.rows.forEach(x),v},at(t.options,"debugTable"))}function $f(){return e=>rt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],l=r.filter(h=>{var m;return(m=e.getColumn(h.id))==null?void 0:m.getCanSort()}),c={};l.forEach(h=>{const m=e.getColumn(h.id);m&&(c[h.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=h=>{const m=h.map(g=>({...g}));return m.sort((g,v)=>{for(let b=0;b<l.length;b+=1){var x;const w=l[b],C=c[w.id],E=C.sortUndefined,R=(x=w==null?void 0:w.desc)!=null?x:!1;let T=0;if(E){const j=g.getValue(w.id),O=v.getValue(w.id),D=j===void 0,_=O===void 0;if(D||_){if(E==="first")return D?-1:1;if(E==="last")return D?1:-1;T=D&&_?0:D?E:-E}}if(T===0&&(T=C.sortingFn(g,v,w.id)),T!==0)return R&&(T*=-1),C.invertSorting&&(T*=-1),T}return g.index-v.index}),m.forEach(g=>{var v;s.push(g),(v=g.subRows)!=null&&v.length&&(g.subRows=d(g.subRows))}),m};return{rows:d(n.rows),flatRows:s,rowsById:n.rowsById}},at(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
699
|
-
* react-table
|
|
700
|
-
*
|
|
701
|
-
* Copyright (c) TanStack
|
|
702
|
-
*
|
|
703
|
-
* This source code is licensed under the MIT license found in the
|
|
704
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
705
|
-
*
|
|
706
|
-
* @license MIT
|
|
707
|
-
*/function fu(e,t){return e?NK(e)?p.createElement(e,t):e:null}function NK(e){return AK(e)||typeof e=="function"||DK(e)}function AK(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function DK(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Tu(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=p.useState(()=>({current:EK(t)})),[r,s]=p.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function ju({className:e,...t}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:J("w-full caption-bottom text-sm",e),...t})})}function _u({className:e,...t}){return o.jsx("thead",{"data-slot":"table-header",className:J("[&_tr]:border-b",e),...t})}function Nu({className:e,...t}){return o.jsx("tbody",{"data-slot":"table-body",className:J("[&_tr:last-child]:border-0",e),...t})}function sr({className:e,...t}){return o.jsx("tr",{"data-slot":"table-row",className:J("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Au({className:e,...t}){return o.jsx("th",{"data-slot":"table-head",className:J("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ya({className:e,...t}){return o.jsx("td",{"data-slot":"table-cell",className:J("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var q4="AlertDialog",[OK]=kr(q4,[E_]),Lo=E_(),Z4=e=>{const{__scopeAlertDialog:t,...n}=e,r=Lo(t);return o.jsx(Yp,{...r,...n,modal:!0})};Z4.displayName=q4;var MK="AlertDialogTrigger",kK=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Lo(n);return o.jsx(VP,{...s,...r,ref:t})});kK.displayName=MK;var IK="AlertDialogPortal",K4=e=>{const{__scopeAlertDialog:t,...n}=e,r=Lo(t);return o.jsx(Wp,{...r,...n})};K4.displayName=IK;var LK="AlertDialogOverlay",Y4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Lo(n);return o.jsx(Qp,{...s,...r,ref:t})});Y4.displayName=LK;var eu="AlertDialogContent",[PK,UK]=OK(eu),FK=Hj("AlertDialogContent"),W4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,l=Lo(n),c=p.useRef(null),d=vt(t,c),h=p.useRef(null);return o.jsx(PP,{contentName:eu,titleName:Q4,docsSlug:"alert-dialog",children:o.jsx(PK,{scope:n,cancelRef:h,children:o.jsxs(Xp,{role:"alertdialog",...l,...s,ref:d,onOpenAutoFocus:Te(s.onOpenAutoFocus,m=>{var g;m.preventDefault(),(g=h.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[o.jsx(FK,{children:r}),o.jsx(VK,{contentRef:c})]})})})});W4.displayName=eu;var Q4="AlertDialogTitle",X4=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Lo(n);return o.jsx(Ab,{...s,...r,ref:t})});X4.displayName=Q4;var J4="AlertDialogDescription",e3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Lo(n);return o.jsx(Db,{...s,...r,ref:t})});e3.displayName=J4;var zK="AlertDialogAction",t3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Lo(n);return o.jsx(Jp,{...s,...r,ref:t})});t3.displayName=zK;var n3="AlertDialogCancel",r3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=UK(n3,n),l=Lo(n),c=vt(t,s);return o.jsx(Jp,{...l,...r,ref:c})});r3.displayName=n3;var VK=({contentRef:e})=>{const t=`\`${eu}\` requires a description for the component to be accessible for screen reader users.
|
|
708
|
-
|
|
709
|
-
You can add a description to the \`${eu}\` by passing a \`${J4}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
710
|
-
|
|
711
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${eu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
712
|
-
|
|
713
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},HK=Z4,$K=K4,BK=Y4,GK=W4,qK=t3,ZK=r3,KK=X4,YK=e3;function WK({...e}){return o.jsx(HK,{"data-slot":"alert-dialog",...e})}function QK({...e}){return o.jsx($K,{"data-slot":"alert-dialog-portal",...e})}function XK({className:e,...t}){return o.jsx(BK,{"data-slot":"alert-dialog-overlay",className:J("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function JK({className:e,...t}){return o.jsxs(QK,{children:[o.jsx(XK,{}),o.jsx(GK,{"data-slot":"alert-dialog-content",className:J("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function eY({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-header",className:J("flex flex-col gap-2 text-center sm:text-left",e),...t})}function tY({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-footer",className:J("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function nY({className:e,...t}){return o.jsx(KK,{"data-slot":"alert-dialog-title",className:J("text-lg font-semibold",e),...t})}function rY({className:e,...t}){return o.jsx(YK,{"data-slot":"alert-dialog-description",className:J("text-muted-foreground text-sm",e),...t})}function aY({className:e,...t}){return o.jsx(qK,{className:J(Tb(),e),...t})}function sY({className:e,...t}){return o.jsx(ZK,{className:J(Tb({variant:"outline"}),e),...t})}const a3=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],s3={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:qe.CONNECTOR,icon:L$},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:qe.CONNECTOR,icon:P$},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:qe.CONNECTOR,icon:U$},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:qe.CONNECTOR,icon:F$},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:qe.CONNECTOR,icon:Eb},sql:{title:"Start with SQL query",datamartTitle:"SQL-based Data Mart",definitionType:qe.SQL,icon:Cb},blank:{title:"Create blank Data Mart",datamartTitle:"New Data Mart",icon:Xm}},dT=a3.map(e=>({key:e,...s3[e]}));function oY(e){if(!e||!a3.includes(e))return;const t=e;return{key:t,...s3[t]}}function iY({children:e,className:t="",...n}){return o.jsx("div",{className:"dm-card",children:o.jsx("div",{className:J("-m-4 flex flex-col items-start justify-between gap-12 overflow-hidden px-8 py-16 lg:flex-row-reverse lg:px-16 lg:py-24 2xl:items-center",t),...n,children:e})})}function lY({children:e,className:t="",...n}){return o.jsx("div",{className:J("pb-2",t),...n,children:e})}function cY({children:e,className:t="",...n}){return o.jsx("h2",{className:J("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function uY({children:e,className:t="",...n}){return o.jsx("p",{className:J("text-muted-foreground text-lg",t),...n,children:e})}function dY({children:e,rings:t=7,className:n="",...r}){return o.jsxs("div",{className:J("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(s,l)=>{const c=`${(16*(l+1)+24).toString()}vmin`;return o.jsx("div",{className:"animate-ring-pulse",style:{height:c,width:c,animationDelay:`${(l*.3).toString()}s`,animationDuration:"4s",opacity:.2+l*.1,filter:l===0?"blur(1px)":"none"}},l)})}),o.jsx("div",{className:"animate-glow-burst"}),o.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function fY({children:e,className:t="",...n}){return o.jsx("div",{className:J("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function Px({separator:e=!0,children:t,className:n="",...r}){return o.jsx("section",{className:J("relative pb-10",e&&"after:from-border after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-gradient-to-r after:to-transparent",n),...r,children:t})}function fT({children:e,className:t="",...n}){return o.jsx("h3",{className:J("mb-4 text-xl font-medium",t),...n,children:e})}function Ux({children:e,className:t="",...n}){return o.jsx("div",{className:J("flex flex-wrap items-center gap-4",t),...n,children:e})}function _m({href:e,icon:t,title:n,variant:r="outline",size:s,className:l="",target:c,...d}){const h=r==="outline"?"lg":"sm",m=o.jsxs("span",{className:J("flex items-center gap-2"),children:[t,n]});return e?o.jsx(Ce,{asChild:!0,variant:r,size:s??h,className:J(r==="ghost"?"text-muted-foreground":"",l),...d,children:o.jsx(Ba,{to:e,target:c,children:m})}):o.jsx(Ce,{variant:r,size:s??h,className:l,...d,children:m})}function hY(){const{scope:e}=Io(),t=dT.filter(r=>r.definitionType===qe.CONNECTOR),n=dT.filter(r=>r.definitionType!==qe.CONNECTOR);return o.jsxs(iY,{children:[o.jsx(dY,{children:o.jsx(I$,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),o.jsxs(fY,{children:[o.jsxs(lY,{children:[o.jsx(cY,{children:"Let’s Build Your First Data Mart"}),o.jsx(uY,{children:"Choose how you want to start – connect a data source, write an SQL query, or begin with a blank setup to explore freely."})]}),o.jsxs(Px,{children:[o.jsx(fT,{children:"Connect a data source"}),o.jsx(Ux,{children:t.map(r=>o.jsx(_m,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&o.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),o.jsxs(Px,{children:[o.jsx(fT,{children:"Use your SQL skills or start from scratch"}),o.jsx(Ux,{children:n.map((r,s)=>o.jsxs(o.Fragment,{children:[o.jsx(_m,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&o.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),s<n.length-1&&o.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),o.jsx(Px,{separator:!1,children:o.jsxs(Ux,{children:[o.jsx(_m,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:o.jsx(CL,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),o.jsx(_m,{href:"https://docs.owox.com/docs/getting-started/core-concepts/?utm_source=owox_data_marts&utm_medium=empty_data_marts_page&utm_campaign=help_buttons",icon:o.jsx(M9,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function mY(){return o.jsx(as,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Ic={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},pY={extractColumnIds:e=>e.map(t=>{if(t.id)return t.id;if("accessorKey"in t&&typeof t.accessorKey=="string")return t.accessorKey}).filter(t=>t!==void 0)};function Bf({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Ic.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=Ic.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:l=Ic.DEFAULT_EXCLUDED_COLUMNS}){const c=p.useMemo(()=>({SORTING:`${t}${Ic.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Ic.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),d=p.useMemo(()=>pY.extractColumnIds(e),[e]),h=p.useMemo(()=>d.filter(C=>!s.includes(C)),[d,s]),m=p.useCallback(()=>{const C=ks.get(c.SORTING,"json");return C&&Array.isArray(C)&&C.length>0?C:[{id:h.includes(n)?n:h[0]??Ic.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,h,n]),g=p.useCallback(()=>{const C=ks.get(c.COLUMN_VISIBILITY,"json");if(C&&typeof C=="object"&&!Array.isArray(C)){const E={};for(const R of d)l.includes(R)||(E[R]=C[R]);return E}return r},[c.COLUMN_VISIBILITY,d,l,r]),[v,x]=p.useState(m),[b,w]=p.useState(g);return p.useEffect(()=>{v.length>0&&h.includes(v[0].id)&&ks.set(c.SORTING,v)},[v,h,c.SORTING]),p.useEffect(()=>{const C={};for(const E of d){if(l.includes(E))continue;const R=b[E];typeof R=="boolean"&&(C[E]=R)}ks.set(c.COLUMN_VISIBILITY,C)},[b,d,l,c.COLUMN_VISIBILITY]),{sorting:v,setSorting:x,columnVisibility:b,setColumnVisibility:w}}function gY({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var _;const{navigate:l,scope:c}=Io(),{sorting:d,setSorting:h,columnVisibility:m,setColumnVisibility:g}=Bf({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1}}),[v,x]=p.useState([]),[b,w]=p.useState({}),[C,E]=p.useState(!1),[R,T]=p.useState(!1),j=async()=>{try{T(!0);const M=D.getSelectedRowModel().rows.map(U=>U.original.id);for(const U of M)await n(U);an.success(`Successfully deleted ${String(M.length)} data mart${M.length!==1?"s":""}`),w({}),await r()}catch(A){console.error("Error deleting data marts:",A),an.error("Failed to delete some data marts. Please try again.")}finally{T(!1),E(!1)}},O=Object.keys(b).length>0,D=Tu({data:t,columns:[{id:"select",size:40,header:({table:A})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":A.getIsAllRowsSelected(),"data-state":A.getIsAllRowsSelected()?"checked":"unchecked","aria-label":"Select all rows",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:A.getToggleAllRowsSelectedHandler(),children:A.getIsAllRowsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),cell:({row:A})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":A.getIsSelected(),"data-state":A.getIsSelected()?"checked":"unchecked","aria-label":"Select row",className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:A.getToggleSelectedHandler(),children:A.getIsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Ru(),getPaginationRowModel:Eg(),onSortingChange:h,getSortedRowModel:$f(),onColumnFiltersChange:x,getFilteredRowModel:Hf(),onColumnVisibilityChange:g,onRowSelectionChange:w,state:{sorting:d,columnFilters:v,columnVisibility:m,rowSelection:b},enableRowSelection:!0});return s?o.jsx("div",{children:o.jsx(mY,{})}):t.length?o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsxs("div",{className:"dm-card-toolbar-left",children:[O&&o.jsx(Ce,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{E(!0)},disabled:R,children:o.jsx(ko,{className:"h-4 w-4"})}),o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Fl,{className:"dm-card-toolbar-search-icon"}),o.jsx($t,{placeholder:"Search by title",value:(_=D.getColumn("title"))==null?void 0:_.getFilterValue(),onChange:A=>{var M;return(M=D.getColumn("title"))==null?void 0:M.setFilterValue(A.target.value)},className:"dm-card-toolbar-search-input"})]})]}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsx(Ba,{to:c("/data-marts/create"),children:o.jsxs(Ce,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[o.jsx(Ta,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(ju,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[o.jsx(_u,{className:"dm-card-table-header",children:D.getHeaderGroups().map(A=>o.jsx(sr,{className:"dm-card-table-header-row",children:A.headers.map(M=>o.jsx(Au,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:M.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:M.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(M.getSize())}%`},children:M.isPlaceholder?null:fu(M.column.columnDef.header,M.getContext())},M.id))},A.id))}),o.jsx(Nu,{className:"dm-card-table-body",children:D.getRowModel().rows.length?D.getRowModel().rows.map(A=>o.jsx(sr,{"data-state":A.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:M=>{if(M.target instanceof HTMLElement&&(M.target.closest('[role="checkbox"]')||M.target.closest(".actions-cell")||M.target.closest('[role="menuitem"]')||M.target.closest('[data-state="open"]')))return;const U=A.original.id;l(`/data-marts/${U}/data-setup`)},children:A.getVisibleCells().map(M=>o.jsx(ya,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${M.column.id==="actions"?"actions-cell":""} ${M.column.id==="createdAt"?"whitespace-nowrap":""}`,style:M.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:M.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(M.column.getSize())}%`},children:fu(M.column.columnDef.cell,M.getContext())},M.id))},A.id)):o.jsx(sr,{children:o.jsx(ya,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{D.previousPage()},disabled:!D.getCanPreviousPage(),children:"Previous"}),o.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{D.nextPage()},disabled:!D.getCanNextPage(),children:"Next"})]}),o.jsx(WK,{open:C,onOpenChange:E,children:o.jsxs(JK,{children:[o.jsxs(eY,{children:[o.jsx(nY,{children:"Are you sure?"}),o.jsxs(rY,{children:["You're about to delete ",Object.keys(b).length," selected data mart",Object.keys(b).length!==1?"s":"",". This action cannot be undone."]})]}),o.jsxs(tY,{children:[o.jsx(sY,{disabled:R,children:"Cancel"}),o.jsx(aY,{onClick:()=>{j()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):o.jsx(hY,{})}function ml({column:e,children:t}){return o.jsxs(Ce,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Us,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Za,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{className:"text-muted-foreground h-4 w-4"})})]})]})}function A1({...e}){return o.jsx(Yp,{"data-slot":"dialog",...e})}function vY({...e}){return o.jsx(Wp,{"data-slot":"dialog-portal",...e})}function yY({className:e,...t}){return o.jsx(Qp,{"data-slot":"dialog-overlay",className:J("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function D1({className:e,children:t,showCloseButton:n=!0,...r}){return o.jsxs(vY,{"data-slot":"dialog-portal",children:[o.jsx(yY,{}),o.jsxs(Xp,{"data-slot":"dialog-content",className:J("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&o.jsxs(Jp,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(su,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function O1({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:J("flex flex-col gap-2 text-center sm:text-left",e),...t})}function xY({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:J("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function M1({className:e,...t}){return o.jsx(Ab,{"data-slot":"dialog-title",className:J("text-lg leading-none font-semibold",e),...t})}function k1({className:e,...t}){return o.jsx(Db,{"data-slot":"dialog-description",className:J("text-muted-foreground text-sm",e),...t})}const bY=bf("",{variants:{variant:{brand:"bg-primary text-white shadow-xs hover:bg-primary-hover focus-visible:ring-brand-blue-200 dark:focus-visible:ring-brand-blue-400"}}});function tu({className:e,variant:t,...n}){return t==="brand"?o.jsx(Ce,{variant:"default",className:J(bY({variant:t}),e),...n}):o.jsx(Ce,{variant:t,className:e,...n})}const xa=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:l,onConfirm:c,onCancel:d,variant:h="destructive",children:m})=>{const g=()=>{t(!1),d==null||d()};return o.jsx(A1,{open:e,onOpenChange:t,children:o.jsxs(D1,{children:[o.jsxs(O1,{children:[o.jsx(M1,{children:n}),o.jsx(k1,{children:r})]}),m,o.jsxs(xY,{children:[l&&o.jsx(tu,{variant:"secondary",onClick:g,children:l}),o.jsx(tu,{variant:h,onClick:c,children:s})]})]})})},SY=({row:e,onDeleteSuccess:t})=>{const{scope:n}=Io(),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{deleteDataMart:d,refreshList:h}=L4(),m=async()=>{try{await d(e.original.id),s(!1),await h(),t==null||t()}catch(g){console.error("Failed to delete data mart:",g)}};return o.jsxs("div",{className:"text-right",children:[o.jsxs(Cr,{open:l,onOpenChange:c,children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Er,{align:"end",children:[o.jsx(bt,{children:o.jsxs(Ba,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[o.jsx(Cf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]})}),o.jsx(Ga,{}),o.jsxs(bt,{onClick:()=>{s(!0)},children:[o.jsx(ko,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),o.jsx(xa,{open:r,onOpenChange:s,title:"Delete Data Mart",description:"Are you sure you want to delete this data mart? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>void m(),variant:"destructive"})]})};var En=(e=>(e.TITLE="title",e.DEFINITION_TYPE="definitionType",e.STORAGE_TYPE="storageType",e.STATUS="status",e.TRIGGERS_COUNT="triggersCount",e.REPORTS_COUNT="reportsCount",e.CREATED_AT="createdAt",e))(En||{});const ui={[En.TITLE]:"Title",[En.DEFINITION_TYPE]:"Input Source",[En.STORAGE_TYPE]:"Storage",[En.STATUS]:"Status",[En.TRIGGERS_COUNT]:"Triggers",[En.REPORTS_COUNT]:"Reports",[En.CREATED_AT]:"Created at"};function CY({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=ui[t.id]||t.id;return o.jsx(bt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const hT={types:{[qe.SQL]:{type:qe.SQL,displayName:"SQL",icon:Cb},[qe.TABLE]:{type:qe.TABLE,displayName:"Table",icon:RL},[qe.VIEW]:{type:qe.VIEW,displayName:"View",icon:P9},[qe.TABLE_PATTERN]:{type:qe.TABLE_PATTERN,displayName:"Pattern",icon:zI},[qe.CONNECTOR]:{type:qe.CONNECTOR,displayName:"Connector",icon:Eb}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},wY=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:En.TITLE,size:40,header:({column:n})=>o.jsx(ml,{column:n,children:ui[En.TITLE]}),cell:({row:n})=>o.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===qe.CONNECTOR){const s=n.definition,l=t.find(c=>c.name===s.connector.source.name);return(l==null?void 0:l.displayName)??(l==null?void 0:l.name)??"Unknown"}else{const{displayName:s}=hT.getInfo(r);return s}},id:En.DEFINITION_TYPE,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:ui[En.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case qe.CONNECTOR:{const s=n.original.definition,l=t.find(c=>c.name===s.connector.source.name);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(l==null?void 0:l.logoBase64)&&o.jsx(Ff,{base64:l.logoBase64,size:18}),(l==null?void 0:l.displayName)??"Unknown"]})}default:{const{displayName:s,icon:l}=hT.getInfo(r);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(l,{className:"h-4 w-4"}),s]})}}}},{accessorKey:En.STORAGE_TYPE,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:ui[En.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:l,icon:c}=Vi.getInfo(r),d=s??l;return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),d]})}},{accessorKey:En.CREATED_AT,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:ui[En.CREATED_AT]}),cell:({row:n})=>{const r=n.getValue("createdAt"),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r);return o.jsx("div",{className:"text-muted-foreground",children:s})}},{accessorKey:En.STATUS,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:ui[En.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return o.jsx(Vf,{type:DZ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:En.TRIGGERS_COUNT,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:ui[En.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:En.REPORTS_COUNT,size:15,header:({column:n})=>o.jsx(ml,{column:n,children:ui[En.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>o.jsx(CY,{table:n}),cell:({row:n})=>o.jsx(SY,{row:n,onDeleteSuccess:e})}];var nr=(e=>(e.FETCH_CONNECTORS_START="FETCH_CONNECTORS_START",e.FETCH_CONNECTORS_SUCCESS="FETCH_CONNECTORS_SUCCESS",e.FETCH_CONNECTORS_ERROR="FETCH_CONNECTORS_ERROR",e.FETCH_CONNECTOR_SPECIFICATION_START="FETCH_CONNECTOR_SPECIFICATION_START",e.FETCH_CONNECTOR_SPECIFICATION_SUCCESS="FETCH_CONNECTOR_SPECIFICATION_SUCCESS",e.FETCH_CONNECTOR_SPECIFICATION_ERROR="FETCH_CONNECTOR_SPECIFICATION_ERROR",e.FETCH_CONNECTOR_FIELDS_START="FETCH_CONNECTOR_FIELDS_START",e.FETCH_CONNECTOR_FIELDS_SUCCESS="FETCH_CONNECTOR_FIELDS_SUCCESS",e.FETCH_CONNECTOR_FIELDS_ERROR="FETCH_CONNECTOR_FIELDS_ERROR",e))(nr||{});const EY={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function RY(e,t){switch(t.type){case nr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case nr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case nr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case nr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case nr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case nr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case nr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case nr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case nr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const o3=p.createContext(void 0);function hu({children:e}){const[t,n]=p.useReducer(RY,EY);return o.jsx(o3.Provider,{value:{state:t,dispatch:n},children:e})}function TY(){const e=p.useContext(o3);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var rs=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(rs||{});class Fx extends Bl{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}}function jY(e){return e.map(t=>({name:t.name,displayName:t.title??t.name,description:t.description??"",logoBase64:t.logo,docUrl:t.docUrl})).sort((t,n)=>t.displayName.localeCompare(n.displayName))}function ql(){const{state:e,dispatch:t}=TY(),n=p.useMemo(()=>jY(e.connectors),[e.connectors]),r=p.useCallback(async()=>{t({type:nr.FETCH_CONNECTORS_START});try{const d=await new Fx().getAvailableConnectors();t({type:nr.FETCH_CONNECTORS_SUCCESS,payload:d})}catch(c){const d=c instanceof Error?c.message:"Unknown error";t({type:nr.FETCH_CONNECTORS_ERROR,payload:d}),Fe({event:"connector_error",category:"Connector",action:"ListError",label:d})}},[t]),s=p.useCallback(async c=>{t({type:nr.FETCH_CONNECTOR_SPECIFICATION_START});try{const h=await new Fx().getConnectorSpecification(c);t({type:nr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:h})}catch(d){const h=d instanceof Error?d.message:"Unknown error";t({type:nr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:h}),Fe({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),l=p.useCallback(async c=>{t({type:nr.FETCH_CONNECTOR_FIELDS_START});try{const h=await new Fx().getConnectorFields(c);t({type:nr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:h})}catch(d){const h=d instanceof Error?d.message:"Unknown error";t({type:nr.FETCH_CONNECTOR_FIELDS_ERROR,payload:h}),Fe({event:"connector_error",category:"Connector",action:"FieldsError",label:c})}},[t]);return{connectors:n,connectorSpecification:e.connectorSpecification,connectorFields:e.connectorFields,loading:e.loading,loadingSpecification:e.loadingSpecification,loadingFields:e.loadingFields,error:e.error,fetchAvailableConnectors:r,fetchConnectorSpecification:s,fetchConnectorFields:l}}const _Y=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=L4(),{connectors:l,fetchAvailableConnectors:c}=ql();return p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t()},[t]),o.jsx(gY,{columns:wY({connectors:l}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function mT(){return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(WG,{children:o.jsx(hu,{children:o.jsx(_Y,{})})})})]})}const i3=p.createContext(void 0),Od=e=>{const t=PZ(e);return{...e,canPublish:t.length===0,validationErrors:t}},l3={dataMart:null,isLoading:!1,error:null,runs:[]};function NY(e,t){switch(t.type){case"FETCH_DATA_MART_START":case"CREATE_DATA_MART_START":case"UPDATE_DATA_MART_START":case"UPDATE_DATA_MART_TITLE_START":case"UPDATE_DATA_MART_DESCRIPTION_START":case"UPDATE_DATA_MART_DEFINITION_START":case"DELETE_DATA_MART_START":case"PUBLISH_DATA_MART_START":case"RUN_DATA_MART_START":case"ACTUALIZE_DATA_MART_SCHEMA_START":case"UPDATE_DATA_MART_SCHEMA_START":case"FETCH_DATA_MART_RUNS_START":case"LOAD_MORE_DATA_MART_RUNS_START":return{...e,isLoading:!0,error:null};case"CREATE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_SUCCESS":case"UPDATE_DATA_MART_SUCCESS":case"PUBLISH_DATA_MART_SUCCESS":case"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS":case"UPDATE_DATA_MART_SCHEMA_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:Od(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Od({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Od({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Od({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Od({...e.dataMart,definitionType:t.payload.definitionType,definition:t.payload.definition,modifiedAt:new Date})}:e;case"DELETE_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null,dataMart:null};case"RUN_DATA_MART_SUCCESS":return{...e,isLoading:!1,error:null};case"FETCH_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:t.payload};case"LOAD_MORE_DATA_MART_RUNS_SUCCESS":return{...e,isLoading:!1,error:null,runs:[...e.runs,...t.payload]};case"FETCH_DATA_MART_ERROR":case"CREATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_ERROR":case"UPDATE_DATA_MART_TITLE_ERROR":case"UPDATE_DATA_MART_DESCRIPTION_ERROR":case"UPDATE_DATA_MART_DEFINITION_ERROR":case"DELETE_DATA_MART_ERROR":case"PUBLISH_DATA_MART_ERROR":case"RUN_DATA_MART_ERROR":case"ACTUALIZE_DATA_MART_SCHEMA_ERROR":case"UPDATE_DATA_MART_SCHEMA_ERROR":case"FETCH_DATA_MART_RUNS_ERROR":case"LOAD_MORE_DATA_MART_RUNS_ERROR":return{...e,isLoading:!1,error:t.payload};case"RESET":return l3;default:return e}}function Hi(){const e=p.useContext(i3);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class AY{mapFromDto(t){const n=t.config,r=t.credentials;let s="";return r&&Object.keys(r).length>0&&(s=JSON.stringify(r,null,2)),{id:t.id,title:t.title,type:Pe.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:s},config:{projectId:(n==null?void 0:n.projectId)??"",location:(n==null?void 0:n.location)??""}}}mapToUpdateRequest(t){const n={config:{projectId:t.config.projectId,location:t.config.location}};return t.credentials&&(n.credentials={...JSON.parse(t.credentials.serviceAccount)}),n}}class DY{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Pe.AWS_ATHENA,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{accessKeyId:(r==null?void 0:r.accessKeyId)??"",secretAccessKey:(r==null?void 0:r.secretAccessKey)??""},config:{region:(n==null?void 0:n.region)??"",outputBucket:(n==null?void 0:n.outputBucket)??""}}}mapToUpdateRequest(t){const n={config:{region:t.config.region,outputBucket:t.config.outputBucket}};return t.credentials&&(n.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),n}}const c3={getMapper(e){switch(e){case Pe.GOOGLE_BIGQUERY:return new AY;case Pe.AWS_ATHENA:return new DY;default:throw new Error(`Unknown storage type: ${e}`)}}};function Zm(e){return c3.getMapper(e.type).mapFromDto(e)}function OY(e){const t=c3.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function MY(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function kY(e){return{type:e}}function IY(e){return{sqlQuery:e.sqlQuery}}function LY(e){return{sqlQuery:e.sqlQuery}}function PY(e){return{fullyQualifiedName:e.fullyQualifiedName}}function UY(e){return{fullyQualifiedName:e.fullyQualifiedName}}function FY(e){return{fullyQualifiedName:e.fullyQualifiedName}}function zY(e){return{fullyQualifiedName:e.fullyQualifiedName}}function VY(e){return{pattern:e.pattern}}function HY(e){return{pattern:e.pattern}}function $Y(e){return{connector:{source:{name:e.connector.source.name,configuration:e.connector.source.configuration,node:e.connector.source.node,fields:e.connector.source.fields},storage:{fullyQualifiedName:e.connector.storage.fullyQualifiedName}}}}function BY(e){const t=e.connector;return{connector:{source:{name:t.source.name,configuration:t.source.configuration,node:t.source.node,fields:t.source.fields},storage:{fullyQualifiedName:t.storage.fullyQualifiedName}}}}function GY(e,t){if(!e||!t)return null;switch(e){case qe.SQL:return LY(t);case qe.TABLE:return UY(t);case qe.VIEW:return zY(t);case qe.TABLE_PATTERN:return HY(t);case qe.CONNECTOR:return BY(t);default:return console.warn(`Unknown definition type: ${String(e)}`),null}}function Lc(e){return{id:e.id,title:e.title,description:e.description,status:l4.getInfo(e.status),storage:Zm(e.storage),definitionType:e.definitionType,definition:GY(e.definitionType,e.definition),schema:e.schema,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,validationErrors:[]}}function qY(e){return{id:e.id,title:e.title}}function u3({children:e}){const[t,n]=p.useReducer(NY,l3),r=p.useCallback(async D=>{try{n({type:"FETCH_DATA_MART_START"});const _=await rn.getDataMartById(D),A=Lc(_);n({type:"FETCH_DATA_MART_SUCCESS",payload:A})}catch(_){n({type:"FETCH_DATA_MART_ERROR",payload:yn(_)})}},[]),s=async D=>{try{n({type:"CREATE_DATA_MART_START"});const _=await rn.createDataMart(D),A=qY(_);return n({type:"CREATE_DATA_MART_SUCCESS",payload:A}),Fe({event:"data_mart_created",category:"DataMart",action:"Create",label:A.id}),Dt.success("Data Mart created"),A}catch(_){const A=yn(_);throw n({type:"CREATE_DATA_MART_ERROR",payload:A}),Fe({event:"data_mart_error",category:"DataMart",action:"CreateError",label:A.message}),_}},l=async(D,_)=>{try{n({type:"UPDATE_DATA_MART_START"});const A=await rn.updateDataMart(D,_),M=Lc(A);n({type:"UPDATE_DATA_MART_SUCCESS",payload:M}),Fe({event:"data_mart_updated",category:"DataMart",action:"Update",label:M.id})}catch(A){const M=yn(A);n({type:"UPDATE_DATA_MART_ERROR",payload:M}),Fe({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:M.message})}},c=async D=>{try{n({type:"DELETE_DATA_MART_START"}),await rn.deleteDataMart(D),n({type:"DELETE_DATA_MART_SUCCESS"}),Fe({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:D}),Dt.success("Data Mart deleted")}catch(_){const A=yn(_);n({type:"DELETE_DATA_MART_ERROR",payload:A}),Fe({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:A.message})}},d=async(D,_)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await rn.updateDataMartTitle(D,_),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:_}),Fe({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:_}),Dt.success("Title updated")}catch(A){const M=yn(A);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:M}),Fe({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:M.message})}},h=async(D,_)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await rn.updateDataMartDescription(D,_),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:_??""}),Fe({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),Dt.success("Description updated")}catch(A){const M=yn(A);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:M}),Fe({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:M.message})}},m=p.useCallback(D=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:D})},[]),g=async(D,_,A)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let M;switch(_){case qe.SQL:M={definitionType:_,definition:IY(A)};break;case qe.TABLE:M={definitionType:_,definition:PY(A)};break;case qe.VIEW:M={definitionType:_,definition:FY(A)};break;case qe.TABLE_PATTERN:M={definitionType:_,definition:VY(A)};break;case qe.CONNECTOR:{const G=A;let K;for(const re of G.connector.source.configuration){const H=re;if(H._copiedFrom){K=H._copiedFrom.dataMartId;break}}M={definitionType:qe.CONNECTOR,definition:$Y(G),sourceDataMartId:K};break}default:throw new Error(`Unsupported definition type: ${String(_)}`)}const U=await rn.updateDataMartDefinition(D,M),B=Lc(U);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:_,definition:A}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:B}),Fe({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:_})}catch(M){const U=yn(M);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:U}),Fe({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:U.message})}},v=async D=>{try{n({type:"PUBLISH_DATA_MART_START"});const _=await rn.publishDataMart(D),A=Lc(_);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:A}),Dt.success("Data Mart published")}catch(_){const A=yn(_);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:A}),Fe({event:"data_mart_error",category:"DataMart",action:"PublishError",label:A.message}),_}},x=async D=>{const _=Dt.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await rn.runDataMart(D.id,D.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(A){Dt.dismiss(_);const M=yn(A);n({type:"RUN_DATA_MART_ERROR",payload:M}),Fe({event:"data_mart_error",category:"DataMart",action:"RunError",label:M.message})}},b=async(D,_)=>{try{await rn.cancelDataMartRun(D,_),await E(D),Dt.success("Data Mart run canceled")}catch(A){const M=yn(A);n({type:"RUN_DATA_MART_ERROR",payload:M}),Fe({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:M.message})}},w=async D=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const _=await rn.actualizeDataMartSchema(D),A=Lc(_);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:A}),Dt.success("Output schema actualized")}catch(_){const A=yn(_);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:A}),Fe({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:A.message})}},C=async(D,_)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const A=await rn.updateDataMartSchema(D,{schema:_}),M=Lc(A);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:M}),Dt.success("Output schema updated")}catch(A){const M=yn(A);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:M}),Fe({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:M.message})}},E=p.useCallback(async(D,_=5,A=0,M)=>{try{M!=null&&M.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const U=await rn.getDataMartRuns(D,_,A,M!=null&&M.silent?{skipLoadingIndicator:!0}:void 0);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:U}),U}catch(U){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:yn(U)}),U}},[]),R=p.useCallback(async(D,_,A=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const M=await rn.getDataMartRuns(D,A,_);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:M}),M}catch(M){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:yn(M)}),M}},[]),T=p.useCallback(()=>{n({type:"RESET"})},[]),j=p.useCallback(()=>t.error?t.error.message:null,[t.error]),O={...t,getDataMart:r,createDataMart:s,updateDataMart:l,deleteDataMart:c,updateDataMartTitle:d,updateDataMartDescription:h,updateDataMartStorage:m,updateDataMartDefinition:g,publishDataMart:v,runDataMart:x,cancelDataMartRun:b,actualizeDataMartSchema:w,updateDataMartSchema:C,getDataMartRuns:E,loadMoreDataMartRuns:R,getErrorMessage:j,reset:T};return o.jsx(i3.Provider,{value:O,children:e})}var Gf=e=>e.type==="checkbox",xl=e=>e instanceof Date,Qr=e=>e==null;const d3=e=>typeof e=="object";var Zn=e=>!Qr(e)&&!Array.isArray(e)&&d3(e)&&!xl(e),f3=e=>Zn(e)&&e.target?Gf(e.target)?e.target.checked:e.target.value:e,ZY=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,h3=(e,t)=>e.has(ZY(t)),KY=e=>{const t=e.constructor&&e.constructor.prototype;return Zn(t)&&t.hasOwnProperty("isPrototypeOf")},I1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function tr(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(I1&&(e instanceof Blob||r))&&(n||Zn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!KY(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=tr(e[s]));else return e;return t}var Rg=e=>/^\w*$/.test(e),Rn=e=>e===void 0,L1=e=>Array.isArray(e)?e.filter(Boolean):[],P1=e=>L1(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ae=(e,t,n)=>{if(!t||!Zn(e))return n;const r=(Rg(t)?[t]:P1(t)).reduce((s,l)=>Qr(s)?s:s[l],e);return Rn(r)||r===e?Rn(e[t])?n:e[t]:r},ua=e=>typeof e=="boolean",Zt=(e,t,n)=>{let r=-1;const s=Rg(t)?[t]:P1(t),l=s.length,c=l-1;for(;++r<l;){const d=s[r];let h=n;if(r!==c){const m=e[d];h=Zn(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=h,e=e[d]}};const jp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ss={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},po={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},U1=je.createContext(null);U1.displayName="HookFormContext";const Du=()=>je.useContext(U1),m3=e=>{const{children:t,...n}=e;return je.createElement(U1.Provider,{value:n},t)};var p3=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(s,l,{get:()=>{const c=l;return t._proxyFormState[c]!==ss.all&&(t._proxyFormState[c]=!r||ss.all),n&&(n[c]=!0),e[c]}});return s};const F1=typeof window<"u"?je.useLayoutEffect:je.useEffect;function g3(e){const t=Du(),{control:n=t.control,disabled:r,name:s,exact:l}=e||{},[c,d]=je.useState(n._formState),h=je.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return F1(()=>n._subscribe({name:s,formState:h.current,exact:l,callback:m=>{!r&&d({...n._formState,...m})}}),[s,r,l]),je.useEffect(()=>{h.current.isValid&&n._setValid(!0)},[n]),je.useMemo(()=>p3(c,n,h.current,!1),[c,n])}var ma=e=>typeof e=="string",v3=(e,t,n,r,s)=>ma(e)?(r&&t.watch.add(e),Ae(n,e,s)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),Ae(n,l))):(r&&(t.watchAll=!0),n),z0=e=>Qr(e)||!d3(e);function So(e,t,n=new WeakSet){if(z0(e)||z0(t))return e===t;if(xl(e)&&xl(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const l of r){const c=e[l];if(!s.includes(l))return!1;if(l!=="ref"){const d=t[l];if(xl(c)&&xl(d)||Zn(c)&&Zn(d)||Array.isArray(c)&&Array.isArray(d)?!So(c,d,n):c!==d)return!1}}return!0}function YY(e){const t=Du(),{control:n=t.control,name:r,defaultValue:s,disabled:l,exact:c,compute:d}=e||{},h=je.useRef(s),m=je.useRef(d),g=je.useRef(void 0);m.current=d;const v=je.useMemo(()=>n._getWatch(r,h.current),[n,r]),[x,b]=je.useState(m.current?m.current(v):v);return F1(()=>n._subscribe({name:r,formState:{values:!0},exact:c,callback:w=>{if(!l){const C=v3(r,n._names,w.values||n._formValues,!1,h.current);if(m.current){const E=m.current(C);So(E,g.current)||(b(E),g.current=E)}else b(C)}}}),[n,l,r,c]),je.useEffect(()=>n._removeUnmounted()),x}function WY(e){const t=Du(),{name:n,disabled:r,control:s=t.control,shouldUnregister:l,defaultValue:c}=e,d=h3(s._names.array,n),h=je.useMemo(()=>Ae(s._formValues,n,Ae(s._defaultValues,n,c)),[s,n,c]),m=YY({control:s,name:n,defaultValue:h,exact:!0}),g=g3({control:s,name:n,exact:!0}),v=je.useRef(e),x=je.useRef(void 0),b=je.useRef(s.register(n,{...e.rules,value:m,...ua(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const w=je.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ae(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ae(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ae(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ae(g.validatingFields,n)},error:{enumerable:!0,get:()=>Ae(g.errors,n)}}),[g,n]),C=je.useCallback(j=>b.current.onChange({target:{value:f3(j),name:n},type:jp.CHANGE}),[n]),E=je.useCallback(()=>b.current.onBlur({target:{value:Ae(s._formValues,n),name:n},type:jp.BLUR}),[n,s._formValues]),R=je.useCallback(j=>{const O=Ae(s._fields,n);O&&j&&(O._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:D=>j.setCustomValidity(D),reportValidity:()=>j.reportValidity()})},[s._fields,n]),T=je.useMemo(()=>({name:n,value:m,...ua(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:C,onBlur:E,ref:R}),[n,r,g.disabled,C,E,R,m]);return je.useEffect(()=>{const j=s._options.shouldUnregister||l,O=x.current;O&&O!==n&&!d&&s.unregister(O),s.register(n,{...v.current.rules,...ua(v.current.disabled)?{disabled:v.current.disabled}:{}});const D=(_,A)=>{const M=Ae(s._fields,_);M&&M._f&&(M._f.mount=A)};if(D(n,!0),j){const _=tr(Ae(s._options.defaultValues,n,v.current.defaultValue));Zt(s._defaultValues,n,_),Rn(Ae(s._formValues,n))&&Zt(s._formValues,n,_)}return!d&&s.register(n),x.current=n,()=>{(d?j&&!s._state.action:j)?s.unregister(n):D(n,!1)}},[n,s,d,l]),je.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),je.useMemo(()=>({field:T,formState:g,fieldState:w}),[T,g,w])}const QY=e=>e.render(WY(e));var z1=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Gd=e=>Array.isArray(e)?e:[e],pT=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function y3(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],l=t[r];if(s&&Zn(s)&&l){const c=y3(s,l);Zn(c)&&(n[r]=c)}else e[r]&&(n[r]=l)}return n}var Wr=e=>Zn(e)&&!Object.keys(e).length,V1=e=>e.type==="file",os=e=>typeof e=="function",_p=e=>{if(!I1)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},x3=e=>e.type==="select-multiple",H1=e=>e.type==="radio",XY=e=>H1(e)||Gf(e),zx=e=>_p(e)&&e.isConnected;function JY(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Rn(e)?r++:e[t[r++]];return e}function eW(e){for(const t in e)if(e.hasOwnProperty(t)&&!Rn(e[t]))return!1;return!0}function Bn(e,t){const n=Array.isArray(t)?t:Rg(t)?[t]:P1(t),r=n.length===1?e:JY(e,n),s=n.length-1,l=n[s];return r&&delete r[l],s!==0&&(Zn(r)&&Wr(r)||Array.isArray(r)&&eW(r))&&Bn(e,n.slice(0,-1)),e}var tW=e=>{for(const t in e)if(os(e[t]))return!0;return!1};function b3(e){return Array.isArray(e)||Zn(e)&&!tW(e)}function V0(e,t={}){for(const n in e)b3(e[n])?(t[n]=Array.isArray(e[n])?[]:{},V0(e[n],t[n])):Rn(e[n])||(t[n]=!0);return t}function Hc(e,t,n){n||(n=V0(t));for(const r in e)b3(e[r])?Rn(t)||z0(n[r])?n[r]=V0(e[r],Array.isArray(e[r])?[]:{}):Hc(e[r],Qr(t)?{}:t[r],n[r]):n[r]=!So(e[r],t[r]);return n}const gT={value:!1,isValid:!1},vT={value:!0,isValid:!0};var S3=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Rn(e[0].attributes.value)?Rn(e[0].value)||e[0].value===""?vT:{value:e[0].value,isValid:!0}:vT:gT}return gT},C3=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Rn(e)?e:t?e===""?NaN:e&&+e:n&&ma(e)?new Date(e):r?r(e):e;const yT={isValid:!1,value:null};var w3=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,yT):yT;function xT(e){const t=e.ref;return V1(t)?t.files:H1(t)?w3(e.refs).value:x3(t)?[...t.selectedOptions].map(({value:n})=>n):Gf(t)?S3(e.refs).value:C3(Rn(t.value)?e.ref.value:t.value,e)}var nW=(e,t,n,r)=>{const s={};for(const l of e){const c=Ae(t,l);c&&Zt(s,l,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Np=e=>e instanceof RegExp,Md=e=>Rn(e)?e:Np(e)?e.source:Zn(e)?Np(e.value)?e.value.source:e.value:e,bT=e=>({isOnSubmit:!e||e===ss.onSubmit,isOnBlur:e===ss.onBlur,isOnChange:e===ss.onChange,isOnAll:e===ss.all,isOnTouch:e===ss.onTouched});const ST="AsyncFunction";var rW=e=>!!e&&!!e.validate&&!!(os(e.validate)&&e.validate.constructor.name===ST||Zn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ST)),aW=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),CT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const qd=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const l=Ae(e,s);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],s)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(qd(d,t))break}else if(Zn(d)&&qd(d,t))break}}};function wT(e,t,n){const r=Ae(e,n);if(r||Rg(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const l=s.join("."),c=Ae(t,l),d=Ae(e,l);if(c&&!Array.isArray(c)&&n!==l)return{name:n};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:n}}var sW=(e,t,n,r)=>{n(e);const{name:s,...l}=e;return Wr(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||ss.all))},oW=(e,t,n)=>!e||!t||e===t||Gd(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),iW=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,lW=(e,t)=>!L1(Ae(e,t)).length&&Bn(e,t),cW=(e,t,n)=>{const r=Gd(Ae(e,n));return Zt(r,"root",t[n]),Zt(e,n,r),e};function ET(e,t,n="validate"){if(ma(e)||Array.isArray(e)&&e.every(ma)||ua(e)&&!e)return{type:n,message:ma(e)?e:"",ref:t}}var Pc=e=>Zn(e)&&!Np(e)?e:{value:e,message:""},RT=async(e,t,n,r,s,l)=>{const{ref:c,refs:d,required:h,maxLength:m,minLength:g,min:v,max:x,pattern:b,validate:w,name:C,valueAsNumber:E,mount:R}=e._f,T=Ae(n,C);if(!R||t.has(C))return{};const j=d?d[0]:c,O=K=>{s&&j.reportValidity&&(j.setCustomValidity(ua(K)?"":K||""),j.reportValidity())},D={},_=H1(c),A=Gf(c),M=_||A,U=(E||V1(c))&&Rn(c.value)&&Rn(T)||_p(c)&&c.value===""||T===""||Array.isArray(T)&&!T.length,B=z1.bind(null,C,r,D),G=(K,re,H,$=po.maxLength,I=po.minLength)=>{const Y=K?re:H;D[C]={type:K?$:I,message:Y,ref:c,...B(K?$:I,Y)}};if(l?!Array.isArray(T)||!T.length:h&&(!M&&(U||Qr(T))||ua(T)&&!T||A&&!S3(d).isValid||_&&!w3(d).isValid)){const{value:K,message:re}=ma(h)?{value:!!h,message:h}:Pc(h);if(K&&(D[C]={type:po.required,message:re,ref:j,...B(po.required,re)},!r))return O(re),D}if(!U&&(!Qr(v)||!Qr(x))){let K,re;const H=Pc(x),$=Pc(v);if(!Qr(T)&&!isNaN(T)){const I=c.valueAsNumber||T&&+T;Qr(H.value)||(K=I>H.value),Qr($.value)||(re=I<$.value)}else{const I=c.valueAsDate||new Date(T),Y=be=>new Date(new Date().toDateString()+" "+be),Z=c.type=="time",ie=c.type=="week";ma(H.value)&&T&&(K=Z?Y(T)>Y(H.value):ie?T>H.value:I>new Date(H.value)),ma($.value)&&T&&(re=Z?Y(T)<Y($.value):ie?T<$.value:I<new Date($.value))}if((K||re)&&(G(!!K,H.message,$.message,po.max,po.min),!r))return O(D[C].message),D}if((m||g)&&!U&&(ma(T)||l&&Array.isArray(T))){const K=Pc(m),re=Pc(g),H=!Qr(K.value)&&T.length>+K.value,$=!Qr(re.value)&&T.length<+re.value;if((H||$)&&(G(H,K.message,re.message),!r))return O(D[C].message),D}if(b&&!U&&ma(T)){const{value:K,message:re}=Pc(b);if(Np(K)&&!T.match(K)&&(D[C]={type:po.pattern,message:re,ref:c,...B(po.pattern,re)},!r))return O(re),D}if(w){if(os(w)){const K=await w(T,n),re=ET(K,j);if(re&&(D[C]={...re,...B(po.validate,re.message)},!r))return O(re.message),D}else if(Zn(w)){let K={};for(const re in w){if(!Wr(K)&&!r)break;const H=ET(await w[re](T,n),j,re);H&&(K={...H,...B(re,H.message)},O(H.message),r&&(D[C]=K))}if(!Wr(K)&&(D[C]={ref:j,...K},!r))return D}}return O(!0),D};const uW={mode:ss.onSubmit,reValidateMode:ss.onChange,shouldFocusError:!0};function dW(e={}){let t={...uW,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:os(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Zn(t.defaultValues)||Zn(t.values)?tr(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:tr(s),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},h,m=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...g};const x={array:pT(),state:pT()},b=t.criteriaMode===ss.all,w=V=>ee=>{clearTimeout(m),m=setTimeout(V,ee)},C=async V=>{if(!t.disabled&&(g.isValid||v.isValid||V)){const ee=t.resolver?Wr((await A()).errors):await U(r,!0);ee!==n.isValid&&x.state.next({isValid:ee})}},E=(V,ee)=>{!t.disabled&&(g.isValidating||g.validatingFields||v.isValidating||v.validatingFields)&&((V||Array.from(d.mount)).forEach(de=>{de&&(ee?Zt(n.validatingFields,de,ee):Bn(n.validatingFields,de))}),x.state.next({validatingFields:n.validatingFields,isValidating:!Wr(n.validatingFields)}))},R=(V,ee=[],de,_e,ye=!0,we=!0)=>{if(_e&&de&&!t.disabled){if(c.action=!0,we&&Array.isArray(Ae(r,V))){const Le=de(Ae(r,V),_e.argA,_e.argB);ye&&Zt(r,V,Le)}if(we&&Array.isArray(Ae(n.errors,V))){const Le=de(Ae(n.errors,V),_e.argA,_e.argB);ye&&Zt(n.errors,V,Le),lW(n.errors,V)}if((g.touchedFields||v.touchedFields)&&we&&Array.isArray(Ae(n.touchedFields,V))){const Le=de(Ae(n.touchedFields,V),_e.argA,_e.argB);ye&&Zt(n.touchedFields,V,Le)}(g.dirtyFields||v.dirtyFields)&&(n.dirtyFields=Hc(s,l)),x.state.next({name:V,isDirty:G(V,ee),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Zt(l,V,ee)},T=(V,ee)=>{Zt(n.errors,V,ee),x.state.next({errors:n.errors})},j=V=>{n.errors=V,x.state.next({errors:n.errors,isValid:!1})},O=(V,ee,de,_e)=>{const ye=Ae(r,V);if(ye){const we=Ae(l,V,Rn(de)?Ae(s,V):de);Rn(we)||_e&&_e.defaultChecked||ee?Zt(l,V,ee?we:xT(ye._f)):H(V,we),c.mount&&C()}},D=(V,ee,de,_e,ye)=>{let we=!1,Le=!1;const st={name:V};if(!t.disabled){if(!de||_e){(g.isDirty||v.isDirty)&&(Le=n.isDirty,n.isDirty=st.isDirty=G(),we=Le!==st.isDirty);const ht=So(Ae(s,V),ee);Le=!!Ae(n.dirtyFields,V),ht?Bn(n.dirtyFields,V):Zt(n.dirtyFields,V,!0),st.dirtyFields=n.dirtyFields,we=we||(g.dirtyFields||v.dirtyFields)&&Le!==!ht}if(de){const ht=Ae(n.touchedFields,V);ht||(Zt(n.touchedFields,V,de),st.touchedFields=n.touchedFields,we=we||(g.touchedFields||v.touchedFields)&&ht!==de)}we&&ye&&x.state.next(st)}return we?st:{}},_=(V,ee,de,_e)=>{const ye=Ae(n.errors,V),we=(g.isValid||v.isValid)&&ua(ee)&&n.isValid!==ee;if(t.delayError&&de?(h=w(()=>T(V,de)),h(t.delayError)):(clearTimeout(m),h=null,de?Zt(n.errors,V,de):Bn(n.errors,V)),(de?!So(ye,de):ye)||!Wr(_e)||we){const Le={..._e,...we&&ua(ee)?{isValid:ee}:{},errors:n.errors,name:V};n={...n,...Le},x.state.next(Le)}},A=async V=>{E(V,!0);const ee=await t.resolver(l,t.context,nW(V||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(V),ee},M=async V=>{const{errors:ee}=await A(V);if(V)for(const de of V){const _e=Ae(ee,de);_e?Zt(n.errors,de,_e):Bn(n.errors,de)}else n.errors=ee;return ee},U=async(V,ee,de={valid:!0})=>{for(const _e in V){const ye=V[_e];if(ye){const{_f:we,...Le}=ye;if(we){const st=d.array.has(we.name),ht=ye._f&&rW(ye._f);ht&&g.validatingFields&&E([we.name],!0);const bn=await RT(ye,d.disabled,l,b,t.shouldUseNativeValidation&&!ee,st);if(ht&&g.validatingFields&&E([we.name]),bn[we.name]&&(de.valid=!1,ee))break;!ee&&(Ae(bn,we.name)?st?cW(n.errors,bn,we.name):Zt(n.errors,we.name,bn[we.name]):Bn(n.errors,we.name))}!Wr(Le)&&await U(Le,ee,de)}}return de.valid},B=()=>{for(const V of d.unMount){const ee=Ae(r,V);ee&&(ee._f.refs?ee._f.refs.every(de=>!zx(de)):!zx(ee._f.ref))&&ue(V)}d.unMount=new Set},G=(V,ee)=>!t.disabled&&(V&&ee&&Zt(l,V,ee),!So(be(),s)),K=(V,ee,de)=>v3(V,d,{...c.mount?l:Rn(ee)?s:ma(V)?{[V]:ee}:ee},de,ee),re=V=>L1(Ae(c.mount?l:s,V,t.shouldUnregister?Ae(s,V,[]):[])),H=(V,ee,de={})=>{const _e=Ae(r,V);let ye=ee;if(_e){const we=_e._f;we&&(!we.disabled&&Zt(l,V,C3(ee,we)),ye=_p(we.ref)&&Qr(ee)?"":ee,x3(we.ref)?[...we.ref.options].forEach(Le=>Le.selected=ye.includes(Le.value)):we.refs?Gf(we.ref)?we.refs.forEach(Le=>{(!Le.defaultChecked||!Le.disabled)&&(Array.isArray(ye)?Le.checked=!!ye.find(st=>st===Le.value):Le.checked=ye===Le.value||!!ye)}):we.refs.forEach(Le=>Le.checked=Le.value===ye):V1(we.ref)?we.ref.value="":(we.ref.value=ye,we.ref.type||x.state.next({name:V,values:tr(l)})))}(de.shouldDirty||de.shouldTouch)&&D(V,ye,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&ie(V)},$=(V,ee,de)=>{for(const _e in ee){if(!ee.hasOwnProperty(_e))return;const ye=ee[_e],we=V+"."+_e,Le=Ae(r,we);(d.array.has(V)||Zn(ye)||Le&&!Le._f)&&!xl(ye)?$(we,ye,de):H(we,ye,de)}},I=(V,ee,de={})=>{const _e=Ae(r,V),ye=d.array.has(V),we=tr(ee);Zt(l,V,we),ye?(x.array.next({name:V,values:tr(l)}),(g.isDirty||g.dirtyFields||v.isDirty||v.dirtyFields)&&de.shouldDirty&&x.state.next({name:V,dirtyFields:Hc(s,l),isDirty:G(V,we)})):_e&&!_e._f&&!Qr(we)?$(V,we,de):H(V,we,de),CT(V,d)&&x.state.next({...n,name:V}),x.state.next({name:c.mount?V:void 0,values:tr(l)})},Y=async V=>{c.mount=!0;const ee=V.target;let de=ee.name,_e=!0;const ye=Ae(r,de),we=ht=>{_e=Number.isNaN(ht)||xl(ht)&&isNaN(ht.getTime())||So(ht,Ae(l,de,ht))},Le=bT(t.mode),st=bT(t.reValidateMode);if(ye){let ht,bn;const Hr=ee.type?xT(ye._f):f3(V),Dn=V.type===jp.BLUR||V.type===jp.FOCUS_OUT,Rr=!aW(ye._f)&&!t.resolver&&!Ae(n.errors,de)&&!ye._f.deps||iW(Dn,Ae(n.touchedFields,de),n.isSubmitted,st,Le),$r=CT(de,d,Dn);Zt(l,de,Hr),Dn?(!ee||!ee.readOnly)&&(ye._f.onBlur&&ye._f.onBlur(V),h&&h(0)):ye._f.onChange&&ye._f.onChange(V);const Sn=D(de,Hr,Dn),mr=!Wr(Sn)||$r;if(!Dn&&x.state.next({name:de,type:V.type,values:tr(l)}),Rr)return(g.isValid||v.isValid)&&(t.mode==="onBlur"?Dn&&C():Dn||C()),mr&&x.state.next({name:de,...$r?{}:Sn});if(!Dn&&$r&&x.state.next({...n}),t.resolver){const{errors:On}=await A([de]);if(we(Hr),_e){const Po=wT(n.errors,r,de),ja=wT(On,r,Po.name||de);ht=ja.error,de=ja.name,bn=Wr(On)}}else E([de],!0),ht=(await RT(ye,d.disabled,l,b,t.shouldUseNativeValidation))[de],E([de]),we(Hr),_e&&(ht?bn=!1:(g.isValid||v.isValid)&&(bn=await U(r,!0)));_e&&(ye._f.deps&&(!Array.isArray(ye._f.deps)||ye._f.deps.length>0)&&ie(ye._f.deps),_(de,bn,ht,Sn))}},Z=(V,ee)=>{if(Ae(n.errors,ee)&&V.focus)return V.focus(),1},ie=async(V,ee={})=>{let de,_e;const ye=Gd(V);if(t.resolver){const we=await M(Rn(V)?V:ye);de=Wr(we),_e=V?!ye.some(Le=>Ae(we,Le)):de}else V?(_e=(await Promise.all(ye.map(async we=>{const Le=Ae(r,we);return await U(Le&&Le._f?{[we]:Le}:Le)}))).every(Boolean),!(!_e&&!n.isValid)&&C()):_e=de=await U(r);return x.state.next({...!ma(V)||(g.isValid||v.isValid)&&de!==n.isValid?{}:{name:V},...t.resolver||!V?{isValid:de}:{},errors:n.errors}),ee.shouldFocus&&!_e&&qd(r,Z,V?ye:d.mount),_e},be=(V,ee)=>{let de={...c.mount?l:s};return ee&&(de=y3(ee.dirtyFields?n.dirtyFields:n.touchedFields,de)),Rn(V)?de:ma(V)?Ae(de,V):V.map(_e=>Ae(de,_e))},L=(V,ee)=>({invalid:!!Ae((ee||n).errors,V),isDirty:!!Ae((ee||n).dirtyFields,V),error:Ae((ee||n).errors,V),isValidating:!!Ae(n.validatingFields,V),isTouched:!!Ae((ee||n).touchedFields,V)}),P=V=>{V&&Gd(V).forEach(ee=>Bn(n.errors,ee)),x.state.next({errors:V?n.errors:{}})},W=(V,ee,de)=>{const _e=(Ae(r,V,{_f:{}})._f||{}).ref,ye=Ae(n.errors,V)||{},{ref:we,message:Le,type:st,...ht}=ye;Zt(n.errors,V,{...ht,...ee,ref:_e}),x.state.next({name:V,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&_e&&_e.focus&&_e.focus()},ae=(V,ee)=>os(V)?x.state.subscribe({next:de=>"values"in de&&V(K(void 0,ee),de)}):K(V,ee,!0),fe=V=>x.state.subscribe({next:ee=>{oW(V.name,ee.name,V.exact)&&sW(ee,V.formState||g,wt,V.reRenderRoot)&&V.callback({values:{...l},...n,...ee,defaultValues:s})}}).unsubscribe,ge=V=>(c.mount=!0,v={...v,...V.formState},fe({...V,formState:v})),ue=(V,ee={})=>{for(const de of V?Gd(V):d.mount)d.mount.delete(de),d.array.delete(de),ee.keepValue||(Bn(r,de),Bn(l,de)),!ee.keepError&&Bn(n.errors,de),!ee.keepDirty&&Bn(n.dirtyFields,de),!ee.keepTouched&&Bn(n.touchedFields,de),!ee.keepIsValidating&&Bn(n.validatingFields,de),!t.shouldUnregister&&!ee.keepDefaultValue&&Bn(s,de);x.state.next({values:tr(l)}),x.state.next({...n,...ee.keepDirty?{isDirty:G()}:{}}),!ee.keepIsValid&&C()},Ne=({disabled:V,name:ee})=>{(ua(V)&&c.mount||V||d.disabled.has(ee))&&(V?d.disabled.add(ee):d.disabled.delete(ee))},Re=(V,ee={})=>{let de=Ae(r,V);const _e=ua(ee.disabled)||ua(t.disabled);return Zt(r,V,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:V}},name:V,mount:!0,...ee}}),d.mount.add(V),de?Ne({disabled:ua(ee.disabled)?ee.disabled:t.disabled,name:V}):O(V,!0,ee.value),{..._e?{disabled:ee.disabled||t.disabled}:{},...t.progressive?{required:!!ee.required,min:Md(ee.min),max:Md(ee.max),minLength:Md(ee.minLength),maxLength:Md(ee.maxLength),pattern:Md(ee.pattern)}:{},name:V,onChange:Y,onBlur:Y,ref:ye=>{if(ye){Re(V,ee),de=Ae(r,V);const we=Rn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Le=XY(we),st=de._f.refs||[];if(Le?st.find(ht=>ht===we):we===de._f.ref)return;Zt(r,V,{_f:{...de._f,...Le?{refs:[...st.filter(zx),we,...Array.isArray(Ae(s,V))?[{}]:[]],ref:{type:we.type,name:V}}:{ref:we}}}),O(V,!1,void 0,we)}else de=Ae(r,V,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||ee.shouldUnregister)&&!(h3(d.array,V)&&c.action)&&d.unMount.add(V)}}},xe=()=>t.shouldFocusError&&qd(r,Z,d.mount),et=V=>{ua(V)&&(x.state.next({disabled:V}),qd(r,(ee,de)=>{const _e=Ae(r,de);_e&&(ee.disabled=_e._f.disabled||V,Array.isArray(_e._f.refs)&&_e._f.refs.forEach(ye=>{ye.disabled=_e._f.disabled||V}))},0,!1))},Xe=(V,ee)=>async de=>{let _e;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let ye=tr(l);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:we,values:Le}=await A();n.errors=we,ye=tr(Le)}else await U(r);if(d.disabled.size)for(const we of d.disabled)Bn(ye,we);if(Bn(n.errors,"root"),Wr(n.errors)){x.state.next({errors:{}});try{await V(ye,de)}catch(we){_e=we}}else ee&&await ee({...n.errors},de),xe(),setTimeout(xe);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Wr(n.errors)&&!_e,submitCount:n.submitCount+1,errors:n.errors}),_e)throw _e},Bt=(V,ee={})=>{Ae(r,V)&&(Rn(ee.defaultValue)?I(V,tr(Ae(s,V))):(I(V,ee.defaultValue),Zt(s,V,tr(ee.defaultValue))),ee.keepTouched||Bn(n.touchedFields,V),ee.keepDirty||(Bn(n.dirtyFields,V),n.isDirty=ee.defaultValue?G(V,tr(Ae(s,V))):G()),ee.keepError||(Bn(n.errors,V),g.isValid&&C()),x.state.next({...n}))},ft=(V,ee={})=>{const de=V?tr(V):s,_e=tr(de),ye=Wr(V),we=ye?s:_e;if(ee.keepDefaultValues||(s=de),!ee.keepValues){if(ee.keepDirtyValues){const Le=new Set([...d.mount,...Object.keys(Hc(s,l))]);for(const st of Array.from(Le))Ae(n.dirtyFields,st)?Zt(we,st,Ae(l,st)):I(st,Ae(we,st))}else{if(I1&&Rn(V))for(const Le of d.mount){const st=Ae(r,Le);if(st&&st._f){const ht=Array.isArray(st._f.refs)?st._f.refs[0]:st._f.ref;if(_p(ht)){const bn=ht.closest("form");if(bn){bn.reset();break}}}}if(ee.keepFieldsRef)for(const Le of d.mount)I(Le,Ae(we,Le));else r={}}l=t.shouldUnregister?ee.keepDefaultValues?tr(s):{}:tr(we),x.array.next({values:{...we}}),x.state.next({values:{...we}})}d={mount:ee.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!ee.keepIsValid||!!ee.keepDirtyValues,c.watch=!!t.shouldUnregister,x.state.next({submitCount:ee.keepSubmitCount?n.submitCount:0,isDirty:ye?!1:ee.keepDirty?n.isDirty:!!(ee.keepDefaultValues&&!So(V,s)),isSubmitted:ee.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ye?{}:ee.keepDirtyValues?ee.keepDefaultValues&&l?Hc(s,l):n.dirtyFields:ee.keepDefaultValues&&V?Hc(s,V):ee.keepDirty?n.dirtyFields:{},touchedFields:ee.keepTouched?n.touchedFields:{},errors:ee.keepErrors?n.errors:{},isSubmitSuccessful:ee.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},gn=(V,ee)=>ft(os(V)?V(l):V,ee),Ie=(V,ee={})=>{const de=Ae(r,V),_e=de&&de._f;if(_e){const ye=_e.refs?_e.refs[0]:_e.ref;ye.focus&&(ye.focus(),ee.shouldSelect&&os(ye.select)&&ye.select())}},wt=V=>{n={...n,...V}},tn={control:{register:Re,unregister:ue,getFieldState:L,handleSubmit:Xe,setError:W,_subscribe:fe,_runSchema:A,_focusError:xe,_getWatch:K,_getDirty:G,_setValid:C,_setFieldArray:R,_setDisabledField:Ne,_setErrors:j,_getFieldArray:re,_reset:ft,_resetDefaultValues:()=>os(t.defaultValues)&&t.defaultValues().then(V=>{gn(V,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:B,_disableForm:et,_subjects:x,_proxyFormState:g,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state(V){c=V},get _defaultValues(){return s},get _names(){return d},set _names(V){d=V},get _formState(){return n},get _options(){return t},set _options(V){t={...t,...V}}},subscribe:ge,trigger:ie,register:Re,handleSubmit:Xe,watch:ae,setValue:I,getValues:be,reset:gn,resetField:Bt,clearErrors:P,unregister:ue,setError:W,setFocus:Ie,getFieldState:L};return{...tn,formControl:tn}}function $i(e={}){const t=je.useRef(void 0),n=je.useRef(void 0),[r,s]=je.useState({isDirty:!1,isValidating:!1,isLoading:os(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:os(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!os(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=dW(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,F1(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>s({...l._formState}),reRenderRoot:!0});return s(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),je.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),je.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),je.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),je.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),je.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==r.isDirty&&l._subjects.state.next({isDirty:c})}},[l,r.isDirty]),je.useEffect(()=>{e.values&&!So(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),n.current=e.values,s(c=>({...c}))):l._resetDefaultValues()},[l,e.values]),je.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),t.current.formState=p3(r,l),t.current}var fW="Label",E3=p.forwardRef((e,t)=>o.jsx(Ke.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));E3.displayName=fW;var hW=E3;function ba({className:e,...t}){return o.jsx(hW,{"data-slot":"label",className:J("flex items-center gap-2 text-sm leading-none font-medium group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Zl=m3,R3=p.createContext({}),Qt=({...e})=>o.jsx(R3.Provider,{value:{name:e.name},children:o.jsx(QY,{...e})}),qf=()=>{const e=p.useContext(R3),t=p.useContext(T3),{getFieldState:n}=Du(),r=g3({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:l}=t;return{id:l,name:e.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...s}},T3=p.createContext({});function Xt({className:e="",...t}){const n=p.useId();return o.jsx(T3.Provider,{value:{id:n},children:o.jsx("div",{"data-slot":"form-item",className:J("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",e),...t})})}function Jt({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:l,formItemId:c}=qf();return o.jsxs(ba,{"data-slot":"form-label","data-error":!!l,className:J("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[o.jsx("span",{children:r}),t&&o.jsxs(Tt,{...n,children:[o.jsx(jt,{asChild:!0,children:o.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(_t,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function en({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=qf();return o.jsx(Hp,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function ar({className:e,...t}){const{formDescriptionId:n}=qf();return o.jsx("div",{"data-slot":"form-description",id:n,className:J("text-muted-foreground text-sm",e),...t})}function ln({className:e,...t}){const{error:n,formMessageId:r}=qf(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?o.jsx("p",{"data-slot":"form-message",id:r,className:J("text-destructive text-sm",e),...t,children:s}):null}function Kl({children:e,className:t="",variant:n="default"}){const r=n==="light"?"flex-1 overflow-y-auto":"bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4";return o.jsx("div",{className:r,children:o.jsx("div",{className:J("flex min-h-full flex-col gap-4",t),children:e})})}function Yl({className:e="",children:t,variant:n="default"}){const r=n==="light"?"flex flex-col gap-1.5 pt-4":"flex flex-col gap-1.5 border-t px-4 py-3";return o.jsx("div",{className:J(r,e),children:t})}function Vs({title:e,children:t}){return o.jsxs("section",{className:"mb-4",children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function mW({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:l="vertical",className:c=""}){const{formItemId:d}=qf();return o.jsxs("label",{htmlFor:`${d}-${e}`,className:J("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",l==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[o.jsx("input",{type:"radio",id:`${d}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:J("peer border-input ring-offset-background h-4 w-4 rounded-full border","checked:bg-primary checked:border-primary","focus-visible:ring-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),o.jsx("span",{className:J("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function pW({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return o.jsx("div",{tabIndex:-1,className:J(r==="horizontal"?"flex gap-6":"flex flex-col gap-2","border-input rounded-md border bg-transparent px-1 py-1 transition-colors","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]","text-foreground selection:bg-primary selection:text-primary-foreground","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",s),children:e.map(l=>o.jsx(mW,{value:l.value,label:l.label,checked:t===l.value,onChange:c=>n(c.target.value),disabled:l.disabled,orientation:r},l.value))})}const Bi=p.forwardRef(({children:e,className:t="",...n},r)=>o.jsx("form",{ref:r,className:J("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));Bi.displayName="AppForm";function TT(e,[t,n]){return Math.min(n,Math.max(t,e))}function $1(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var gW=[" ","Enter","ArrowUp","ArrowDown"],vW=[" ","Enter"],Il="Select",[Tg,jg,yW]=og(Il),[Ou]=kr(Il,[yW,Gs]),_g=Gs(),[xW,Gi]=Ou(Il),[bW,SW]=Ou(Il),j3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:h,dir:m,name:g,autoComplete:v,disabled:x,required:b,form:w}=e,C=_g(t),[E,R]=p.useState(null),[T,j]=p.useState(null),[O,D]=p.useState(!1),_=Af(m),[A,M]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:Il}),[U,B]=zr({prop:c,defaultProp:d,onChange:h,caller:Il}),G=p.useRef(null),K=E?w||!!E.closest("form"):!0,[re,H]=p.useState(new Set),$=Array.from(re).map(I=>I.props.value).join(";");return o.jsx(Su,{...C,children:o.jsxs(xW,{required:b,scope:t,trigger:E,onTriggerChange:R,valueNode:T,onValueNodeChange:j,valueNodeHasChildren:O,onValueNodeHasChildrenChange:D,contentId:Nn(),value:U,onValueChange:B,open:A,onOpenChange:M,dir:_,triggerPointerDownPosRef:G,disabled:x,children:[o.jsx(Tg.Provider,{scope:t,children:o.jsx(bW,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(I=>{H(Y=>new Set(Y).add(I))},[]),onNativeOptionRemove:p.useCallback(I=>{H(Y=>{const Z=new Set(Y);return Z.delete(I),Z})},[]),children:n})}),K?o.jsxs(Q3,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:v,value:U,onChange:I=>B(I.target.value),disabled:x,form:w,children:[U===void 0?o.jsx("option",{value:""}):null,Array.from(re)]},$):null]})})};j3.displayName=Il;var _3="SelectTrigger",N3=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=_g(n),c=Gi(_3,n),d=c.disabled||r,h=vt(t,c.onTriggerChange),m=jg(n),g=p.useRef("touch"),[v,x,b]=J3(C=>{const E=m().filter(j=>!j.disabled),R=E.find(j=>j.value===c.value),T=eD(E,C,R);T!==void 0&&c.onValueChange(T.value)}),w=C=>{d||(c.onOpenChange(!0),b()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return o.jsx(Cu,{asChild:!0,...l,children:o.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":X3(c.value)?"":void 0,...s,ref:h,onClick:Te(s.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&w(C)}),onPointerDown:Te(s.onPointerDown,C=>{g.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(w(C),C.preventDefault())}),onKeyDown:Te(s.onKeyDown,C=>{const E=v.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&x(C.key),!(E&&C.key===" ")&&gW.includes(C.key)&&(w(),C.preventDefault())})})})});N3.displayName=_3;var A3="SelectValue",D3=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:c="",...d}=e,h=Gi(A3,n),{onValueNodeHasChildrenChange:m}=h,g=l!==void 0,v=vt(t,h.onValueNodeChange);return br(()=>{m(g)},[m,g]),o.jsx(Ke.span,{...d,ref:v,style:{pointerEvents:"none"},children:X3(h.value)?o.jsx(o.Fragment,{children:c}):l})});D3.displayName=A3;var CW="SelectIcon",O3=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(Ke.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});O3.displayName=CW;var wW="SelectPortal",M3=e=>o.jsx(Vl,{asChild:!0,...e});M3.displayName=wW;var Ll="SelectContent",k3=p.forwardRef((e,t)=>{const n=Gi(Ll,e.__scopeSelect),[r,s]=p.useState();if(br(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?is.createPortal(o.jsx(I3,{scope:e.__scopeSelect,children:o.jsx(Tg.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),l):null}return o.jsx(L3,{...e,ref:t})});k3.displayName=Ll;var ts=10,[I3,qi]=Ou(Ll),EW="SelectContentImpl",RW=Ri("SelectContent.RemoveScroll"),L3=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:h,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E,...R}=e,T=Gi(Ll,n),[j,O]=p.useState(null),[D,_]=p.useState(null),A=vt(t,ue=>O(ue)),[M,U]=p.useState(null),[B,G]=p.useState(null),K=jg(n),[re,H]=p.useState(!1),$=p.useRef(!1);p.useEffect(()=>{if(j)return Zp(j)},[j]),Gp();const I=p.useCallback(ue=>{const[Ne,...Re]=K().map(Xe=>Xe.ref.current),[xe]=Re.slice(-1),et=document.activeElement;for(const Xe of ue)if(Xe===et||(Xe==null||Xe.scrollIntoView({block:"nearest"}),Xe===Ne&&D&&(D.scrollTop=0),Xe===xe&&D&&(D.scrollTop=D.scrollHeight),Xe==null||Xe.focus(),document.activeElement!==et))return},[K,D]),Y=p.useCallback(()=>I([M,j]),[I,M,j]);p.useEffect(()=>{re&&Y()},[re,Y]);const{onOpenChange:Z,triggerPointerDownPosRef:ie}=T;p.useEffect(()=>{if(j){let ue={x:0,y:0};const Ne=xe=>{var et,Xe;ue={x:Math.abs(Math.round(xe.pageX)-(((et=ie.current)==null?void 0:et.x)??0)),y:Math.abs(Math.round(xe.pageY)-(((Xe=ie.current)==null?void 0:Xe.y)??0))}},Re=xe=>{ue.x<=10&&ue.y<=10?xe.preventDefault():j.contains(xe.target)||Z(!1),document.removeEventListener("pointermove",Ne),ie.current=null};return ie.current!==null&&(document.addEventListener("pointermove",Ne),document.addEventListener("pointerup",Re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ne),document.removeEventListener("pointerup",Re,{capture:!0})}}},[j,Z,ie]),p.useEffect(()=>{const ue=()=>Z(!1);return window.addEventListener("blur",ue),window.addEventListener("resize",ue),()=>{window.removeEventListener("blur",ue),window.removeEventListener("resize",ue)}},[Z]);const[be,L]=J3(ue=>{const Ne=K().filter(et=>!et.disabled),Re=Ne.find(et=>et.ref.current===document.activeElement),xe=eD(Ne,ue,Re);xe&&setTimeout(()=>xe.ref.current.focus())}),P=p.useCallback((ue,Ne,Re)=>{const xe=!$.current&&!Re;(T.value!==void 0&&T.value===Ne||xe)&&(U(ue),xe&&($.current=!0))},[T.value]),W=p.useCallback(()=>j==null?void 0:j.focus(),[j]),ae=p.useCallback((ue,Ne,Re)=>{const xe=!$.current&&!Re;(T.value!==void 0&&T.value===Ne||xe)&&G(ue)},[T.value]),fe=r==="popper"?H0:P3,ge=fe===H0?{side:d,sideOffset:h,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E}:{};return o.jsx(I3,{scope:n,content:j,viewport:D,onViewportChange:_,itemRefCallback:P,selectedItem:M,onItemLeave:W,itemTextRefCallback:ae,focusSelectedItem:Y,selectedItemText:B,position:r,isPositioned:re,searchRef:be,children:o.jsx(Ef,{as:RW,allowPinchZoom:!0,children:o.jsx(wf,{asChild:!0,trapped:T.open,onMountAutoFocus:ue=>{ue.preventDefault()},onUnmountAutoFocus:Te(s,ue=>{var Ne;(Ne=T.trigger)==null||Ne.focus({preventScroll:!0}),ue.preventDefault()}),children:o.jsx(zl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:ue=>ue.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(fe,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:ue=>ue.preventDefault(),...R,...ge,onPlaced:()=>H(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,ue=>{const Ne=ue.ctrlKey||ue.altKey||ue.metaKey;if(ue.key==="Tab"&&ue.preventDefault(),!Ne&&ue.key.length===1&&L(ue.key),["ArrowUp","ArrowDown","Home","End"].includes(ue.key)){let xe=K().filter(et=>!et.disabled).map(et=>et.ref.current);if(["ArrowUp","End"].includes(ue.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ue.key)){const et=ue.target,Xe=xe.indexOf(et);xe=xe.slice(Xe+1)}setTimeout(()=>I(xe)),ue.preventDefault()}})})})})})})});L3.displayName=EW;var TW="SelectItemAlignedPosition",P3=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=Gi(Ll,n),c=qi(Ll,n),[d,h]=p.useState(null),[m,g]=p.useState(null),v=vt(t,A=>g(A)),x=jg(n),b=p.useRef(!1),w=p.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:R,focusSelectedItem:T}=c,j=p.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&C&&E&&R){const A=l.trigger.getBoundingClientRect(),M=m.getBoundingClientRect(),U=l.valueNode.getBoundingClientRect(),B=R.getBoundingClientRect();if(l.dir!=="rtl"){const et=B.left-M.left,Xe=U.left-et,Bt=A.left-Xe,ft=A.width+Bt,gn=Math.max(ft,M.width),Ie=window.innerWidth-ts,wt=TT(Xe,[ts,Math.max(ts,Ie-gn)]);d.style.minWidth=ft+"px",d.style.left=wt+"px"}else{const et=M.right-B.right,Xe=window.innerWidth-U.right-et,Bt=window.innerWidth-A.right-Xe,ft=A.width+Bt,gn=Math.max(ft,M.width),Ie=window.innerWidth-ts,wt=TT(Xe,[ts,Math.max(ts,Ie-gn)]);d.style.minWidth=ft+"px",d.style.right=wt+"px"}const G=x(),K=window.innerHeight-ts*2,re=C.scrollHeight,H=window.getComputedStyle(m),$=parseInt(H.borderTopWidth,10),I=parseInt(H.paddingTop,10),Y=parseInt(H.borderBottomWidth,10),Z=parseInt(H.paddingBottom,10),ie=$+I+re+Z+Y,be=Math.min(E.offsetHeight*5,ie),L=window.getComputedStyle(C),P=parseInt(L.paddingTop,10),W=parseInt(L.paddingBottom,10),ae=A.top+A.height/2-ts,fe=K-ae,ge=E.offsetHeight/2,ue=E.offsetTop+ge,Ne=$+I+ue,Re=ie-Ne;if(Ne<=ae){const et=G.length>0&&E===G[G.length-1].ref.current;d.style.bottom="0px";const Xe=m.clientHeight-C.offsetTop-C.offsetHeight,Bt=Math.max(fe,ge+(et?W:0)+Xe+Y),ft=Ne+Bt;d.style.height=ft+"px"}else{const et=G.length>0&&E===G[0].ref.current;d.style.top="0px";const Bt=Math.max(ae,$+C.offsetTop+(et?P:0)+ge)+Re;d.style.height=Bt+"px",C.scrollTop=Ne-ae+C.offsetTop}d.style.margin=`${ts}px 0`,d.style.minHeight=be+"px",d.style.maxHeight=K+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[x,l.trigger,l.valueNode,d,m,C,E,R,l.dir,r]);br(()=>j(),[j]);const[O,D]=p.useState();br(()=>{m&&D(window.getComputedStyle(m).zIndex)},[m]);const _=p.useCallback(A=>{A&&w.current===!0&&(j(),T==null||T(),w.current=!1)},[j,T]);return o.jsx(_W,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:b,onScrollButtonChange:_,children:o.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:o.jsx(Ke.div,{...s,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});P3.displayName=TW;var jW="SelectPopperPosition",H0=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ts,...l}=e,c=_g(n);return o.jsx(Tf,{...c,...l,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});H0.displayName=jW;var[_W,B1]=Ou(Ll,{}),$0="SelectViewport",U3=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=qi($0,n),c=B1($0,n),d=vt(t,l.onViewportChange),h=p.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(Tg.Slot,{scope:n,children:o.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Te(s.onScroll,m=>{const g=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&v){const b=Math.abs(h.current-g.scrollTop);if(b>0){const w=window.innerHeight-ts*2,C=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(C,E);if(R<w){const T=R+b,j=Math.min(w,T),O=T-j;v.style.height=j+"px",v.style.bottom==="0px"&&(g.scrollTop=O>0?O:0,v.style.justifyContent="flex-end")}}}h.current=g.scrollTop})})})]})});U3.displayName=$0;var F3="SelectGroup",[NW,AW]=Ou(F3),z3=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Nn();return o.jsx(NW,{scope:n,id:s,children:o.jsx(Ke.div,{role:"group","aria-labelledby":s,...r,ref:t})})});z3.displayName=F3;var V3="SelectLabel",DW=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=AW(V3,n);return o.jsx(Ke.div,{id:s.id,...r,ref:t})});DW.displayName=V3;var Ap="SelectItem",[OW,H3]=Ou(Ap),$3=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...c}=e,d=Gi(Ap,n),h=qi(Ap,n),m=d.value===r,[g,v]=p.useState(l??""),[x,b]=p.useState(!1),w=vt(t,T=>{var j;return(j=h.itemRefCallback)==null?void 0:j.call(h,T,r,s)}),C=Nn(),E=p.useRef("touch"),R=()=>{s||(d.onValueChange(r),d.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(OW,{scope:n,value:r,disabled:s,textId:C,isSelected:m,onItemTextChange:p.useCallback(T=>{v(j=>j||((T==null?void 0:T.textContent)??"").trim())},[]),children:o.jsx(Tg.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:o.jsx(Ke.div,{role:"option","aria-labelledby":C,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:w,onFocus:Te(c.onFocus,()=>b(!0)),onBlur:Te(c.onBlur,()=>b(!1)),onClick:Te(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:Te(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:Te(c.onPointerDown,T=>{E.current=T.pointerType}),onPointerMove:Te(c.onPointerMove,T=>{var j;E.current=T.pointerType,s?(j=h.onItemLeave)==null||j.call(h):E.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(c.onPointerLeave,T=>{var j;T.currentTarget===document.activeElement&&((j=h.onItemLeave)==null||j.call(h))}),onKeyDown:Te(c.onKeyDown,T=>{var O;((O=h.searchRef)==null?void 0:O.current)!==""&&T.key===" "||(vW.includes(T.key)&&R(),T.key===" "&&T.preventDefault())})})})})});$3.displayName=Ap;var Vd="SelectItemText",B3=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,c=Gi(Vd,n),d=qi(Vd,n),h=H3(Vd,n),m=SW(Vd,n),[g,v]=p.useState(null),x=vt(t,R=>v(R),h.onItemTextChange,R=>{var T;return(T=d.itemTextRefCallback)==null?void 0:T.call(d,R,h.value,h.disabled)}),b=g==null?void 0:g.textContent,w=p.useMemo(()=>o.jsx("option",{value:h.value,disabled:h.disabled,children:b},h.value),[h.disabled,h.value,b]),{onNativeOptionAdd:C,onNativeOptionRemove:E}=m;return br(()=>(C(w),()=>E(w)),[C,E,w]),o.jsxs(o.Fragment,{children:[o.jsx(Ke.span,{id:h.textId,...l,ref:x}),h.isSelected&&c.valueNode&&!c.valueNodeHasChildren?is.createPortal(l.children,c.valueNode):null]})});B3.displayName=Vd;var G3="SelectItemIndicator",q3=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return H3(G3,n).isSelected?o.jsx(Ke.span,{"aria-hidden":!0,...r,ref:t}):null});q3.displayName=G3;var B0="SelectScrollUpButton",Z3=p.forwardRef((e,t)=>{const n=qi(B0,e.__scopeSelect),r=B1(B0,e.__scopeSelect),[s,l]=p.useState(!1),c=vt(t,r.onScrollButtonChange);return br(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=h.scrollTop>0;l(m)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(Y3,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});Z3.displayName=B0;var G0="SelectScrollDownButton",K3=p.forwardRef((e,t)=>{const n=qi(G0,e.__scopeSelect),r=B1(G0,e.__scopeSelect),[s,l]=p.useState(!1),c=vt(t,r.onScrollButtonChange);return br(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=h.scrollHeight-h.clientHeight,g=Math.ceil(h.scrollTop)<m;l(g)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(Y3,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});K3.displayName=G0;var Y3=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=qi("SelectScrollButton",n),c=p.useRef(null),d=jg(n),h=p.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return p.useEffect(()=>()=>h(),[h]),br(()=>{var g;const m=d().find(v=>v.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),o.jsx(Ke.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Te(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Te(s.onPointerMove,()=>{var m;(m=l.onItemLeave)==null||m.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Te(s.onPointerLeave,()=>{h()})})}),MW="SelectSeparator",W3=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Ke.div,{"aria-hidden":!0,...r,ref:t})});W3.displayName=MW;var q0="SelectArrow",kW=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_g(n),l=Gi(q0,n),c=qi(q0,n);return l.open&&c.position==="popper"?o.jsx(jf,{...s,...r,ref:t}):null});kW.displayName=q0;var IW="SelectBubbleInput",Q3=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=p.useRef(null),l=vt(r,s),c=$1(t);return p.useEffect(()=>{const d=s.current;if(!d)return;const h=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(h,"value").set;if(c!==t&&g){const v=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(v)}},[c,t]),o.jsx(Ke.select,{...n,style:{...iN,...n.style},ref:l,defaultValue:t})});Q3.displayName=IW;function X3(e){return e===""||e===void 0}function J3(e){const t=ds(e),n=p.useRef(""),r=p.useRef(0),s=p.useCallback(c=>{const d=n.current+c;t(d),(function h(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>h(""),1e3))})(d)},[t]),l=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function eD(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=LW(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const h=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function LW(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var PW=j3,UW=N3,FW=D3,zW=O3,VW=M3,HW=k3,$W=U3,BW=z3,GW=$3,qW=B3,ZW=q3,KW=Z3,YW=K3,WW=W3;function Sa({...e}){return o.jsx(PW,{"data-slot":"select",...e})}function Ng({...e}){return o.jsx(BW,{"data-slot":"select-group",...e})}function Ca({...e}){return o.jsx(FW,{"data-slot":"select-value",...e})}function wa({className:e,size:t="default",children:n,...r}){return o.jsxs(UW,{"data-slot":"select-trigger","data-size":t,className:J("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,o.jsx(zW,{asChild:!0,children:o.jsx(Za,{className:"size-4 opacity-50"})})]})}function Ea({className:e,children:t,position:n="popper",...r}){return o.jsx(VW,{children:o.jsxs(HW,{"data-slot":"select-content",className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[o.jsx(XW,{}),o.jsx($W,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o.jsx(JW,{})]})})}function qn({className:e,children:t,...n}){return o.jsxs(GW,{"data-slot":"select-item",className:J("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(ZW,{children:o.jsx(dr,{className:"size-4"})})}),o.jsx(qW,{children:t})]})}function QW({className:e,...t}){return o.jsx(WW,{"data-slot":"select-separator",className:J("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function XW({className:e,...t}){return o.jsx(KW,{"data-slot":"select-scroll-up-button",className:J("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Us,{className:"size-4"})})}function JW({className:e,...t}){return o.jsx(YW,{"data-slot":"select-scroll-down-button",className:J("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Za,{className:"size-4"})})}const eQ=sn({title:on().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:on().min(1,"Storage is required")});function tQ(){const{createDataMart:e,isLoading:t,error:n}=Hi();return{handleCreate:p.useCallback(async s=>{try{return await e(s)}catch(l){return console.error(l),null}},[e]),isSubmitting:t,serverError:n}}function nQ(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:h,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,reset:b,dataMart:w,isLoading:C,error:E,getErrorMessage:R,runs:T}=Hi();return p.useEffect(()=>(e?t(e):b(),()=>{b()}),[e,t,b]),{dataMart:w,isLoading:C,error:E,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:h,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,runs:T,getDataMart:t}}const jT=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ae(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Z0=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?jT(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>jT(s,n,e))}},_T=(e,t)=>{t.shouldUseNativeValidation&&Z0(e,t);const n={};for(const r in e){const s=Ae(t.fields,r),l=Object.assign(e[r]||{},{ref:s&&s.ref});if(rQ(t.names||Object.keys(e),r)){const c=Object.assign({},Ae(n,r));Zt(c,"root",l),Zt(n,r,c)}else Zt(n,r,l)}return n},rQ=(e,t)=>{const n=NT(t);return e.some(r=>NT(r).match(`^${n}\\.\\d+`))};function NT(e){return e.replace(/\]|\[/g,"")}function tD(e,t,n){function r(d,h){var m;Object.defineProperty(d,"_zod",{value:d._zod??{},enumerable:!1}),(m=d._zod).traits??(m.traits=new Set),d._zod.traits.add(e),t(d,h);for(const g in c.prototype)g in d||Object.defineProperty(d,g,{value:c.prototype[g].bind(d)});d._zod.constr=c,d._zod.def=h}const s=(n==null?void 0:n.Parent)??Object;class l extends s{}Object.defineProperty(l,"name",{value:e});function c(d){var h;const m=n!=null&&n.Parent?new l:this;r(m,d),(h=m._zod).deferred??(h.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var h,m;return n!=null&&n.Parent&&d instanceof n.Parent?!0:(m=(h=d==null?void 0:d._zod)==null?void 0:h.traits)==null?void 0:m.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class aQ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const sQ={};function nD(e){return sQ}function oQ(e,t){return typeof t=="bigint"?t.toString():t}const rD=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Nm(e){return typeof e=="string"?e:e==null?void 0:e.message}function aD(e,t,n){var s,l,c,d,h,m;const r={...e,path:e.path??[]};if(!e.message){const g=Nm((c=(l=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:l.error)==null?void 0:c.call(l,e))??Nm((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??Nm((h=n.customError)==null?void 0:h.call(n,e))??Nm((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=g}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const sD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,oQ,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iQ=tD("$ZodError",sD),oD=tD("$ZodError",sD,{Parent:Error}),lQ=e=>(t,n,r,s)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new aQ;if(c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>aD(h,l,nD())));throw rD(d,s==null?void 0:s.callee),d}return c.value},cQ=lQ(oD),uQ=e=>async(t,n,r,s)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(h=>aD(h,l,nD())));throw rD(d,s==null?void 0:s.callee),d}return c.value},dQ=uQ(oD);function AT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function fQ(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var d=r.unionErrors[0].errors[0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(g){return g.errors.forEach(function(v){return e.push(v)})}),t){var h=n[c].types,m=h&&h[r.code];n[c]=z1(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function hQ(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var d=r.errors[0][0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(g){return g.forEach(function(v){return e.push(v)})}),t){var h=n[c].types,m=h&&h[r.code];n[c]=z1(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Wl(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,s,l){try{return Promise.resolve(AT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&Z0({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return Array.isArray(d==null?void 0:d.issues)})(c))return{values:{},errors:_T(fQ(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,l){try{return Promise.resolve(AT(function(){return Promise.resolve((n.mode==="sync"?cQ:dQ)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&Z0({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof iQ})(c))return{values:{},errors:_T(hQ(c.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const iD=p.createContext(void 0);function mQ(){const e=p.useContext(iD);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var kt=(e=>(e.FETCH_STORAGES_START="FETCH_STORAGES_START",e.FETCH_STORAGES_SUCCESS="FETCH_STORAGES_SUCCESS",e.FETCH_STORAGES_ERROR="FETCH_STORAGES_ERROR",e.FETCH_STORAGE_START="FETCH_STORAGE_START",e.FETCH_STORAGE_SUCCESS="FETCH_STORAGE_SUCCESS",e.FETCH_STORAGE_ERROR="FETCH_STORAGE_ERROR",e.CLEAR_CURRENT_STORAGE="CLEAR_CURRENT_STORAGE",e.CREATE_STORAGE_START="CREATE_STORAGE_START",e.CREATE_STORAGE_SUCCESS="CREATE_STORAGE_SUCCESS",e.CREATE_STORAGE_ERROR="CREATE_STORAGE_ERROR",e.UPDATE_STORAGE_START="UPDATE_STORAGE_START",e.UPDATE_STORAGE_SUCCESS="UPDATE_STORAGE_SUCCESS",e.UPDATE_STORAGE_ERROR="UPDATE_STORAGE_ERROR",e.DELETE_STORAGE_START="DELETE_STORAGE_START",e.DELETE_STORAGE_SUCCESS="DELETE_STORAGE_SUCCESS",e.DELETE_STORAGE_ERROR="DELETE_STORAGE_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(kt||{});const pQ={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function gQ(e,t){switch(t.type){case kt.FETCH_STORAGES_START:case kt.FETCH_STORAGE_START:case kt.CREATE_STORAGE_START:case kt.UPDATE_STORAGE_START:return{...e,error:null};case kt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case kt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case kt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case kt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case kt.UPDATE_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,dataStorages:e.dataStorages.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case kt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case kt.FETCH_STORAGES_ERROR:case kt.FETCH_STORAGE_ERROR:case kt.CREATE_STORAGE_ERROR:case kt.UPDATE_STORAGE_ERROR:case kt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case kt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case kt.CLEAR_ERROR:return{...e,error:null};default:return e}}function G1({children:e}){const[t,n]=p.useReducer(gQ,pQ);return o.jsx(iD.Provider,{value:{state:t,dispatch:n},children:e})}class vQ extends Bl{constructor(){super("/data-storages")}async getDataStorages(){return this.get("/")}async getDataStorageById(t){return this.get(`/${t}`)}async createDataStorage(t){return this.post("",t)}async updateDataStorage(t,n){return this.put(`/${t}`,n)}async deleteDataStorage(t){return this.delete(`/${t}`)}}const kd=new vQ;function Ag(){const{state:e,dispatch:t}=mQ(),n=p.useCallback(async()=>{t({type:kt.FETCH_STORAGES_START});try{const h=await kd.getDataStorages();t({type:kt.FETCH_STORAGES_SUCCESS,payload:h.map(MY)})}catch(h){throw t({type:kt.FETCH_STORAGES_ERROR,payload:yn(h)}),h}},[t]),r=p.useCallback(async h=>{try{const m=await kd.getDataStorageById(h),g=Zm(m);t({type:kt.FETCH_STORAGE_SUCCESS,payload:g})}catch(m){throw t({type:kt.FETCH_STORAGE_ERROR,payload:yn(m)}),m}},[t]),s=p.useCallback(async h=>{t({type:kt.CREATE_STORAGE_START});try{const m=kY(h),g=await kd.createDataStorage(m),v=Zm(g);return t({type:kt.CREATE_STORAGE_SUCCESS,payload:v}),Fe({event:"data_storage_created",category:"DataStorage",action:"Create",label:v.type}),Dt.success("Storage created"),v}catch(m){return t({type:kt.CREATE_STORAGE_ERROR,payload:yn(m)}),null}},[t]),l=p.useCallback(async(h,m)=>{t({type:kt.UPDATE_STORAGE_START});try{const g=OY(m),v=await kd.updateDataStorage(h,g),x=Zm(v);return t({type:kt.UPDATE_STORAGE_SUCCESS,payload:x}),Fe({event:"data_storage_updated",category:"DataStorage",action:"Update",label:x.type}),Dt.success("Storage updated"),x}catch(g){return t({type:kt.UPDATE_STORAGE_ERROR,payload:yn(g)}),null}},[t]),c=p.useCallback(async h=>{t({type:kt.DELETE_STORAGE_START});try{await kd.deleteDataStorage(h),t({type:kt.DELETE_STORAGE_SUCCESS,payload:h}),Fe({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:h}),Dt.success("Storage deleted")}catch(m){throw t({type:kt.DELETE_STORAGE_ERROR,payload:yn(m)}),m}},[t]),d=p.useCallback(()=>{t({type:kt.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:l,deleteDataStorage:c,clearCurrentDataStorage:d}}const lD=({isOpen:e,onClose:t,onSelect:n})=>o.jsx(A1,{open:e,onOpenChange:t,children:o.jsxs(D1,{className:"sm:max-w-sm",children:[o.jsxs(O1,{children:[o.jsx(M1,{children:"New Storage"}),o.jsx(k1,{children:"Choose the type of storage you want to create"})]}),o.jsx("div",{className:"flex flex-col gap-4 py-4",children:Vi.getAllTypes().map(r=>{const s=r.icon,l=r.status===bo.ACTIVE;return o.jsxs(Ce,{variant:"outline",className:"flex px-4 py-6",onClick:()=>void n(r.type),disabled:!l,children:[o.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[o.jsx(s,{size:24}),o.jsx("span",{className:"font-medium",children:r.displayName})]}),!l&&o.jsx(Ar,{variant:"secondary",children:"Coming soon"})]},r.type)})})]})});function yQ({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=tQ(),{dataStorages:l,loading:c,fetchDataStorages:d,createDataStorage:h,getDataStorageById:m}=Ag(),[g,v]=p.useState(!1);p.useEffect(()=>{d()},[d]);const x=$i({resolver:Wl(eQ),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async E=>{const R=await n(E);R&&t&&t(R)},w=()=>{v(!0)},C=async E=>{try{const R=await h(E);R!=null&&R.id&&(await m(R.id),x.setValue("storageId",R.id))}catch(R){console.error("Failed to create storage:",R)}v(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(Zl,{...x,children:o.jsxs(Bi,{onSubmit:E=>{x.handleSubmit(b)(E)},children:[o.jsxs(Kl,{variant:"light",children:[s&&o.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),o.jsx(Qt,{control:x.control,name:"title",render:({field:E})=>o.jsxs(Xt,{children:[o.jsx(Jt,{children:"Title"}),o.jsx(en,{children:o.jsx($t,{id:"title",placeholder:"Enter title",...E,disabled:r})}),o.jsx(ln,{})]})}),o.jsx(Qt,{control:x.control,name:"storageId",render:({field:E})=>o.jsxs(Xt,{children:[o.jsx(Jt,{children:"Storage"}),o.jsx(en,{children:o.jsxs(Sa,{onValueChange:R=>{R==="create_new"?w():E.onChange(R)},value:E.value,disabled:r||c,children:[o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{placeholder:"Select a storage"})}),o.jsx(Ea,{children:o.jsxs(Ng,{children:[c&&o.jsx(qn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&l.map(R=>{const T=Vi.getInfo(R.type).icon;return o.jsx(qn,{value:R.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T,{size:20}),o.jsx("span",{children:R.title})]})},R.id)}),!c&&l.length>0&&o.jsx(QW,{}),o.jsx(qn,{value:"create_new",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:o.jsx(Ta,{size:20})}),o.jsx("span",{children:"Create new storage"})]})})]})})]})}),o.jsx(ln,{})]})})]}),o.jsxs(Yl,{variant:"light",children:[o.jsx(Ce,{type:"submit",children:"Create Data Mart"}),o.jsx(Ce,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),o.jsx(lD,{isOpen:g,onClose:()=>{v(!1)},onSelect:E=>C(E)})]})}function xQ({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[l,c]=p.useState(e),[d,h]=p.useState(!1),m=p.useRef(null);p.useEffect(()=>{c(e)},[e]),p.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[l]);const g=async()=>{if(l.trim()===""){c(e);return}if(l.trim()!==e)try{h(!0),await t(l.trim())}catch(x){c(e),console.error(x)}finally{h(!1)}},v=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),l.trim()===""){Dt.error(r),c(e);return}g()}else x.key==="Escape"&&c(e)};return o.jsx("h2",{className:J("m-0 cursor-pointer p-0 hover:opacity-80",n),children:o.jsx(Fi,{ref:m,value:l,onChange:x=>{c(x.target.value);const b=x.target;b.style.height="auto",b.style.height=`${String(b.scrollHeight)}px`},onBlur:()=>void g(),onKeyDown:v,className:J("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":d}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:d})})}var $c=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))($c||{}),cD=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(cD||{});function bQ({configuration:e,onClose:t,onSubmit:n}){const[r,s]=p.useState(new Set),l=p.useId(),c=$i({defaultValues:{runType:$c.INCREMENTAL}}),{loading:d,loadingSpecification:h,connectorSpecification:m,fetchConnectorSpecification:g}=ql(),v=p.useCallback(async C=>{!r.has(C)&&!h&&(s(E=>new Set(E).add(C)),await g(C))},[r,h,g]);p.useEffect(()=>{e!=null&&e.connector.source.name&&v(e.connector.source.name)},[e,d,v]);const x=C=>{n&&n(C)},b=()=>{t&&t()},w=C=>{if(!C)return"text";switch(C){case rs.DATE:return"date";case rs.NUMBER:return"number";default:return"text"}};return h?o.jsx("div",{children:"Loading..."}):m?o.jsx(Zl,{...c,children:o.jsxs(Bi,{id:l,noValidate:!0,onSubmit:C=>void c.handleSubmit(x)(C),children:[o.jsxs(Kl,{children:[o.jsx(Vs,{title:"General",children:o.jsx(Qt,{control:c.control,name:"runType",render:({field:C})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),o.jsx(en,{children:o.jsxs(o.Fragment,{children:[o.jsx(pW,{options:[{value:$c.INCREMENTAL,label:"Incremental load"},{value:$c.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:C.value,onChange:C.onChange,orientation:"horizontal"}),o.jsx(ar,{children:c.watch("runType")===$c.MANUAL_BACKFILL?"Reloads all data for a specific time range from the source, replacing existing records for that period. Use when you need to correct or update historical data.":"Adds only new or updated records since the last run, using the current state of your Data Mart as a reference. Ideal for keeping data fresh without reloading what`s already there."})]})})]})})}),c.watch("runType")===$c.MANUAL_BACKFILL&&o.jsx(Vs,{title:"Run configuration",children:m.filter(C=>{var E;return(E=C.attributes)==null?void 0:E.includes(cD.MANUAL_BACKFILL)}).map(C=>o.jsx(Qt,{control:c.control,name:`data.${C.name}`,render:()=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:C.description,children:C.title??C.name}),o.jsx(en,{children:o.jsx($t,{id:C.name,placeholder:C.description,type:w(C.requiredType),defaultValue:typeof C.default=="string"||typeof C.default=="number"?C.default.toString():void 0,...c.register(`data.${C.name}`,{required:!0})})}),o.jsx(ln,{})]},C.name)}))})]}),o.jsxs(Yl,{children:[o.jsx(Ce,{type:"submit",disabled:!c.formState.isValid||h,children:"Run"}),o.jsx(Ce,{type:"button",variant:"outline",onClick:b,children:"Cancel"})]})]})}):o.jsx("div",{children:"No connector specification found"})}function SQ({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return o.jsx(Mi,{open:e,onOpenChange:t,children:o.jsxs(ki,{children:[o.jsx(Ii,{children:o.jsx(Li,{children:"Manual Run"})}),o.jsx(bQ,{configuration:n,onClose:t,onSubmit:r})]})})}function uD({children:e,configuration:t,onManualRun:n,open:r}){const[s,l]=p.useState(r??!1),c=()=>{l(!0)},d=m=>{n(m),l(!1)},h=()=>e?o.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return o.jsxs(o.Fragment,{children:[h(),s&&o.jsx(hu,{children:o.jsx(SQ,{isOpen:s,onClose:()=>{l(!1)},configuration:t,onSubmit:d})})]})}var Cl=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Cl||{});const CQ=1e3;function q1(e,t){const[n,r]=p.useState(!1),[s,l]=p.useState(null),c=p.useRef(null),d=p.useRef(null),h=p.useRef(!0),m=p.useRef(t);m.current=t;const g=p.useCallback(E=>{h.current&&r(E)},[]),v=p.useCallback(E=>{h.current&&l(E)},[]),x=p.useCallback((E,R)=>{const T=E instanceof Error?E.message:"Schema actualization failed";Dt.dismiss(R),v(T),g(!1),c.current=null,d.current=null,Dt.error(T,{duration:void 0,id:R})},[v,g]),b=p.useCallback(async()=>{var R;const E=c.current;if((R=d.current)==null||R.abort(),E){Dt.dismiss(E);try{await rn.abortSchemaActualizeTrigger(e,E)}catch{}}c.current=null,d.current=null,g(!1)},[e,g]),w=p.useCallback(async(E,R)=>{var j;const T=O=>O===Cl.SUCCESS||O===Cl.ERROR||O===Cl.CANCELLED;for(;!R.aborted&&c.current===E;)try{const O=await rn.getSchemaActualizeTriggerStatus(e,E);if(T(O)){try{const D=await rn.getSchemaActualizeTriggerResponse(e,E);if(Dt.dismiss(E),D.success)(j=m.current)==null||j.call(m),Dt.success("Output schema actualized",{duration:void 0,id:E});else{const _=D.error??"Schema actualization failed";v(_),Dt.error(_,{duration:void 0,id:E})}}catch(D){const _=D instanceof Error?D.message:"Schema actualization failed";Dt.dismiss(E),v(_),Dt.error(_,{duration:void 0,id:E})}g(!1),c.current=null,d.current=null;return}await new Promise(D=>setTimeout(D,CQ))}catch(O){x(O,E)}},[e,v,g,x]),C=p.useCallback(async()=>{c.current&&await b(),v(null),g(!0);try{const{triggerId:E}=await rn.createSchemaActualizeTrigger(e);Dt.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:E}),c.current=E;const R=new AbortController;d.current=R;try{await w(E,R.signal)}catch(T){x(T,E)}}catch(E){g(!1),v(E instanceof Error?E.message:"Failed to start schema actualization")}},[e,b,w,v,g,x]);return p.useEffect(()=>(h.current=!0,()=>{var R;h.current=!1;const E=c.current;(R=d.current)==null||R.abort(),E&&(Dt.dismiss(E),rn.abortSchemaActualizeTrigger(e,E).catch(()=>{})),c.current=null,d.current=null}),[e]),{run:C,isLoading:n,cancel:b,error:s}}function wQ({id:e}){const{navigate:t}=Io(),{dataMart:n,deleteDataMart:r,updateDataMartTitle:s,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:h,publishDataMart:m,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,isLoading:w,error:C,getErrorMessage:E,runs:R,getDataMart:T}=nQ(e),[j,O]=p.useState(!1),[D,_]=p.useState(!1),A=(n==null?void 0:n.id)??"",M=p.useCallback(()=>{A&&T(A)},[A,T]),{run:U}=q1(A,M),B=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],G=async H=>{n&&await s(n.id,H)},K=async()=>{if(n){_(!0);try{await m(n.id),U()}catch(H){console.log(H instanceof Error?H.message:"Failed to publish Data Mart")}finally{_(!1)}}},re=async H=>{if(n){if(n.status.code!==ur.PUBLISHED){an.error("Manual run is only available for published Data Marts");return}await g({id:n.id,payload:H})}};return n?o.jsxs("div",{className:"px-12 py-6",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[o.jsx(tu,{onClick:()=>{t("/data-marts")},variant:"ghost",size:"sm","aria-label":"Back to Data Marts",title:"Back to Data Marts",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:o.jsx(kI,{className:"h-5 w-5"})}),o.jsx(xQ,{title:n.title,onUpdate:G,className:"text-2xl font-medium"})]}),o.jsxs("div",{className:"flex items-center gap-2"+(D?" opacity-50":""),style:{minWidth:"120px"},children:[o.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("div",{children:o.jsx(Vf,{type:n.status.code===ur.PUBLISHED?Tn.SUCCESS:Tn.NEUTRAL,variant:"subtle",children:n.status.displayName})})}),o.jsx(_t,{children:n.status.code===ur.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),n.status.code===ur.DRAFT&&o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("div",{children:o.jsxs(tu,{variant:"default",onClick:()=>{K()},disabled:D||!n.canPublish,className:"ml-2 flex items-center gap-1",children:[o.jsx($p,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!n.canPublish&&o.jsxs(_t,{children:[o.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),n.validationErrors.length>0&&o.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:UZ(n.validationErrors).map((H,$)=>o.jsx("li",{children:H},$))})]})]})]}),o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(tu,{variant:"ghost",children:o.jsx(w9,{className:"h-5 w-5"})})}),o.jsxs(Er,{align:"end",children:[n.definitionType===qe.CONNECTOR&&o.jsxs(o.Fragment,{children:[o.jsx(uD,{configuration:n.definition??null,onManualRun:H=>{re({runType:H.runType,data:H.data})},children:o.jsxs(bt,{onClick:H=>{H.preventDefault()},children:[o.jsx(wb,{className:"text-foreground h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})}),o.jsx(Ga,{})]}),o.jsxs(bt,{onClick:()=>{O(!0)},children:[o.jsx(ko,{className:"h-4 w-4 text-red-600"}),o.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),o.jsx("div",{children:o.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:B.map(H=>o.jsx(xf,{to:H.path,className:({isActive:$})=>J("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",$?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:border-gray-200 dark:hover:text-gray-200"),children:H.name},H.name))})}),o.jsx("div",{className:"pt-4",children:o.jsx(Ij,{context:{dataMart:n,isLoading:w,error:C,getErrorMessage:E,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:h,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,runs:R,getDataMart:T}})}),o.jsx(xa,{open:j,onOpenChange:O,title:"Delete Data Mart",description:o.jsxs(o.Fragment,{children:["Are you sure you want to delete ",o.jsxs("strong",{children:['"',n.title,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await r(n.id),O(!1),t("/data-marts")}catch(H){console.error("Failed to delete Data Mart:",H)}})()}})]}):o.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[o.jsx(as,{className:"h-16 w-full"},0),Array.from({length:3}).map((H,$)=>o.jsx(as,{className:"h-48 w-full"},$+1))]})}function EQ({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:l="100px"}){const[c,d]=p.useState(e??""),[h,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useRef(null);p.useEffect(()=>{d(e??"")},[e]),p.useEffect(()=>{if(x.current&&h){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),b(x.current)}},[h]);const b=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},w=R=>{d(R.target.value),b(R.target)},C=async()=>{const R=c.trim();if(R===(e??"")){m(!1);return}try{v(!0),await t(R===""?null:R),m(!1)}catch(j){console.error("Failed to update description:",j),d(e??"")}finally{v(!1)}},E=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),C()):R.key==="Escape"&&(R.preventDefault(),d(e??""),m(!1))};return h?o.jsxs("div",{className:"w-full",children:[o.jsx(Fi,{ref:x,value:c,onChange:w,onBlur:()=>void C(),onKeyDown:E,placeholder:r,className:J("m-0 w-full border-0 bg-white p-2 shadow-none dark:bg-white/4","focus-visible:ring-primary focus-visible:ring-0",{"opacity-50":g}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:l,minWidth:s},disabled:g}),o.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[o.jsxs("span",{children:["Press"," ",o.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Ctrl+Enter"})," ","to save •"," "]}),o.jsxs("span",{children:[o.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Esc"})," ","to cancel •"," "]}),o.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):o.jsx("div",{className:"flex w-full items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:o.jsx("div",{onClick:()=>{m(!0)},className:J("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:s},children:e??r})})}function RQ(){const{dataMart:e,updateDataMartDescription:t}=gs(),n=async r=>{await t(e.id,r)};return o.jsx("div",{children:o.jsx(EQ,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function DT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TQ(e){if(Array.isArray(e))return e}function jQ(e,t,n){return(t=kQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Q(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,l,c,d=[],h=!0,m=!1;try{if(l=(n=n.call(e)).next,t!==0)for(;!(h=(r=l.call(n)).done)&&(d.push(r.value),d.length!==t);h=!0);}catch(g){m=!0,s=g}finally{try{if(!h&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return d}}function NQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
714
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function MT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OT(Object(n),!0).forEach(function(r){jQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AQ(e,t){if(e==null)return{};var n,r,s=DQ(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function DQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function OQ(e,t){return TQ(e)||_Q(e,t)||IQ(e,t)||NQ()}function MQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kQ(e){var t=MQ(e,"string");return typeof t=="symbol"?t:t+""}function IQ(e,t){if(e){if(typeof e=="string")return DT(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?DT(e,t):void 0}}function LQ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function IT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kT(Object(n),!0).forEach(function(r){LQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PQ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,l){return l(s)},r)}}function Hd(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];return t.apply(n,[].concat(s,d))}}}function Dp(e){return{}.toString.call(e).includes("Object")}function UQ(e){return!Object.keys(e).length}function ff(e){return typeof e=="function"}function FQ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function zQ(e,t){return Dp(t)||Si("changeType"),Object.keys(t).some(function(n){return!FQ(e,n)})&&Si("changeField"),t}function VQ(e){ff(e)||Si("selectorType")}function HQ(e){ff(e)||Dp(e)||Si("handlerType"),Dp(e)&&Object.values(e).some(function(t){return!ff(t)})&&Si("handlersType")}function $Q(e){e||Si("initialIsRequired"),Dp(e)||Si("initialType"),UQ(e)&&Si("initialContent")}function BQ(e,t){throw new Error(e[t]||e.default)}var GQ={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Si=Hd(BQ)(GQ),Am={changes:zQ,selector:VQ,handler:HQ,initial:$Q};function qQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Am.initial(e),Am.handler(t);var n={current:e},r=Hd(YQ)(n,t),s=Hd(KQ)(n),l=Hd(Am.changes)(e),c=Hd(ZQ)(n);function d(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return Am.selector(m),m(n.current)}function h(m){PQ(r,s,l,c)(m)}return[d,h]}function ZQ(e,t){return ff(t)?t(e.current):t}function KQ(e,t){return e.current=IT(IT({},e.current),t),t}function YQ(e,t,n){return ff(t)?t(e.current):Object.keys(n).forEach(function(r){var s;return(s=t[r])===null||s===void 0?void 0:s.call(t,e.current[r])}),n}var WQ={create:qQ},QQ={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function XQ(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];return t.apply(n,[].concat(s,d))}}}function JQ(e){return{}.toString.call(e).includes("Object")}function eX(e){return e||LT("configIsRequired"),JQ(e)||LT("configType"),e.urls?(tX(),{paths:{vs:e.urls.monacoBase}}):e}function tX(){console.warn(dD.deprecation)}function nX(e,t){throw new Error(e[t]||e.default)}var dD={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
715
|
-
You are using deprecated way of configuration.
|
|
716
|
-
|
|
717
|
-
Instead of using
|
|
718
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
719
|
-
use
|
|
720
|
-
monaco.config({ paths: { vs: '...' } })
|
|
721
|
-
|
|
722
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
723
|
-
`},LT=XQ(nX)(dD),rX={config:eX},aX=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(l,c){return c(l)},s)}};function fD(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],fD(e[n],t[n]))}),MT(MT({},e),t)}var sX={type:"cancelation",msg:"operation is manually canceled"};function Vx(e){var t=!1,n=new Promise(function(r,s){e.then(function(l){return t?s(sX):r(l)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var oX=["monaco"],iX=WQ.create({config:QQ,isInitialized:!1,resolve:null,reject:null,monaco:null}),hD=OQ(iX,2),Zf=hD[0],Dg=hD[1];function lX(e){var t=rX.config(e),n=t.monaco,r=AQ(t,oX);Dg(function(s){return{config:fD(s.config,r),monaco:n}})}function cX(){var e=Zf(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Dg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Vx(Hx);if(window.monaco&&window.monaco.editor)return mD(window.monaco),e.resolve(window.monaco),Vx(Hx);aX(uX,fX)(hX)}return Vx(Hx)}function uX(e){return document.body.appendChild(e)}function dX(e){var t=document.createElement("script");return e&&(t.src=e),t}function fX(e){var t=Zf(function(r){var s=r.config,l=r.reject;return{config:s,reject:l}}),n=dX("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function hX(){var e=Zf(function(n){var r=n.config,s=n.resolve,l=n.reject;return{config:r,resolve:s,reject:l}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;mD(r),e.resolve(r)},function(n){e.reject(n)})}function mD(e){Zf().monaco||Dg({monaco:e})}function mX(){return Zf(function(e){var t=e.monaco;return t})}var Hx=new Promise(function(e,t){return Dg({resolve:e,reject:t})}),pD={config:lX,init:cX,__getMonacoInstance:mX},pX={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},$x=pX,gX={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},vX=gX;function yX({children:e}){return je.createElement("div",{style:vX.container},e)}var xX=yX,bX=xX;function SX({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:l,wrapperProps:c}){return je.createElement("section",{style:{...$x.wrapper,width:e,height:t},...c},!n&&je.createElement(bX,null,r),je.createElement("div",{ref:s,style:{...$x.fullWidth,...!n&&$x.hide},className:l}))}var CX=SX,gD=p.memo(CX);function wX(e){p.useEffect(e,[])}var vD=wX;function EX(e,t,n=!0){let r=p.useRef(!0);p.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var da=EX;function Zd(){}function Zc(e,t,n,r){return RX(e,r)||TX(e,t,n,r)}function RX(e,t){return e.editor.getModel(yD(e,t))}function TX(e,t,n,r){return e.editor.createModel(t,n,r?yD(e,r):void 0)}function yD(e,t){return e.Uri.parse(t)}function jX({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:l,modifiedModelPath:c,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:h=!1,theme:m="light",loading:g="Loading...",options:v={},height:x="100%",width:b="100%",className:w,wrapperProps:C={},beforeMount:E=Zd,onMount:R=Zd}){let[T,j]=p.useState(!1),[O,D]=p.useState(!0),_=p.useRef(null),A=p.useRef(null),M=p.useRef(null),U=p.useRef(R),B=p.useRef(E),G=p.useRef(!1);vD(()=>{let $=pD.init();return $.then(I=>(A.current=I)&&D(!1)).catch(I=>(I==null?void 0:I.type)!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>_.current?H():$.cancel()}),da(()=>{if(_.current&&A.current){let $=_.current.getOriginalEditor(),I=Zc(A.current,e||"",r||n||"text",l||"");I!==$.getModel()&&$.setModel(I)}},[l],T),da(()=>{if(_.current&&A.current){let $=_.current.getModifiedEditor(),I=Zc(A.current,t||"",s||n||"text",c||"");I!==$.getModel()&&$.setModel(I)}},[c],T),da(()=>{let $=_.current.getModifiedEditor();$.getOption(A.current.editor.EditorOption.readOnly)?$.setValue(t||""):t!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[t],T),da(()=>{var $,I;(I=($=_.current)==null?void 0:$.getModel())==null||I.original.setValue(e||"")},[e],T),da(()=>{let{original:$,modified:I}=_.current.getModel();A.current.editor.setModelLanguage($,r||n||"text"),A.current.editor.setModelLanguage(I,s||n||"text")},[n,r,s],T),da(()=>{var $;($=A.current)==null||$.editor.setTheme(m)},[m],T),da(()=>{var $;($=_.current)==null||$.updateOptions(v)},[v],T);let K=p.useCallback(()=>{var Y;if(!A.current)return;B.current(A.current);let $=Zc(A.current,e||"",r||n||"text",l||""),I=Zc(A.current,t||"",s||n||"text",c||"");(Y=_.current)==null||Y.setModel({original:$,modified:I})},[n,t,s,e,r,l,c]),re=p.useCallback(()=>{var $;!G.current&&M.current&&(_.current=A.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...v}),K(),($=A.current)==null||$.editor.setTheme(m),j(!0),G.current=!0)},[v,m,K]);p.useEffect(()=>{T&&U.current(_.current,A.current)},[T]),p.useEffect(()=>{!O&&!T&&re()},[O,T,re]);function H(){var I,Y,Z,ie;let $=(I=_.current)==null?void 0:I.getModel();d||((Y=$==null?void 0:$.original)==null||Y.dispose()),h||((Z=$==null?void 0:$.modified)==null||Z.dispose()),(ie=_.current)==null||ie.dispose()}return je.createElement(gD,{width:b,height:x,isEditorReady:T,loading:g,_ref:M,className:w,wrapperProps:C})}var _X=jX;p.memo(_X);function NX(e){let t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}var AX=NX,Dm=new Map;function DX({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:l,theme:c="light",line:d,loading:h="Loading...",options:m={},overrideServices:g={},saveViewState:v=!0,keepCurrentModel:x=!1,width:b="100%",height:w="100%",className:C,wrapperProps:E={},beforeMount:R=Zd,onMount:T=Zd,onChange:j,onValidate:O=Zd}){let[D,_]=p.useState(!1),[A,M]=p.useState(!0),U=p.useRef(null),B=p.useRef(null),G=p.useRef(null),K=p.useRef(T),re=p.useRef(R),H=p.useRef(),$=p.useRef(r),I=AX(l),Y=p.useRef(!1),Z=p.useRef(!1);vD(()=>{let L=pD.init();return L.then(P=>(U.current=P)&&M(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>B.current?be():L.cancel()}),da(()=>{var P,W,ae,fe;let L=Zc(U.current,e||r||"",t||s||"",l||n||"");L!==((P=B.current)==null?void 0:P.getModel())&&(v&&Dm.set(I,(W=B.current)==null?void 0:W.saveViewState()),(ae=B.current)==null||ae.setModel(L),v&&((fe=B.current)==null||fe.restoreViewState(Dm.get(l))))},[l],D),da(()=>{var L;(L=B.current)==null||L.updateOptions(m)},[m],D),da(()=>{!B.current||r===void 0||(B.current.getOption(U.current.editor.EditorOption.readOnly)?B.current.setValue(r):r!==B.current.getValue()&&(Z.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),B.current.pushUndoStop(),Z.current=!1))},[r],D),da(()=>{var P,W;let L=(P=B.current)==null?void 0:P.getModel();L&&s&&((W=U.current)==null||W.editor.setModelLanguage(L,s))},[s],D),da(()=>{var L;d!==void 0&&((L=B.current)==null||L.revealLine(d))},[d],D),da(()=>{var L;(L=U.current)==null||L.editor.setTheme(c)},[c],D);let ie=p.useCallback(()=>{var L;if(!(!G.current||!U.current)&&!Y.current){re.current(U.current);let P=l||n,W=Zc(U.current,r||e||"",t||s||"",P||"");B.current=(L=U.current)==null?void 0:L.editor.create(G.current,{model:W,automaticLayout:!0,...m},g),v&&B.current.restoreViewState(Dm.get(P)),U.current.editor.setTheme(c),d!==void 0&&B.current.revealLine(d),_(!0),Y.current=!0}},[e,t,n,r,s,l,m,g,v,c,d]);p.useEffect(()=>{D&&K.current(B.current,U.current)},[D]),p.useEffect(()=>{!A&&!D&&ie()},[A,D,ie]),$.current=r,p.useEffect(()=>{var L,P;D&&j&&((L=H.current)==null||L.dispose(),H.current=(P=B.current)==null?void 0:P.onDidChangeModelContent(W=>{Z.current||j(B.current.getValue(),W)}))},[D,j]),p.useEffect(()=>{if(D){let L=U.current.editor.onDidChangeMarkers(P=>{var ae;let W=(ae=B.current.getModel())==null?void 0:ae.uri;if(W&&P.find(fe=>fe.path===W.path)){let fe=U.current.editor.getModelMarkers({resource:W});O==null||O(fe)}});return()=>{L==null||L.dispose()}}return()=>{}},[D,O]);function be(){var L,P;(L=H.current)==null||L.dispose(),x?v&&Dm.set(l,B.current.saveViewState()):(P=B.current.getModel())==null||P.dispose(),B.current.dispose()}return je.createElement(gD,{width:b,height:w,isEditorReady:D,loading:h,_ref:G,className:C,wrapperProps:E})}var OX=DX,MX=p.memo(OX);function kX({initialValue:e,onChange:t}){const[n,r]=p.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=s4();p.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function l(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return o.jsx("div",{className:"shadow-xs",children:o.jsx(MX,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:l,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function K0({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:l}){const c=e;return o.jsxs("div",{className:J("group flex items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",s&&"cursor-pointer dark:hover:bg-white/5",l),onClick:s,children:[o.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx(c,{className:"h-6 w-6"})}),o.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[o.jsx("div",{className:"text-md font-medium",children:t}),n&&o.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),o.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:o.jsx(Ra,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var PT=1,IX=.9,LX=.8,PX=.17,Bx=.1,Gx=.999,UX=.9999,FX=.99,zX=/[\\\/_+.#"@\[\(\{&]/,VX=/[\\\/_+.#"@\[\(\{&]/g,HX=/[\s-]/,xD=/[\s-]/g;function Y0(e,t,n,r,s,l,c){if(l===t.length)return s===e.length?PT:FX;var d=`${s},${l}`;if(c[d]!==void 0)return c[d];for(var h=r.charAt(l),m=n.indexOf(h,s),g=0,v,x,b,w;m>=0;)v=Y0(e,t,n,r,m+1,l+1,c),v>g&&(m===s?v*=PT:zX.test(e.charAt(m-1))?(v*=LX,b=e.slice(s,m-1).match(VX),b&&s>0&&(v*=Math.pow(Gx,b.length))):HX.test(e.charAt(m-1))?(v*=IX,w=e.slice(s,m-1).match(xD),w&&s>0&&(v*=Math.pow(Gx,w.length))):(v*=PX,s>0&&(v*=Math.pow(Gx,m-s))),e.charAt(m)!==t.charAt(l)&&(v*=UX)),(v<Bx&&n.charAt(m-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(m-1)!==r.charAt(l))&&(x=Y0(e,t,n,r,m+1,l+2,c),x*Bx>v&&(v=x*Bx)),v>g&&(g=v),m=n.indexOf(h,m+1);return c[d]=g,g}function UT(e){return e.toLowerCase().replace(xD," ")}function $X(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Y0(e,t,UT(e),UT(t),0,0,{})}var Id='[cmdk-group=""]',qx='[cmdk-group-items=""]',BX='[cmdk-group-heading=""]',bD='[cmdk-item=""]',FT=`${bD}:not([aria-disabled="true"])`,W0="cmdk-item-select",Bc="data-value",GX=(e,t,n)=>$X(e,t,n),SD=p.createContext(void 0),Kf=()=>p.useContext(SD),CD=p.createContext(void 0),Z1=()=>p.useContext(CD),wD=p.createContext(void 0),ED=p.forwardRef((e,t)=>{let n=Gc(()=>{var P,W;return{search:"",value:(W=(P=e.value)!=null?P:e.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Gc(()=>new Set),s=Gc(()=>new Map),l=Gc(()=>new Map),c=Gc(()=>new Set),d=RD(e),{label:h,children:m,value:g,onValueChange:v,filter:x,shouldFilter:b,loop:w,disablePointerSelection:C=!1,vimBindings:E=!0,...R}=e,T=Nn(),j=Nn(),O=Nn(),D=p.useRef(null),_=nJ();Pl(()=>{if(g!==void 0){let P=g.trim();n.current.value=P,A.emit()}},[g]),Pl(()=>{_(6,re)},[]);let A=p.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,W,ae)=>{var fe,ge,ue,Ne;if(!Object.is(n.current[P],W)){if(n.current[P]=W,P==="search")K(),B(),_(1,G);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Re=document.getElementById(O);Re?Re.focus():(fe=document.getElementById(T))==null||fe.focus()}if(_(7,()=>{var Re;n.current.selectedItemId=(Re=H())==null?void 0:Re.id,A.emit()}),ae||_(5,re),((ge=d.current)==null?void 0:ge.value)!==void 0){let Re=W??"";(Ne=(ue=d.current).onValueChange)==null||Ne.call(ue,Re);return}}A.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),M=p.useMemo(()=>({value:(P,W,ae)=>{var fe;W!==((fe=l.current.get(P))==null?void 0:fe.value)&&(l.current.set(P,{value:W,keywords:ae}),n.current.filtered.items.set(P,U(W,ae)),_(2,()=>{B(),A.emit()}))},item:(P,W)=>(r.current.add(P),W&&(s.current.has(W)?s.current.get(W).add(P):s.current.set(W,new Set([P]))),_(3,()=>{K(),B(),n.current.value||G(),A.emit()}),()=>{l.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let ae=H();_(4,()=>{K(),(ae==null?void 0:ae.getAttribute("id"))===P&&G(),A.emit()})}),group:P=>(s.current.has(P)||s.current.set(P,new Set),()=>{l.current.delete(P),s.current.delete(P)}),filter:()=>d.current.shouldFilter,label:h||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:O,labelId:j,listInnerRef:D}),[]);function U(P,W){var ae,fe;let ge=(fe=(ae=d.current)==null?void 0:ae.filter)!=null?fe:GX;return P?ge(P,n.current.search,W):0}function B(){if(!n.current.search||d.current.shouldFilter===!1)return;let P=n.current.filtered.items,W=[];n.current.filtered.groups.forEach(fe=>{let ge=s.current.get(fe),ue=0;ge.forEach(Ne=>{let Re=P.get(Ne);ue=Math.max(Re,ue)}),W.push([fe,ue])});let ae=D.current;$().sort((fe,ge)=>{var ue,Ne;let Re=fe.getAttribute("id"),xe=ge.getAttribute("id");return((ue=P.get(xe))!=null?ue:0)-((Ne=P.get(Re))!=null?Ne:0)}).forEach(fe=>{let ge=fe.closest(qx);ge?ge.appendChild(fe.parentElement===ge?fe:fe.closest(`${qx} > *`)):ae.appendChild(fe.parentElement===ae?fe:fe.closest(`${qx} > *`))}),W.sort((fe,ge)=>ge[1]-fe[1]).forEach(fe=>{var ge;let ue=(ge=D.current)==null?void 0:ge.querySelector(`${Id}[${Bc}="${encodeURIComponent(fe[0])}"]`);ue==null||ue.parentElement.appendChild(ue)})}function G(){let P=$().find(ae=>ae.getAttribute("aria-disabled")!=="true"),W=P==null?void 0:P.getAttribute(Bc);A.setState("value",W||void 0)}function K(){var P,W,ae,fe;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ge=0;for(let ue of r.current){let Ne=(W=(P=l.current.get(ue))==null?void 0:P.value)!=null?W:"",Re=(fe=(ae=l.current.get(ue))==null?void 0:ae.keywords)!=null?fe:[],xe=U(Ne,Re);n.current.filtered.items.set(ue,xe),xe>0&&ge++}for(let[ue,Ne]of s.current)for(let Re of Ne)if(n.current.filtered.items.get(Re)>0){n.current.filtered.groups.add(ue);break}n.current.filtered.count=ge}function re(){var P,W,ae;let fe=H();fe&&(((P=fe.parentElement)==null?void 0:P.firstChild)===fe&&((ae=(W=fe.closest(Id))==null?void 0:W.querySelector(BX))==null||ae.scrollIntoView({block:"nearest"})),fe.scrollIntoView({block:"nearest"}))}function H(){var P;return(P=D.current)==null?void 0:P.querySelector(`${bD}[aria-selected="true"]`)}function $(){var P;return Array.from(((P=D.current)==null?void 0:P.querySelectorAll(FT))||[])}function I(P){let W=$()[P];W&&A.setState("value",W.getAttribute(Bc))}function Y(P){var W;let ae=H(),fe=$(),ge=fe.findIndex(Ne=>Ne===ae),ue=fe[ge+P];(W=d.current)!=null&&W.loop&&(ue=ge+P<0?fe[fe.length-1]:ge+P===fe.length?fe[0]:fe[ge+P]),ue&&A.setState("value",ue.getAttribute(Bc))}function Z(P){let W=H(),ae=W==null?void 0:W.closest(Id),fe;for(;ae&&!fe;)ae=P>0?eJ(ae,Id):tJ(ae,Id),fe=ae==null?void 0:ae.querySelector(FT);fe?A.setState("value",fe.getAttribute(Bc)):Y(P)}let ie=()=>I($().length-1),be=P=>{P.preventDefault(),P.metaKey?ie():P.altKey?Z(1):Y(1)},L=P=>{P.preventDefault(),P.metaKey?I(0):P.altKey?Z(-1):Y(-1)};return p.createElement(Ke.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:P=>{var W;(W=R.onKeyDown)==null||W.call(R,P);let ae=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||ae))switch(P.key){case"n":case"j":{E&&P.ctrlKey&&be(P);break}case"ArrowDown":{be(P);break}case"p":case"k":{E&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),I(0);break}case"End":{P.preventDefault(),ie();break}case"Enter":{P.preventDefault();let fe=H();if(fe){let ge=new Event(W0);fe.dispatchEvent(ge)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:aJ},h),Og(e,P=>p.createElement(CD.Provider,{value:A},p.createElement(SD.Provider,{value:M},P))))}),qX=p.forwardRef((e,t)=>{var n,r;let s=Nn(),l=p.useRef(null),c=p.useContext(wD),d=Kf(),h=RD(e),m=(r=(n=h.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Pl(()=>{if(!m)return d.item(s,c==null?void 0:c.id)},[m]);let g=TD(s,l,[e.value,e.children,l],e.keywords),v=Z1(),x=Ai(_=>_.value&&_.value===g.current),b=Ai(_=>m||d.filter()===!1?!0:_.search?_.filtered.items.get(s)>0:!0);p.useEffect(()=>{let _=l.current;if(!(!_||e.disabled))return _.addEventListener(W0,w),()=>_.removeEventListener(W0,w)},[b,e.onSelect,e.disabled]);function w(){var _,A;C(),(A=(_=h.current).onSelect)==null||A.call(_,g.current)}function C(){v.setState("value",g.current,!0)}if(!b)return null;let{disabled:E,value:R,onSelect:T,forceMount:j,keywords:O,...D}=e;return p.createElement(Ke.div,{ref:No(l,t),...D,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!x,"data-disabled":!!E,"data-selected":!!x,onPointerMove:E||d.getDisablePointerSelection()?void 0:C,onClick:E?void 0:w},e.children)}),ZX=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...l}=e,c=Nn(),d=p.useRef(null),h=p.useRef(null),m=Nn(),g=Kf(),v=Ai(b=>s||g.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Pl(()=>g.group(c),[]),TD(c,d,[e.value,e.heading,h]);let x=p.useMemo(()=>({id:c,forceMount:s}),[s]);return p.createElement(Ke.div,{ref:No(d,t),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},n&&p.createElement("div",{ref:h,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Og(e,b=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},p.createElement(wD.Provider,{value:x},b))))}),KX=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=p.useRef(null),l=Ai(c=>!c.search);return!n&&!l?null:p.createElement(Ke.div,{ref:No(s,t),...r,"cmdk-separator":"",role:"separator"})}),YX=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,l=Z1(),c=Ai(m=>m.search),d=Ai(m=>m.selectedItemId),h=Kf();return p.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),p.createElement(Ke.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":h.listId,"aria-labelledby":h.labelId,"aria-activedescendant":d,id:h.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||l.setState("search",m.target.value),n==null||n(m.target.value)}})}),WX=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,l=p.useRef(null),c=p.useRef(null),d=Ai(m=>m.selectedItemId),h=Kf();return p.useEffect(()=>{if(c.current&&l.current){let m=c.current,g=l.current,v,x=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let b=m.offsetHeight;g.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(v),x.unobserve(m)}}},[]),p.createElement(Ke.div,{ref:No(l,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:h.listId},Og(e,m=>p.createElement("div",{ref:No(c,h.listInnerRef),"cmdk-list-sizer":""},m)))}),QX=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:l,container:c,...d}=e;return p.createElement(Yp,{open:n,onOpenChange:r},p.createElement(Wp,{container:c},p.createElement(Qp,{"cmdk-overlay":"",className:s}),p.createElement(Xp,{"aria-label":e.label,"cmdk-dialog":"",className:l},p.createElement(ED,{ref:t,...d}))))}),XX=p.forwardRef((e,t)=>Ai(n=>n.filtered.count===0)?p.createElement(Ke.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),JX=p.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...l}=e;return p.createElement(Ke.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Og(e,c=>p.createElement("div",{"aria-hidden":!0},c)))}),Mu=Object.assign(ED,{List:WX,Item:qX,Input:YX,Group:ZX,Separator:KX,Dialog:QX,Empty:XX,Loading:JX});function eJ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function tJ(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function RD(e){let t=p.useRef(e);return Pl(()=>{t.current=e}),t}var Pl=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Gc(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Ai(e){let t=Z1(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function TD(e,t,n,r=[]){let s=p.useRef(),l=Kf();return Pl(()=>{var c;let d=(()=>{var m;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(m=g.current.textContent)==null?void 0:m.trim():s.current}})(),h=r.map(m=>m.trim());l.value(e,d,h),(c=t.current)==null||c.setAttribute(Bc,d),s.current=d}),s}var nJ=()=>{let[e,t]=p.useState(),n=Gc(()=>new Map);return Pl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function rJ(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Og({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(rJ(t),{ref:t.ref},n(t.props.children)):n(t)}var aJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function jD({className:e,...t}){return o.jsx(Mu,{"data-slot":"command",className:J("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function _D({className:e,...t}){return o.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[o.jsx(Fl,{className:"size-4 shrink-0 opacity-50"}),o.jsx(Mu.Input,{"data-slot":"command-input",className:J("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function sJ({className:e,...t}){return o.jsx(Mu.List,{"data-slot":"command-list",className:J("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function ND({...e}){return o.jsx(Mu.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function AD({className:e,...t}){return o.jsx(Mu.Group,{"data-slot":"command-group",className:J("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function DD({className:e,...t}){return o.jsx(Mu.Item,{"data-slot":"command-item",className:J("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Mg="Popover",[OD]=kr(Mg,[Gs]),Yf=Gs(),[oJ,Zi]=OD(Mg),MD=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!1}=e,d=Yf(t),h=p.useRef(null),[m,g]=p.useState(!1),[v,x]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:Mg});return o.jsx(Su,{...d,children:o.jsx(oJ,{scope:t,contentId:Nn(),triggerRef:h,open:v,onOpenChange:x,onOpenToggle:p.useCallback(()=>x(b=>!b),[x]),hasCustomAnchor:m,onCustomAnchorAdd:p.useCallback(()=>g(!0),[]),onCustomAnchorRemove:p.useCallback(()=>g(!1),[]),modal:c,children:n})})};MD.displayName=Mg;var kD="PopoverAnchor",iJ=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Zi(kD,n),l=Yf(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=s;return p.useEffect(()=>(c(),()=>d()),[c,d]),o.jsx(Cu,{...l,...r,ref:t})});iJ.displayName=kD;var ID="PopoverTrigger",LD=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Zi(ID,n),l=Yf(n),c=vt(t,s.triggerRef),d=o.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":VD(s.open),...r,ref:c,onClick:Te(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?d:o.jsx(Cu,{asChild:!0,...l,children:d})});LD.displayName=ID;var K1="PopoverPortal",[lJ,cJ]=OD(K1,{forceMount:void 0}),PD=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=Zi(K1,t);return o.jsx(lJ,{scope:t,forceMount:n,children:o.jsx(Sr,{present:n||l.open,children:o.jsx(Vl,{asChild:!0,container:s,children:r})})})};PD.displayName=K1;var mu="PopoverContent",UD=p.forwardRef((e,t)=>{const n=cJ(mu,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=Zi(mu,e.__scopePopover);return o.jsx(Sr,{present:r||l.open,children:l.modal?o.jsx(dJ,{...s,ref:t}):o.jsx(fJ,{...s,ref:t})})});UD.displayName=mu;var uJ=Ri("PopoverContent.RemoveScroll"),dJ=p.forwardRef((e,t)=>{const n=Zi(mu,e.__scopePopover),r=p.useRef(null),s=vt(t,r),l=p.useRef(!1);return p.useEffect(()=>{const c=r.current;if(c)return Zp(c)},[]),o.jsx(Ef,{as:uJ,allowPinchZoom:!0,children:o.jsx(FD,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),l.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,m=d.button===2||h;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),fJ=p.forwardRef((e,t)=>{const n=Zi(mu,e.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(FD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,m;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),FD=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,...v}=e,x=Zi(mu,n),b=Yf(n);return Gp(),o.jsx(wf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx(zl,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(Tf,{"data-state":VD(x.open),role:"dialog",id:x.contentId,...b,...v,ref:t,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),zD="PopoverClose",hJ=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Zi(zD,n);return o.jsx(Ke.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>s.onOpenChange(!1))})});hJ.displayName=zD;var mJ="PopoverArrow",pJ=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Yf(n);return o.jsx(jf,{...s,...r,ref:t})});pJ.displayName=mJ;function VD(e){return e?"open":"closed"}var gJ=MD,vJ=LD,yJ=PD,xJ=UD;function Y1({...e}){return o.jsx(gJ,{"data-slot":"popover",...e})}function W1({...e}){return o.jsx(vJ,{"data-slot":"popover-trigger",...e})}function Q1({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(yJ,{children:o.jsx(xJ,{"data-slot":"popover-content",align:t,sideOffset:n,className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function X1({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:l,disabled:c=!1}){const[d,h]=p.useState(!1),[m,g]=p.useState(""),v=p.useMemo(()=>{const w={};return e.forEach(C=>{const E=C.group??"";Object.prototype.hasOwnProperty.call(w,E)||(w[E]=[]),w[E].push(C)}),w},[e]),x=e.find(w=>w.value===t),b=p.useCallback(w=>{n(w),requestAnimationFrame(()=>{g(""),h(!1)})},[n]);return o.jsxs(Y1,{open:d,onOpenChange:h,modal:!0,children:[o.jsx(W1,{asChild:!0,children:o.jsxs(Ce,{variant:"outline",role:"combobox","aria-expanded":d,className:J("w-full justify-between",!t&&"text-muted-foreground",l),disabled:c,children:[x?x.label:r,o.jsx(Sb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(Q1,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:o.jsxs(jD,{children:[o.jsx(_D,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:g}),o.jsx(ND,{children:s}),Object.entries(v).map(([w,C])=>o.jsx(AD,{heading:w,children:C.map(E=>o.jsxs(DD,{value:E.value,onSelect:()=>{b(E.value)},keywords:[E.label],children:[o.jsx(dr,{className:J("mr-2 h-4 w-4",t===E.value?"opacity-100":"opacity-0")}),E.label]},E.value))},w||"default"))]})})]})}var kg="Collapsible",[bJ,HD]=kr(kg),[SJ,J1]=bJ(kg),$D=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:l,onOpenChange:c,...d}=e,[h,m]=zr({prop:r,defaultProp:s??!1,onChange:c,caller:kg});return o.jsx(SJ,{scope:n,disabled:l,contentId:Nn(),open:h,onOpenToggle:p.useCallback(()=>m(g=>!g),[m]),children:o.jsx(Ke.div,{"data-state":rS(h),"data-disabled":l?"":void 0,...d,ref:t})})});$D.displayName=kg;var BD="CollapsibleTrigger",eS=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=J1(BD,n);return o.jsx(Ke.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":rS(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Te(e.onClick,s.onOpenToggle)})});eS.displayName=BD;var tS="CollapsibleContent",nS=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=J1(tS,e.__scopeCollapsible);return o.jsx(Sr,{present:n||s.open,children:({present:l})=>o.jsx(CJ,{...r,ref:t,present:l})})});nS.displayName=tS;var CJ=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...l}=e,c=J1(tS,n),[d,h]=p.useState(r),m=p.useRef(null),g=vt(t,m),v=p.useRef(0),x=v.current,b=p.useRef(0),w=b.current,C=c.open||d,E=p.useRef(C),R=p.useRef(void 0);return p.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),br(()=>{const T=m.current;if(T){R.current=R.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const j=T.getBoundingClientRect();v.current=j.height,b.current=j.width,E.current||(T.style.transitionDuration=R.current.transitionDuration,T.style.animationName=R.current.animationName),h(r)}},[c.open,r]),o.jsx(Ke.div,{"data-state":rS(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!C,...l,ref:g,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:C&&s})});function rS(e){return e?"open":"closed"}var GD=$D,wJ=eS,EJ=nS,xs="Accordion",RJ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[aS,TJ,jJ]=og(xs),[Ig]=kr(xs,[jJ,HD]),sS=HD(),qD=je.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,l=r;return o.jsx(aS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(DJ,{...l,ref:t}):o.jsx(AJ,{...s,ref:t})})});qD.displayName=xs;var[ZD,_J]=Ig(xs),[KD,NJ]=Ig(xs,{collapsible:!1}),AJ=je.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:l=!1,...c}=e,[d,h]=zr({prop:n,defaultProp:r??"",onChange:s,caller:xs});return o.jsx(ZD,{scope:e.__scopeAccordion,value:je.useMemo(()=>d?[d]:[],[d]),onItemOpen:h,onItemClose:je.useCallback(()=>l&&h(""),[l,h]),children:o.jsx(KD,{scope:e.__scopeAccordion,collapsible:l,children:o.jsx(YD,{...c,ref:t})})})}),DJ=je.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...l}=e,[c,d]=zr({prop:n,defaultProp:r??[],onChange:s,caller:xs}),h=je.useCallback(g=>d((v=[])=>[...v,g]),[d]),m=je.useCallback(g=>d((v=[])=>v.filter(x=>x!==g)),[d]);return o.jsx(ZD,{scope:e.__scopeAccordion,value:c,onItemOpen:h,onItemClose:m,children:o.jsx(KD,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(YD,{...l,ref:t})})})}),[OJ,Lg]=Ig(xs),YD=je.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:l="vertical",...c}=e,d=je.useRef(null),h=vt(d,t),m=TJ(n),v=Af(s)==="ltr",x=Te(e.onKeyDown,b=>{var M;if(!RJ.includes(b.key))return;const w=b.target,C=m().filter(U=>{var B;return!((B=U.ref.current)!=null&&B.disabled)}),E=C.findIndex(U=>U.ref.current===w),R=C.length;if(E===-1)return;b.preventDefault();let T=E;const j=0,O=R-1,D=()=>{T=E+1,T>O&&(T=j)},_=()=>{T=E-1,T<j&&(T=O)};switch(b.key){case"Home":T=j;break;case"End":T=O;break;case"ArrowRight":l==="horizontal"&&(v?D():_());break;case"ArrowDown":l==="vertical"&&D();break;case"ArrowLeft":l==="horizontal"&&(v?_():D());break;case"ArrowUp":l==="vertical"&&_();break}const A=T%R;(M=C[A].ref.current)==null||M.focus()});return o.jsx(OJ,{scope:n,disabled:r,direction:s,orientation:l,children:o.jsx(aS.Slot,{scope:n,children:o.jsx(Ke.div,{...c,"data-orientation":l,ref:h,onKeyDown:r?void 0:x})})})}),Op="AccordionItem",[MJ,oS]=Ig(Op),WD=je.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,l=Lg(Op,n),c=_J(Op,n),d=sS(n),h=Nn(),m=r&&c.value.includes(r)||!1,g=l.disabled||e.disabled;return o.jsx(MJ,{scope:n,open:m,disabled:g,triggerId:h,children:o.jsx(GD,{"data-orientation":l.orientation,"data-state":nO(m),...d,...s,ref:t,disabled:g,open:m,onOpenChange:v=>{v?c.onItemOpen(r):c.onItemClose(r)}})})});WD.displayName=Op;var QD="AccordionHeader",XD=je.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Lg(xs,n),l=oS(QD,n);return o.jsx(Ke.h3,{"data-orientation":s.orientation,"data-state":nO(l.open),"data-disabled":l.disabled?"":void 0,...r,ref:t})});XD.displayName=QD;var Q0="AccordionTrigger",JD=je.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Lg(xs,n),l=oS(Q0,n),c=NJ(Q0,n),d=sS(n);return o.jsx(aS.ItemSlot,{scope:n,children:o.jsx(wJ,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:l.triggerId,...d,...r,ref:t})})});JD.displayName=Q0;var eO="AccordionContent",tO=je.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Lg(xs,n),l=oS(eO,n),c=sS(n);return o.jsx(EJ,{role:"region","aria-labelledby":l.triggerId,"data-orientation":s.orientation,...c,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});tO.displayName=eO;function nO(e){return e?"open":"closed"}var kJ=qD,IJ=WD,LJ=XD,PJ=JD,UJ=tO;const iS={default:{itemClass:"border-b last:border-b-0",triggerClass:"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",icon:null,chevronClass:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",contentInnerClass:"pt-0 pb-4",headerClass:"flex"},common:{itemClass:"overflow-hidden",triggerClass:"group focus-visible:ring-primary hover:bg-muted [&[data-state=open]]:bg-muted flex items-center gap-1 rounded-sm px-2 py-1 transition-all outline-none focus-visible:ring-2 [&[data-state=open]]:rounded-br-none [&[data-state=open]]:rounded-bl-none [&[data-state=open]]:font-semibold",icon:o.jsx(W9,{className:"size-4 shrink-0","aria-hidden":"true"}),chevronClass:"size-3.5 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down bg-muted overflow-hidden rounded-sm rounded-tl-none py-0 pr-2 pl-7 text-sm",contentInnerClass:"pt-2 pb-4",headerClass:void 0}},rO=p.createContext("default");function hr({variant:e="default",...t}){return o.jsx(rO.Provider,{value:e,children:o.jsx(kJ,{"data-slot":"accordion",...t})})}function lS(e){const t=p.useContext(rO);return e??t??"default"}function Kn({className:e,variant:t,...n}){const r=lS(t),{itemClass:s}=iS[r];return o.jsx(IJ,{"data-slot":"accordion-item",className:J(s,e),...n})}function Yn({className:e,children:t,variant:n,...r}){const s=lS(n),{triggerClass:l,icon:c,chevronClass:d,headerClass:h}=iS[s];return o.jsx(LJ,{className:h,children:o.jsxs(PJ,{"data-slot":"accordion-trigger",className:J(l,e),...r,children:[c,t,o.jsx(Za,{className:d,"aria-hidden":"true"})]})})}function Wn({className:e,children:t,variant:n,...r}){const s=lS(n),{contentClass:l,contentInnerClass:c}=iS[s];return o.jsx(UJ,{"data-slot":"accordion-content",className:J(l,e),...r,children:o.jsx("div",{className:c,children:t})})}function fr({href:e,children:t,className:n,...r}){return o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:J("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,o.jsx(Tl,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function FJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"service-account-details",children:[o.jsx(Yn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(fr,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Assign the ",o.jsx("strong",{children:"bigquery.dataEditor"})," and ",o.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function zJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"project-id-details",children:[o.jsx(Yn,{children:"How do I find my Project ID?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(fr,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),o.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),o.jsxs("li",{children:["Find your project in the list. The ",o.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),o.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function VJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"gbq-location-details",children:[o.jsx(Yn,{children:"How do I find my dataset location?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"BigQuery data is stored in specific regions. To avoid query errors, your SQL queries must process data stored in the same location."}),o.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(fr,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),o.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),o.jsxs("li",{children:["Click each dataset name to open its details. The ",o.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",o.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),o.jsx("li",{children:"Make sure all your datasets are stored in the same location. If they are in different locations, select the location where most of your data is stored or create separate Storage for each location."}),o.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const aO=e=>{try{const t=JSON.parse(e),{project_id:n,client_id:r,client_email:s}=t;return!n||!r||!s?null:{url:`https://console.cloud.google.com/iam-admin/serviceaccounts/details/${r}?project=${n}`,email:s}}catch{return null}},HJ=({form:e})=>{const[t,n]=p.useState(!1);if(e.watch("type")!==Pe.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?aO(l):null;return o.jsxs(o.Fragment,{children:[o.jsxs(Vs,{title:"Connection Settings",children:[o.jsx(Qt,{control:e.control,name:"config.projectId",render:({field:d})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),o.jsx(en,{children:o.jsx($t,{...d,placeholder:"Enter a Project Id"})}),o.jsx(ar,{children:o.jsx(zJ,{})}),o.jsx(ln,{})]})}),o.jsx(Qt,{control:e.control,name:"config.location",render:({field:d})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),o.jsx(en,{children:o.jsx(X1,{options:aq,value:d.value,onValueChange:d.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),o.jsx(ar,{children:o.jsx(VJ,{})}),o.jsx(ln,{})]})})]}),o.jsx(Vs,{title:"Authentication",children:o.jsx(Qt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Xt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Jt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&l&&o.jsx(Ce,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(Ce,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(en,{children:!t&&c?o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(fr,{href:c.url,children:c.email})}),o.jsx(_t,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(Fi,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(ar,{children:o.jsx(FJ,{})}),o.jsx(ln,{})]})})})]})};function $J(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"athena-region-details",children:[o.jsx(Yn,{children:"How do I find my Athena region?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"Athena queries run in a specific AWS region. You must select the region where your Athena service and data are located."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(fr,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),o.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),o.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function BJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"athena-output-bucket-details",children:[o.jsx(Yn,{children:"How do I find a bucket?"}),o.jsxs(Wn,{children:[o.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",o.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(fr,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),o.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),o.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),o.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function GJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"athena-access-key-id-details",children:[o.jsx(Yn,{children:"How do I get my AWS Access Key ID?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"Before accessing your AWS Access Key ID, make sure you have a user with the necessary permissions to use Athena and Glue in your AWS account."}),o.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",o.jsx(fr,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/?utm_source=owox_data_marts&utm_medium=storage_enity&utm_campaign=tooltip_aws",children:"in documentation"}),"."]}),o.jsx(d_,{className:"my-4"}),o.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(fr,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),o.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function qJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"athena-secret-access-key-details",children:[o.jsx(Yn,{children:"How do I get my AWS Secret Access Key?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"The Secret Access Key is part of your AWS credentials needed to connect and authenticate. It is only shown when you create a new key."}),o.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(fr,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),o.jsx("li",{children:"When you create a new key, copy and securely store the Secret Access Key — you won't be able to see it again."})]})]})]})})}const ZJ=({form:e})=>{const[t,n]=p.useState("");return p.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const s="_".repeat(r.length);n(s),e.setValue("credentials.secretAccessKey",s,{shouldDirty:!1})}},[e]),e.watch("type")!==Pe.AWS_ATHENA?null:o.jsxs(o.Fragment,{children:[o.jsxs(Vs,{title:"Connection Settings",children:[o.jsx(Qt,{control:e.control,name:"config.region",render:({field:r})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),o.jsx(en,{children:o.jsx($t,{...r,placeholder:"Enter a region"})}),o.jsx(ar,{children:o.jsx($J,{})}),o.jsx(ln,{})]})}),o.jsx(Qt,{control:e.control,name:"config.outputBucket",render:({field:r})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),o.jsx(en,{children:o.jsx($t,{...r,placeholder:"Enter an output bucket"})}),o.jsx(ar,{children:o.jsx(BJ,{})}),o.jsx(ln,{})]})})]}),o.jsxs(Vs,{title:"Authentication",children:[o.jsx(Qt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),o.jsx(en,{children:o.jsx($t,{...r,placeholder:"Enter an access key id"})}),o.jsx(ar,{children:o.jsx(GJ,{})}),o.jsx(ln,{})]})}),o.jsx(Qt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),o.jsx(en,{children:o.jsx($t,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),o.jsx(ar,{children:o.jsx(qJ,{})}),o.jsx(ln,{})]})})]})]})};function KJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"bigquery-api-details",children:[o.jsx(Yn,{children:"How do I enable the BigQuery API?"}),o.jsxs(Wn,{children:[o.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",o.jsx(fr,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function YJ(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"athena-api-details",children:[o.jsx(Yn,{children:"How do I activate Athena API?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"AWS Athena is a serverless interactive query service. To use it, you need to activate Athena in your AWS account."}),o.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(fr,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),o.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),o.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function sO(e){return JSON.parse(JSON.stringify(e))}function WJ({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=$i({resolver:Wl(wq),defaultValues:e}),{watch:l,control:c,formState:{isDirty:d,isSubmitting:h}}=s,m=l("type");je.useEffect(()=>{r==null||r(d)},[d,r]);const g=async v=>{const{dirtyFields:x}=s.formState,b=sO(v);return x.credentials||delete b.credentials,t(b)};return o.jsx(Zl,{...s,children:o.jsxs(Bi,{onSubmit:v=>{s.handleSubmit(g)(v)},noValidate:!0,children:[o.jsxs(Kl,{children:[o.jsxs(Vs,{title:"General",children:[o.jsx(Qt,{control:c,name:"title",render:({field:v})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),o.jsx(en,{children:o.jsx($t,{...v,placeholder:"Storage title"})}),o.jsx(ln,{})]})}),o.jsx(Qt,{control:c,name:"type",render:({field:v})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),o.jsx(en,{children:o.jsxs(Sa,{value:v.value,onValueChange:v.onChange,disabled:!!e,children:[o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{placeholder:"Select a storage type"})}),o.jsx(Ea,{children:o.jsx(Ng,{children:Vi.getAllTypes().map(({type:x,displayName:b,icon:w,status:C})=>o.jsx(qn,{value:x,disabled:C===bo.COMING_SOON,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(w,{size:20}),b]})},x))})})]})}),o.jsxs(ar,{children:[m===Pe.GOOGLE_BIGQUERY&&o.jsx(KJ,{}),m===Pe.AWS_ATHENA&&o.jsx(YJ,{})]}),o.jsx(ln,{})]})})]}),m===Pe.GOOGLE_BIGQUERY&&o.jsx(HJ,{form:s}),m===Pe.AWS_ATHENA&&o.jsx(ZJ,{form:s})]}),o.jsxs(Yl,{children:[o.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!d||h,children:"Save"}),o.jsx(Ce,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function oO({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=Ag(),[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(w=>{h(w)},[]),x=async w=>{if(n){const C=await s(n.id,w);C&&(r(C),t())}},b=p.useRef(!1);return p.useEffect(()=>{const w=n?"Edit":"Create";e&&!b.current?(Fe({event:"data_storage_config_open",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!0):!e&&b.current&&(Fe({event:"data_storage_config_close",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!1)},[e,n]),o.jsxs(o.Fragment,{children:[o.jsx(Mi,{open:e,onOpenChange:w=>{w||m()},children:o.jsxs(ki,{children:[o.jsxs(Ii,{children:[o.jsx(Li,{children:"Configure Storage Provider"}),o.jsx(Hl,{children:"Customize settings for your storage provider"})]}),o.jsx(WJ,{initialData:n??void 0,onSubmit:x,onCancel:m,onDirtyChange:v})]})}),o.jsx(xa,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const QJ=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=p.useState(!1),s=Vi.getInfo(e.type),l=()=>{r(!0)},c=()=>{r(!1)},d=()=>{if(!p4(e))return o.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[o.jsx(Bp,{className:"h-4 w-4 text-red-500"}),o.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(v,x)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),g=(v,x,b)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx(fr,{href:b,onClick:w=>{w.stopPropagation()},children:x})]});switch(e.type){case Pe.GOOGLE_BIGQUERY:{const v=e.config.projectId,x=e.config.location,b=`https://console.cloud.google.com/bigquery?project=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",v,b),o.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",x)]})}case Pe.AWS_ATHENA:{const v=e.config.region,x=e.config.outputBucket,b=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",v),o.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",x,b)]})}default:return"Unknown storage type configuration"}};return o.jsxs(o.Fragment,{children:[o.jsx(K0,{title:e.title,icon:s.icon,subtitle:d(),onClick:l}),o.jsx(G1,{children:o.jsx(oO,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:h=>{t&&t(h)}})})]})};function XJ({initialType:e,onTypeSelect:t}){var c;const[n,r]=p.useState(e??null);p.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const s=d=>{r(d),t(d)},l=[{type:qe.SQL,label:"SQL",description:"SQL query"},{type:qe.TABLE,label:"Table",description:"Existing table"},{type:qe.VIEW,label:"View",description:"Existing view"},{type:qe.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:qe.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return o.jsxs("div",{className:"dm-card-block",children:[o.jsx(ba,{className:"text-foreground",children:"Definition Type"}),o.jsxs(Sa,{value:n??"",onValueChange:d=>{s(d)},children:[o.jsx(wa,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:o.jsx(Ca,{placeholder:"Select definition type",children:n&&((c=l.find(d=>d.type===n))==null?void 0:c.label)})}),o.jsx(Ea,{children:o.jsx(Ng,{children:l.map(d=>o.jsxs(qn,{value:d.type,children:[d.label,o.jsx("span",{className:"text-muted-foreground/80 ml-2",children:d.description})]},d.type))})})]})]})}const JJ=sn({definitionType:qs(qe.SQL),definition:sn({sqlQuery:on().min(1,"SQL query is required")})}),eee=e=>{const t=I4(e);return sn({definitionType:qs(qe.TABLE),definition:t})},tee=e=>{const t=I4(e);return sn({definitionType:qs(qe.VIEW),definition:t})},nee=e=>{const t=LZ(e);return sn({definitionType:qs(qe.TABLE_PATTERN),definition:t})},ree=sn({definitionType:qs(qe.CONNECTOR),definition:sn({connector:sn({source:sn({name:on().min(1,"Connector name is required"),configuration:tT(vB(pB())).min(1,"At least one configuration is required"),node:on().min(1,"Node is required"),fields:tT(on()).min(1,"At least one field is required")}),storage:sn({fullyQualifiedName:on().min(1,"fully qualified name is required")})})})}),aee=(e,t)=>{if(!e)return sn({definitionType:yB(c1(qe)),definition:sn({}).optional()});switch(e){case qe.SQL:return JJ;case qe.TABLE:return eee(t);case qe.VIEW:return tee(t);case qe.TABLE_PATTERN:return nee(t);case qe.CONNECTOR:return ree;default:return sn({})}};function see({control:e}){return o.jsx(Qt,{control:e,name:"definition.sqlQuery",render:({field:t})=>o.jsxs(Xt,{className:"dm-card-block",children:[o.jsx(Jt,{className:"text-foreground",children:"SQL Query"}),o.jsx(en,{children:o.jsx(kX,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),o.jsx(ln,{})]})})}function oee({control:e,storageType:t}){const n=v4(t),r=y4(t);return o.jsx(Qt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Xt,{className:"dm-card-block",children:[o.jsx(Jt,{children:"Fully Qualified Table Name"}),o.jsx(en,{children:o.jsx($t,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(ar,{className:"text-muted-foreground/75",children:r}),o.jsx(ln,{})]})})}function iee({control:e,storageType:t}){const n=v4(t),r=y4(t);return o.jsx(Qt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(Xt,{className:"dm-card-block",children:[o.jsx(Jt,{children:"Fully Qualified View Name"}),o.jsx(en,{children:o.jsx($t,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(ar,{className:"text-muted-foreground/75",children:r}),o.jsx(ln,{})]})})}function lee({control:e,storageType:t}){const n=_q(t),r=Nq(t);return o.jsx(Qt,{control:e,name:"definition.pattern",render:({field:s})=>o.jsxs(Xt,{className:"dm-card-block",children:[o.jsx(Jt,{children:"Table Pattern"}),o.jsx(en,{children:o.jsx($t,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(ar,{className:"text-muted-foreground/75",children:r}),o.jsx(ln,{})]})})}const X0=e=>{switch(e){case qe.SQL:return{sqlQuery:""};case qe.TABLE:return{fullyQualifiedName:""};case qe.VIEW:return{fullyQualifiedName:""};case qe.TABLE_PATTERN:return{pattern:""};case qe.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},cee=bf("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function cS({className:e,variant:t,...n}){return o.jsx("div",{"data-slot":"alert",role:"alert",className:J(cee({variant:t}),e),...n})}function iO({className:e,...t}){return o.jsx("div",{"data-slot":"alert-title",className:J("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function uS({className:e,...t}){return o.jsx("div",{"data-slot":"alert-description",className:J("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var Pg="Tabs",[uee]=kr(Pg,[ig]),lO=ig(),[dee,dS]=uee(Pg),cO=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:h="automatic",...m}=e,g=Af(d),[v,x]=zr({prop:r,onChange:s,defaultProp:l??"",caller:Pg});return o.jsx(dee,{scope:n,baseId:Nn(),value:v,onValueChange:x,orientation:c,dir:g,activationMode:h,children:o.jsx(Ke.div,{dir:g,"data-orientation":c,...m,ref:t})})});cO.displayName=Pg;var uO="TabsList",dO=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,l=dS(uO,n),c=lO(n);return o.jsx(EN,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:o.jsx(Ke.div,{role:"tablist","aria-orientation":l.orientation,...s,ref:t})})});dO.displayName=uO;var fO="TabsTrigger",hO=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...l}=e,c=dS(fO,n),d=lO(n),h=gO(c.baseId,r),m=vO(c.baseId,r),g=r===c.value;return o.jsx(RN,{asChild:!0,...d,focusable:!s,active:g,children:o.jsx(Ke.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:h,...l,ref:t,onMouseDown:Te(e.onMouseDown,v=>{!s&&v.button===0&&v.ctrlKey===!1?c.onValueChange(r):v.preventDefault()}),onKeyDown:Te(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&c.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const v=c.activationMode!=="manual";!g&&!s&&v&&c.onValueChange(r)})})})});hO.displayName=fO;var mO="TabsContent",pO=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:l,...c}=e,d=dS(mO,n),h=gO(d.baseId,r),m=vO(d.baseId,r),g=r===d.value,v=p.useRef(g);return p.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),o.jsx(Sr,{present:s||g,children:({present:x})=>o.jsx(Ke.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":h,hidden:!x,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:v.current?"0s":void 0},children:x&&l})})});pO.displayName=mO;function gO(e,t){return`${e}-trigger-${t}`}function vO(e,t){return`${e}-content-${t}`}var fee=cO,hee=dO,mee=hO,pee=pO;function gee({className:e,...t}){return o.jsx(fee,{"data-slot":"tabs",className:J("flex flex-col gap-2",e),...t})}function vee({className:e,...t}){return o.jsx(hee,{"data-slot":"tabs-list",className:J("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function yee({className:e,...t}){return o.jsx(mee,{"data-slot":"tabs-trigger",className:J("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function xee({className:e,...t}){return o.jsx(pee,{"data-slot":"tabs-content",className:J("flex-1 outline-none",e),...t})}const bee=GD,See=eS,Cee=nS;function wee({children:e,className:t="",...n}){return o.jsx("div",{className:J("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function Eee({children:e,className:t="",...n}){return o.jsx("div",{className:J("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:o.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function Ree({children:e,className:t="",variant:n="horizontal",...r}){const s=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return o.jsx("div",{className:J(s,t),...r,children:e})}function $d({children:e,className:t="",...n}){return o.jsx("div",{"data-slot":"wizard-step-item",className:J("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",t),...n,children:e})}function Tee({label:e,children:t,className:n="",options:r,value:s,onValueChange:l,required:c=!1,tooltip:d,...h}){return o.jsx("div",{"data-slot":"wizard-step-item-one-of",className:J("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",n),...h,children:o.jsxs(gee,{value:s,onValueChange:l,children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx(wo,{required:c,tooltip:d,className:"w-full",children:e}),o.jsx(vee,{children:r.map(m=>o.jsx(yee,{value:m.value,children:m.label},m.value))})]}),t]})})}function jee({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,l]=p.useState(n);return o.jsxs(bee,{open:s,onOpenChange:l,"data-slot":"wizard-collapsible",className:J("group flex flex-col gap-2 py-3",r),children:[o.jsx(See,{asChild:!0,children:o.jsxs("button",{type:"button",className:J("flex cursor-pointer items-center gap-1"),children:[o.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx(Ra,{className:J("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),o.jsx(Cee,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:o.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function wo({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...l}){return o.jsxs(ba,{"data-slot":"wizard-step-label",className:J("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...l,children:[t?o.jsxs(Tt,{...r,children:[o.jsx(jt,{asChild:!0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[e,o.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),o.jsx(_t,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):o.jsx("span",{children:e}),n&&o.jsxs(Tt,{...r,children:[o.jsx(jt,{asChild:!0,children:o.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(_t,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function wl({title:e,children:t,className:n="",...r}){return o.jsxs("section",{"data-slot":"wizard-step-section",className:J("mb-8",n),...r,children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function Di({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:l,...c}){return s==="compact"?o.jsxs("div",{"data-slot":"wizard-step-hero",className:J("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",l),...c,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[e&&o.jsx("div",{children:e}),o.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&o.jsx(Ce,{variant:"outline",asChild:!0,children:o.jsxs(Ba,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(Tl,{className:"h-4 w-4"})]})})]}):o.jsxs("div",{"data-slot":"wizard-step-hero",className:J("mb-6 flex flex-col items-center justify-center text-center",l),...c,children:[e&&o.jsx("div",{className:"mt-6 mb-3",children:e}),o.jsx("h2",{className:"text-xl font-medium",children:t}),n&&o.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&o.jsx(Ce,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:o.jsxs(Ba,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(Tl,{className:"h-4 w-4"})]})})]})}function Ro({children:e,className:t="",...n}){return o.jsx("div",{"data-slot":"wizard-step",className:J("space-y-4",t),...n,children:e})}function _ee({children:e,className:t="",...n}){return o.jsx("div",{className:J("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function Nee({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:l,className:c="",...d}){return o.jsxs("div",{className:J("border-border flex items-center gap-4 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",r?"cursor-not-allowed opacity-50 hover:shadow-none":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",n&&!r?"ring-primary border-transparent ring-2 dark:bg-white/8":"",c),onClick:s,onDoubleClick:l,...d,children:[e&&o.jsx("span",{className:"shrink-0",children:e}),r?o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),o.jsx(_t,{side:"top",align:"center",children:"Coming soon"})]}):o.jsx("span",{className:"text-sm font-medium",children:t})]})}function yO({type:e,id:t,name:n,value:r,label:s,checked:l,selected:c=!1,disabled:d=!1,tooltip:h,rightIcon:m,onChange:g,className:v="",...x}){const b=C=>{g&&g(e==="checkbox"?C.target.checked:C.target.value)},w=p.useRef(null);return o.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:C=>{if(d)return;const E=C.target;E.tagName==="INPUT"||E.tagName==="LABEL"||E.closest("label")||w.current&&w.current.click()},className:J("group border-border flex items-center gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",d?"cursor-not-allowed":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",c?"ring-primary border-transparent ring-2 dark:bg-white/8":"",v),children:[o.jsx("input",{ref:w,id:t,type:e,name:n,value:r,checked:l,disabled:d,onChange:b,className:J("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"h-4 w-4":"h-8 w-full rounded-md border px-2"),...x}),s&&o.jsx(wo,{htmlFor:t,className:J("cursor-pointer",d&&"cursor-not-allowed"),children:s}),(h||m)&&o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[h&&o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(Fr,{className:"text-muted-foreground/75 pointer-events-none h-4 w-4 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100","data-tooltip-trigger":!0})}),o.jsx(_t,{side:"top",align:"center",children:h})]}),m&&o.jsx("div",{className:"flex items-center",children:m})]})]})}function fS({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),s=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return o.jsx("div",{"data-slot":"wizard-step-loading",className:J(s,n),children:Array.from({length:r}).map((l,c)=>o.jsx(as,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function Aee({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:l}){return n?o.jsx(fS,{variant:"grid"}):r?o.jsxs(cS,{variant:"destructive",children:[o.jsx(Sf,{className:"h-4 w-4"}),o.jsx(uS,{children:"Failed to load available connectors. Please try again."})]}):o.jsxs(Ro,{children:[o.jsx(wl,{title:"Choose Connector",children:o.jsx(_ee,{children:e.map(c=>o.jsx(Nee,{icon:c.logoBase64?o.jsx(Ff,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),l==null||l(c)}},c.name))})}),e.length===0&&o.jsx(Di,{icon:o.jsx(nf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function Dee({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:l,onBack:c,onFinish:d,nextLabel:h="Next",backLabel:m="Back",finishLabel:g="Finish"}){const v=e===t;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex-1",children:r&&o.jsxs(Ce,{variant:"outline",onClick:c,disabled:s,children:[o.jsx(JI,{className:"h-4 w-4"}),m]})}),o.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex flex-1 justify-end",children:v?o.jsx(Ce,{variant:"default",onClick:d,disabled:!n||s,children:g}):o.jsxs(Ce,{variant:"default",onClick:l,disabled:!n||s,children:[h,o.jsx(Ra,{className:"h-4 w-4"})]})})]})}function El({connector:e,size:t=24,variant:n="compact"}){return o.jsx(Di,{icon:o.jsx(Ff,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function nu({label:e}){return o.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:o.jsx(Ce,{variant:"outline",asChild:!0,children:o.jsxs(Ba,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",o.jsx(Tl,{className:"h-4 w-4"})]})})})}const J0="**********";function Oee({specification:e,configuration:t,onValueChange:n}){const{name:r,title:s}=e,l=s??r,c=r;return o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx($t,{type:"checkbox",id:c,name:r,checked:t[r]||!1,onChange:d=>{n(r,d.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),o.jsx(ba,{htmlFor:c,className:"cursor-pointer text-sm",children:o.jsx(wo,{htmlFor:c,required:e.required,tooltip:e.description,children:l})})]})}function Mee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,l=e.title??e.name;return o.jsx($t,{id:r,name:r,type:"number",value:t[r]||"",placeholder:s??`Enter ${l.toLowerCase()}`,onChange:c=>{const d=c.target.value,h=d===""?void 0:parseFloat(d);n(r,h)}})}function kee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:l}=e,c=e.title??e.name;return o.jsx(Fi,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
724
|
-
`):Array.isArray(l)?l.join(`
|
|
725
|
-
`):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:d=>{const h=d.target.value.split(`
|
|
726
|
-
`).filter(m=>m.trim());n(r,h)}})}function Iee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:l}=e,c=e.title??e.name,d=h=>{if(!h||typeof h!="string"&&typeof h!="number")return"";const m=typeof h=="string"?h:h.toString();try{const g=new Date(m);return isNaN(g.getTime())?"":g.toISOString().split("T")[0]}catch{return""}};return o.jsx($t,{id:r,name:r,type:"date",value:t[r]||d(l)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:h=>{n(r,h.target.value)}})}function Lee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,l=e.title??e.name;return o.jsx($t,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${l.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function Pee({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:l,default:c}=e;return o.jsx(Fi,{id:s,name:s,value:t[s]&&typeof t[s]=="object"?JSON.stringify(t[s],null,2):typeof c=="object"?JSON.stringify(c,null,2):"",placeholder:l??`Enter ${r.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:d=>{try{const h=JSON.parse(d.target.value);n(s,h)}catch{n(s,d.target.value)}}})}function Uee({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const l=e.title??e.name,c=r&&!s;return o.jsx($t,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?J0:t[e.name]||"",...c?{readOnly:!0,disabled:!0}:{},...c?{}:{placeholder:e.placeholder??`Enter ${l.toLowerCase()}`},...c?{}:{onChange:d=>{n(e.name,d.target.value)}}})}function Fee({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:s,placeholder:l,default:c}=e,d=e.title??e.name,h=r.map(m=>({value:m,label:m}));return o.jsx(X1,{options:h,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:l??`Select ${d.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function xO({specification:e,configuration:t,onValueChange:n,flags:r}){const{requiredType:s,options:l}=e,{isSecret:c=!1,isEditingExisting:d=!1,isSecretEditing:h=!1}=r??{};if(c)return o.jsx(Uee,{specification:e,configuration:t,onValueChange:n,isEditingExisting:d,isSecretEditing:h});if(l&&l.length>0)return o.jsx(Fee,{specification:e,configuration:t,onValueChange:n,specOptions:l});switch(s){case rs.BOOLEAN:return o.jsx(Oee,{specification:e,configuration:t,onValueChange:n});case rs.NUMBER:return o.jsx(Mee,{specification:e,configuration:t,onValueChange:n});case rs.ARRAY:return o.jsx(kee,{specification:e,configuration:t,onValueChange:n});case rs.OBJECT:return o.jsx(Pee,{specification:e,configuration:t,onValueChange:n});case rs.DATE:return o.jsx(Iee,{specification:e,configuration:t,onValueChange:n});case rs.STRING:default:return o.jsx(Lee,{specification:e,configuration:t,onValueChange:n})}}function zee({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:l,onSecretEditToggle:c}){return o.jsxs($d,{children:[e.requiredType!==rs.BOOLEAN&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(wo,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&o.jsx(Ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),xO({specification:e,configuration:t,onValueChange:l,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r}})]},e.name)}function Vee({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:l}){const c=p.useMemo(()=>{var v,x;const g=t[e.name];if(g&&typeof g=="object"){const b=Object.keys(g);if(b.length>0)return b[0]}return((x=(v=e.oneOf)==null?void 0:v[0])==null?void 0:x.value)??""},[t,e.name,e.oneOf]),[d,h]=p.useState(c);if(p.useEffect(()=>{h(c)},[c]),!e.oneOf)return null;const m=(g,v,x)=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[g]:{...typeof b[g]=="object"&&b[g]!==null?b[g]:{},[v]:x}})};return o.jsx(Tee,{label:e.title??e.name,options:e.oneOf.map(g=>({value:g.value,label:g.label})),value:d,onValueChange:h,children:e.oneOf.map(g=>o.jsx(xee,{value:g.value,children:Object.entries(g.items).map(([v,x])=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},w=Array.isArray(x.attributes)&&Object.keys(b)[0]===g.value?x.attributes.includes("SECRET"):!1,C=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},E=typeof C[g.value]=="object"&&C[g.value]!==null?C[g.value]:{};return o.jsxs("div",{className:"mb-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(wo,{htmlFor:v,required:x.required,tooltip:x.description,className:"mb-2 justify-start",children:v}),w&&r&&o.jsx(Ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>{l(e.name,!s)},children:s?"Cancel":"Edit"})]}),xO({specification:{...x,name:v},configuration:E,onValueChange:(R,T)=>{m(g.value,R,T)},flags:{isEditingExisting:r,isSecret:w,isSecretEditing:s}})]},v)})},g.value))},e.name)}function zT(e,t,n,r,s,l){return e.map(c=>{const d=Array.isArray(c.attributes)?c.attributes.includes("SECRET"):!1,h=s[c.name];return c.oneOf&&c.requiredType===rs.OBJECT?o.jsx(Vee,{specification:c,configuration:t,onValueChange:n,isEditingExisting:l,isSecretEditing:h,onSecretEditToggle:r},c.name):o.jsx(zee,{specification:c,configuration:t,isEditingExisting:l,isSecret:d,isSecretEditing:h,onValueChange:n,onSecretEditToggle:r},c.name)})}function VT({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:l,isEditingExisting:c}){return e?o.jsx(jee,{title:e,children:zT(t,n,r,s,l,c)}):zT(t,n,r,s,l,c)}function Hee({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=p.useState([]),[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(async()=>{c(!0);try{const x=await rn.getDataMartsByConnectorName(e);s(x)}catch{s([])}finally{c(!1)}},[e]);p.useEffect(()=>{d&&m()},[d,m]);const g=(x,b)=>{const w=b._id;if(!w){console.error("Configuration does not have _id field");return}t({dataMartId:x.id,dataMartTitle:x.title,configId:w,configuration:b}),h(!1)},v=x=>{const w=[],C=R=>{if(!n)return!0;const T=n.find(j=>j.name===R);return(T==null?void 0:T.required)??!1},E=(R,T,j=0,O=!0)=>{if(R.startsWith("_")||O&&j===0&&!C(R))return;let D=null;if(T==null)D="N/A";else if(typeof T=="string")D=T;else if(typeof T=="number"||typeof T=="boolean")D=String(T);else if(Array.isArray(T))D=JSON.stringify(T);else if(typeof T=="object"){w.push({key:R,value:"{",indent:j}),Object.entries(T).forEach(([_,A])=>{E(_,A,j+1,!1)}),w.push({key:"",value:"}",indent:j});return}else D=JSON.stringify(T);w.push({key:R,value:D,indent:j})};for(const[R,T]of Object.entries(x))E(R,T);return o.jsx("div",{className:"space-y-1 font-mono text-xs",children:w.map(({key:R,value:T,indent:j},O)=>o.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(j*12)}px`},children:[R&&o.jsxs("span",{className:"font-medium",children:[R,":"]}),o.jsx("span",{className:"text-muted-foreground truncate",title:T,children:T})]},O))})};return o.jsx(ls,{children:o.jsxs(Cr,{open:d,onOpenChange:h,children:[o.jsx(wr,{asChild:!0,children:o.jsxs(Ce,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[o.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Auto-fill from…"}),o.jsx(Ra,{className:J("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",d&&"rotate-90")})]})}),o.jsx(Er,{side:"bottom",align:"end",className:"w-72",children:l?o.jsx(bt,{disabled:!0,children:"Loading…"}):r.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[o.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:o.jsx(lL,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),o.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),o.jsx("span",{className:"text-muted-foreground text-sm",children:"You can auto-fill settings only from connector-based Data Marts with the same source."})]}):o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to auto-fill settings in this form"}),o.jsx("div",{children:r.map(x=>{const w=x.definition.connector.source.configuration;return w.length===0?null:w.length===1?o.jsxs(Tt,{delayDuration:300,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(bt,{onSelect:()=>{g(x,w[0])},children:[o.jsx(Xm,{className:"text-foreground h-4 w-4"}),x.title]})}),o.jsx(_t,{side:"right",className:"max-w-sm",children:v(w[0])})]},x.id):o.jsxs(Qb,{children:[o.jsxs(Xb,{className:"flex items-center gap-2",children:[o.jsx(Xm,{className:"text-foreground h-4 w-4"}),o.jsx("span",{children:x.title})]}),o.jsx(Jb,{children:w.map((C,E)=>o.jsxs(Tt,{delayDuration:300,children:[o.jsx(jt,{asChild:!0,children:o.jsxs(bt,{onSelect:()=>{g(x,C)},children:["Configuration ",E+1]})}),o.jsx(_t,{side:"right",className:"max-w-sm",children:v(C)})]},E))})]},x.id)})})]})})]})})}function HT({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:l=!1,isEditingExisting:c=!1}){const[d,h]=p.useState({}),m=p.useRef(!1),g=p.useRef(!1),[v,x]=p.useState({});p.useEffect(()=>{if(t){g.current=!0;const _={...s??{}};t.forEach(A=>{const M=Array.isArray(A.attributes)?A.attributes.includes("SECRET"):!1;_[A.name]===void 0&&A.default!==void 0&&(_[A.name]=A.default),c&&M&&(_[A.name]=J0)}),h(_),m.current=!0,setTimeout(()=>{g.current=!1},0)}},[t,s,c]),p.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(g.current=!0,h({...s}),setTimeout(()=>{g.current=!1},0))},[s]),p.useEffect(()=>{m.current&&!g.current&&Object.keys(d).length>0&&(n==null||n(d))},[d,n]);const b=(_,A)=>{h(M=>({...M,[_]:A}))},w=p.useCallback(_=>!(_==null||typeof _=="string"&&_.trim()===""||typeof _=="number"&&isNaN(_)||Array.isArray(_)&&_.length===0),[]),C=p.useCallback((_,A)=>{var U;if(typeof _!="object"||_===null)return w(_);const M=(U=A.oneOf)==null?void 0:U.filter(B=>B.value===Object.keys(_)[0]);return M?M.every(B=>Object.entries(B.items).every(([,G])=>B.value in _?C(_[B.value],G):!1)):w(_[A.name])},[w]),E=p.useCallback((_,A)=>{const M=A.filter(K=>K.required&&K.oneOf),U=M.length===0?!0:M.some(K=>C(_[K.name],K)),G=A.filter(K=>K.required&&K.name!=="Fields").every(K=>w(_[K.name]));return U&&G},[w,C]),R=(_,A)=>{x(M=>({...M,[_]:A})),h(A?M=>({...M,[_]:""}):M=>({...M,[_]:J0}))},T=_=>{const A={...d};Object.entries(_.configuration).forEach(([M,U])=>{A[M]=U}),A._copiedFrom={dataMartId:_.dataMartId,dataMartTitle:_.dataMartTitle,configId:_.configId},h(A)};if(p.useEffect(()=>{if(t&&r){const _=E(d,t);r(_)}},[d,t,r,E]),l)return o.jsx(fS,{variant:"list"});if(!t||t.length===0)return o.jsxs(Ro,{children:[o.jsx(El,{connector:e}),o.jsx(Di,{icon:o.jsx(nf,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(nu,{label:"Need configuration?"})]});const j=[...t].filter(_=>{var A;return _.name!=="Fields"&&!((A=_.attributes)!=null&&A.includes("HIDE_IN_CONFIG_FORM"))}).sort((_,A)=>{const M=U=>{const B=U.default!=null&&U.default!=="";return U.required&&!B?1:U.required&&B?2:!U.required&&!B?3:4};return M(_)-M(A)}),O=j.filter(_=>{var A;return!((A=_.attributes)!=null&&A.includes("ADVANCED"))}),D=j.filter(_=>{var A;return(A=_.attributes)==null?void 0:A.includes("ADVANCED")});return o.jsx(o.Fragment,{children:o.jsxs(Ro,{children:[o.jsx(El,{connector:e}),o.jsxs(wl,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),o.jsx(Hee,{currentConnectorName:e.name,onCopyConfiguration:T,connectorSpecification:t})]}),O.length>0&&o.jsx(VT,{items:O,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:v,isEditingExisting:c}),D.length>0&&o.jsx(VT,{collapsibleTitle:"Advanced Settings",items:D,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:v,isEditingExisting:c})]})]})})}function $ee({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:s=!1,onFieldSelect:l}){const c=r?`Select data for ${r}`:"Select data";return s?o.jsx(fS,{variant:"list"}):!t||t.length===0?o.jsxs(Ro,{children:[o.jsx(El,{connector:e}),o.jsx(Di,{icon:o.jsx(nf,{size:56,strokeWidth:1}),title:r?`No nodes found for ${r}`:"No nodes found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(nu,{label:"Missing some data?"})]}):o.jsxs(Ro,{children:[o.jsx(El,{connector:e}),o.jsxs(wl,{title:c,children:[t.map(d=>o.jsx(yO,{type:"radio",id:d.name,name:"selectedField",value:d.name,label:d.overview??d.name,checked:n===d.name,onChange:h=>{l(h)},tooltip:d.name&&o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Table name:"})," ",d.destinationName??d.name]}),d.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",d.description]}),d.documentation&&o.jsxs(Ba,{to:d.documentation,target:"_blank",rel:"noopener noreferrer",className:"bg-muted/16 hover:bg-muted/20 dark:bg-muted/8 dark:hover:bg-muted/16 flex items-center justify-center gap-1 rounded-sm px-2 py-1 font-semibold",children:["Read more",o.jsx(Ra,{className:"h-3 w-3"})]})]}),selected:n===d.name},d.name)),o.jsx(nu,{label:"Missing some data?"})]})]})}var As=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(As||{});function $T({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const l=p.useRef(null),[c,d]=p.useState(""),[h,m]=p.useState(As.ORIGINAL),g=t==null?void 0:t.find(R=>R.name===n),v=p.useMemo(()=>(g==null?void 0:g.fields)??[],[g==null?void 0:g.fields]),x=p.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),b=p.useMemo(()=>{const R=new Map;return v.forEach((T,j)=>R.set(T.name,j)),R},[v]),w=p.useMemo(()=>{const R=v.filter(j=>j.name.toLowerCase().includes(c.toLowerCase().trim())),T=(j,O)=>{const D=x.includes(j.name),_=x.includes(O.name);if(D&&!_)return-1;if(!D&&_)return 1;if(h===As.ASC)return j.name.localeCompare(O.name);if(h===As.DESC)return O.name.localeCompare(j.name);const A=b.get(j.name)??0,M=b.get(O.name)??0;return A-M};return[...R].sort(T)},[v,c,x,h,b]),C=v.map(R=>R.name),E=r.filter(R=>C.includes(R)).length;return p.useEffect(()=>{if(x.length>0){const R=x.filter(T=>v.some(j=>j.name===T)&&!r.includes(T));R.length>0&&R.forEach(T=>{s(T,!0)})}},[n,x,v,r,s]),p.useEffect(()=>{const R=T=>{const O=(T.ctrlKey||T.metaKey)&&T.shiftKey&&T.key.toLowerCase()==="a",D=document.activeElement.tagName;if(!(D==="INPUT"||D==="TEXTAREA")&&O){T.preventDefault();const _=v.map(U=>U.name),M=_.filter(U=>!r.includes(U)).length>0;_.forEach(U=>{s(U,M)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[v,r,s]),!n||!t?o.jsxs(Ro,{children:[o.jsx(El,{connector:e}),o.jsx(Di,{icon:o.jsx(nf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(nu,{label:"Need fields?"})]}):v.length?o.jsx(Ro,{children:o.jsxs(o.Fragment,{children:[o.jsx(El,{connector:e}),o.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Fl,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=l.current)==null||R.focus()}}),o.jsx("input",{ref:l,type:"text",placeholder:"Search field",value:c,onChange:R=>{d(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&o.jsx("button",{type:"button",onClick:()=>{d("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(su,{className:"h-4 w-4"})})]}),o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsxs(Ce,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[h===As.ASC&&o.jsx(q2,{className:"text-muted-foreground h-4 w-4"}),h===As.DESC&&o.jsx(G2,{className:"text-muted-foreground h-4 w-4"}),h===As.ORIGINAL&&o.jsx(Z2,{className:"text-muted-foreground h-4 w-4"})]})}),o.jsxs(Er,{align:"end",children:[o.jsxs(bt,{onSelect:()=>{m(As.ASC)},children:[o.jsx(q2,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),o.jsxs(bt,{onSelect:()=>{m(As.DESC)},children:[o.jsx(G2,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),o.jsxs(bt,{onSelect:()=>{m(As.ORIGINAL)},children:[o.jsx(Z2,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),o.jsxs(wl,{title:`Selected ${String(E)} of ${String(C.length)} fields for "${n}" data`,children:[w.map(R=>{const T=x.includes(R.name);return o.jsx(yO,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||T,disabled:T,onChange:j=>{s(R.name,j)},label:R.name,tooltip:o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[T&&o.jsxs("p",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-semibold",children:"Unique key"})," ",o.jsx(l0,{className:"text-secondary h-3 w-3"})]}),o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:T?o.jsx(l0,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),w.length===0&&c&&o.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),o.jsx(nu,{label:"Need another field?"})]})]})}):o.jsxs(Ro,{children:[o.jsx(El,{connector:e}),o.jsx(Di,{icon:o.jsx(nf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(nu,{label:"Need fields?"})]})}const bO=p.createContext(void 0),SO={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Bee(e,t){switch(t.type){case"FETCH_TRIGGERS_START":case"FETCH_TRIGGER_START":case"CREATE_TRIGGER_START":case"UPDATE_TRIGGER_START":case"DELETE_TRIGGER_START":return{...e,isLoading:!0,error:null};case"FETCH_TRIGGERS_SUCCESS":return{...e,triggers:t.payload,isLoading:!1};case"FETCH_TRIGGER_SUCCESS":return{...e,selectedTrigger:t.payload,isLoading:!1};case"CREATE_TRIGGER_SUCCESS":return{...e,triggers:[...e.triggers,t.payload],isLoading:!1};case"UPDATE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.map(n=>n.id===t.payload.id?t.payload:n),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload.id?t.payload:e.selectedTrigger,isLoading:!1};case"DELETE_TRIGGER_SUCCESS":return{...e,triggers:e.triggers.filter(n=>n.id!==t.payload),selectedTrigger:e.selectedTrigger&&e.selectedTrigger.id===t.payload?null:e.selectedTrigger,isLoading:!1};case"FETCH_TRIGGERS_ERROR":case"FETCH_TRIGGER_ERROR":case"CREATE_TRIGGER_ERROR":case"UPDATE_TRIGGER_ERROR":case"DELETE_TRIGGER_ERROR":return{...e,isLoading:!1,error:t.payload};case"SELECT_TRIGGER":return{...e,selectedTrigger:t.payload};case"RESET":return SO;default:return e}}class Gee extends Bl{constructor(){super("/data-marts")}async getScheduledTriggers(t){return this.get(`/${t}/scheduled-triggers`)}async getScheduledTrigger(t,n){return this.get(`/${t}/scheduled-triggers/${n}`)}async createScheduledTrigger(t,n){return this.post(`/${t}/scheduled-triggers`,n)}async updateScheduledTrigger(t,n,r){return this.put(`/${t}/scheduled-triggers/${n}`,r)}async deleteScheduledTrigger(t,n){return this.delete(`/${t}/scheduled-triggers/${n}`)}}const Uc=new Gee;var xn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(xn||{});const Kc={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class eb{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}async enhanceWithReportData(t){if(t.type!==xn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await yo.getReportById(n.reportId),s=gl(r);return{...t,triggerConfig:{...n,report:s}}}catch(r){return console.error(`Failed to fetch report data for trigger ${t.id}:`,r),t}}async enhanceTriggersWithReportData(t){return Promise.all(t.map(n=>this.enhanceWithReportData(n)))}mapToCreateRequest(t){return{type:xn.REPORT_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}class qee{mapFromDto(t){return{id:t.id,type:t.type,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,nextRun:t.nextRunTimestamp?new Date(t.nextRunTimestamp):null,lastRun:t.lastRunTimestamp?new Date(t.lastRunTimestamp):null,triggerConfig:t.triggerConfig,createdById:t.createdById,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToCreateRequest(t){return{type:xn.CONNECTOR_RUN,cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive,triggerConfig:t.triggerConfig}}mapToUpdateRequest(t){return{cronExpression:t.cronExpression,timeZone:t.timeZone,isActive:t.isActive}}}const Zx={getMapper(e){switch(e){case xn.REPORT_RUN:return new eb;case xn.CONNECTOR_RUN:return new qee;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Ld={mapFromDto(e){return Zx.getMapper(e.type).mapFromDto(e)},mapFromDtoList(e){return e.map(t=>this.mapFromDto(t))},async mapFromDtoWithReportData(e,t){const n=this.mapFromDto(e);switch(n.type){case xn.REPORT_RUN:return new eb().enhanceWithReportData(n);case xn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new eb,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===xn.REPORT_RUN),l=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case xn.REPORT_RUN:return l.find(d=>d.id===c.id)??c;case xn.CONNECTOR_RUN:{const d=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:d}}}default:return c}})},mapToCreateRequest(e){return Zx.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return Zx.getMapper(e.type).mapToUpdateRequest(e)}};function Zee({children:e}){const[t,n]=p.useReducer(Bee,SO),{dataMart:r}=Hi(),{fetchAvailableConnectors:s}=ql();if(!r)throw new Error("Trigger provider must be used within a data mart context");const l=p.useCallback(async b=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const w=await Uc.getScheduledTriggers(b),C=await Ld.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:C})}catch(w){const C=w instanceof Error?w.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:C}),Fe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:C})}},[r,s]),c=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGERS_START"});try{const E=(await Uc.getScheduledTriggers(b)).filter(T=>T.type===w),R=await Ld.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(C){const E=C instanceof Error?C.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:E}),Fe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:E})}},[r]),d=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGER_START"});try{const C=await Uc.getScheduledTrigger(b,w),E=await Ld.mapFromDtoWithReportData(C,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:E})}catch(C){const E=C instanceof Error?C.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:E}),Fe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:E})}},[r]),h=p.useCallback(async(b,w,C,E,R,T)=>{n({type:"CREATE_TRIGGER_START"});try{const j={type:w,cronExpression:C,timeZone:E,isActive:R,triggerConfig:T},O=await Uc.createScheduledTrigger(b,j),D=await Ld.mapFromDtoWithReportData(O,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:D}),Fe({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:w}),an.success("Trigger created"),D}catch(j){const O=j instanceof Error?j.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:O}),Fe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:O}),j}},[r]),m=p.useCallback(async(b,w,C,E,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const T={cronExpression:C,timeZone:E,isActive:R},j=await Uc.updateScheduledTrigger(b,w,T),O=await Ld.mapFromDtoWithReportData(j,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:O}),Fe({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:O.type}),an.success("Trigger updated")}catch(T){const j=T instanceof Error?T.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:j}),Fe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:j}),T}},[r]),g=p.useCallback(async(b,w)=>{n({type:"DELETE_TRIGGER_START"});try{await Uc.deleteScheduledTrigger(b,w),n({type:"DELETE_TRIGGER_SUCCESS",payload:w}),Fe({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:w}),an.success("Trigger deleted")}catch(C){const E=C instanceof Error?C.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:E}),Fe({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:E}),C}},[]),v=p.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),x=p.useCallback(()=>{n({type:"RESET"})},[]);return o.jsx(bO.Provider,{value:{...t,getScheduledTriggers:l,getScheduledTriggersByType:c,getScheduledTrigger:d,createScheduledTrigger:h,updateScheduledTrigger:m,deleteScheduledTrigger:g,selectScheduledTrigger:v,reset:x},children:e})}function CO(){const e=p.useContext(bO);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function Kee(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:l,deleteScheduledTrigger:c,selectScheduledTrigger:d,reset:h,triggers:m,selectedTrigger:g,isLoading:v,error:x}=CO();return p.useEffect(()=>(e?t(e):h(),()=>{h()}),[e,t,h]),{triggers:m,selectedTrigger:g,isLoading:v,error:x,getScheduledTriggers:b=>t(b),getScheduledTriggersByType:(b,w)=>n(b,w),getScheduledTrigger:(b,w)=>r(b,w),createScheduledTrigger:(b,w,C,E,R,T)=>s(b,w,C,E,R,T),updateScheduledTrigger:(b,w,C,E,R)=>l(b,w,C,E,R),deleteScheduledTrigger:(b,w)=>c(b,w),selectScheduledTrigger:d}}const Yee=sn({type:qs(Kc.SCHEDULED_REPORT_RUN),reportId:on().min(1,"Report ID is required")}),Wee=mB(),Qee=sn({type:c1(xn),cronExpression:on().min(1,"Cron expression is required"),timeZone:on().min(1,"Time zone is required"),isActive:hB(),triggerConfig:gB([Yee,Wee])});function Xee({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=$i({resolver:Wl(Qee),defaultValues:{type:e?e.type:n??xn.REPORT_RUN,cronExpression:(e==null?void 0:e.cronExpression)??"",timeZone:(e==null?void 0:e.timeZone)??Intl.DateTimeFormat().resolvedOptions().timeZone,isActive:(e==null?void 0:e.isActive)??!0,triggerConfig:e?e.triggerConfig:{type:Kc.SCHEDULED_REPORT_RUN,reportId:t??""}}});p.useEffect(()=>{t&&s.getValues("type")===xn.REPORT_RUN&&s.setValue("triggerConfig",{type:Kc.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),p.useEffect(()=>{n&&(s.setValue("type",n),n===xn.REPORT_RUN?s.setValue("triggerConfig",{type:Kc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const l=d=>{s.setValue("type",d),d===xn.REPORT_RUN?s.setValue("triggerConfig",{type:Kc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async d=>{try{await r(d)}catch(h){console.error("Error submitting form:",h)}};return{form:s,handleTypeChange:l,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}function Jee({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=Gl(),{dataMart:l}=Hi();p.useEffect(()=>{l&&s(l.id)},[s,l]);const c=r.filter(d=>d.dataDestination.type===Lt.GOOGLE_SHEETS);return o.jsxs(Sa,{value:e,onValueChange:t,disabled:n,children:[o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{placeholder:"Select a report"})}),o.jsx(Ea,{children:c.map(d=>o.jsx(qn,{value:d.id,children:d.title},d.id))})]})}var Ug="Switch",[ete]=kr(Ug),[tte,nte]=ete(Ug),wO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:h="on",onCheckedChange:m,form:g,...v}=e,[x,b]=p.useState(null),w=vt(t,j=>b(j)),C=p.useRef(!1),E=x?g||!!x.closest("form"):!0,[R,T]=zr({prop:s,defaultProp:l??!1,onChange:m,caller:Ug});return o.jsxs(tte,{scope:n,checked:R,disabled:d,children:[o.jsx(Ke.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":jO(R),"data-disabled":d?"":void 0,disabled:d,value:h,...v,ref:w,onClick:Te(e.onClick,j=>{T(O=>!O),E&&(C.current=j.isPropagationStopped(),C.current||j.stopPropagation())})}),E&&o.jsx(TO,{control:x,bubbles:!C.current,name:r,value:h,checked:R,required:c,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});wO.displayName=Ug;var EO="SwitchThumb",RO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=nte(EO,n);return o.jsx(Ke.span,{"data-state":jO(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});RO.displayName=EO;var rte="SwitchBubbleInput",TO=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},l)=>{const c=p.useRef(null),d=vt(c,l),h=$1(n),m=Ub(t);return p.useEffect(()=>{const g=c.current;if(!g)return;const v=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(v,"checked").set;if(h!==n&&b){const w=new Event("click",{bubbles:r});b.call(g,n),g.dispatchEvent(w)}},[h,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:d,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});TO.displayName=rte;function jO(e){return e?"checked":"unchecked"}var ate=wO,ste=RO;function _O({className:e,...t}){return o.jsx(ate,{"data-slot":"switch",className:J("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(ste,{"data-slot":"switch-thumb",className:J("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function ote(e){const t=e.trim().split(/\s+/);return t.length!==5?null:{minute:t[0],hour:t[1],day:t[2],month:t[3],dayOfWeek:t[4]}}function tb(e,t="UTC"){const n=ote(e);if(!n)return{type:"daily",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};const{minute:r,hour:s,day:l,month:c,dayOfWeek:d}=n;if(r.startsWith("*/")&&s==="*"&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(r.substring(2));if(!isNaN(v))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:v,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(s.substring(2));if(!isNaN(v)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:v,timezone:t}}const h=Number.parseInt(r),m=Number.parseInt(s),g=!isNaN(h)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}`:"09:00";if(!isNaN(h)&&!isNaN(m)&&l==="*"&&c==="*"&&d==="*")return{type:"daily",time:g,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(h)&&!isNaN(m)&&l==="*"&&c==="*"&&d!=="*"){const v=d.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(v.length>0)return{type:"weekly",time:g,weekdays:v,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(h)&&!isNaN(m)&&l!=="*"&&c==="*"&&d==="*"){const v=l.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(v.length>0)return{type:"monthly",time:g,weekdays:[1,2,3,4,5],monthDays:v,customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}return{type:"custom",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}function NO({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:l=3}){const[c,d]=p.useState(!1),h=v=>{const x=t.includes(v)?t.filter(b=>b!==v):[...t,v].sort((b,w)=>b-w);n(x)},m=(v,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(b=>b!==v))},g=()=>{if(t.length===0)return o.jsx("span",{className:"text-muted-foreground text-sm",children:r});const v=t.map(x=>e.find(b=>b.value===x)).filter(Boolean);return v.length<=l?o.jsx("div",{className:"flex flex-wrap gap-1",children:v.map(x=>o.jsxs(Ar,{variant:"secondary",className:"h-5 text-xs",children:[x.label,o.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:b=>m(x.value,b),children:o.jsx(su,{className:"h-2 w-2"})})]},x.value))}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(Ar,{variant:"secondary",className:"h-5 text-xs",children:[v[0].label,o.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:x=>m(v[0].value,x),children:o.jsx(su,{className:"h-2 w-2"})})]}),v.length>1&&o.jsxs(Ar,{variant:"outline",className:"h-5 text-xs",children:["+",v.length-1]})]})};return o.jsxs(Y1,{open:c,onOpenChange:d,modal:!0,children:[o.jsx(W1,{asChild:!0,children:o.jsxs(Ce,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[o.jsx("div",{className:"flex-1 text-left",children:g()}),o.jsx(Sb,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),o.jsx(Q1,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:o.jsxs(jD,{className:"h-full overflow-visible",children:[o.jsx(_D,{placeholder:s,className:"h-8"}),o.jsxs(sJ,{className:"h-full max-h-[350px] overflow-y-auto",children:[o.jsx(ND,{children:"No items found."}),o.jsx(AD,{className:"h-full overflow-visible",children:e.map(v=>o.jsxs(DD,{value:v.value.toString(),onSelect:()=>h(v.value),className:"text-sm",children:[o.jsx(dr,{className:J("mr-2 h-3 w-3",t.includes(v.value)?"opacity-100":"opacity-0")}),v.label]},v.value))})]})]})})]})}const AO=[{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"},{value:0,label:"Sunday"}],Om=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function DO(e,t){if(!t)return"Schedule is disabled";const n=e.time;switch(e.type){case"daily":return`Daily at ${n}`;case"weekly":return`Weekly on ${e.weekdays.map(s=>{var l;return(l=AO.find(c=>c.value===s))==null?void 0:l.label}).join(", ")} at ${n}`;case"monthly":{const s=[...e.monthDays].sort((c,d)=>c-d).map(c=>c===1?"1st":c===2?"2nd":c===3?"3rd":`${String(c)}th`);return`Monthly on the ${s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s[s.length-1]}`} at ${n}`}case"interval":return e.intervalType==="minutes"?`Every ${String(e.intervalValue)} minute${e.intervalValue!==1?"s":""}`:`Every ${String(e.intervalValue)} hour${e.intervalValue!==1?"s":""}`;case"custom":return"Custom schedule";default:return""}}function ite(e,t,n=!0){const r=tb(e,t);return DO(r,n)}const lte=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),nb=[5,10,15,30],rb=[1,2,3,4,6,8,12],cte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(ba,{children:"Type"}),o.jsxs(Sa,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{})}),o.jsxs(Ea,{children:[o.jsx(qn,{value:"daily",children:"Daily"}),o.jsx(qn,{value:"weekly",children:"Weekly"}),o.jsx(qn,{value:"monthly",children:"Monthly"}),o.jsx(qn,{value:"interval",children:"Interval"})]})]})]}),ute=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(ba,{children:"Time"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx($t,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),BT=({value:e,onChange:t,disabled:n,timezones:r})=>o.jsxs("div",{className:"w-full space-y-2",children:[o.jsx(ba,{children:"Timezone"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(X1,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),dte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(ba,{children:"Days of Week"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(NO,{options:AO,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),fte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(ba,{children:"Days of Month"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(NO,{options:lte,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),hte=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(ba,{children:"Type"}),o.jsxs(Sa,{value:e,onValueChange:l=>{n(l)},disabled:s,children:[o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{})}),o.jsxs(Ea,{children:[o.jsx(qn,{value:"minutes",children:"Minutes"}),o.jsx(qn,{value:"hours",children:"Hours"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(ba,{children:"Every"}),o.jsxs(Sa,{value:t.toString(),onValueChange:l=>{r(Number.parseInt(l)||1)},disabled:s,children:[o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{})}),o.jsx(Ea,{children:(e==="minutes"?nb:rb).map(l=>o.jsxs(qn,{value:l.toString(),children:[l," ",e==="minutes"?"min":"hr"]},l))})]})]})]}),mte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(ba,{className:"text-sm",children:"Cron Expression"}),o.jsx($t,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function pte({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:l=!0,showSaveButton:c=!1}){const[d,h]=p.useState(n),[m,g]=p.useState(t??Om()),[v,x]=p.useState(!1),b=p.useMemo(()=>FG.getTimezonesWithOffset().map(H=>({value:H.identifier,label:H.displayName,offset:H.offsetString,isDST:H.isDST})),[]),[w,C]=p.useState(()=>tb(e,m)),[E,R]=p.useState(""),[T,j]=p.useState("");p.useEffect(()=>{h(n)},[n]),p.useEffect(()=>{const H=t??Om();g(H)},[t]),p.useEffect(()=>{if(e){const H=tb(e,m);C(H)}},[e,m]);const O=H=>{const[$,I]=H.time.split(":").map(Number);switch(H.type){case"daily":return`${String(I)} ${String($)} * * *`;case"weekly":return`${String(I)} ${String($)} * * ${H.weekdays.join(",")}`;case"monthly":return`${String(I)} ${String($)} ${H.monthDays.join(",")} * *`;case"interval":return H.intervalType==="minutes"?`*/${String(H.intervalValue)} * * * *`:`0 */${String(H.intervalValue)} * * *`;case"custom":return H.customCron;default:return`${String(I)} ${String($)} * * *`}},D=p.useCallback(H=>{C($=>{if($.intervalType===H)return console.log("Type unchanged, skipping update"),$;const Y=(H==="minutes"?nb:rb)[0];return{...$,intervalType:H,intervalValue:Y}})},[]),_=p.useCallback(H=>{C($=>($.intervalType==="minutes"?nb:rb).includes(H)?{...$,intervalValue:H}:$)},[]),A=p.useMemo(()=>H=>DO(H,d),[d]);p.useEffect(()=>{const H=O(w);R(H),j(A(w))},[w,d,m,A]);const M=p.useRef(""),U=p.useRef(""),B=p.useRef(!1);p.useEffect(()=>{const H=O(w);r&&(M.current!==H||U.current!==m||B.current!==d)&&(r({cron:H,timezone:m,enabled:d}),M.current=H,U.current=m,B.current=d)},[w,m,d,r]);const G=H=>{h(H)},K=H=>{g(H),C($=>({...$,timezone:H}))},re=["daily","weekly","monthly"].includes(w.type);return o.jsxs("div",{className:s,children:[o.jsx("div",{className:"mb-4 space-y-4 pt-0",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ba,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:d?"Enabled":"Disabled"}),o.jsx(_O,{id:"schedule-enabled",checked:d,onCheckedChange:G})]})]})}),o.jsxs("div",{className:"space-y-4 pt-0",children:[o.jsxs("div",{className:`space-y-4 ${d?"":"opacity-50"}`,children:[o.jsx(cte,{value:w.type,onChange:H=>{C($=>({...$,type:H}))},disabled:!d}),w.type!=="custom"&&w.type!=="interval"&&o.jsxs("div",{className:"flex gap-3",children:[o.jsx(ute,{value:w.time,onChange:H=>{C($=>({...$,time:H}))},disabled:!d}),re&&o.jsx(BT,{value:m,onChange:K,disabled:!d,timezones:b})]}),(w.type==="interval"||w.type==="custom")&&o.jsx(BT,{value:m,onChange:K,disabled:!d,timezones:b}),w.type==="weekly"&&o.jsx(dte,{value:w.weekdays,onChange:H=>{C($=>({...$,weekdays:H}))},disabled:!d}),w.type==="monthly"&&o.jsx(fte,{value:w.monthDays,onChange:H=>{C($=>({...$,monthDays:H}))},disabled:!d}),w.type==="interval"&&o.jsx(hte,{intervalType:w.intervalType,intervalValue:w.intervalValue,onTypeChange:D,onValueChange:_,disabled:!d}),w.type==="custom"&&o.jsx(mte,{value:w.customCron,onChange:H=>{C($=>({...$,customCron:H}))},disabled:!d})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx(d_,{className:"my-3"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{x(!v)},children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Wj,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),v?o.jsx(Us,{className:"text-muted-foreground h-4 w-4"}):o.jsx(Za,{className:"text-muted-foreground h-4 w-4"})]}),v&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),o.jsx(Ar,{variant:d?"default":"secondary",className:"text-xs",children:d?"Enabled":"Disabled"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),o.jsx(Ar,{variant:"secondary",className:"font-mono text-xs",children:E})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),o.jsx(Ar,{variant:"outline",className:"text-xs",children:m})]}),o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),o.jsx("span",{className:"flex-1 text-right text-xs",children:T})]})]}),d&&re&&m!==Om()&&o.jsxs(cS,{className:"border-amber-200 bg-amber-50",children:[o.jsx(Sf,{className:"h-4 w-4"}),o.jsx(iO,{children:"Time Zone"}),o.jsxs(uS,{children:["Schedule runs in ",m," (not your local ",Om()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&o.jsx(Ce,{className:"w-full",disabled:!d,children:"Save Schedule"})]})]})}function gte(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"trigger-type-options-description-details",children:[o.jsx(Yn,{children:"How do I choose a type?"}),o.jsxs(Wn,{children:[o.jsxs("p",{className:"mb-2",children:[o.jsx("strong",{children:"Report Run"})," - runs a report to import data from the specified Data Storage into a Destination provider (e.g. Google Sheets document)."]}),o.jsxs("p",{className:"mb-2",children:[o.jsx("strong",{children:"Connector Run"})," - runs a connector (e.g., Facebook Ads) configured in the Data Mart to update raw data in the selected Data Storage."]})]})]})})}function vte(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"trigger-type-change-description-details",children:[o.jsx(Yn,{children:"How do I change the trigger type?"}),o.jsx(Wn,{children:o.jsx("p",{children:"Trigger type cannot be changed after the trigger is created. If you need a different type, delete the existing trigger and create a new one with the desired type."})})]})})}function yte(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"report-change-description-details",children:[o.jsx(Yn,{children:"How do I change a report?"}),o.jsx(Wn,{children:o.jsx("p",{children:"The report cannot be changed after the trigger is created. If you need a different report, delete the existing trigger and create a new one with the desired report."})})]})})}function xte(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"report-select-description-details",children:[o.jsx(Yn,{children:"How do I choose the report?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),o.jsxs("p",{children:["You can use an existing one or create a new one on the ",o.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function bte({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:l}){const[c,d]=p.useState(!1),{form:h,handleTypeChange:m,handleSubmit:g,isDirty:v}=Xee({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async E=>{d(!0);try{await r(E)}finally{d(!1)}}});p.useEffect(()=>{l==null||l(v)},[v,l]);const{control:x,watch:b}=h,C=b("type")===xn.REPORT_RUN;return o.jsx(Zl,{...h,children:o.jsxs(Bi,{onSubmit:E=>void g(E),noValidate:!1,children:[o.jsxs(Kl,{children:[o.jsx(Qt,{control:x,name:"type",render:({field:E})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),o.jsxs(Sa,{onValueChange:R=>{E.onChange(R),m(R)},defaultValue:E.value,disabled:!!n||!!e||!!b("triggerConfig.reportId"),children:[o.jsx(en,{children:o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{placeholder:"Select trigger type"})})}),o.jsxs(Ea,{children:[o.jsx(qn,{value:xn.REPORT_RUN,children:"Report Run"}),o.jsx(qn,{value:xn.CONNECTOR_RUN,children:"Connector Run"})]})]}),o.jsx(ar,{children:e?o.jsx(vte,{}):o.jsx(gte,{})}),o.jsx(ln,{})]})}),C&&o.jsx(Qt,{control:x,name:"triggerConfig.reportId",render:({field:E})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),o.jsx(en,{children:o.jsx(E4,{children:o.jsx(Jee,{value:E.value,onChange:E.onChange,disabled:!!t||!!e})})}),o.jsx(ar,{children:e!=null&&e.triggerConfig?o.jsx(yte,{}):o.jsx(xte,{})}),o.jsx(ln,{})]})}),o.jsx(pte,{showPreview:!1,cron:b("cronExpression"),timezone:b("timeZone"),enabled:b("isActive"),onChange:E=>{h.setValue("cronExpression",E.cron,{shouldDirty:!0}),h.setValue("timeZone",E.timezone,{shouldDirty:!0}),h.setValue("isActive",E.enabled,{shouldDirty:!0})},className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4"})]}),o.jsxs(Yl,{children:[o.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!v||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&o.jsx(Ce,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Ste({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=p.useMemo(()=>ite(e,t,n),[e,t,n]);return o.jsxs("div",{children:[o.jsx("div",{children:r}),n&&o.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function Cte({table:e}){return o.jsx("div",{className:"text-right",children:o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(bt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta.title??t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function wte({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),d=()=>{c(!1),n(e.id)};return o.jsxs("div",{className:"text-right",onClick:h=>{h.stopPropagation()},children:[o.jsxs(Cr,{open:r,onOpenChange:s,children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${r?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Er,{align:"end",children:[o.jsxs(bt,{onClick:()=>{t(e.id)},children:[o.jsx(Cf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),o.jsx(Ga,{}),o.jsxs(bt,{onClick:()=>{c(!0)},children:[o.jsx(ko,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),o.jsx(xa,{open:l,onOpenChange:c,title:"Delete Scheduled Trigger",description:"Are you sure you want to delete this scheduled trigger? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:d,variant:"destructive"})]})}function Ete(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function Rte({connector:e}){const{connectors:t}=ql(),n=Ete(e,t);return o.jsx(o.Fragment,{children:n})}function OO({connector:e}){return o.jsx(Rte,{connector:e})}function Tte(e){if(e.length===0)return{lastRunDate:null,lastRunStatus:null,totalRuns:0,firstRunDate:null};const t=e[0],n=e[e.length-1],r=new Date(n.createdAt);return{lastRunDate:new Date(t.createdAt),lastRunStatus:t.status,totalRuns:e.length,firstRunDate:r}}const jte=e=>{const{connectors:t}=ql();return p.useMemo(()=>t.find(n=>n.name===e),[t,e])},_te=je.memo(function({connector:t,children:n}){const r=jte(t.source.name),{dataMart:s,runs:l,getDataMartRuns:c}=Hi();p.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const d=p.useMemo(()=>r!=null&&r.logoBase64?o.jsx(Ff,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),h=p.useCallback(()=>{s!=null&&s.storage&&gq(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=p.useMemo(()=>Tte(l),[l]),g=p.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:OZ(m.lastRunStatus),statusText:kZ(m.lastRunStatus),date:m.lastRunDate},[m]),v=p.useMemo(()=>(s==null?void 0:s.storage)&&vq(s.storage),[s]),x=p.useMemo(()=>{const b=t.source.fields.length.toString();return`${t.source.node} • ${b} fields`},[t.source.node,t.source.fields.length]);return o.jsxs(g1,{children:[o.jsx(v1,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(y1,{children:[o.jsxs(x1,{children:[o.jsx(b1,{children:d}),o.jsxs(S1,{children:[o.jsx(C1,{children:o.jsx(OO,{connector:t})}),o.jsx(w1,{children:x})]})]}),o.jsxs(E1,{children:[o.jsxs(gi,{children:[o.jsx(vi,{children:"Last run status:"}),o.jsx(yi,{children:g?o.jsx(Vf,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),o.jsxs(gi,{children:[o.jsx(vi,{children:"Last run date:"}),o.jsx(yi,{children:g?o.jsx(kl,{date:g.date}):"Never run"})]}),o.jsxs(gi,{children:[o.jsx(vi,{children:"Total runs:"}),o.jsxs(yi,{children:[m.totalRuns," runs",m.firstRunDate&&o.jsxs(o.Fragment,{children:[", since"," ",m.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),o.jsx(R1,{children:o.jsxs(Ce,{className:"w-full",variant:"default",onClick:h,title:"Open Storage","aria-label":"Open Storage",children:[v,o.jsx(Tl,{className:"ml-1 inline h-4 w-4","aria-hidden":"true"})]})})]})]})},(e,t)=>e.connector.source.name===t.connector.source.name&&e.connector.storage.fullyQualifiedName===t.connector.storage.fullyQualifiedName&&e.connector.source.node===t.connector.source.node&&e.connector.source.fields.length===t.connector.source.fields.length);function Nte(e){const t=e.triggerConfig;return o.jsxs("div",{className:"inline gap-1",children:[t.report.title,o.jsx(AZ,{report:t.report,children:o.jsx(Fr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Ate(e){const t=e.triggerConfig,{connector:n}=t.connector;return o.jsxs("div",{className:"inline gap-1",children:[o.jsx(OO,{connector:n}),o.jsx(_te,{connector:n,children:o.jsx(Fr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Dte({trigger:e}){switch(e.type){case xn.REPORT_RUN:return Nte(e);case xn.CONNECTOR_RUN:return Ate(e);default:return o.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Ote({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===xn.REPORT_RUN?"Report Run":"Connector Run";return o.jsx(Ar,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>o.jsx(Dte,{trigger:n.original}),meta:{title:"Run Target"}},{accessorKey:"cronExpression",size:20,header:"Schedule",cell:({row:n})=>{const r=n.getValue("cronExpression"),s=n.original.timeZone,l=n.getValue("isActive");return o.jsx(Ste,{cronExpression:String(r),timeZone:s,isEnabled:l})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(kl,{date:new Date(r)}):"Not scheduled"})},meta:{title:"Next Run"}},{accessorKey:"lastRun",size:15,header:"Last Run",cell:({row:n})=>{const r=n.original.lastRun;return o.jsx("div",{className:"text-sm",children:r?o.jsx(kl,{date:new Date(r)}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"Never run"})})},meta:{title:"Last Run"}},{accessorKey:"isActive",size:15,header:"Trigger Status",cell:({row:n})=>{const r=n.getValue("isActive");return o.jsx(Vf,{type:r?Tn.SUCCESS:Tn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>o.jsx(Cte,{table:n}),cell:({row:n})=>o.jsx(wte,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function Mte({table:e,onPreviousClick:t,onNextClick:n}){return o.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[o.jsx(Ce,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),o.jsx(Ce,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function hS({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:l,updateScheduledTrigger:c,selectedTrigger:d}=CO(),[h,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useCallback(()=>{g?m(!0):t()},[g,t]),b=p.useCallback(()=>{m(!1),v(!1),t()},[t]),w=p.useCallback(O=>{v(O)},[]),C=p.useCallback(()=>{v(!1),t()},[t]),E=!!d,R=p.useMemo(()=>d?{type:d.type,cronExpression:d.cronExpression,timeZone:d.timeZone,isActive:d.isActive,triggerConfig:d.type===xn.REPORT_RUN?{type:Kc.SCHEDULED_REPORT_RUN,reportId:d.triggerConfig.reportId}:null}:void 0,[d]),T=async O=>{E?await c(n,d.id,O.cronExpression,O.timeZone,O.isActive):await l(n,O.type,O.cronExpression,O.timeZone,O.isActive,O.triggerConfig),C()},j=p.useRef(!1);return p.useEffect(()=>{const O=E?"Edit":"Create",D=(d==null?void 0:d.type)??s;e&&!j.current?(Fe({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:O,label:D}),j.current=!0):!e&&j.current&&(Fe({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:O,label:D}),j.current=!1)},[e,E,d,s]),o.jsxs(o.Fragment,{children:[o.jsx(Mi,{open:e,onOpenChange:O=>{O||x()},children:o.jsxs(ki,{children:[o.jsxs(Ii,{children:[o.jsxs(Li,{children:[E?"Edit":"Create"," Scheduled Trigger"]}),o.jsx(Hl,{children:"Configure automatic runs for your reports or connectors."})]}),o.jsx(bte,{preSelectedReportId:r,preSelectedType:s,initialData:R,onSubmit:T,onCancel:x,onDirtyChange:w})]})}),o.jsx(xa,{open:h,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:b,variant:"destructive"})]})}function kte({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,l]=p.useState(!1),c=p.useCallback(()=>{l(!1)},[]),d=p.useCallback(R=>{r(R)},[r]),h=p.useMemo(()=>Ote({onEditTrigger:n,onDeleteTrigger:d}),[n,d]),{sorting:m,setSorting:g,columnVisibility:v,setColumnVisibility:x}=Bf({columns:h,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),b=Tu({data:e,columns:h,getCoreRowModel:Ru(),getPaginationRowModel:Eg(),onSortingChange:g,getSortedRowModel:$f(),getFilteredRowModel:Hf(),state:{sorting:m,columnVisibility:v},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),w=p.useCallback(()=>{b.previousPage()},[b]),C=p.useCallback(()=>{b.nextPage()},[b]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(ju,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[o.jsx(_u,{className:"dm-card-table-header",children:b.getHeaderGroups().map(R=>o.jsx(sr,{className:"dm-card-table-header-row",children:R.headers.map(T=>o.jsx(Au,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:T.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.getSize())}%`},children:T.isPlaceholder?null:typeof T.column.columnDef.header=="function"?T.column.columnDef.header(T.getContext()):T.column.columnDef.header},T.id))},R.id))}),o.jsx(Nu,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map((R,T)=>o.jsx(sr,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":T+1,children:R.getVisibleCells().map((j,O)=>o.jsx(ya,{className:`whitespace-normal ${j.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":O+1,style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.column.getSize())}%`},children:typeof j.column.columnDef.cell=="function"?j.column.columnDef.cell(j.getContext()):j.column.columnDef.cell},j.id))},R.id)):o.jsx(sr,{children:o.jsx(ya,{colSpan:h.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),o.jsx(Mte,{table:b,onPreviousClick:w,onNextClick:C}),o.jsx(hS,{isOpen:s,onClose:c,dataMartId:t})]})}function Ite({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=Kee(e),[l,c]=p.useState(!1);p.useEffect(()=>{s&&c(!0)},[s]);const d=g=>{const v=t.find(x=>x.id===g);v&&r(v)},h=()=>{c(!1),r(null)},m=async g=>{try{await n(e,g)}catch(v){console.error("Error deleting trigger:",v)}};return o.jsxs(o.Fragment,{children:[o.jsx(kte,{triggers:t,dataMartId:e,onEditTrigger:d,onDeleteTrigger:g=>void m(g)}),o.jsx(hS,{isOpen:l,onClose:h,dataMartId:e})]})}function MO(){return o.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:o.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[o.jsx(Xj,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"Time Triggers"}),o.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",o.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function Lte({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const l=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[d,h]=p.useState(""),[m,g]=p.useState(""),[v,x]=p.useState(null),[b,w]=p.useState(null),C=j=>j.trim()?/^[A-Za-z][A-Za-z0-9_]*$/.test(j)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",E=p.useCallback((j,O,D,_)=>{s({fullyQualifiedName:`${j}.${O}`,isValid:!!(j&&O&&D===null&&_===null)})},[s]);p.useEffect(()=>{let j="",O="";if(t!=null&&t.fullyQualifiedName){const U=t.fullyQualifiedName.split(".");j=U[0]??"",O=U[1]??""}else j=`${c}_owox`,O=l;const D=C(j),_=C(O);h(j),g(O),x(D),w(_);const A=`${j}.${O}`,M=!!(j&&O&&D===null&&_===null);((t==null?void 0:t.fullyQualifiedName)!==A||t.isValid!==M)&&E(j,O,D,_)},[t,l,c,E]);const R=j=>{h(j);const O=C(j);x(O),E(j,m,O,b)},T=j=>{g(j);const O=C(j);w(O),E(d,j,v,O)};return o.jsxs(Ro,{children:[e===Pe.GOOGLE_BIGQUERY&&o.jsxs(o.Fragment,{children:[o.jsx(Di,{icon:o.jsx(VA,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),o.jsxs(wl,{title:"Choose where to store your data",children:[o.jsxs($d,{children:[o.jsx(wo,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),o.jsx($t,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:j=>{R(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),v&&o.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs($d,{children:[o.jsx(wo,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx($t,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"table-name-error":void 0,onChange:j=>{T(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),e===Pe.AWS_ATHENA&&o.jsxs(o.Fragment,{children:[o.jsx(Di,{icon:o.jsx(HA,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),o.jsxs(wl,{title:"Choose where to store your data",children:[o.jsxs($d,{children:[o.jsx(wo,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),o.jsx($t,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:j=>{R(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),v&&o.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs($d,{children:[o.jsx(wo,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx($t,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"athena-table-name-error":void 0,onChange:j=>{T(j.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),o.jsx(wl,{title:"Schedule updates",children:o.jsx(MO,{})})]})}function Pte({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full",initialStep:l,preselectedConnector:c}){const[d,h]=p.useState(null),[m,g]=p.useState(""),[v,x]=p.useState([]),[b,w]=p.useState(1),[C,E]=p.useState({}),[R,T]=p.useState(!1),[j,O]=p.useState(new Set),[D,_]=p.useState(new Set),{connectors:A,connectorSpecification:M,connectorFields:U,loading:B,loadingSpecification:G,loadingFields:K,error:re,fetchAvailableConnectors:H,fetchConnectorSpecification:$,fetchConnectorFields:I}=ql(),[Y,Z]=p.useState(null),be=(n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:s==="fields-only"?[{id:1,title:"Select Fields",description:"Pick specific fields"}]:[{id:1,title:"Select Connector",description:"Choose a data source"},{id:2,title:"Configuration",description:"Set up connector parameters"},{id:3,title:"Select Nodes",description:"Choose data nodes"},{id:4,title:"Select Fields",description:"Pick specific fields"},{id:5,title:"Target Setup",description:"Configure destination"}]).length,L=p.useCallback(async Ie=>{!j.has(Ie)&&!G&&(O(wt=>new Set(wt).add(Ie)),await $(Ie))},[j,G,$]),P=p.useCallback(async Ie=>{D.has(Ie)||(_(wt=>new Set(wt).add(Ie)),await I(Ie))},[D,I]);p.useEffect(()=>{if(!c||d||A.length===0)return;const Ie=A.find(wt=>wt.name===c);Ie&&(h(Ie),w(l??2),L(Ie.name),!n&&s!=="fields-only"&&P(Ie.name))},[c,A,d,l,n,s,L,P]),p.useEffect(()=>{if(A.length===0&&!B&&H(),r&&A.length>0&&!d){const{source:Ie,storage:wt}=r;g(Ie.node),x(Ie.fields),E(Ie.configuration[0]||{}),Z({fullyQualifiedName:wt.fullyQualifiedName,isValid:!0});const Ot=A.find(tn=>tn.name===Ie.name);Ot&&(h(Ot),L(Ot.name),!n&&s!=="fields-only"&&P(Ot.name),s==="fields-only"&&P(Ot.name))}if(n&&A.length>0&&!d&&!r){const Ie=A[0];h(Ie),L(Ie.name)}},[s,r,A,n,B,H,L,P,d]);const W=Ie=>{h(Ie),E({}),T(!1),O(wt=>{const Ot=new Set(wt);return Ot.delete(Ie.name),Ot}),L(Ie.name),P(Ie.name)},ae=Ie=>{g(Ie),x([])},fe=(Ie,wt)=>{x(wt?Ot=>Ot.includes(Ie)?Ot:[...Ot,Ie]:Ot=>Ot.filter(tn=>tn!==Ie))},ge=(Ie,wt)=>{x(wt?Ot=>{const tn=Ie.filter(V=>!Ot.includes(V));return[...Ot,...tn]}:Ot=>Ot.filter(tn=>!Ie.includes(tn)))},ue=Ie=>{Z(Ie)},Ne=p.useCallback(Ie=>{E(Ie)},[]),Re=p.useCallback(Ie=>{T(Ie)},[]);p.useEffect(()=>{M&&(M.some(wt=>wt.required&&wt.name!=="Fields")||T(!0))},[M]);const xe=()=>{b<be&&w(b+1)},et=()=>{b>1&&w(b-1)},Xe=()=>{if(n)return d!==null&&R;if(s==="fields-only")switch(b){case 1:return v.length>0;default:return!1}switch(b){case 1:return d!==null;case 2:return R;case 3:return m!=="";case 4:return v.length>0;case 5:return Y!==null&&Y.fullyQualifiedName!==""&&Y.isValid;default:return!1}},Bt=()=>b>1,ft=(Ie,wt)=>{if(!Ie)return wt;const Ot=Ie.find(tn=>tn.name===wt);return(Ot==null?void 0:Ot.destinationName)??wt},gn=()=>{if(n&&b===1)return M&&d?o.jsx(HT,{connector:d,connectorSpecification:M,onConfigurationChange:Ne,onValidationChange:Re,initialConfiguration:C,loading:G,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(b){case 1:return d&&m&&U?o.jsx($T,{connector:d,connectorFields:U,selectedField:m,selectedFields:v,onFieldToggle:fe,onSelectAllFields:ge}):null;default:return null}switch(b){case 1:return o.jsx(Aee,{connectors:A,selectedConnector:d,loading:B,error:re,onConnectorSelect:W,onConnectorDoubleClick:()=>{w(Ie=>Ie<be?Ie+1:Ie)}});case 2:return d&&M?o.jsx(HT,{connector:d,connectorSpecification:M,onConfigurationChange:Ne,onValidationChange:Re,initialConfiguration:C,loading:G,isEditingExisting:!1}):null;case 3:return d&&U?o.jsx($ee,{connectorFields:U,connector:d,selectedField:m,connectorName:d.displayName,loading:K,onFieldSelect:ae}):null;case 4:return d&&m&&U?o.jsx($T,{connector:d,connectorFields:U,selectedField:m,selectedFields:v,onFieldToggle:fe,onSelectAllFields:ge}):null;case 5:return m&&U?o.jsx(Lte,{dataStorageType:t,destinationName:ft(U,m),connectorName:(d==null?void 0:d.displayName)??"",target:Y,onTargetChange:ue}):null;default:return null}};return o.jsxs(wee,{children:[o.jsx(Eee,{children:gn()}),o.jsx(Ree,{variant:"horizontal",children:o.jsx(Dee,{currentStep:b,totalSteps:be,canGoNext:Xe(),canGoBack:Bt(),isLoading:G||K,onNext:xe,onBack:et,onFinish:()=>{n&&d?e({source:{name:d.name,configuration:[C],node:(r==null?void 0:r.source.node)??m,fields:(r==null?void 0:r.source.fields)??v},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}):s==="fields-only"&&r?e({source:{...r.source,fields:v},storage:r.storage}):d&&Y&&e({source:{name:d.name,configuration:[C],node:m,fields:v},storage:{fullyQualifiedName:Y.fullyQualifiedName}})}})})]})}const kO=20,IO=20;function LO({vertical:e,horizontal:t}){if(window.Intercom)try{const n={};n.vertical_padding=e,n.horizontal_padding=t,Object.keys(n).length>0&&window.Intercom("update",n)}catch(n){console.warn("Failed to update Intercom padding",n)}}function Ute(e=30,t=0){LO({vertical:IO+e,horizontal:kO+t})}function ab(){LO({vertical:IO,horizontal:kO})}function PO({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:l=null,mode:c="full",initialStep:d,preselectedConnector:h}){return p.useEffect(()=>(e?Ute(55):ab(),()=>{ab()}),[e]),o.jsx(Mi,{open:e,onOpenChange:t,children:o.jsxs(ki,{children:[o.jsxs(Ii,{children:[o.jsx(Li,{children:c==="fields-only"?"Connector Fields":l!=null&&l.source.name?"Edit Connector":"Set Up Connector"}),o.jsx(Hl,{children:c==="fields-only"?"Select fields for your Data Mart":l!=null&&l.source.name?"Update configuration":"Follow these steps to set it up"})]}),o.jsx(Pte,{onSubmit:m=>{r(m),t()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:l,mode:c,initialStep:d,preselectedConnector:h})]})})}const mS=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:l,isOpen:c,onClose:d})=>{const[h,m]=p.useState(!1),[g,v]=p.useState(1),[x,b]=p.useState();p.useEffect(()=>{c!==void 0&&m(c)},[c]);const w=()=>{b(void 0),v(1),m(!0)},C=()=>{m(!1),d==null||d()};return p.useEffect(()=>{l&&(l==="connector"?(b(void 0),v(1),m(!0)):(b(l),v(2),m(!0)))},[l]),o.jsxs(o.Fragment,{children:[n&&o.jsx("div",{onClick:w,style:{cursor:"pointer"},children:n}),o.jsx(hu,{children:o.jsx(PO,{isOpen:h,onClose:C,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:g,preselectedConnector:x})})]})};function Fte({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return o.jsx(mS,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:o.jsxs(Ce,{type:"button",variant:"outline",className:"flex h-24 w-full cursor-pointer items-center justify-center gap-2 border-0 shadow-none dark:border-transparent dark:bg-transparent dark:hover:bg-white/4",children:[o.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:o.jsx(Eb,{className:"h-4 w-4",strokeWidth:2.25})}),o.jsx("span",{children:"Setup Connector"}),o.jsx(Ra,{className:"h-6 w-6"})]})})}const zte=e=>{switch(e){case Pe.GOOGLE_BIGQUERY:return"Google BigQuery";case Pe.AWS_ATHENA:return"AWS Athena";default:return e}},qc=e=>typeof e=="object"&&"connector"in e,Pd=e=>{if(!qc(e))return!1;const{source:t,storage:n}=e.connector,r=!!t.name&&!!t.configuration&&t.configuration.length>0&&!!t.node&&!!t.fields&&t.fields.length>0,s=!!n.fullyQualifiedName&&n.fullyQualifiedName.split(".").length===2;return r&&s};function Vte({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,dataMartStatus:s,totalConfigurations:l,dataStorage:c}){const d=Vi.getInfo(c.type),{connectors:h,fetchAvailableConnectors:m}=ql();p.useEffect(()=>{m()},[m]);const g=C=>{const E=h.find(R=>R.name===C);if(E!=null&&E.logoBase64)return()=>o.jsx(Ff,{base64:E.logoBase64,size:24})},v=()=>{const C=t.connector.source.node||"No node selected";return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:C}),o.jsx("span",{className:"text-muted-foreground",children:"•"}),o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[o.jsx("span",{children:"Edit config"}),o.jsx(Ra,{className:"h-3 w-3"})]})}),o.jsx(_t,{children:"Edit connector configuration"})]})]})},x=(C,E,R)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",o.jsx(fr,{href:R,onClick:T=>{T.stopPropagation()},children:E})]}),b=()=>{switch(c.type){case Pe.GOOGLE_BIGQUERY:{const C=c.config.projectId,E=t.connector.storage.fullyQualifiedName,R=E.split(".")[0],T=E.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}`,O=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}!3s${T}`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Dataset",R,j),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,O),o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(Fr,{className:"h-4 w-4"})}),o.jsx(_t,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Pe.AWS_ATHENA:{const C=c.config.region,E=t.connector.storage.fullyQualifiedName,[R,T]=E.split("."),j=`https://console.aws.amazon.com/athena/home?region=${C}#/query-editor`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Database",R,j),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,j),o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(Fr,{className:"h-4 w-4"})}),o.jsx(_t,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}default:return"Unknown storage type configuration"}},w=()=>!(s===ur.PUBLISHED&&l===1);return o.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[o.jsx("div",{className:"flex-grow",children:o.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[o.jsx(mS,{dataStorageType:c.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:o.jsx(K0,{icon:g(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:v(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),o.jsx(K0,{title:zte(c.type),icon:d.icon,subtitle:b(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),o.jsx("div",{className:"shrink-0 px-4",children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(Ce,{type:"button",variant:"ghost",onClick:()=>{w()&&n(e)},disabled:!w(),children:o.jsx(ko,{className:"h-4 w-4"})})}),!w()&&o.jsx(_t,{children:"Cannot remove the last configuration in published pipeline"})]})})]})}function Hte({storageType:e,onAddConfiguration:t,existingConnector:n}){return o.jsx("div",{children:o.jsx(mS,{dataStorageType:e,onSubmit:r=>{const s=r.source.configuration[0]||{};t(s)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:o.jsxs(Ce,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(Ta,{className:"h-4 w-4"}),o.jsx("span",{children:"Configuration"})]})})})}function $te({control:e,storageType:t,preset:n,autoOpen:r=!1}){const{dataMart:s,runDataMart:l}=gs(),{setValue:c,getValues:d,trigger:h}=Du(),[m,g]=p.useState(!1),[v,x]=p.useState(!1);p.useEffect(()=>{r&&x(!0)},[r]);const b=()=>{setTimeout(()=>void h("definition"),0)},w=(s==null?void 0:s.status)??ur.DRAFT,C=A=>{const M=A.source,U=A.storage;c("definition",{connector:{source:M,storage:U}},{shouldDirty:!0,shouldTouch:!0}),b()},E=async A=>{if(s){if(s.status.code!==ur.PUBLISHED){Dt.error("Manual run is only available for published data marts");return}await l({id:s.id,payload:A})}},R=A=>M=>{const B=d().definition;if(typeof B=="object"&&qc(B)){const G=[...B.connector.source.configuration];G[A]=M.source.configuration[0]||{};const K={connector:{...B.connector,source:{...B.connector.source,configuration:G}}};c("definition",K,{shouldDirty:!0,shouldTouch:!0}),b()}},T=A=>{const U=d().definition;if(typeof U=="object"&&qc(U)){const B={connector:{...U.connector,source:{...U.connector.source,fields:A.source.fields}}};c("definition",B,{shouldDirty:!0,shouldTouch:!0}),b()}g(!1)},j=A=>{E({runType:A.runType,data:A.data})},O=A=>{const M=A.connector.source.fields.length;return o.jsxs(Ce,{type:"button",variant:"outline",onClick:()=>{g(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(uL,{className:"h-4 w-4"}),o.jsxs("span",{children:["Edit Fields (",String(M),")"]})]})},D=A=>{const U=d().definition;if(qc(U)&&U.connector.source.configuration.length<=1){const B=X0(qe.CONNECTOR);c("definition",B,{shouldDirty:!0,shouldTouch:!0}),b()}if(typeof U=="object"&&qc(U)&&U.connector.source.configuration.length>1){const B={...U.connector.source,configuration:U.connector.source.configuration.filter((K,re)=>re!==A)},G={connector:{...U.connector,source:B}};c("definition",G,{shouldDirty:!0,shouldTouch:!0}),b()}},_=A=>{const U=d().definition;if(qc(U)){const B={...U.connector.source,configuration:[...U.connector.source.configuration,A]},G={connector:{...U.connector,source:B}};c("definition",G,{shouldDirty:!0,shouldTouch:!0}),b()}};return o.jsxs(o.Fragment,{children:[o.jsx(Qt,{control:e,name:"definition",render:({field:A})=>o.jsxs(Xt,{className:"dark:bg-white/2",children:[o.jsx(en,{children:o.jsx("div",{className:"space-y-3",children:!Pd(A.value)||w===ur.DRAFT?o.jsx(Fte,{storageType:t,onSetupConnector:C,preset:n,isOpen:v,onClose:()=>{x(!1)}}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Hte,{storageType:t,onAddConfiguration:_,existingConnector:Pd(A.value)?{source:A.value.connector.source,storage:A.value.connector.storage}:void 0}),Pd(A.value)&&O(A.value)]}),o.jsx("div",{className:"flex items-center gap-2",children:s&&s.definitionType===qe.CONNECTOR&&o.jsx(uD,{configuration:s.definition,onManualRun:j,children:o.jsxs(Ce,{variant:"outline",children:[o.jsx(wb,{className:"h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})})})]}),o.jsx("div",{className:"space-y-3",children:Pd(A.value)&&(s!=null&&s.storage)?A.value.connector.source.configuration.map((M,U)=>{const B=A.value;return o.jsx(hu,{children:o.jsx(Vte,{configIndex:U,connectorDef:B,dataStorage:s.storage,onRemoveConfiguration:D,onUpdateConfiguration:R,dataMartStatus:typeof w=="object"?w.code:w,totalConfigurations:B.connector.source.configuration.length},U)},U)}):null})]})})}),o.jsx(ln,{})]})}),o.jsx(hu,{children:o.jsx(PO,{isOpen:m,onClose:()=>{g(!1)},onSubmit:T,dataStorageType:t,existingConnector:Pd(d().definition)?{source:d().definition.connector.source,storage:d().definition.connector.storage}:void 0,mode:"fields-only"})})]})}function Bte({definitionType:e,storageType:t,preset:n}){const{control:r}=Du(),[s,l]=p.useState(!1);return p.useEffect(()=>{e===qe.CONNECTOR&&!n?l(!0):l(!1)},[e,n]),o.jsxs("div",{className:"space-y-2",children:[e===qe.SQL&&o.jsx(see,{control:r}),e===qe.TABLE&&o.jsx(oee,{control:r,storageType:t}),e===qe.VIEW&&o.jsx(iee,{control:r,storageType:t}),e===qe.TABLE_PATTERN&&o.jsx(lee,{control:r,storageType:t}),e===qe.CONNECTOR&&o.jsx($te,{control:r,storageType:t,preset:n,autoOpen:s})]})}function UO(){const[e]=gI(),t=e.get("preset");return p.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return oY(n)},[t])}function Gte(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/Math.pow(t,r)).toFixed(2)).toString()} ${n[r]}`}function qte(e,t){const[n,r]=p.useState(e);return p.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const Zte=1e3,Kte=[Cl.SUCCESS,Cl.ERROR,Cl.CANCELLED];function Yte(e){const[t,n]=p.useState(!1),[r,s]=p.useState(null),l=p.useRef({triggerId:null,abortController:null}),c=p.useCallback(v=>l.current.triggerId===v,[]),d=p.useCallback(v=>{s({isValid:!1,error:v instanceof Error?v.message:"Validation failed"}),n(!1)},[]),h=p.useCallback(async()=>{const{triggerId:v,abortController:x}=l.current;if(v){x==null||x.abort(),l.current={triggerId:null,abortController:null},s(null),n(!1);try{await rn.abortSqlDryRunTrigger(e,v)}catch(b){console.error("Failed to cancel trigger:",b)}}},[e]),m=p.useCallback(async(v,x)=>{for(;!x.aborted&&c(v);)try{const b=await rn.getSqlDryRunTriggerStatus(e,v);if(Kte.includes(b)){const w=await rn.getSqlDryRunTriggerResponse(e,v);s({isValid:w.isValid,error:w.error??void 0,bytes:w.bytes}),n(!1),l.current={triggerId:null,abortController:null};return}await new Promise(w=>setTimeout(w,Zte))}catch(b){d(b),l.current={triggerId:null,abortController:null};return}},[e,c,d]),g=p.useCallback(async v=>{await h(),n(!0),s(null);try{const{triggerId:x}=await rn.createSqlDryRunTrigger(e,v),b=new AbortController;l.current={triggerId:x,abortController:b},await m(x,b.signal)}catch(x){d(x)}},[e,h,m,d]);return p.useEffect(()=>()=>{const{triggerId:v,abortController:x}=l.current;x==null||x.abort(),v&&rn.abortSqlDryRunTrigger(e,v).catch(()=>{})},[e]),{validateSql:g,isLoading:t,result:r,cancel:h}}const Wte=300;function Qte({sql:e,dataMartId:t,debounceDelay:n=Wte,className:r="",onValidationStateChange:s}){const l=qte(e.trim(),n),{validateSql:c,isLoading:d,result:h,cancel:m}=Yte(t);p.useEffect(()=>{if(!l){m();const v={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(v);return}c(l)},[l,c,m,s]),p.useEffect(()=>{const v={isLoading:d,isValid:(h==null?void 0:h.isValid)??null,error:(h==null?void 0:h.error)??null,bytes:(h==null?void 0:h.bytes)??null};s==null||s(v)},[d,h,s]);const g=()=>d?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(gu,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{className:"text-sm",children:"Validating..."})]}):h?h.isValid?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(qj,{className:"h-4 w-4 text-green-600"}),o.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),h.bytes!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(Jm,{className:"h-3 w-3 text-gray-600"}),o.jsx("span",{className:"text-xs text-gray-600",children:Gte(h.bytes)})]})}),o.jsx(_t,{children:o.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):o.jsxs("div",{className:"flex h-9 items-center gap-2",children:[o.jsx(ef,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),h.error&&o.jsx("span",{className:"text-xs text-red-500",children:h.error})]}):o.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[o.jsx(Jm,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return o.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:g()})}function Xte(){const{dataMart:e,updateDataMartDefinition:t,getDataMart:n}=gs(),r=UO();if(!e)throw new Error("Data mart not found");const{definitionType:s,definition:l,id:c,storage:{type:d}}=e,[h,m]=p.useState(s),[,g]=p.useState({isValid:null,isLoading:!1,error:null}),v=p.useCallback(()=>{if(!h)return;const $={definitionType:h,definition:X0(h)};return l?{definitionType:h,definition:l}:$},[h,l]),x=p.useCallback(()=>{if(!h)return;const $=aee(h,d);return Wl($)},[h,d]),b=$i({resolver:x(),defaultValues:v(),mode:"onChange"}),{handleSubmit:w,reset:C,watch:E,formState:{isDirty:R,isValid:T}}=b,j=($,I)=>{if($!==qe.SQL)return"";const Y=I;return(Y==null?void 0:Y.sqlQuery)??""},O=E("definition"),D=j(h,O);p.useEffect(()=>{h&&C(v())},[h,C,v]);const _=$=>X0($);p.useEffect(()=>{if(!h&&!s&&(r!=null&&r.definitionType)){m(r.definitionType);const $={definitionType:r.definitionType,definition:_(r.definitionType)};C($)}},[r,h,s,C]);const A=p.useCallback($=>{g({isLoading:$.isLoading,isValid:$.isValid,error:$.error})},[]),M=$=>{m($)},U=p.useCallback(()=>{c&&n(c)},[c,n]),{run:B}=q1(c,U),G=async $=>{if(h&&c)try{await t(c,$.definitionType,$.definition),await B(),C($)}catch(I){console.error("Failed to update data mart definition:",I)}},K=$=>{$.preventDefault(),w(G)($)},re=()=>{C(v())},H=()=>h?o.jsxs("form",{onSubmit:K,className:"space-y-4",children:[o.jsx(Bte,{definitionType:h,storageType:d,preset:r==null?void 0:r.connectorSourceTitle}),o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Ce,{variant:"default",type:"submit",disabled:!T||!R,children:"Save"}),o.jsx(Ce,{type:"button",variant:"ghost",onClick:re,disabled:!R,children:"Discard"}),h===qe.SQL&&D&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-6 w-px bg-gray-300"}),o.jsx(Qte,{sql:D,dataMartId:c,onValidationStateChange:A})]})]})]}):null;return o.jsx(m3,{...b,children:o.jsxs("div",{className:"space-y-4",children:[!s&&o.jsx(XJ,{initialType:h,onTypeSelect:M}),H()]})})}function Jte(e){switch(e){case Pe.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Pe.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function FO(e){return e.type==="bigquery-data-mart-schema"}function zO(e){return e.type==="athena-data-mart-schema"}function GT(e){return e!==null&&typeof e=="object"&&"mode"in e}function qT(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function ene(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function Kx(e){return e==null?e:JSON.parse(JSON.stringify(e))}function tne(e){const t=Kx(e),[n,r]=p.useState(t),[s,l]=p.useState(!1);p.useEffect(()=>{const h=Kx(e);r(h),l(!1)},[e]);const c=p.useCallback(h=>{n?FO(n)&&h.every(GT)?(r({...n,fields:h}),l(!0)):zO(n)&&h.every(qT)&&(r({...n,fields:h}),l(!0)):h.length>0&&(GT(h[0])?(r({type:"bigquery-data-mart-schema",fields:h}),l(!0)):qT(h[0])&&(r({type:"athena-data-mart-schema",fields:h}),l(!0)))},[n]),d=p.useCallback(()=>{const h=Kx(e);r(h),l(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:d,setIsDirty:l}}function nne(e,t){const n=p.useRef(!1),r=p.useRef(!1),[s,l]=p.useState("idle");return p.useEffect(()=>{e||(n.current||r.current)&&(l(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,l("idle")},startActualizeOperation:()=>{r.current=!0,l("idle")},resetOperationStatus:()=>{l("idle")}}}function rne(e){const t=p.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(s=>s.meta&&s.meta.hidden).map(s=>["id"in s&&s.id?s.id:"accessorKey"in s&&typeof s.accessorKey=="string"?s.accessorKey:void 0,!1]).filter(([s])=>s!==void 0)):{},[e]),[n,r]=p.useState({});return p.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function VO(e,t){const n=e.name?e.name.toLowerCase().includes(t):!1,r=e.alias?e.alias.toLowerCase().includes(t):!1,s=e.description?e.description.toLowerCase().includes(t):!1;if(n||r||s)return!0;const l=e;return l.fields&&l.fields.length>0?l.fields.some(c=>VO(c,t)):!1}function HO(e,t,n=""){const r=[];return e.forEach((s,l)=>{const c=n?`${n}.${String(l)}`:String(l),d=s.name?s.name.toLowerCase().includes(t):!1,h=s.alias?s.alias.toLowerCase().includes(t):!1,m=s.description?s.description.toLowerCase().includes(t):!1;if((d||h||m)&&r.push(c),s.fields&&s.fields.length>0){const g=HO(s.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function ane(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return VO(r,s)}function sne(e){const[t,n]=p.useState(""),r=p.useCallback(l=>{n(l),e.setGlobalFilter(l)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}var us=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(us||{}),hf=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(hf||{}),Pn=(e=>(e.INTEGER="INTEGER",e.FLOAT="FLOAT",e.NUMERIC="NUMERIC",e.BIGNUMERIC="BIGNUMERIC",e.STRING="STRING",e.BYTES="BYTES",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.TIME="TIME",e.DATETIME="DATETIME",e.TIMESTAMP="TIMESTAMP",e.GEOGRAPHY="GEOGRAPHY",e.JSON="JSON",e.RECORD="RECORD",e.STRUCT="STRUCT",e.RANGE="RANGE",e.INTERVAL="INTERVAL",e))(Pn||{}),pS=(e=>(e.BOOLEAN="BOOLEAN",e.TINYINT="TINYINT",e.SMALLINT="SMALLINT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.REAL="REAL",e.FLOAT="FLOAT",e.DOUBLE="DOUBLE",e.DECIMAL="DECIMAL",e.CHAR="CHAR",e.VARCHAR="VARCHAR",e.STRING="STRING",e.BINARY="BINARY",e.VARBINARY="VARBINARY",e.DATE="DATE",e.TIME="TIME",e.TIMESTAMP="TIMESTAMP",e.TIME_WITH_TIME_ZONE="TIME WITH TIME ZONE",e.TIMESTAMP_WITH_TIME_ZONE="TIMESTAMP WITH TIME ZONE",e.INTERVAL_YEAR_TO_MONTH="INTERVAL YEAR TO MONTH",e.INTERVAL_DAY_TO_SECOND="INTERVAL DAY TO SECOND",e.ARRAY="ARRAY",e.MAP="MAP",e.STRUCT="STRUCT",e.ROW="ROW",e.JSON="JSON",e))(pS||{});function one(e){const[t,n]=p.useState(new Set),[r,s]=p.useState(null),l=p.useRef(""),c=p.useMemo(()=>{const w=C=>C.some(E=>E.type===Pn.RECORD||E.type===Pn.STRUCT||E.fields&&w(E.fields));return w(e)},[e]),d=p.useCallback(w=>{n(C=>{const E=new Set(C);return E.has(w)?E.delete(w):E.add(w),E})},[]),h=p.useCallback(()=>{const w=[],C=(E,R="")=>{E.forEach((T,j)=>{const O=R?`${R}.${String(j)}`:String(j);(T.type===Pn.RECORD||T.type===Pn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};C(e),n(E=>w.every(T=>E.has(T))?new Set:new Set(w))},[e]),m=p.useMemo(()=>{const w=[],C=(E,R="",T=0)=>{E.forEach((j,O)=>{const D=R?`${R}.${String(O)}`:String(O),_=j.type===Pn.RECORD||j.type===Pn.STRUCT;w.push({...j,path:D,level:T}),_&&j.fields&&t.has(D)&&C(j.fields,D,T+1)})};return C(e),w},[e,t]),g=p.useCallback(w=>{if(w!==l.current)if(l.current=w,w){r===null&&s(new Set(t));const E=HO(e,w).filter(R=>{const T=R.split(".").map(Number);let j=e,O;for(let D=0;D<T.length;D++){if(O=j[T[D]],!O)return!1;if((O.type===Pn.RECORD||O.type===Pn.STRUCT)&&O.fields&&O.fields.length>0)return!0;D<T.length-1&&(j=O.fields??[])}return!1});n(R=>{const T=new Set(R);return E.forEach(j=>{T.add(j)}),T})}else r!==null&&(n(r),s(null))},[e,t,r]),v=p.useCallback(w=>{const C=m[w];return C.type===Pn.RECORD||C.type===Pn.STRUCT},[m]),x=p.useMemo(()=>e.map(w=>({...w,fields:void 0})),[e]),b=p.useMemo(()=>{const w=[],C=(E,R="")=>{E.forEach((T,j)=>{const O=R?`${R}.${String(j)}`:String(j);(T.type===Pn.RECORD||T.type===Pn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};return C(e),w.length===0?!1:w.every(E=>t.has(E))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:d,toggleAllRecords:h,flattenedFields:m,handleSearchChange:g,isRecordType:v,topLevelFields:x,allExpanded:b}}function ine(e,t,n,r){const s=p.useCallback((h,m)=>{if(n){const g=[...e],v=t[h].path;if(!v)g[h]={...g[h],...m};else{const x=v.split(".").map(Number);let b=g,w;for(let E=0;E<x.length-1;E++)w=b[x[E]],b=w.fields??[];const C=x[x.length-1];b[C]&&(b[C]={...b[C],...m})}n(g)}},[e,t,n]),l=p.useCallback(()=>{if(n){const h={name:"",type:Pn.STRING,mode:hf.NULLABLE,isPrimaryKey:!1,status:us.DISCONNECTED};n([...e,h])}},[e,n]),c=p.useCallback(h=>{if(n){const m=[...e],g=t[h].path;if(!g)m.splice(h,1);else{const v=g.split(".").map(Number);let x=m,b;for(let C=0;C<v.length-1;C++)b=x[v[C]],x=b.fields??[];const w=v[v.length-1];x.splice(w,1)}n(m)}},[e,t,n]),d=p.useCallback(h=>{var m,g;if(n&&r){const v=[...e],x=t[h].path,b={name:"",type:Pn.STRING,mode:hf.NULLABLE,isPrimaryKey:!1,status:us.DISCONNECTED};if(!x)(m=v[h]).fields??(m.fields=[]),v[h].fields.push(b);else{const w=x.split(".").map(Number);let C=v;for(let E=0;E<w.length;E++){const R=w[E];E===w.length-1?((g=C[R]).fields??(g.fields=[]),C[R].fields.push(b)):C=C[R].fields??[]}}n(v)}},[e,t,n,r]);return{updateField:s,handleAddRow:l,handleDeleteRow:c,handleAddNestedField:d}}function $O(e,t,n){return{handleDragEnd:p.useCallback(s=>{const{active:l,over:c}=s;if(!c||l.id===c.id||!t)return;if(!n){const x=Number(l.id),b=Number(c.id),w=[...e],[C]=w.splice(x,1);w.splice(b,0,C),t(w);return}const d=n.findIndex((x,b)=>(x.path??String(b))===l.id),h=n.findIndex((x,b)=>(x.path??String(b))===c.id);if(d===-1||h===-1)return;const m=n[d].path,g=n[h].path,v=[...e];if(!m&&!g){const[x]=v.splice(d,1);v.splice(h,0,x),t(v);return}if(m&&g){const x=m.split(".").map(Number),b=g.split(".").map(Number);if(x.length===b.length&&x.slice(0,-1).join(".")===b.slice(0,-1).join(".")){let w=v;for(let T=0;T<x.length-1;T++)w=w[x[T]].fields??[];const C=x[x.length-1],E=b[b.length-1],[R]=w.splice(C,1);w.splice(E,0,R),t(v)}}},[e,n,t])}}function lne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Fg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ku(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function gS(e){return"nodeType"in e}function ta(e){var t,n;return e?ku(e)?e:gS(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function vS(e){const{Document:t}=ta(e);return e instanceof t}function Wf(e){return ku(e)?!1:e instanceof ta(e).HTMLElement}function BO(e){return e instanceof ta(e).SVGElement}function Iu(e){return e?ku(e)?e.document:gS(e)?vS(e)?e:Wf(e)||BO(e)?e.ownerDocument:document:document:document}const Hs=Fg?p.useLayoutEffect:p.useEffect;function yS(e){const t=p.useRef(e);return Hs(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function cne(){const e=p.useRef(null),t=p.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function mf(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return Hs(()=>{n.current!==e&&(n.current=e)},t),n}function Qf(e,t){const n=p.useRef();return p.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Mp(e){const t=yS(e),n=p.useRef(null),r=p.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function sb(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let Yx={};function Xf(e,t){return p.useMemo(()=>{if(t)return t;const n=Yx[e]==null?0:Yx[e]+1;return Yx[e]=n,e+"-"+n},[e,t])}function GO(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((l,c)=>{const d=Object.entries(c);for(const[h,m]of d){const g=l[h];g!=null&&(l[h]=g+e*m)}return l},{...t})}}const ru=GO(1),kp=GO(-1);function une(e){return"clientX"in e&&"clientY"in e}function xS(e){if(!e)return!1;const{KeyboardEvent:t}=ta(e.target);return t&&e instanceof t}function dne(e){if(!e)return!1;const{TouchEvent:t}=ta(e.target);return t&&e instanceof t}function ob(e){if(dne(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return une(e)?{x:e.clientX,y:e.clientY}:null}const pf=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[pf.Translate.toString(e),pf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ZT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function fne(e){return e.matches(ZT)?e:e.querySelector(ZT)}const hne={display:"none"};function mne(e){let{id:t,value:n}=e;return je.createElement("div",{id:t,style:hne},n)}function pne(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return je.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function gne(){const[e,t]=p.useState("");return{announce:p.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const qO=p.createContext(null);function vne(e){const t=p.useContext(qO);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function yne(){const[e]=p.useState(()=>new Set),t=p.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[p.useCallback(r=>{let{type:s,event:l}=r;e.forEach(c=>{var d;return(d=c[s])==null?void 0:d.call(c,l)})},[e]),t]}const xne={draggable:`
|
|
727
|
-
To pick up a draggable item, press the space bar.
|
|
728
|
-
While dragging, use the arrow keys to move the item.
|
|
729
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
730
|
-
`},bne={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Sne(e){let{announcements:t=bne,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=xne}=e;const{announce:l,announcement:c}=gne(),d=Xf("DndLiveRegion"),[h,m]=p.useState(!1);if(p.useEffect(()=>{m(!0)},[]),vne(p.useMemo(()=>({onDragStart(v){let{active:x}=v;l(t.onDragStart({active:x}))},onDragMove(v){let{active:x,over:b}=v;t.onDragMove&&l(t.onDragMove({active:x,over:b}))},onDragOver(v){let{active:x,over:b}=v;l(t.onDragOver({active:x,over:b}))},onDragEnd(v){let{active:x,over:b}=v;l(t.onDragEnd({active:x,over:b}))},onDragCancel(v){let{active:x,over:b}=v;l(t.onDragCancel({active:x,over:b}))}}),[l,t])),!h)return null;const g=je.createElement(je.Fragment,null,je.createElement(mne,{id:r,value:s.draggable}),je.createElement(pne,{id:d,announcement:c}));return n?is.createPortal(g,n):g}var rr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(rr||(rr={}));function Ip(){}function ZO(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function KO(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ms=Object.freeze({x:0,y:0});function Cne(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function wne(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ene(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Rne(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function KT(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const YO=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=KT(t,t.left,t.top),l=[];for(const c of r){const{id:d}=c,h=n.get(d);if(h){const m=Cne(KT(h),s);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort(wne)};function Tne(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=s-r,d=l-n;if(r<s&&n<l){const h=t.width*t.height,m=e.width*e.height,g=c*d,v=g/(h+m-g);return Number(v.toFixed(4))}return 0}const jne=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:c}=l,d=n.get(c);if(d){const h=Tne(d,t);h>0&&s.push({id:c,data:{droppableContainer:l,value:h}})}}return s.sort(Ene)};function _ne(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function WO(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ms}function Nne(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const Ane=Nne(1);function Dne(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function One(e,t,n){const r=Dne(t);if(!r)return e;const{scaleX:s,scaleY:l,x:c,y:d}=r,h=e.left-c-(1-s)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s:e.width,v=l?e.height/l:e.height;return{width:g,height:v,top:m,right:h+g,bottom:m+v,left:h}}const Mne={ignoreTransform:!1};function Lu(e,t){t===void 0&&(t=Mne);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:g}=ta(e).getComputedStyle(e);m&&(n=One(n,m,g))}const{top:r,left:s,width:l,height:c,bottom:d,right:h}=n;return{top:r,left:s,width:l,height:c,bottom:d,right:h}}function YT(e){return Lu(e,{ignoreTransform:!0})}function kne(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Ine(e,t){return t===void 0&&(t=ta(e).getComputedStyle(e)),t.position==="fixed"}function Lne(e,t){t===void 0&&(t=ta(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function bS(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(vS(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Wf(s)||BO(s)||n.includes(s))return n;const l=ta(e).getComputedStyle(s);return s!==e&&Lne(s,l)&&n.push(s),Ine(s,l)?n:r(s.parentNode)}return e?r(e):n}function QO(e){const[t]=bS(e,1);return t??null}function Wx(e){return!Fg||!e?null:ku(e)?e:gS(e)?vS(e)||e===Iu(e).scrollingElement?window:Wf(e)?e:null:null}function XO(e){return ku(e)?e.scrollX:e.scrollLeft}function JO(e){return ku(e)?e.scrollY:e.scrollTop}function ib(e){return{x:XO(e),y:JO(e)}}var cr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(cr||(cr={}));function e5(e){return!Fg||!e?!1:e===document.scrollingElement}function t5(e){const t={x:0,y:0},n=e5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,d=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:c,isRight:d,maxScroll:r,minScroll:t}}const Pne={x:.2,y:.2};function Une(e,t,n,r,s){let{top:l,left:c,right:d,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=Pne);const{isTop:m,isBottom:g,isLeft:v,isRight:x}=t5(e),b={x:0,y:0},w={x:0,y:0},C={height:t.height*s.y,width:t.width*s.x};return!m&&l<=t.top+C.height?(b.y=cr.Backward,w.y=r*Math.abs((t.top+C.height-l)/C.height)):!g&&h>=t.bottom-C.height&&(b.y=cr.Forward,w.y=r*Math.abs((t.bottom-C.height-h)/C.height)),!x&&d>=t.right-C.width?(b.x=cr.Forward,w.x=r*Math.abs((t.right-C.width-d)/C.width)):!v&&c<=t.left+C.width&&(b.x=cr.Backward,w.x=r*Math.abs((t.left+C.width-c)/C.width)),{direction:b,speed:w}}function Fne(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function n5(e){return e.reduce((t,n)=>ru(t,ib(n)),ms)}function zne(e){return e.reduce((t,n)=>t+XO(n),0)}function Vne(e){return e.reduce((t,n)=>t+JO(n),0)}function Hne(e,t){if(t===void 0&&(t=Lu),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);QO(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const $ne=[["x",["left","right"],zne],["y",["top","bottom"],Vne]];class SS{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=bS(n),s=n5(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of $ne)for(const h of c)Object.defineProperty(this,h,{get:()=>{const m=d(r),g=s[l]-m;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Kd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Bne(e){const{EventTarget:t}=ta(e);return e instanceof t?e:Iu(e)}function Qx(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Va;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Va||(Va={}));function WT(e){e.preventDefault()}function Gne(e){e.stopPropagation()}var Vt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Vt||(Vt={}));const r5={start:[Vt.Space,Vt.Enter],cancel:[Vt.Esc],end:[Vt.Space,Vt.Enter,Vt.Tab]},qne=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Vt.Right:return{...n,x:n.x+25};case Vt.Left:return{...n,x:n.x-25};case Vt.Down:return{...n,y:n.y+25};case Vt.Up:return{...n,y:n.y-25}}};class a5{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Kd(Iu(n)),this.windowListeners=new Kd(ta(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Va.Resize,this.handleCancel),this.windowListeners.add(Va.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Va.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Hne(r),n(ms)}handleKeyDown(t){if(xS(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=r5,coordinateGetter:c=qne,scrollBehavior:d="smooth"}=s,{code:h}=t;if(l.end.includes(h)){this.handleEnd(t);return}if(l.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:m}=r.current,g=m?{x:m.left,y:m.top}:ms;this.referenceCoordinates||(this.referenceCoordinates=g);const v=c(t,{active:n,context:r.current,currentCoordinates:g});if(v){const x=kp(v,g),b={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const E=t.code,{isTop:R,isRight:T,isLeft:j,isBottom:O,maxScroll:D,minScroll:_}=t5(C),A=Fne(C),M={x:Math.min(E===Vt.Right?A.right-A.width/2:A.right,Math.max(E===Vt.Right?A.left:A.left+A.width/2,v.x)),y:Math.min(E===Vt.Down?A.bottom-A.height/2:A.bottom,Math.max(E===Vt.Down?A.top:A.top+A.height/2,v.y))},U=E===Vt.Right&&!T||E===Vt.Left&&!j,B=E===Vt.Down&&!O||E===Vt.Up&&!R;if(U&&M.x!==v.x){const G=C.scrollLeft+x.x,K=E===Vt.Right&&G<=D.x||E===Vt.Left&&G>=_.x;if(K&&!x.y){C.scrollTo({left:G,behavior:d});return}K?b.x=C.scrollLeft-G:b.x=E===Vt.Right?C.scrollLeft-D.x:C.scrollLeft-_.x,b.x&&C.scrollBy({left:-b.x,behavior:d});break}else if(B&&M.y!==v.y){const G=C.scrollTop+x.y,K=E===Vt.Down&&G<=D.y||E===Vt.Up&&G>=_.y;if(K&&!x.x){C.scrollTo({top:G,behavior:d});return}K?b.y=C.scrollTop-G:b.y=E===Vt.Down?C.scrollTop-D.y:C.scrollTop-_.y,b.y&&C.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,ru(kp(v,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}a5.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=r5,onActivation:s}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function QT(e){return!!(e&&"distance"in e)}function XT(e){return!!(e&&"delay"in e)}class CS{constructor(t,n,r){var s;r===void 0&&(r=Bne(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=Iu(c),this.documentListeners=new Kd(this.document),this.listeners=new Kd(r),this.windowListeners=new Kd(ta(c)),this.initialCoordinates=(s=ob(l))!=null?s:ms,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Va.Resize,this.handleCancel),this.windowListeners.add(Va.DragStart,WT),this.windowListeners.add(Va.VisibilityChange,this.handleCancel),this.windowListeners.add(Va.ContextMenu,WT),this.documentListeners.add(Va.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(XT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(QT(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Va.Click,Gne,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Va.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!s)return;const h=(n=ob(t))!=null?n:ms,m=kp(s,h);if(!r&&d){if(QT(d)){if(d.tolerance!=null&&Qx(m,d.tolerance))return this.handleCancel();if(Qx(m,d.distance))return this.handleStart()}if(XT(d)&&Qx(m,d.tolerance))return this.handleCancel();this.handlePending(d,m);return}t.cancelable&&t.preventDefault(),c(h)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Vt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Zne={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class zg extends CS{constructor(t){const{event:n}=t,r=Iu(n.target);super(t,Zne,r)}}zg.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const Kne={move:{name:"mousemove"},end:{name:"mouseup"}};var lb;(function(e){e[e.RightClick=2]="RightClick"})(lb||(lb={}));class Yne extends CS{constructor(t){super(t,Kne,Iu(t.event.target))}}Yne.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===lb.RightClick?!1:(r==null||r({event:n}),!0)}}];const Xx={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Wne extends CS{constructor(t){super(t,Xx)}static setup(){return window.addEventListener(Xx.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Xx.move.name,t)};function t(){}}}Wne.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var Yd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Yd||(Yd={}));var Lp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Lp||(Lp={}));function Qne(e){let{acceleration:t,activator:n=Yd.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:c=5,order:d=Lp.TreeOrder,pointerCoordinates:h,scrollableAncestors:m,scrollableAncestorRects:g,delta:v,threshold:x}=e;const b=Jne({delta:v,disabled:!l}),[w,C]=cne(),E=p.useRef({x:0,y:0}),R=p.useRef({x:0,y:0}),T=p.useMemo(()=>{switch(n){case Yd.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case Yd.DraggableRect:return s}},[n,s,h]),j=p.useRef(null),O=p.useCallback(()=>{const _=j.current;if(!_)return;const A=E.current.x*R.current.x,M=E.current.y*R.current.y;_.scrollBy(A,M)},[]),D=p.useMemo(()=>d===Lp.TreeOrder?[...m].reverse():m,[d,m]);p.useEffect(()=>{if(!l||!m.length||!T){C();return}for(const _ of D){if((r==null?void 0:r(_))===!1)continue;const A=m.indexOf(_),M=g[A];if(!M)continue;const{direction:U,speed:B}=Une(_,M,T,t,x);for(const G of["x","y"])b[G][U[G]]||(B[G]=0,U[G]=0);if(B.x>0||B.y>0){C(),j.current=_,w(O,c),E.current=B,R.current=U;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,O,r,C,l,c,JSON.stringify(T),JSON.stringify(b),w,m,D,g,JSON.stringify(x)])}const Xne={x:{[cr.Backward]:!1,[cr.Forward]:!1},y:{[cr.Backward]:!1,[cr.Forward]:!1}};function Jne(e){let{delta:t,disabled:n}=e;const r=sb(t);return Qf(s=>{if(n||!r||!s)return Xne;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[cr.Backward]:s.x[cr.Backward]||l.x===-1,[cr.Forward]:s.x[cr.Forward]||l.x===1},y:{[cr.Backward]:s.y[cr.Backward]||l.y===-1,[cr.Forward]:s.y[cr.Forward]||l.y===1}}},[n,t,r])}function ere(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Qf(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function tre(e,t){return p.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...l]},[]),[e,t])}var gf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(gf||(gf={}));var cb;(function(e){e.Optimized="optimized"})(cb||(cb={}));const JT=new Map;function nre(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,c]=p.useState(null),{frequency:d,measure:h,strategy:m}=s,g=p.useRef(e),v=E(),x=mf(v),b=p.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(T=>T===null?R:T.concat(R.filter(j=>!T.includes(j))))},[x]),w=p.useRef(null),C=Qf(R=>{if(v&&!n)return JT;if(!R||R===JT||g.current!==e||l!=null){const T=new Map;for(let j of e){if(!j)continue;if(l&&l.length>0&&!l.includes(j.id)&&j.rect.current){T.set(j.id,j.rect.current);continue}const O=j.node.current,D=O?new SS(h(O),O):null;j.rect.current=D,D&&T.set(j.id,D)}return T}return R},[e,l,n,v,h]);return p.useEffect(()=>{g.current=e},[e]),p.useEffect(()=>{v||b()},[n,v]),p.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),p.useEffect(()=>{v||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},d))},[d,v,b,...r]),{droppableRects:C,measureDroppableContainers:b,measuringScheduled:l!=null};function E(){switch(m){case gf.Always:return!1;case gf.BeforeDragging:return n;default:return!n}}}function s5(e,t){return Qf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function rre(e,t){return s5(e,t)}function are(e){let{callback:t,disabled:n}=e;const r=yS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Vg(e){let{callback:t,disabled:n}=e;const r=yS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function sre(e){return new SS(Lu(e),e)}function ej(e,t,n){t===void 0&&(t=sre);const[r,s]=p.useState(null);function l(){s(h=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=h??n)!=null?m:null}const g=t(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const c=are({callback(h){if(e)for(const m of h){const{type:g,target:v}=m;if(g==="childList"&&v instanceof HTMLElement&&v.contains(e)){l();break}}}}),d=Vg({callback:l});return Hs(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),r}function ore(e){const t=s5(e);return WO(e,t)}const tj=[];function ire(e){const t=p.useRef(e),n=Qf(r=>e?r&&r!==tj&&e&&t.current&&e.parentNode===t.current.parentNode?r:bS(e):tj,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function lre(e){const[t,n]=p.useState(null),r=p.useRef(e),s=p.useCallback(l=>{const c=Wx(l.target);c&&n(d=>d?(d.set(c,ib(c)),new Map(d)):null)},[]);return p.useEffect(()=>{const l=r.current;if(e!==l){c(l);const d=e.map(h=>{const m=Wx(h);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,ib(m)]):null}).filter(h=>h!=null);n(d.length?new Map(d):null),r.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(h=>{const m=Wx(h);m==null||m.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>ru(l,c),ms):n5(e):ms,[e,t])}function nj(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const r=e!==ms;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?kp(e,n.current):ms}function cre(e){p.useEffect(()=>{if(!Fg)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function ure(e,t){return p.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=c=>{l(c,t)},n},{}),[e,t])}function o5(e){return p.useMemo(()=>e?kne(e):null,[e])}const rj=[];function dre(e,t){t===void 0&&(t=Lu);const[n]=e,r=o5(n?ta(n):null),[s,l]=p.useState(rj);function c(){l(()=>e.length?e.map(h=>e5(h)?r:new SS(t(h),h)):rj)}const d=Vg({callback:c});return Hs(()=>{d==null||d.disconnect(),c(),e.forEach(h=>d==null?void 0:d.observe(h))},[e]),s}function fre(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Wf(t)?t:e}function hre(e){let{measure:t}=e;const[n,r]=p.useState(null),s=p.useCallback(m=>{for(const{target:g}of m)if(Wf(g)){r(v=>{const x=t(g);return v?{...v,width:x.width,height:x.height}:x});break}},[t]),l=Vg({callback:s}),c=p.useCallback(m=>{const g=fre(m);l==null||l.disconnect(),g&&(l==null||l.observe(g)),r(g?t(g):null)},[t,l]),[d,h]=Mp(c);return p.useMemo(()=>({nodeRef:d,rect:n,setRef:h}),[n,d,h])}const mre=[{sensor:zg,options:{}},{sensor:a5,options:{}}],pre={current:{}},Km={draggable:{measure:YT},droppable:{measure:YT,strategy:gf.WhileDragging,frequency:cb.Optimized},dragOverlay:{measure:Lu}};class Wd extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const gre={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Wd,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ip},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Km,measureDroppableContainers:Ip,windowRect:null,measuringScheduled:!1},vre={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ip,draggableNodes:new Map,over:null,measureDroppableContainers:Ip},Hg=p.createContext(vre),i5=p.createContext(gre);function yre(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Wd}}}function xre(e,t){switch(t.type){case rr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case rr.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case rr.DragEnd:case rr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case rr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Wd(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case rr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const c=new Wd(e.droppable.containers);return c.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case rr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new Wd(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function bre(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=p.useContext(Hg),l=sb(r),c=sb(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!r&&l&&c!=null){if(!xS(l)||document.activeElement===l.target)return;const d=s.get(c);if(!d)return;const{activatorNode:h,node:m}=d;if(!h.current&&!m.current)return;requestAnimationFrame(()=>{for(const g of[h.current,m.current]){if(!g)continue;const v=fne(g);if(v){v.focus();break}}})}},[r,t,s,c,l]),null}function Sre(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function Cre(e){return p.useMemo(()=>({draggable:{...Km.draggable,...e==null?void 0:e.draggable},droppable:{...Km.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Km.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function wre(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=p.useRef(!1),{x:c,y:d}=typeof s=="boolean"?{x:s,y:s}:s;Hs(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!r)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const g=n(m),v=WO(g,r);if(c||(v.x=0),d||(v.y=0),l.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const x=QO(m);x&&x.scrollBy({top:v.y,left:v.x})}},[t,c,d,r,n])}const l5=p.createContext({...ms,scaleX:1,scaleY:1});var fi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(fi||(fi={}));const c5=p.memo(function(t){var n,r,s,l;let{id:c,accessibility:d,autoScroll:h=!0,children:m,sensors:g=mre,collisionDetection:v=jne,measuring:x,modifiers:b,...w}=t;const C=p.useReducer(xre,void 0,yre),[E,R]=C,[T,j]=yne(),[O,D]=p.useState(fi.Uninitialized),_=O===fi.Initialized,{draggable:{active:A,nodes:M,translate:U},droppable:{containers:B}}=E,G=A!=null?M.get(A):null,K=p.useRef({initial:null,translated:null}),re=p.useMemo(()=>{var hn;return A!=null?{id:A,data:(hn=G==null?void 0:G.data)!=null?hn:pre,rect:K}:null},[A,G]),H=p.useRef(null),[$,I]=p.useState(null),[Y,Z]=p.useState(null),ie=mf(w,Object.values(w)),be=Xf("DndDescribedBy",c),L=p.useMemo(()=>B.getEnabled(),[B]),P=Cre(x),{droppableRects:W,measureDroppableContainers:ae,measuringScheduled:fe}=nre(L,{dragging:_,dependencies:[U.x,U.y],config:P.droppable}),ge=ere(M,A),ue=p.useMemo(()=>Y?ob(Y):null,[Y]),Ne=Uo(),Re=rre(ge,P.draggable.measure);wre({activeNode:A!=null?M.get(A):null,config:Ne.layoutShiftCompensation,initialRect:Re,measure:P.draggable.measure});const xe=ej(ge,P.draggable.measure,Re),et=ej(ge?ge.parentElement:null),Xe=p.useRef({activatorEvent:null,active:null,activeNode:ge,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Bt=B.getNodeFor((n=Xe.current.over)==null?void 0:n.id),ft=hre({measure:P.dragOverlay.measure}),gn=(r=ft.nodeRef.current)!=null?r:ge,Ie=_?(s=ft.rect)!=null?s:xe:null,wt=!!(ft.nodeRef.current&&ft.rect),Ot=ore(wt?null:xe),tn=o5(gn?ta(gn):null),V=ire(_?Bt??ge:null),ee=dre(V),de=Sre(b,{transform:{x:U.x-Ot.x,y:U.y-Ot.y,scaleX:1,scaleY:1},activatorEvent:Y,active:re,activeNodeRect:xe,containerNodeRect:et,draggingNodeRect:Ie,over:Xe.current.over,overlayNodeRect:ft.rect,scrollableAncestors:V,scrollableAncestorRects:ee,windowRect:tn}),_e=ue?ru(ue,U):null,ye=lre(V),we=nj(ye),Le=nj(ye,[xe]),st=ru(de,we),ht=Ie?Ane(Ie,de):null,bn=re&&ht?v({active:re,collisionRect:ht,droppableRects:W,droppableContainers:L,pointerCoordinates:_e}):null,Hr=Rne(bn,"id"),[Dn,Rr]=p.useState(null),$r=wt?de:ru(de,Le),Sn=_ne($r,(l=Dn==null?void 0:Dn.rect)!=null?l:null,xe),mr=p.useRef(null),On=p.useCallback((hn,vn)=>{let{sensor:Mn,options:Qn}=vn;if(H.current==null)return;const Xn=M.get(H.current);if(!Xn)return;const or=hn.nativeEvent,Tr=new Mn({active:H.current,activeNode:Xn,event:or,options:Qn,context:Xe,onAbort(Q){if(!M.get(Q))return;const{onDragAbort:ve}=ie.current,Ee={id:Q};ve==null||ve(Ee),T({type:"onDragAbort",event:Ee})},onPending(Q,oe,ve,Ee){if(!M.get(Q))return;const{onDragPending:He}=ie.current,ke={id:Q,constraint:oe,initialCoordinates:ve,offset:Ee};He==null||He(ke),T({type:"onDragPending",event:ke})},onStart(Q){const oe=H.current;if(oe==null)return;const ve=M.get(oe);if(!ve)return;const{onDragStart:Ee}=ie.current,ze={activatorEvent:or,active:{id:oe,data:ve.data,rect:K}};is.unstable_batchedUpdates(()=>{Ee==null||Ee(ze),D(fi.Initializing),R({type:rr.DragStart,initialCoordinates:Q,active:oe}),T({type:"onDragStart",event:ze}),I(mr.current),Z(or)})},onMove(Q){R({type:rr.DragMove,coordinates:Q})},onEnd:F(rr.DragEnd),onCancel:F(rr.DragCancel)});mr.current=Tr;function F(Q){return async function(){const{active:ve,collisions:Ee,over:ze,scrollAdjustedTranslate:He}=Xe.current;let ke=null;if(ve&&He){const{cancelDrop:Ze}=ie.current;ke={activatorEvent:or,active:ve,collisions:Ee,delta:He,over:ze},Q===rr.DragEnd&&typeof Ze=="function"&&await Promise.resolve(Ze(ke))&&(Q=rr.DragCancel)}H.current=null,is.unstable_batchedUpdates(()=>{R({type:Q}),D(fi.Uninitialized),Rr(null),I(null),Z(null),mr.current=null;const Ze=Q===rr.DragEnd?"onDragEnd":"onDragCancel";if(ke){const Ye=ie.current[Ze];Ye==null||Ye(ke),T({type:Ze,event:ke})}})}}},[M]),Po=p.useCallback((hn,vn)=>(Mn,Qn)=>{const Xn=Mn.nativeEvent,or=M.get(Qn);if(H.current!==null||!or||Xn.dndKit||Xn.defaultPrevented)return;const Tr={active:or};hn(Mn,vn.options,Tr)===!0&&(Xn.dndKit={capturedBy:vn.sensor},H.current=Qn,On(Mn,vn))},[M,On]),ja=tre(g,Po);cre(g),Hs(()=>{xe&&O===fi.Initializing&&D(fi.Initialized)},[xe,O]),p.useEffect(()=>{const{onDragMove:hn}=ie.current,{active:vn,activatorEvent:Mn,collisions:Qn,over:Xn}=Xe.current;if(!vn||!Mn)return;const or={active:vn,activatorEvent:Mn,collisions:Qn,delta:{x:st.x,y:st.y},over:Xn};is.unstable_batchedUpdates(()=>{hn==null||hn(or),T({type:"onDragMove",event:or})})},[st.x,st.y]),p.useEffect(()=>{const{active:hn,activatorEvent:vn,collisions:Mn,droppableContainers:Qn,scrollAdjustedTranslate:Xn}=Xe.current;if(!hn||H.current==null||!vn||!Xn)return;const{onDragOver:or}=ie.current,Tr=Qn.get(Hr),F=Tr&&Tr.rect.current?{id:Tr.id,rect:Tr.rect.current,data:Tr.data,disabled:Tr.disabled}:null,Q={active:hn,activatorEvent:vn,collisions:Mn,delta:{x:Xn.x,y:Xn.y},over:F};is.unstable_batchedUpdates(()=>{Rr(F),or==null||or(Q),T({type:"onDragOver",event:Q})})},[Hr]),Hs(()=>{Xe.current={activatorEvent:Y,active:re,activeNode:ge,collisionRect:ht,collisions:bn,droppableRects:W,draggableNodes:M,draggingNode:gn,draggingNodeRect:Ie,droppableContainers:B,over:Dn,scrollableAncestors:V,scrollAdjustedTranslate:st},K.current={initial:Ie,translated:ht}},[re,ge,bn,ht,M,gn,Ie,W,B,Dn,V,st]),Qne({...Ne,delta:U,draggingRect:ht,pointerCoordinates:_e,scrollableAncestors:V,scrollableAncestorRects:ee});const Ql=p.useMemo(()=>({active:re,activeNode:ge,activeNodeRect:xe,activatorEvent:Y,collisions:bn,containerNodeRect:et,dragOverlay:ft,draggableNodes:M,droppableContainers:B,droppableRects:W,over:Dn,measureDroppableContainers:ae,scrollableAncestors:V,scrollableAncestorRects:ee,measuringConfiguration:P,measuringScheduled:fe,windowRect:tn}),[re,ge,xe,Y,bn,et,ft,M,B,W,Dn,ae,V,ee,P,fe,tn]),bs=p.useMemo(()=>({activatorEvent:Y,activators:ja,active:re,activeNodeRect:xe,ariaDescribedById:{draggable:be},dispatch:R,draggableNodes:M,over:Dn,measureDroppableContainers:ae}),[Y,ja,re,xe,R,be,M,Dn,ae]);return je.createElement(qO.Provider,{value:j},je.createElement(Hg.Provider,{value:bs},je.createElement(i5.Provider,{value:Ql},je.createElement(l5.Provider,{value:Sn},m)),je.createElement(bre,{disabled:(d==null?void 0:d.restoreFocus)===!1})),je.createElement(Sne,{...d,hiddenTextDescribedById:be}));function Uo(){const hn=($==null?void 0:$.autoScrollEnabled)===!1,vn=typeof h=="object"?h.enabled===!1:h===!1,Mn=_&&!hn&&!vn;return typeof h=="object"?{...h,enabled:Mn}:{enabled:Mn}}}),Ere=p.createContext(null),aj="button",Rre="Draggable";function Tre(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=Xf(Rre),{activators:c,activatorEvent:d,active:h,activeNodeRect:m,ariaDescribedById:g,draggableNodes:v,over:x}=p.useContext(Hg),{role:b=aj,roleDescription:w="draggable",tabIndex:C=0}=s??{},E=(h==null?void 0:h.id)===t,R=p.useContext(E?l5:Ere),[T,j]=Mp(),[O,D]=Mp(),_=ure(c,t),A=mf(n);Hs(()=>(v.set(t,{id:t,key:l,node:T,activatorNode:O,data:A}),()=>{const U=v.get(t);U&&U.key===l&&v.delete(t)}),[v,t]);const M=p.useMemo(()=>({role:b,tabIndex:C,"aria-disabled":r,"aria-pressed":E&&b===aj?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,b,C,E,w,g.draggable]);return{active:h,activatorEvent:d,activeNodeRect:m,attributes:M,isDragging:E,listeners:r?void 0:_,node:T,over:x,setNodeRef:j,setActivatorNodeRef:D,transform:R}}function jre(){return p.useContext(i5)}const _re="Droppable",Nre={timeout:25};function Are(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=Xf(_re),{active:c,dispatch:d,over:h,measureDroppableContainers:m}=p.useContext(Hg),g=p.useRef({disabled:n}),v=p.useRef(!1),x=p.useRef(null),b=p.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:E}={...Nre,...s},R=mf(C??r),T=p.useCallback(()=>{if(!v.current){v.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),b.current=null},E)},[E]),j=Vg({callback:T,disabled:w||!c}),O=p.useCallback((M,U)=>{j&&(U&&(j.unobserve(U),v.current=!1),M&&j.observe(M))},[j]),[D,_]=Mp(O),A=mf(t);return p.useEffect(()=>{!j||!D.current||(j.disconnect(),v.current=!1,j.observe(D.current))},[D,j]),p.useEffect(()=>(d({type:rr.RegisterDroppable,element:{id:r,key:l,disabled:n,node:D,rect:x,data:A}}),()=>d({type:rr.UnregisterDroppable,key:l,id:r})),[r]),p.useEffect(()=>{n!==g.current.disabled&&(d({type:rr.SetDroppableDisabled,id:r,key:l,disabled:n}),g.current.disabled=n)},[r,l,n,d]),{active:c,rect:x,isOver:(h==null?void 0:h.id)===r,node:D,over:h,setNodeRef:_}}function u5(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Dre(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function Mm(e){return e!==null&&e>=0}function Ore(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mre(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const d5=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=u5(t,r,n),c=t[s],d=l[s];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},km={scaleX:1,scaleY:1},f5=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:r;if(!d)return null;if(s===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...km}:null}const h=kre(l,s,n);return s>n&&s<=c?{x:0,y:-d.height-h,...km}:s<n&&s>=c?{x:0,y:d.height+h,...km}:{x:0,y:0,...km}};function kre(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const h5="Sortable",m5=je.createContext({activeIndex:-1,containerId:h5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:d5,disabled:{draggable:!1,droppable:!1}});function p5(e){let{children:t,id:n,items:r,strategy:s=d5,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:h,over:m,measureDroppableContainers:g}=jre(),v=Xf(h5,n),x=d.rect!==null,b=p.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),w=c!=null,C=c?b.indexOf(c.id):-1,E=m?b.indexOf(m.id):-1,R=p.useRef(b),T=!Ore(b,R.current),j=E!==-1&&C===-1||T,O=Mre(l);Hs(()=>{T&&w&&g(b)},[T,b,w,g]),p.useEffect(()=>{R.current=b},[b]);const D=p.useMemo(()=>({activeIndex:C,containerId:v,disabled:O,disableTransforms:j,items:b,overIndex:E,useDragOverlay:x,sortedRects:Dre(b,h),strategy:s}),[C,v,O.draggable,O.droppable,j,b,E,h,x,s]);return je.createElement(m5.Provider,{value:D},t)}const Ire=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return u5(n,r,s).indexOf(t)},Lre=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:c,previousItems:d,previousContainerId:h,transition:m}=e;return!m||!r||d!==l&&s===c?!1:n?!0:c!==s&&t===h},Pre={duration:200,easing:"ease"},g5="transform",Ure=pf.Transition.toString({property:g5,duration:0,easing:"linear"}),Fre={roleDescription:"sortable"};function zre(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,c]=p.useState(null),d=p.useRef(n);return Hs(()=>{if(!t&&n!==d.current&&r.current){const h=s.current;if(h){const m=Lu(r.current,{ignoreTransform:!0}),g={x:h.left-m.left,y:h.top-m.top,scaleX:h.width/m.width,scaleY:h.height/m.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,r,s]),p.useEffect(()=>{l&&c(null)},[l]),l}function Vre(e){let{animateLayoutChanges:t=Lre,attributes:n,disabled:r,data:s,getNewIndex:l=Ire,id:c,strategy:d,resizeObserverConfig:h,transition:m=Pre}=e;const{items:g,containerId:v,activeIndex:x,disabled:b,disableTransforms:w,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:T}=p.useContext(m5),j=Hre(r,b),O=g.indexOf(c),D=p.useMemo(()=>({sortable:{containerId:v,index:O,items:g},...s}),[v,s,O,g]),_=p.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:A,node:M,isOver:U,setNodeRef:B}=Are({id:c,data:D,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...h}}),{active:G,activatorEvent:K,activeNodeRect:re,attributes:H,setNodeRef:$,listeners:I,isDragging:Y,over:Z,setActivatorNodeRef:ie,transform:be}=Tre({id:c,data:D,attributes:{...Fre,...n},disabled:j.draggable}),L=lne(B,$),P=!!G,W=P&&!w&&Mm(x)&&Mm(E),ae=!R&&Y,fe=ae&&W?be:null,ue=W?fe??(d??T)({rects:C,activeNodeRect:re,activeIndex:x,overIndex:E,index:O}):null,Ne=Mm(x)&&Mm(E)?l({id:c,items:g,activeIndex:x,overIndex:E}):O,Re=G==null?void 0:G.id,xe=p.useRef({activeId:Re,items:g,newIndex:Ne,containerId:v}),et=g!==xe.current.items,Xe=t({active:G,containerId:v,isDragging:Y,isSorting:P,id:c,index:O,items:g,newIndex:xe.current.newIndex,previousItems:xe.current.items,previousContainerId:xe.current.containerId,transition:m,wasDragging:xe.current.activeId!=null}),Bt=zre({disabled:!Xe,index:O,node:M,rect:A});return p.useEffect(()=>{P&&xe.current.newIndex!==Ne&&(xe.current.newIndex=Ne),v!==xe.current.containerId&&(xe.current.containerId=v),g!==xe.current.items&&(xe.current.items=g)},[P,Ne,v,g]),p.useEffect(()=>{if(Re===xe.current.activeId)return;if(Re&&!xe.current.activeId){xe.current.activeId=Re;return}const gn=setTimeout(()=>{xe.current.activeId=Re},50);return()=>clearTimeout(gn)},[Re]),{active:G,activeIndex:x,attributes:H,data:D,rect:A,index:O,newIndex:Ne,items:g,isOver:U,isSorting:P,isDragging:Y,listeners:I,node:M,overIndex:E,over:Z,setNodeRef:L,setActivatorNodeRef:ie,setDroppableNodeRef:B,setDraggableNodeRef:$,transform:Bt??ue,transition:ft()};function ft(){if(Bt||et&&xe.current.newIndex===O)return Ure;if(!(ae&&!xS(K)||!m)&&(P||Xe))return pf.Transition.toString({...m,property:g5})}}function Hre(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}Vt.Down,Vt.Right,Vt.Up,Vt.Left;function au({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:l,saveButtonText:c="Save",cancelButtonText:d="Discard"}){const[h,m]=p.useState(!1),[g,v]=p.useState(e),x=p.useRef(null),b=T=>{v(T.target.value)},w=()=>{n&&g!==e&&n(g.trim()),m(!1)},C=()=>{v(e),m(!1)},E=T=>{T.key==="Enter"&&!T.shiftKey?(r===1||T.ctrlKey)&&(T.preventDefault(),w()):T.key==="Escape"&&(T.preventDefault(),C())},R=T=>{m(T),T?(v(e),setTimeout(()=>{x.current&&x.current.focus()},0)):C()};return o.jsxs(Y1,{open:h,onOpenChange:R,children:[o.jsx(W1,{asChild:!0,children:o.jsx("div",{className:J("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",l),children:e||t})}),o.jsxs(Q1,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[o.jsx(Fi,{ref:x,value:g,onChange:b,onKeyDown:E,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),o.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[o.jsx(Ce,{variant:"outline",size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:d}),o.jsx(Ce,{size:"sm",onClick:w,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function $re({isAllExpanded:e,onToggle:t}){return o.jsx(Ce,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,title:e?"Collapse all items":"Expand all items",children:e?o.jsx(r9,{className:"h-4 w-4"}):o.jsx(Sb,{className:"h-4 w-4"})})}function Bre({isExpanded:e,onToggle:t,ariaLabel:n}){return o.jsx(Ce,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?o.jsx(Za,{className:"h-4 w-4"}):o.jsx(Ra,{className:"h-4 w-4"})})}function Gre({className:e="",...t}){return o.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:o.jsx(I9,{className:"h-4 w-4 text-gray-400"})})}function v5({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:l,transition:c,isDragging:d}=Vre({id:e}),h={transform:pf.Transform.toString(l),transition:c,opacity:d?.75:1},m=p.Children.toArray(t),g=[o.jsx(ya,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:o.jsx(Gre,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return o.jsx(sr,{ref:s,style:h,className:"group",children:g})}function y5({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,l]=p.useState(!1),c=()=>{t&&t(e.index),l(!1)},d=r&&n&&r(e.index),h=!!t,m=d&&h;return o.jsxs("div",{className:"px-3 text-right",children:[o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":"Row actions",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Er,{align:"end",children:[d&&o.jsxs(bt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[o.jsx(Ta,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&o.jsx(Ga,{}),h&&o.jsxs(bt,{onClick:()=>{l(!0)},children:[o.jsx(ko,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),o.jsx(xa,{open:s,onOpenChange:l,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function qre({mode:e,onModeChange:t}){const n=Object.values(hf),r=s=>{t&&t(s)};return o.jsxs(Sa,{value:e,onValueChange:r,children:[o.jsx(wa,{className:"h-90 cursor-pointer",size:"sm",children:o.jsx(Ca,{placeholder:"Select field mode"})}),o.jsx(Ea,{className:"max-h-[300px]",children:n.map(s=>o.jsx(qn,{value:s,children:s},s))})]})}var $g="Checkbox",[Zre]=kr($g),[Kre,wS]=Zre($g);function Yre(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:l,form:c,name:d,onCheckedChange:h,required:m,value:g="on",internal_do_not_use_render:v}=e,[x,b]=zr({prop:n,defaultProp:s??!1,onChange:h,caller:$g}),[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useRef(!1),j=w?!!c||!!w.closest("form"):!0,O={checked:x,disabled:l,setChecked:b,control:w,setControl:C,name:d,form:c,value:g,hasConsumerStoppedPropagationRef:T,required:m,defaultChecked:Ci(s)?!1:s,isFormControl:j,bubbleInput:E,setBubbleInput:R};return o.jsx(Kre,{scope:t,...O,children:Wre(v)?v(O):r})}var x5="CheckboxTrigger",b5=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:l,value:c,disabled:d,checked:h,required:m,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:w}=wS(x5,e),C=vt(s,g),E=p.useRef(h);return p.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const T=()=>v(E.current);return R.addEventListener("reset",T),()=>R.removeEventListener("reset",T)}},[l,v]),o.jsx(Ke.button,{type:"button",role:"checkbox","aria-checked":Ci(h)?"mixed":h,"aria-required":m,"data-state":T5(h),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:C,onKeyDown:Te(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Te(n,R=>{v(T=>Ci(T)?!0:!T),w&&b&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});b5.displayName=x5;var S5=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:h,onCheckedChange:m,form:g,...v}=e;return o.jsx(Yre,{__scopeCheckbox:n,checked:s,defaultChecked:l,disabled:d,required:c,onCheckedChange:m,name:r,form:g,value:h,internal_do_not_use_render:({isFormControl:x})=>o.jsxs(o.Fragment,{children:[o.jsx(b5,{...v,ref:t,__scopeCheckbox:n}),x&&o.jsx(R5,{__scopeCheckbox:n})]})})});S5.displayName=$g;var C5="CheckboxIndicator",w5=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,l=wS(C5,n);return o.jsx(Sr,{present:r||Ci(l.checked)||l.checked===!0,children:o.jsx(Ke.span,{"data-state":T5(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});w5.displayName=C5;var E5="CheckboxBubbleInput",R5=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:l,defaultChecked:c,required:d,disabled:h,name:m,value:g,form:v,bubbleInput:x,setBubbleInput:b}=wS(E5,e),w=vt(n,b),C=$1(l),E=Ub(r);p.useEffect(()=>{const T=x;if(!T)return;const j=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(j,"checked").set,_=!s.current;if(C!==l&&D){const A=new Event("click",{bubbles:_});T.indeterminate=Ci(l),D.call(T,Ci(l)?!1:l),T.dispatchEvent(A)}},[x,C,l,s]);const R=p.useRef(Ci(l)?!1:l);return o.jsx(Ke.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:d,disabled:h,name:m,value:g,form:v,...t,tabIndex:-1,ref:w,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});R5.displayName=E5;function Wre(e){return typeof e=="function"}function Ci(e){return e==="indeterminate"}function T5(e){return Ci(e)?"indeterminate":e?"checked":"unchecked"}function j5({className:e,...t}){return o.jsx(S5,{"data-slot":"checkbox",className:J("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(w5,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5"})})})}function _5({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return o.jsx(j5,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const sj={[us.CONNECTED]:{icon:$p,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[us.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Bp,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[us.DISCONNECTED]:{icon:aL,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function N5({status:e}){if(!e||!(e in sj))return null;const t=sj[e],{icon:n,color:r,label:s,description:l}=t,c=`schema-field-status-tooltip-${e}`;return o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(n,{className:J("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),o.jsxs(_t,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs font-medium",children:s}),o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:l})]})]})})}function A5({type:e,storageType:t,onTypeChange:n}){const r=t===Pe.GOOGLE_BIGQUERY?Object.values(Pn):Object.values(pS),s=l=>{n&&(Pe.GOOGLE_BIGQUERY,n(l))};return o.jsxs(Sa,{value:e,onValueChange:s,children:[o.jsx(wa,{className:"cursor-pointer",size:"sm",children:o.jsx(Ca,{placeholder:"Select field type"})}),o.jsx(Ea,{className:"max-h-[300px]",children:r.map(l=>o.jsx(qn,{value:l,children:l},l))})]})}function Qre({table:e}){return o.jsx("div",{className:"px-3 text-right",children:o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(bt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta?t.columnDef.meta.title??t.id:t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function Xre({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:l,"aria-label":c}){const[d,h]=p.useState(n),m=p.useRef(!0);p.useEffect(()=>{(n===""||m.current)&&(h(n),m.current=!1)},[n]);const g=p.useCallback(v=>{const x=v.target.value;h(x);const b=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(b)}},[r,s]);return o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Fl,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),o.jsx($t,{id:e,placeholder:t,value:d,onChange:g,className:l??"dm-card-toolbar-search-input","aria-label":c??t})]})}function Jre({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s}){return o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsx(Xre,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),o.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&o.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([l,c])=>c===0?null:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(N5,{status:l}),o.jsx("span",{className:"text-sm font-medium text-gray-500",children:c})]},l))}),o.jsxs(Ce,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,"aria-label":"Add new field",children:[o.jsx(Ta,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const eae={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function oj(e,t={}){const n=eae[e];return n?{...t,position:"sticky",zIndex:n.zIndex,...n.left!==void 0&&{left:n.left},...n.right!==void 0&&{right:n.right}}:t}function tae({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:l,dragContextProps:c,rowComponent:d=sr,getRowId:h}){const m=t,g=l,v=d,{columnVisibility:x,setColumnVisibility:b}=rne(m),w=Tu({data:e,columns:m,getCoreRowModel:Ru(),getFilteredRowModel:Hf(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:x},onColumnVisibilityChange:b,enableGlobalFilter:!0,globalFilterFn:ane,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:C,onChange:E,searchValue:R}=sne(w),T=p.useRef("");p.useEffect(()=>{s&&R!==T.current&&(T.current=R,s(R))},[R,s]);const j=p.useMemo(()=>{const _={[us.CONNECTED]:0,[us.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[us.DISCONNECTED]:0};return(r??e).forEach(M=>{M.status in _&&_[M.status]++}),_},[e,r]);return o.jsxs("div",{className:"space-y-4",children:[n&&o.jsx(Jre,{table:w,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:C,onFilterChange:E,statusCounts:j}),o.jsx("div",{className:"dm-card-table-wrap mb-0",children:o.jsxs(ju,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[o.jsx(_u,{className:"dm-card-table-header",children:w.getHeaderGroups().map(_=>o.jsx(sr,{className:"dm-card-table-header-row",children:_.headers.map(A=>o.jsx(Au,{className:"bg-secondary dark:bg-background",style:oj(A.column.id,{width:A.getSize()!==0?A.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:A.isPlaceholder?null:typeof A.column.columnDef.header=="function"?A.column.columnDef.header(A.getContext()):A.column.columnDef.header},A.id))},_.id))}),o.jsx(Nu,{className:"dm-card-table-body",children:w.getRowModel().rows.length?o.jsx(g,{...c,children:w.getRowModel().rows.map(_=>o.jsx(v,{id:h?h(_):_.index,row:_,children:_.getVisibleCells().map(A=>o.jsx(ya,{className:"bg-background dark:bg-muted",style:oj(A.column.id,{width:A.column.getSize()!==0?A.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:A.column.columnDef.cell&&typeof A.column.columnDef.cell=="function"?A.column.columnDef.cell(A.getContext()):null},A.id))},_.id))}):o.jsx(sr,{children:o.jsx(ya,{colSpan:m.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&o.jsxs(Ce,{variant:"outline",className:"dm-card-table-add-field-btn bg-background dark:bg-muted w-full cursor-pointer rounded-t-none border-0",onClick:n,"aria-label":"Add new field",children:[o.jsx(Ta,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function D5({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:l=[],fieldsForStatusCount:c,onSearchChange:d,nameColumnHeader:h,nameColumnCell:m,primaryKeyColumnCell:g,aliasColumnCell:v,descriptionColumnCell:x,actionsColumnCell:b,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R}){const T=p.useCallback((A,M)=>{if(t){const U=[...e];U[A]={...U[A],...M},t(U)}},[e,t]),j=p.useCallback(()=>{if(t){const A=r();t([...e,A])}},[e,t,r]),O=p.useCallback(A=>{if(t){const M=[...e];M.splice(A,1),t(M)}},[e,t]),D=p.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:A})=>o.jsx(N5,{status:A.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:h??(()=>o.jsxs(Tt,{children:[o.jsx(jt,{className:"cursor-default",children:"Name"}),o.jsx(_t,{children:"Field name in the output schema"})]})),size:80,cell:({row:A})=>m?m({row:A,updateField:T}):o.jsx(au,{value:ene(A.getValue("name")),onValueChange:M=>{T(A.index,{name:M})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>o.jsxs(Tt,{children:[o.jsx(jt,{className:"cursor-default",children:"PK"}),o.jsx(_t,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:A})=>g?g({row:A,updateField:T}):o.jsx(_5,{isPrimaryKey:A.getValue("isPrimaryKey"),onPrimaryKeyChange:M=>{T(A.index,{isPrimaryKey:M})}}),enableHiding:!1},{accessorKey:"alias",header:()=>o.jsxs(Tt,{children:[o.jsx(jt,{className:"cursor-default",children:"Alias"}),o.jsx(_t,{children:"Alternative name for the field"})]}),size:80,cell:({row:A})=>v?v({row:A,updateField:T}):o.jsx(au,{value:A.getValue("alias"),onValueChange:M=>{T(A.index,{alias:M})},placeholder:"-"})},{accessorKey:"description",header:()=>o.jsxs(Tt,{children:[o.jsx(jt,{className:"cursor-default",children:"Description"}),o.jsx(_t,{children:"Detailed information about the field"})]}),cell:({row:A})=>x?x({row:A,updateField:T}):o.jsx(au,{value:A.getValue("description"),onValueChange:M=>{T(A.index,{description:M})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:A})=>o.jsx(Qre,{table:A}),cell:({row:A,table:M})=>b?b({row:A,table:M}):o.jsx(y5,{row:A,onDeleteRow:t?O:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[T,O,t,h,m,g,v,x,b]),_=p.useMemo(()=>{const M={accessorKey:"type",header:()=>o.jsxs(Tt,{children:[o.jsx(jt,{className:"cursor-default pl-[12px]",children:"Type"}),o.jsx(_t,{children:"Data type of the field"})]}),size:80,cell:B=>s({row:B.row,updateField:T}),enableHiding:!1},U=[...D];if(U.splice(3,0,M),l.length>0){const B=[...l];B.sort((G,K)=>{const re=G.columnIndex??1/0,H=K.columnIndex??1/0;return re-H}),B.forEach(G=>{if(G.columnIndex!==void 0){const K=Math.min(Math.max(0,G.columnIndex),U.length);U.splice(K,0,G)}else U.splice(U.length-1,0,G)})}return U},[D,s,T,l]);return o.jsx(tae,{fields:e,columns:_,onFieldsChange:t,onAddRow:n??(t?j:void 0),fieldsForStatusCount:c,onSearchChange:d,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R})}function nae({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:l,flattenedFields:c,handleSearchChange:d,isRecordType:h,topLevelFields:m,allExpanded:g}=one(e),{updateField:v,handleDeleteRow:x,handleAddNestedField:b,handleAddRow:w}=ine(e,c,t,G=>G),C=p.useCallback(()=>({name:"",type:Pn.STRING,mode:hf.NULLABLE,isPrimaryKey:!1,status:us.DISCONNECTED}),[]),E=p.useCallback(({row:G})=>o.jsx(A5,{type:G.getValue("type"),storageType:Pe.GOOGLE_BIGQUERY,onTypeChange:K=>{v(G.index,{type:K})}}),[v]),R=p.useMemo(()=>[{accessorKey:"mode",header:()=>o.jsxs(Tt,{children:[o.jsx(jt,{className:"cursor-default pl-[12px]",children:"Mode"}),o.jsx(_t,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
731
|
-
NULLABLE - field can be NULL
|
|
732
|
-
REQUIRED - field cant be NULL
|
|
733
|
-
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:G})=>o.jsx(qre,{mode:G.getValue("mode"),onModeChange:K=>{v(G.index,{mode:K})}}),columnIndex:4}],[v]),T=p.useCallback(()=>o.jsxs("div",{className:"flex items-center",children:[r&&o.jsx($re,{isAllExpanded:g,onToggle:l}),o.jsxs(Tt,{children:[o.jsx(jt,{className:"cursor-default",children:"Name"}),o.jsx(_t,{children:"Field name in the output schema"})]})]}),[r,g,l]),j=p.useCallback(({row:G})=>{const K=c[G.index],H=(K.type===Pn.RECORD||K.type===Pn.STRUCT)&&K.fields&&K.fields.length>0,$=K.path??"",I=K.level??0,Y=n.has($);return o.jsxs("div",{className:"flex items-center",children:[I>0&&o.jsx("div",{style:{width:`${String(I*16-(H?4:0))}px`},className:"flex-shrink-0"}),H?o.jsx(Bre,{isExpanded:Y,onToggle:()=>{s($)},ariaLabel:Y?"Collapse nested fields":"Expand nested fields"}):r&&o.jsx("div",{className:"w-5"}),o.jsx(au,{value:G.getValue("name"),onValueChange:Z=>{v(G.index,{name:Z})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,v]),O=p.useCallback(({row:G})=>{const K=c[G.index],re=K.type===Pn.RECORD||K.type===Pn.STRUCT;return(K.level??0)===0&&!re?o.jsx(_5,{isPrimaryKey:G.getValue("isPrimaryKey"),onPrimaryKeyChange:$=>{v(G.index,{isPrimaryKey:$})}}):o.jsx("div",{})},[c,v]),D=p.useCallback(({row:G})=>o.jsx(au,{value:G.getValue("description"),onValueChange:K=>{v(G.index,{description:K})},minRows:5,placeholder:"-"}),[v]),_=p.useCallback(({row:G})=>o.jsx(au,{value:G.getValue("alias"),onValueChange:K=>{v(G.index,{alias:K})},placeholder:"-"}),[v]),A=p.useCallback(({row:G})=>o.jsx(y5,{row:G,onDeleteRow:t?x:void 0,onAddNestedField:t?b:void 0,isRecordType:h}),[t,x,b,h]),{handleDragEnd:M}=$O(e,t,c),U=p.useCallback(G=>{const K=c[G.index];return K.path??String(c.indexOf(K))},[c]),B=KO(ZO(zg,{activationConstraint:{distance:5}}));return o.jsx(c5,{sensors:B,collisionDetection:YO,onDragEnd:M,children:o.jsx(D5,{fields:c,onFieldsChange:t,onAddRow:w,createNewField:C,renderTypeCell:E,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:d,nameColumnHeader:T,nameColumnCell:j,primaryKeyColumnCell:O,aliasColumnCell:_,descriptionColumnCell:D,actionsColumnCell:A,dragContext:p5,dragContextProps:{items:c.map(G=>G.path??String(c.indexOf(G))),strategy:f5},rowComponent:v5,getRowId:U})})}function rae({fields:e,onFieldsChange:t}){const n=p.useCallback(()=>({name:"",type:pS.STRING,isPrimaryKey:!1,status:us.DISCONNECTED}),[]),r=p.useCallback(({row:c,updateField:d})=>o.jsx(A5,{type:c.getValue("type"),storageType:Pe.AWS_ATHENA,onTypeChange:h=>{d(c.index,{type:h})}}),[]),{handleDragEnd:s}=$O(e,t),l=KO(ZO(zg,{activationConstraint:{distance:5}}));return o.jsx(c5,{sensors:l,collisionDetection:YO,onDragEnd:s,children:o.jsx(D5,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:p5,dragContextProps:{items:e.map((c,d)=>d),strategy:f5},rowComponent:v5})})}function aae({schema:e,storageType:t,onFieldsChange:n}){const r=p.useMemo(()=>{if(!e){const s=Jte(t);return n(s.fields),s}return e},[e,t,n]);return FO(r)?o.jsx(nae,{fields:r.fields,onFieldsChange:n}):zO(r)?o.jsx(rae,{fields:r.fields,onFieldsChange:n}):o.jsx("div",{className:"p-4 text-center",children:o.jsx("p",{children:"Unsupported schema type"})})}function sae(){const{dataMart:e,updateDataMartSchema:t,isLoading:n,error:r,getDataMart:s}=gs(),l=e==null?void 0:e.schema,{schema:c,isDirty:d,updateSchema:h,resetSchema:m}=tne(l),{operationStatus:g,startSaveOperation:v}=nne(n,r);p.useEffect(()=>{g==="success"&&m()},[g,m]);const x=p.useCallback(O=>{h(O)},[h]),b=(e==null?void 0:e.id)??"",w=p.useCallback(()=>{b&&s(b)},[b,s]),{run:C,isLoading:E}=q1(b,w);if(!e)return o.jsx("div",{children:"Error: Data mart not found"});const R=()=>{b&&c&&(v(),t(b,c).then(()=>{C()}))},T=()=>{C()},j=()=>{m()};return o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx(aae,{schema:c,storageType:e.storage.type,onFieldsChange:x}),o.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[o.jsxs("div",{className:"flex space-x-4",children:[o.jsx(Ce,{variant:"default",onClick:R,disabled:!d,children:"Save"}),o.jsx(Ce,{type:"button",variant:"ghost",onClick:j,disabled:!d,children:"Discard"})]}),o.jsx("div",{children:o.jsx(Ce,{type:"button",variant:"outline",onClick:T,disabled:E,children:"Refresh schema"})})]})]})})}function oae(){const e=Mj(),{id:t,projectId:n}=e;return t?n?o.jsx("div",{className:"dm-page",children:o.jsx(u3,{children:o.jsx(wQ,{id:t})})}):o.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):o.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function iae({className:e,...t}){return o.jsx("div",{"data-slot":"card",className:J("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function lae({className:e,...t}){return o.jsx("div",{"data-slot":"card-header",className:J("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function cae({className:e,...t}){return o.jsx("div",{"data-slot":"card-title",className:J("leading-none font-semibold",e),...t})}function uae({className:e,...t}){return o.jsx("div",{"data-slot":"card-description",className:J("text-muted-foreground text-sm",e),...t})}function dae({className:e,...t}){return o.jsx("div",{"data-slot":"card-content",className:J("px-6",e),...t})}function fae({className:e,...t}){return o.jsx("div",{"data-slot":"card-footer",className:J("flex items-center px-6 [.border-t]:pt-6",e),...t})}const ES=p.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function To({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=p.useContext(ES);return o.jsxs("div",{className:"flex items-center gap-2 self-center",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:o.jsx(e,{size:18})}),o.jsx(cae,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&o.jsx(uae,{className:J("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsxs("div",{className:"pointer-events-none ml-2 flex items-center opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100",children:[o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),o.jsx("span",{className:"sr-only",children:t})]})}),o.jsx(_t,{children:o.jsx("p",{children:t})})]})})]})}To.displayName="CollapsibleCardHeaderTitle";function Jf({children:e,className:t}){const n=r=>{r.stopPropagation()};return o.jsx("div",{className:J("flex items-center gap-2 self-center",t),onClick:n,children:e})}Jf.displayName="CollapsibleCardHeaderActions";function jo({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=p.useContext(ES);let s,l;return p.Children.forEach(e,c=>{if(p.isValidElement(c))switch(c.type){case To:s=c;break;case Jf:l=c;break}}),o.jsxs(lae,{className:J("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,o.jsxs("div",{className:"flex items-center gap-2",children:[l,t&&o.jsx("div",{className:J("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-white/4"),children:o.jsx("div",{className:J("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:o.jsx(Za,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}jo.displayName="CollapsibleCardHeader";function _o({children:e}){return o.jsx(dae,{className:"px-4 pt-1",children:e})}_o.displayName="CollapsibleCardContent";function wi({left:e,right:t}){return o.jsxs(fae,{className:"flex items-center gap-2 px-4 py-4",children:[o.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&o.jsx("div",{className:"flex items-center",children:t})]})}wi.displayName="CollapsibleCardFooter";const ij="collapsed-card-";function Rl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:l,name:c}){const d=c?ks.get(`${ij}${c}`,"boolean")??s:s,[h,m]=p.useState(d);p.useEffect(()=>{c&&ks.set(`${ij}${c}`,h)},[h,c]);const g=()=>{const C=!h;m(C),l==null||l(C)};let v,x,b;p.Children.forEach(e,C=>{if(p.isValidElement(C))switch(C.type){case jo:v=C;break;case _o:x=C;break;case wi:b=C;break}});const w={default:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none",dense:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none text-sm",flat:"rounded-md p-0 gap-0 border-0 border-b-0 shadow-none"};return o.jsx(ES.Provider,{value:{isCollapsed:h,collapsible:r,handleCollapse:g},children:o.jsxs(iae,{className:J(w[n],t),children:[v,o.jsx("div",{className:J("grid transition-all duration-200",h?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:o.jsxs("div",{className:"overflow-hidden",children:[x,b]})})]})})}function hae(){const{dataMart:e,updateDataMartStorage:t}=Hi();return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs(Rl,{collapsible:!0,name:"data-storage",children:[o.jsx(jo,{children:o.jsx(To,{icon:Jm,tooltip:"Configure where your data will be stored",children:"Storage"})}),o.jsx(_o,{children:(e==null?void 0:e.storage)&&o.jsx(QJ,{dataStorage:e.storage,onDataStorageChange:t})}),o.jsx(wi,{})]}),o.jsxs(Rl,{collapsible:!0,name:"input-source",children:[o.jsx(jo,{children:o.jsx(To,{icon:Cb,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),o.jsx(_o,{children:e&&o.jsx(Xte,{})}),o.jsx(wi,{})]}),o.jsxs(Rl,{collapsible:!0,name:"output-schema",children:[o.jsx(jo,{children:o.jsx(To,{icon:p9,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),o.jsx(_o,{children:e&&o.jsx(sae,{})}),o.jsx(wi,{})]})]})}function mae({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),[d,h]=p.useState(!1),{deleteReport:m,fetchReportsByDataMartId:g,runReport:v}=Gl(),x=`actions-menu-${e.original.id}`,b=p.useCallback(async()=>{try{await m(e.original.id),await g(e.original.dataMart.id),t==null||t(),h(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,g,t,e.original.id,e.original.dataMart.id]),w=p.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),C=p.useCallback(async()=>{try{s(!0),await v(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[v,e.original.id]),E=p.useCallback(()=>{h(!0),c(!1)},[]);return o.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[o.jsxs(Cr,{open:l,onOpenChange:c,children:[o.jsx(wr,{asChild:!0,children:o.jsxs(Ce,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":l,"aria-controls":x,children:[o.jsx("span",{className:"sr-only",children:"Open menu"}),o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),o.jsxs(Er,{id:x,align:"end",role:"menu",children:[o.jsxs(bt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem",children:[o.jsx(Cf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),Cg(e.original.destinationConfig)&&o.jsxs(o.Fragment,{children:[o.jsx(Ga,{}),o.jsxs(bt,{onClick:R=>{R.stopPropagation(),C()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[o.jsx(wb,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),o.jsx(bt,{asChild:!0,children:o.jsxs("a",{href:h1(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[o.jsx(A9,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),o.jsx(Ga,{}),o.jsxs(bt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[o.jsx(ko,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),o.jsx(xa,{open:d,onOpenChange:h,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{b()},variant:"destructive"})]})}const pae={[un.SUCCESS]:{icon:$p,color:"text-green-500",label:"Success"},[un.ERROR]:{icon:ef,color:"text-red-500",label:"Fail"},[un.RUNNING]:{icon:gu,color:"text-primary animate-spin",label:"In progress"},[un.CANCELLED]:{icon:ef,color:"text-gray-500",label:"Cancelled"}};function gae({status:e,error:t}){if(!e)return null;const n=pae[e],{icon:r,color:s,label:l}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,d=()=>e===un.ERROR&&t?`${l}: ${t}`:l;return o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(r,{className:J("h-5 w-5",s),role:"img","aria-label":d(),"aria-describedby":c,tabIndex:0})}),o.jsxs(_t,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs",children:l}),e===un.ERROR&&t&&o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function Jx({column:e,children:t,label:n}){const r=e.getIsSorted(),s=p.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),l=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",d=n??(typeof t=="string"?t:"Column");return o.jsxs(Ce,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&o.jsx(Us,{className:"text-foreground h-4 w-4"}),r==="desc"&&o.jsx(Za,{className:"text-foreground h-4 w-4"}),!r&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{className:"text-muted-foreground h-4 w-4"})})]})]})}var bi=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(bi||{});const O5={[bi.TITLE]:"Title",[bi.LAST_RUN_DATE]:"Last Run Date",[bi.LAST_RUN_STATUS]:"Last Run Status"};function vae({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=O5[t.id]||t.id;return o.jsx(bt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const lj=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},yae=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:bi.TITLE,header:({column:n})=>o.jsx(Jx,{column:n,children:O5[bi.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:bi.LAST_RUN_DATE,header:({column:n})=>o.jsx(Jx,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(kl,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:bi.LAST_RUN_STATUS,header:({column:n})=>o.jsx(Jx,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?o.jsx(gae,{status:n.original.lastRunStatus,error:n.original.lastRunError}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>o.jsx(vae,{table:n}),cell:({row:n})=>o.jsx(mae,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function M5({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const s=p.useRef(r);s.current=r;const l=p.useRef(null);p.useEffect(()=>{var h;if(!e)return;(h=l.current)==null||h.abort(),l.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const m=new AbortController;s.current(m.signal)}};c();const d=window.setInterval(c,t);return()=>{var m;window.clearInterval(d),(m=l.current)==null||m.abort()}},[e,t,n])}const xae=5e3;function bae({destination:e,onEditReport:t,autoRefreshEnabled:n=!1}){const{dataMart:r}=gs(),{fetchReportsByDataMartId:s,reports:l,stopAllPolling:c,setPollingConfig:d}=Gl(),h=p.useMemo(()=>l.filter(E=>E.dataDestination.type===Lt.GOOGLE_SHEETS&&E.dataDestination.id===e.id),[l,e.id]);p.useEffect(()=>{d({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[d]),p.useEffect(()=>{(async()=>{try{if(!r)return;await s(r.id)}catch(R){console.error(R)}})()},[s,r]),M5({enabled:!!r&&n,intervalMs:xae,onTick:()=>{r&&s(r.id,{silent:!0})}}),p.useEffect(()=>()=>{c()},[r==null?void 0:r.id,c]);const m=p.useMemo(()=>yae({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:g,setSorting:v,columnVisibility:x,setColumnVisibility:b}=Bf({columns:m,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),w=Tu({data:h,columns:m,getCoreRowModel:Ru(),onSortingChange:v,getSortedRowModel:$f(),state:{sorting:g,columnVisibility:x},onColumnVisibilityChange:b}),C=`google-sheets-reports-table-${e.id}`;return o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(ju,{id:C,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[o.jsx(_u,{className:"dm-card-table-header",children:w.getHeaderGroups().map(E=>o.jsx(sr,{className:"dm-card-table-header-row",children:E.headers.map(R=>o.jsx(Au,{className:lj(R.column.columnDef._align),style:R.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(R.column.getSize())}%`},scope:"col",children:R.isPlaceholder?null:typeof R.column.columnDef.header=="function"?R.column.columnDef.header(R.getContext()):R.column.columnDef.header},R.id))},E.id))}),o.jsx(Nu,{className:"dm-card-table-body",children:w.getRowModel().rows.length?w.getRowModel().rows.map((E,R)=>o.jsx(sr,{onClick:()=>{const T=l.find(j=>j.id===E.original.id);T&&t(T)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":R+1,children:E.getVisibleCells().map((T,j)=>o.jsx(ya,{className:`px-6 whitespace-normal ${lj(T.column.columnDef._align)}`,style:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.column.getSize())}%`},role:"cell","aria-colindex":j+1,children:typeof T.column.columnDef.cell=="function"?T.column.columnDef.cell(T.getContext()):T.column.columnDef.cell},T.id))},E.id)):o.jsx(sr,{children:o.jsx(ya,{colSpan:m.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function Sae({children:e,className:t,...n}){return o.jsx("div",{className:J("group flex items-start justify-center gap-3 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",t),...n,children:e})}function Cae({children:e,className:t,...n}){return o.jsx("div",{className:J("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function wae({children:e,className:t,...n}){return o.jsx("div",{className:J("text-md font-medium",t),...n,children:e})}function Eae({children:e,className:t,...n}){return o.jsx("div",{className:J("text-muted-foreground text-sm",t),...n,children:e})}function Rae({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:s,tooltipTextSwitchOff:l,tooltipTextSwitchDisabled:c}){const d=t?c??"Disabled":e?s:l;return o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:h=>h.stopPropagation(),children:n?o.jsx(gu,{className:"text-muted-foreground h-5 w-5 animate-spin"}):o.jsx(_O,{checked:e,disabled:t,onCheckedChange:r})})}),o.jsx(_t,{children:d})]})}function Tae({icon:e,className:t,...n}){return o.jsx("div",{className:J("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:e??o.jsx(Ra,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function jae(e){const{dataMart:t}=gs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:l}=Gl(),[c,d]=p.useState(!1),h=p.useMemo(()=>n.find(b=>b.dataDestination.type===Lt.LOOKER_STUDIO&&b.dataDestination.id===e.id),[n,e.id]),m=p.useMemo(()=>(t==null?void 0:t.status.code)===ur.PUBLISHED,[t==null?void 0:t.status.code]),g=p.useMemo(()=>!!h,[h]),v=p.useMemo(()=>g?"Available in Looker Studio":"Not available in Looker Studio",[g]),x=p.useCallback(async b=>{if(!(!t||!m)){d(!0);try{if(b){const w={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:ga.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(w),await l(t.id)}else h&&(await s(h.id),await l(t.id))}catch(w){console.error("Failed to toggle Looker Studio report:",w)}finally{d(!1)}}},[t,m,e,h,r,s,l]);return{existingReport:h,isLoading:c,isEnabled:m,isChecked:g,dynamicTitle:v,handleSwitchChange:x}}function _ae({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:l,isChecked:c,dynamicTitle:d,handleSwitchChange:h}=jae(e),m=p.useCallback(()=>{r&&t(r)},[r,t]);return o.jsxs(Sae,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[o.jsx(Rae,{checked:c,disabled:!l,loading:s,onCheckedChange:g=>void h(g),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),o.jsxs(Cae,{children:[o.jsx(wae,{children:d}),o.jsx(Eae,{children:c&&r?o.jsx(o.Fragment,{children:r.lastRunDate?o.jsxs(o.Fragment,{children:["Last fetched"," ",r.lastRunStatus===un.SUCCESS&&"successfully ",o.jsx(kl,{date:new Date(r.lastRunDate)}),r.lastRunStatus===un.ERROR&&" but failed with error",r.lastRunError&&o.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:r.lastRunError})]}):"Waiting for Looker Studio to fetch data"}):"Switch on to enable access"})]}),c&&r&&o.jsx(Tae,{})]})}function Nae(){const{scope:e}=Io();return o.jsx("div",{className:"dm-card",children:o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(bb,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),o.jsx(Ce,{variant:"outline",asChild:!0,children:o.jsxs(Ba,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",o.jsx(Ra,{className:"h-4 w-4"})]})})]})})}function Aae(){const[e,t]=p.useState(!1),[n,r]=p.useState(Un.CREATE),[s,l]=p.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Un.CREATE),l(null),t(!0),Fe({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(Un.EDIT),l(m),t(!0),Fe({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),l(null),Fe({event:"report_close",category:"Report",action:n===Un.EDIT?"Edit":"Create",label:"ReportForm"})}}}function Dae({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=fZ(e),{isOpen:s,mode:l,editingReport:c,handleAddReport:d,handleEditReport:h,handleCloseModal:m}=Aae();return r?o.jsxs(o.Fragment,{children:[o.jsxs(Rl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[o.jsxs(jo,{children:[o.jsx(To,{icon:n.icon,children:e.title}),o.jsx(Jf,{children:e.type===Lt.GOOGLE_SHEETS&&o.jsx(Oae,{dataMartStatus:t,onAddReport:d})})]}),o.jsx(_o,{children:o.jsx(Zae,{destination:e,onEditReport:h,...e.type===Lt.GOOGLE_SHEETS&&{autoRefreshEnabled:!0}})}),o.jsx(wi,{})]}),o.jsx(qae,{destination:e,isOpen:s,onClose:m,mode:l,initialReport:c})]}):null}function Oae({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===ur.DRAFT;return o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("span",{children:o.jsxs(Ce,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[o.jsx(Ta,{className:"h-4 w-4"}),"Add Report"]})})}),n&&o.jsx(_t,{children:o.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function Mae({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){p.useEffect(()=>{{const s=setTimeout(()=>{const l=document.getElementById(e);if(l){const c=l;c.focus(),r&&c.value?c.select():c.value&&c.setSelectionRange(c.value.length,c.value.length)}},n);return()=>{clearTimeout(s)}}},[t,e,n,r])}const kae=sn({title:on().min(1,"Title is required"),documentUrl:on().refine(C4,"Enter a valid Google Sheets URL"),dataDestinationId:on().min(1,"Destination is required")});function Iae({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:s}){const[l,c]=p.useState(null),[d,h]=p.useState(!1),{updateReport:m,createReport:g,error:v,clearError:x}=Gl();p.useEffect(()=>{d&&v&&(c(v),h(!1))},[v,d]);const b=$i({resolver:Wl(kae),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&Cg(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(s==null?void 0:s.id)??""},mode:"onTouched"}),{register:w,handleSubmit:C,formState:E,reset:R}=b,{errors:T,isDirty:j}=E,O=p.useCallback(async D=>{try{c(null),x(),h(!0);const{spreadsheetId:_,sheetId:A}=Kq(D.documentUrl);if(!_){c("Invalid Google Sheets URL");return}let M;if(t===Un.CREATE)M=await g({title:D.title,dataMartId:n,dataDestinationId:D.dataDestinationId,destinationConfig:{type:ga.GOOGLE_SHEETS_CONFIG,spreadsheetId:_,sheetId:A}});else{if(!e){c("Initial report is required for edit mode");return}M=await m(e.id,{title:D.title,dataDestinationId:D.dataDestinationId,destinationConfig:{type:ga.GOOGLE_SHEETS_CONFIG,spreadsheetId:_,sheetId:A}})}if(!M||v){c(v??"An error occurred while submitting the form");return}r==null||r()}catch(_){console.error("Error submitting form:",_),c("An error occurred while submitting the form")}},[t,e,n,g,m,r,x,v]);return{form:b,register:w,handleSubmit:C,errors:T,isDirty:j,reset:R,formError:l,isSubmitting:d,setFormError:c,getValues:b.getValues,onSubmit:O}}function Lae(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"service-account-details",children:[o.jsx(Yn,{children:"How do I get a correct document link?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open your Google Sheets document and select the specific ",o.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),o.jsxs("li",{children:["Share the document with the service account email and grant it ",o.jsx("strong",{children:"Editor"})," ","access."]}),o.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",o.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),o.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function e0(e){return"serviceAccount"in e}function Pae({value:e,children:t}){const[n,r]=p.useState(!1),s=async()=>{e&&(await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3))};return o.jsx(ls,{children:o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>l.key==="Enter"&&s(),className:J("flex cursor-pointer items-center justify-between gap-2 select-none","text-muted-foreground border-input rounded-md border px-3 py-1.5 text-sm","hover:bg-accent hover:text-accent-foreground transition-colors"),children:[o.jsx("span",{className:"truncate",children:t||e||"No data"}),n?o.jsx(dr,{className:"h-4 w-4 text-green-500"}):o.jsx(tf,{className:"h-4 w-4"})]})}),o.jsx(_t,{children:o.jsx("p",{children:n?"Copied!":"Click to copy"})})]})})}const Uae=p.forwardRef(({initialReport:e,mode:t=Un.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const h="google-sheets-edit-form",m="google-sheets-title-input",g="google-sheets-document-url-input",v="google-sheets-data-destination-select",{dataMart:x}=gs(),{scope:b}=Io(),{dataDestinations:w,fetchDataDestinations:C,loading:E}=yg(),[R,T]=p.useState([]);p.useEffect(()=>{x&&C()},[x,C]),p.useEffect(()=>{if(w.length>0){const G=w.filter(K=>K.type===Lt.GOOGLE_SHEETS);T(G)}},[w]),Mae({elementId:m,isOpen:!0,delay:150});const{isDirty:j,reset:O,form:D,isSubmitting:_,formError:A,onSubmit:M}=Iae({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});p.useEffect(()=>{r&&r(A)},[A,r]),p.useEffect(()=>{if(t===Un.EDIT&&e&&Cg(e.destinationConfig))O({title:e.title,documentUrl:h1(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===Un.CREATE){const G=(c==null?void 0:c.id)??"";O({title:"",documentUrl:"",dataDestinationId:G})}},[e,t,O,c]),p.useEffect(()=>{n==null||n(j)},[j,n]);const U=D.watch("documentUrl"),B=U&&C4(U.trim());return o.jsx(Zl,{...D,children:o.jsxs(Bi,{id:h,ref:d,noValidate:!0,onSubmit:G=>void D.handleSubmit(M)(G),children:[o.jsxs(Kl,{children:[o.jsxs(Vs,{title:"General",children:[o.jsx(Qt,{control:D.control,name:"title",render:({field:G})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),o.jsx(en,{children:o.jsx($t,{id:m,placeholder:"Enter a report title",...G})}),o.jsx(ln,{})]})}),o.jsx(Qt,{control:D.control,name:"dataDestinationId",render:({field:G})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Select one of your existing destinations",children:"Destination"}),o.jsxs(Sa,{onValueChange:G.onChange,value:G.value,disabled:E||R.length===0,children:[o.jsx(en,{children:o.jsx(wa,{id:v,className:"w-full max-w-full overflow-hidden",children:o.jsx(Ca,{className:"truncate",placeholder:"Select a destination",children:G.value&&R.length>0&&(()=>{const K=R.find(re=>re.id===G.value);if(K){const H=df.getInfo(K.type).icon;return o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(H,{className:"flex-shrink-0",size:18}),o.jsx("div",{className:"flex min-w-0 flex-col",children:o.jsx("span",{className:"truncate",children:K.title})})]})}return null})()})})}),o.jsx(Ea,{children:R.map(K=>{const H=df.getInfo(K.type).icon;return o.jsx(qn,{value:K.id,children:o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(H,{className:"flex-shrink-0",size:18}),o.jsxs("div",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate",children:K.title}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(e0(K.credentials)&&_x(K.credentials.serviceAccount))??"No email found"})]})]})},K.id)})})]}),R.length===0&&!E&&o.jsxs(cS,{className:"mt-2",children:[o.jsx(Sf,{className:"h-4 w-4"}),o.jsx(iO,{children:"No destinations available"}),o.jsxs(uS,{children:["You need to create a Destination before you can create a report."," ",o.jsx(Ba,{to:b("/data-destinations"),className:"font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:"Go to Destinations"})]})]}),G.value&&R.length>0&&(()=>{const K=R.find(re=>re.id===G.value);return K?o.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[o.jsx(Jt,{children:"Service Account Email"}),o.jsx(Pae,{value:e0(K.credentials)?_x(K.credentials.serviceAccount)??"No email found":"",children:e0(K.credentials)?_x(K.credentials.serviceAccount):"No email found"})]}):null})(),o.jsx(ln,{})]})}),o.jsx(Qt,{control:D.control,name:"documentUrl",render:({field:G})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),o.jsx(en,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx($t,{id:g,placeholder:"Document URL",className:"flex-1",...G}),o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${B?"text-blue-600 hover:bg-blue-50 hover:text-blue-700 dark:text-blue-400 dark:hover:bg-blue-950/20 dark:hover:text-blue-300":"text-muted-foreground/30 cursor-not-allowed"}`,onClick:()=>{B&&window.open(U.trim(),"_blank","noopener,noreferrer")},disabled:!B,"aria-label":B?"Open document in new tab":"Document link is not valid",children:o.jsx(Tl,{className:"h-4 w-4","aria-hidden":"true"})})}),o.jsx(_t,{side:"top",align:"center",role:"tooltip",children:B?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),o.jsx(ar,{children:o.jsx(Lae,{})}),o.jsx(ln,{})]})})]}),o.jsx(Vs,{title:"Automate Report Runs",children:o.jsx(MO,{})})]}),o.jsxs(Yl,{children:[o.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":t===Un.CREATE?"Create new report":"Save changes to report",disabled:!j||_,children:_?t===Un.CREATE?"Creating...":"Saving...":t===Un.CREATE?"Create new report":"Save changes to report"}),l&&o.jsx(Ce,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Fae({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=p.useCallback(()=>{h(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Mi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(ki,{children:[o.jsxs(Ii,{children:[o.jsx(Li,{children:r===Un.CREATE?"Create new report":"Edit report"}),o.jsx(Hl,{children:r===Un.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),o.jsx(vg,{children:o.jsx(Uae,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(xa,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const zae=sn({cacheLifetime:fB().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Vae({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,l]=p.useState(null),{createReport:c,updateReport:d}=Gl(),h=$i({resolver:Wl(zae),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&k4(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:h,onSubmit:async g=>{try{l(null);const{cacheLifetime:v}=g,x={type:ga.LOOKER_STUDIO_CONFIG,cacheLifetime:v};e?await d(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:x}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:x}),n==null||n()}catch(v){console.error("Error submitting form:",v),l("Failed to save report. Please try again.")}},formError:s,isSubmitting:h.formState.isSubmitting,isDirty:h.formState.isDirty,reset:h.reset}}function Hae(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"cache-lifetime-details",children:[o.jsx(Yn,{children:"What is the Cache Lifetime for Looker Studio?"}),o.jsx(Wn,{children:o.jsx("p",{className:"mb-2",children:"Cache Lifetime - defines the period during which results from previous query executions are served from storage-side cache, eliminating the need to re-execute the query"})})]})})}const $ae=[{value:300,label:"5 minutes"},{value:600,label:"10 minutes"},{value:900,label:"15 minutes"},{value:1800,label:"30 minutes"},{value:3600,label:"1 hour"},{value:7200,label:"2 hours"},{value:14400,label:"4 hours"},{value:28800,label:"8 hours"},{value:43200,label:"12 hours"}],Bae=p.forwardRef(({initialReport:e,mode:t=Un.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const h="looker-studio-edit-form",{dataMart:m}=gs(),{isDirty:g,reset:v,form:x,isSubmitting:b,formError:w,onSubmit:C}=Vae({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return p.useEffect(()=>{r&&r(w)},[w,r]),p.useEffect(()=>{t===Un.EDIT&&e&&k4(e.destinationConfig)?v({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Un.CREATE&&v({cacheLifetime:300})},[e,t,v]),p.useEffect(()=>{n==null||n(g)},[g,n]),o.jsx(Zl,{...x,children:o.jsxs(Bi,{id:h,ref:d,noValidate:!0,onSubmit:E=>void x.handleSubmit(C)(E),children:[o.jsx(Kl,{children:o.jsx(Vs,{title:"Cache Configuration",children:o.jsx(Qt,{control:x.control,name:"cacheLifetime",render:({field:E})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),o.jsxs(Sa,{onValueChange:R=>{E.onChange(parseInt(R,10))},value:E.value.toString(),defaultValue:"300",children:[o.jsx(en,{children:o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{placeholder:"Select cache time"})})}),o.jsx(Ea,{children:$ae.map(R=>o.jsx(qn,{value:R.value.toString(),children:R.label},R.value))})]}),o.jsx(ln,{}),o.jsx(ar,{children:o.jsx(Hae,{})})]})})})}),o.jsxs(Yl,{children:[o.jsx(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":t===Un.CREATE?"Create":"Save changes",disabled:!g||b,children:b?t===Un.CREATE?"Creating...":"Saving...":t===Un.CREATE?"Create":"Save changes"}),l&&o.jsx(Ce,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Gae({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,h]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),h(!1),t()},[t]),v=p.useCallback(b=>{h(b)},[]),x=p.useCallback(()=>{h(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Mi,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(ki,{children:[o.jsxs(Ii,{children:[o.jsx(Li,{children:(s==null?void 0:s.title)??"Looker Studio"}),o.jsx(Hl,{children:r===Un.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),o.jsx(vg,{children:o.jsx(Bae,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(xa,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function qae({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Lt.GOOGLE_SHEETS:return o.jsx(Fae,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Lt.LOOKER_STUDIO:return o.jsx(Gae,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function Zae({destination:e,onEditReport:t,autoRefreshEnabled:n}){switch(e.type){case Lt.GOOGLE_SHEETS:return o.jsx(bae,{destination:e,onEditReport:t,autoRefreshEnabled:n});case Lt.LOOKER_STUDIO:return o.jsx(_ae,{destination:e,onEditReport:t});default:return null}}function k5(){return o.jsx("div",{className:"flex flex-col gap-4",children:o.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>o.jsx("div",{className:"border-border rounded-lg border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(as,{className:"h-4 w-4 rounded-full"}),o.jsx(as,{className:"h-4 w-40"}),o.jsx(as,{className:"h-3 w-32"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(as,{className:"h-6 w-16 rounded-full"}),o.jsx(as,{className:"h-4 w-4"})]})]})},t))})})}function Kae(){const{dataMart:e}=gs(),{dataDestinations:t,isLoading:n}=hZ();return e?o.jsx("div",{className:"flex flex-col gap-4",children:n?o.jsx(k5,{}):t.length===0?o.jsx(Nae,{}):t.map(r=>o.jsx(Dae,{destination:r,dataMartStatus:e.status},r.id))}):null}function Yae(){return o.jsx(vg,{children:o.jsx(E4,{children:o.jsx(Kae,{})})})}function cj(){return o.jsxs(Rl,{children:[o.jsx(jo,{children:o.jsx(To,{icon:qI,tooltip:"Description of the Data Mart",children:"Description"})}),o.jsx(_o,{children:o.jsx(RQ,{})}),o.jsx(wi,{})]})}function Wae(){const{dataMart:e}=Hi(),[t,n]=p.useState(!1),r=p.useCallback(()=>{n(!0)},[]),s=p.useCallback(()=>{n(!1)},[]);return o.jsxs(Rl,{children:[o.jsxs(jo,{children:[o.jsx(To,{icon:Xj,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),o.jsx(Jf,{children:o.jsxs(Ce,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[o.jsx(Ta,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),o.jsx(_o,{children:o.jsx(hu,{children:o.jsx(Zee,{children:e&&o.jsxs(o.Fragment,{children:[o.jsx(Ite,{dataMartId:e.id}),o.jsx(hS,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),o.jsx(wi,{})]})}function Qae(){const e=UO(),{navigate:t}=Io(),n=r=>{const s=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(s)};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsx("div",{className:"m-auto w-lg",children:o.jsxs("div",{className:"bg-muted/50 dark:bg-sidebar rounded-xl border-b border-gray-200 p-12 pt-8 dark:border-gray-700/50",children:[o.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),o.jsx(G1,{children:o.jsx(u3,{children:o.jsx(yQ,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function I5({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:l,clearCurrentDataStorage:c}=Ag();p.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const d=()=>{c(),t()};return o.jsx(A1,{open:e,onOpenChange:h=>{h||d()},children:o.jsxs(D1,{children:[o.jsxs(O1,{children:[o.jsx(M1,{children:"Storage Details"}),o.jsx(k1,{children:"View detailed information about this storage."})]}),o.jsx("div",{className:"py-4",children:o.jsx(dq,{dataStorage:s,isLoading:l})})]})})}function t0({column:e,children:t}){return o.jsxs(Ce,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Za,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const Xae=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,l]=p.useState(!1);return o.jsx("div",{className:"text-right",children:o.jsxs(Cr,{open:s,onOpenChange:l,children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${s?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Er,{align:"end",children:[o.jsxs(bt,{onClick:()=>t==null?void 0:t(e),children:[o.jsx(Zj,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"View details"})]}),o.jsxs(bt,{onClick:()=>void(n==null?void 0:n(e)),children:[o.jsx(Cf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),o.jsx(Ga,{}),o.jsxs(bt,{onClick:()=>r==null?void 0:r(e),children:[o.jsx(ko,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})};function Jae({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(bt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const ese=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(t0,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(t0,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Vi.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(t0,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(Jae,{table:r}),cell:({row:r})=>o.jsx(Xae,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function tse({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(y9,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),o.jsxs(Ce,{variant:"outline",onClick:e,children:[o.jsx(Ta,{className:"h-4 w-4"}),"New Storage"]})]})}function nse({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Bf({columns:e,storageKeyPrefix:"data-storage-list"}),[h,m]=p.useState([]),[g,v]=p.useState({}),[x,b]=p.useState(!1),[w]=p.useState(null),C=Tu({data:t,columns:[...e],getCoreRowModel:Ru(),getPaginationRowModel:Eg(),onSortingChange:l,getSortedRowModel:$f(),onColumnFiltersChange:m,getFilteredRowModel:Hf(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:h,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),E=(T,j)=>{j.target instanceof HTMLElement&&(j.target.closest('[role="checkbox"]')||j.target.closest(".actions-cell")||j.target.closest('[role="menuitem"]'))||n==null||n(T)};return t.length?o.jsxs("div",{children:[w&&o.jsx(I5,{isOpen:x,onClose:()=>{b(!1)},id:w.id}),o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Fl,{className:"dm-card-toolbar-search-icon"}),o.jsx($t,{placeholder:"Search by title",value:(R=C.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:T=>{var j;return(j=C.getColumn("title"))==null?void 0:j.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(Ce,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(Ta,{className:"h-4 w-4"}),"New Storage"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(ju,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[o.jsx(_u,{className:"dm-card-table-header",children:C.getHeaderGroups().map(T=>o.jsx(sr,{className:"dm-card-table-header-row",children:T.headers.map(j=>o.jsx(Au,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:fu(j.column.columnDef.header,j.getContext())},j.id))},T.id))}),o.jsx(Nu,{className:"dm-card-table-body",children:C.getRowModel().rows.length?C.getRowModel().rows.map(T=>o.jsx(sr,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:j=>{const O=T.original.id;E(O,j)},children:T.getVisibleCells().map(j=>o.jsx(ya,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${j.column.id==="actions"?"actions-cell":""} ${j.column.id==="createdAt"?"whitespace-nowrap":""}`,style:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.column.getSize())}%`},children:fu(j.column.columnDef.cell,j.getContext())},j.id))},T.id)):o.jsx(sr,{children:o.jsx(ya,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{C.previousPage()},disabled:!C.getCanPreviousPage(),children:"Previous"}),o.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{C.nextPage()},disabled:!C.getCanNextPage(),children:"Next"})]})]})]}):o.jsx("div",{className:"dm-card",children:o.jsx(tse,{onOpenTypeDialog:r})})}const rse=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=p.useState(e),{dataStorages:s,currentDataStorage:l,clearCurrentDataStorage:c,fetchDataStorages:d,getDataStorageById:h,deleteDataStorage:m,createDataStorage:g}=Ag();p.useEffect(()=>{d()},[d]),p.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,j]=p.useState(!1),[O,D]=p.useState(null),_=async I=>{try{const Y=await g(I);v(),Y!=null&&Y.id&&(await h(Y.id),b(!0))}catch(Y){console.error("Failed to create storage:",Y)}},A=I=>{D(I),j(!0)},M=()=>{j(!1),D(null)},U=async I=>{await h(I),b(!0)},B=I=>{R(I),C(!0)},G=async()=>{if(E)try{await m(E),await d()}catch(I){console.error("Failed to delete storage:",I)}finally{C(!1),R(null)}},K=async()=>{try{b(!1),await d()}catch(I){console.error("Failed to save storage:",I)}},re=()=>{b(!1),c()},H=s.map(I=>({id:I.id,title:I.title,type:I.type,createdAt:I.createdAt,modifiedAt:I.modifiedAt})),$=ese({onViewDetails:A,onEdit:U,onDelete:B});return o.jsxs("div",{children:[o.jsx(nse,{columns:$,data:H,onEdit:U,onOpenTypeDialog:()=>{r(!0)}}),o.jsx(I5,{isOpen:T,onClose:M,id:O??""}),o.jsx(lD,{isOpen:n,onClose:v,onSelect:_}),o.jsx(oO,{isOpen:x,onClose:re,dataStorage:l,onSaveSuccess:()=>void K()}),o.jsx(xa,{open:w,onOpenChange:C,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{G()},onCancel:()=>{R(null)},variant:"destructive"})]})},ase=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(G1,{children:o.jsx(rse,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function sse({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(bb,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Destination combines your reporting tool and access credentials — both needed to deliver data from Data Marts to your reports and dashboards."}),o.jsxs(Ce,{variant:"outline",onClick:e,children:[o.jsx(Ta,{className:"h-4 w-4"}),"New Destination"]})]})}function ose({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var w;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Bf({columns:e,storageKeyPrefix:"data-destination-list"}),[h,m]=p.useState([]),[g,v]=p.useState({}),x=Tu({data:t,columns:[...e],getCoreRowModel:Ru(),getPaginationRowModel:Eg(),onSortingChange:l,getSortedRowModel:$f(),onColumnFiltersChange:m,getFilteredRowModel:Hf(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:h,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),b=(C,E)=>{E.target instanceof HTMLElement&&(E.target.closest('[role="checkbox"]')||E.target.closest(".actions-cell")||E.target.closest('[role="menuitem"]'))||n==null||n(C)};return t.length?o.jsx("div",{children:o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Fl,{className:"dm-card-toolbar-search-icon"}),o.jsx($t,{placeholder:"Search by title",value:(w=x.getColumn("title"))==null?void 0:w.getFilterValue(),onChange:C=>{var E;return(E=x.getColumn("title"))==null?void 0:E.setFilterValue(C.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(Ce,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(Ta,{className:"h-4 w-4"}),"New Destination"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(ju,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[o.jsx(_u,{className:"dm-card-table-header",children:x.getHeaderGroups().map(C=>o.jsx(sr,{className:"dm-card-table-header-row",children:C.headers.map(E=>o.jsx(Au,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.getSize())}%`},children:E.isPlaceholder?null:fu(E.column.columnDef.header,E.getContext())},E.id))},C.id))}),o.jsx(Nu,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(C=>o.jsx(sr,{"data-state":C.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:E=>{const R=C.original.id;b(R,E)},children:C.getVisibleCells().map(E=>o.jsx(ya,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${E.column.id==="actions"?"actions-cell":""} ${E.column.id==="createdAt"?"whitespace-nowrap":""}`,style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},children:fu(E.column.columnDef.cell,E.getContext())},E.id))},C.id)):o.jsx(sr,{children:o.jsx(ya,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),o.jsx(Ce,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):o.jsx("div",{className:"dm-card",children:o.jsx(sse,{onOpenTypeDialog:r})})}function n0({column:e,children:t}){return o.jsxs(Ce,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Za,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}function RS(e){return"destinationSecretKey"in e}const ise=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:l})=>{const[c,d]=p.useState(!1),h=()=>{if(n&&RS(n)){const v=m1(n);navigator.clipboard.writeText(v),Dt.success("JSON Config copied to clipboard")}},m=t===Lt.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-right",children:o.jsxs(Cr,{open:c,onOpenChange:d,children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${c?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(Er,{align:"end",children:[o.jsxs(bt,{onClick:()=>void(r==null?void 0:r(e)),children:[o.jsx(Cf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),m&&g&&o.jsxs(o.Fragment,{children:[o.jsx(Ga,{}),o.jsxs(bt,{onClick:h,children:[o.jsx(tf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Copy JSON Config"})]}),o.jsxs(bt,{onClick:()=>{l==null||l(e)},children:[o.jsx(l0,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Rotate Secret Key"})]})]}),o.jsx(Ga,{}),o.jsxs(bt,{onClick:()=>s==null?void 0:s(e),children:[o.jsx(ko,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})};function lse({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Cr,{children:[o.jsx(wr,{asChild:!0,children:o.jsx(Ce,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ka,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(bt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(dr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const cse=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(n0,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(n0,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=df.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(n0,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(lse,{table:r}),cell:({row:r})=>o.jsx(ise,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function use(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"service-account-details",children:[o.jsx(Yn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(fr,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function dse({form:e}){const[t,n]=p.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?aO(l):null;return o.jsx(Qt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(Xt,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Jt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&l&&o.jsx(Ce,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(Ce,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(en,{children:!t&&c?o.jsxs(Tt,{children:[o.jsx(jt,{asChild:!0,children:o.jsx(fr,{href:c.url,children:c.email})}),o.jsx(_t,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(Fi,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(ar,{children:o.jsx(use,{})}),o.jsx(ln,{})]})})}function fse(){return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Kn,{value:"json-config-details",children:[o.jsx(Yn,{children:"What is the JSON Config for Looker Studio?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),o.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[o.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),o.jsx("li",{children:"If you need to rotate a previous secret key, you can use the corresponding function in the menu on the destinations list."})]})]})]})})}function hse({form:e}){const t=e.getValues("credentials"),n=p.useMemo(()=>t&&RS(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=p.useMemo(()=>m1(n),[n]);return o.jsx(o.Fragment,{children:n.destinationSecretKey&&o.jsx(Qt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>o.jsxs(Xt,{children:[o.jsx(Jt,{children:"JSON Config"}),o.jsx(en,{children:o.jsx(z$,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),o.jsx(ln,{}),o.jsx(ar,{children:o.jsx(fse,{})})]})})})}const mse=()=>o.jsxs(Kn,{value:"sheets-api-details",children:[o.jsx(Yn,{children:"How do I enable the Google Sheets API?"}),o.jsxs(Wn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",o.jsx(fr,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]}),pse=()=>o.jsxs(Kn,{value:"looker-studio-details",children:[o.jsx(Yn,{children:"How do I connect to Looker Studio?"}),o.jsxs(Wn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",o.jsx(fr,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),o.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),o.jsx(fr,{className:"p-0",href:"https://docs.owox.com/docs/destinations/supported-destinations/looker-studio/?utm_source=owox_data_marts&utm_medium=destination_enity&utm_campaign=tooltip",children:"Learn more"})]})]}),gse=()=>o.jsxs(Kn,{value:"odata-details",children:[o.jsx(Yn,{children:"How do I use OData?"}),o.jsxs(Wn,{children:[o.jsx("p",{className:"mb-2",children:"OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs."}),o.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]}),vse={[Lt.GOOGLE_SHEETS]:mse,[Lt.LOOKER_STUDIO]:pse,[Lt.ODATA]:gse};function yse({destinationType:e}){const t=vse[e];return o.jsx(hr,{variant:"common",type:"single",collapsible:!0,children:o.jsx(t,{})})}function xse({form:e,initialData:t}){return o.jsx(Qt,{control:e.control,name:"type",render:({field:n})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),o.jsxs(Sa,{onValueChange:n.onChange,defaultValue:n.value,disabled:!!t,children:[o.jsx(en,{children:o.jsx(wa,{className:"w-full",children:o.jsx(Ca,{placeholder:"Select a destination type"})})}),o.jsx(Ea,{children:o.jsx(Ng,{children:df.getAllTypes().map(({type:r,displayName:s,icon:l,status:c})=>{const d=c===Jc.COMING_SOON;return o.jsx(qn,{value:r,disabled:d,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(l,{size:18}),s,d&&o.jsx(Ar,{variant:"secondary",children:c})]})},r)})})})]}),o.jsx(ar,{children:o.jsx(yse,{destinationType:n.value})}),o.jsx(ln,{})]})})}function bse({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=$i({resolver:Wl(oZ),defaultValues:e??{title:"New Destination",type:Lt.GOOGLE_SHEETS},mode:"onTouched"}),l=s.watch("type");p.useEffect(()=>{r==null||r(s.formState.isDirty)},[s.formState.isDirty,r]);const c=async d=>{const{dirtyFields:h}=s.formState,m=sO(d);return h.credentials||delete m.credentials,t(m)};return o.jsx(Zl,{...s,children:o.jsxs(Bi,{onSubmit:d=>{s.handleSubmit(c)(d)},children:[o.jsxs(Kl,{children:[o.jsx(Qt,{control:s.control,name:"title",render:({field:d})=>o.jsxs(Xt,{children:[o.jsx(Jt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),o.jsx(en,{children:o.jsx($t,{placeholder:"Enter title",...d})}),o.jsx(ln,{})]})}),o.jsx(xse,{form:s,initialData:e}),l===Lt.GOOGLE_SHEETS&&o.jsx(dse,{form:s}),l===Lt.LOOKER_STUDIO&&o.jsx(hse,{form:s})]}),o.jsxs(Yl,{children:[o.jsxs(Ce,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!s.formState.isDirty||s.formState.isSubmitting,children:[s.formState.isSubmitting&&o.jsx(gu,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),o.jsx(Ce,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Sse({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:s,createDataDestination:l}=yg(),[c,d]=p.useState(!1),[h,m]=p.useState(!1),g=p.useCallback(()=>{h?d(!0):t()},[h,t]),v=p.useCallback(()=>{d(!1),m(!1),t()},[t]),x=p.useCallback(C=>{m(C)},[]),b=async C=>{const E=j4.getMapper(C.type);if(n){const R=E.mapToUpdateRequest(C),T=await s(n.id,R);T&&r(T)}else{const R=E.mapToCreateRequest(C),T=await l(R);T&&r(T)}t()},w=p.useRef(!1);return p.useEffect(()=>{const C=n?"Edit":"Create";e&&!w.current?(Fe({event:"data_destination_config_open",category:"DataDestination",action:C,label:n==null?void 0:n.type}),w.current=!0):!e&&w.current&&(Fe({event:"data_destination_config_close",category:"DataDestination",action:C,label:n==null?void 0:n.type}),w.current=!1)},[e,n]),o.jsxs(o.Fragment,{children:[o.jsx(Mi,{open:e,onOpenChange:C=>{C||g()},children:o.jsxs(ki,{children:[o.jsxs(Ii,{children:[o.jsx(Li,{children:"Configure destination"}),o.jsx(Hl,{children:"Customize settings for your destination"})]}),o.jsx(bse,{initialData:n??void 0,onSubmit:b,onCancel:g,onDirtyChange:x})]})}),o.jsx(xa,{open:c,onOpenChange:d,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}const Cse=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:l,getDataDestinationById:c,deleteDataDestination:d,rotateSecretKey:h}=yg(),m=p.useCallback(()=>{s(),v(!0),t==null||t()},[s,t]),[g,v]=p.useState(!1),[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,j]=p.useState(null);p.useEffect(()=>{l()},[l]),p.useEffect(()=>{e&&m()},[e,m]);const O=async re=>{await c(re),v(!0)},D=re=>{R(re),b(!0)},_=re=>{j(re),C(!0)},A=async()=>{if(T)try{const re=await h(T);if(RS(re.credentials)){Dt.success("New JSON Config copied to clipboard");const H=m1(re.credentials);navigator.clipboard.writeText(H)}await l()}catch(re){console.error("Failed to rotate secret key:",re)}finally{C(!1),j(null)}},M=async()=>{if(E)try{await d(E),await l()}catch(re){console.error("Failed to delete destination:",re)}finally{b(!1),R(null)}},U=async()=>{try{v(!1),await l()}catch(re){console.error("Failed to save destination:",re)}},B=()=>{v(!1),s()},G=n.map(re=>({id:re.id,title:re.title,type:re.type,createdAt:re.createdAt,modifiedAt:re.modifiedAt,credentials:re.credentials})),K=cse({onEdit:O,onDelete:D,onRotateSecretKey:_});return o.jsxs("div",{children:[o.jsx(ose,{columns:K,data:G,onEdit:O,onDelete:D,onRotateSecretKey:_,onOpenTypeDialog:m}),o.jsx(Sse,{isOpen:g,onClose:B,dataDestination:r,onSaveSuccess:()=>void U()}),o.jsx(xa,{open:x,onOpenChange:b,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{M()},onCancel:()=>{R(null)},variant:"destructive"}),o.jsx(xa,{open:w,onOpenChange:C,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void A(),onCancel:()=>{C(!1)},variant:"destructive",children:o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),o.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[o.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),o.jsx("li",{children:"Go to your Looker Studio Connector"}),o.jsx("li",{children:"Update the configuration with the new JSON Config"}),o.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),o.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},wse=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(vg,{children:o.jsx(Cse,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Ese(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:l=[],isLoading:c}=gs(),[d,h]=p.useState(!1),[m,g]=p.useState(!0),[v,x]=p.useState(0),[b,w]=p.useState(null),[C,E]=p.useState(ns.STRUCTURED),[R,T]=p.useState(""),j=p.useCallback(async()=>{if(!(t!=null&&t.id))return;const _=await n(t.id,20,0);x(_.length),g(_.length===20)},[t==null?void 0:t.id,n,20]),O=p.useCallback(async()=>{if(!(t!=null&&t.id)||d)return;h(!0);const _=await r(t.id,v,20);x(A=>A+_.length),g(_.length===20),h(!1)},[t==null?void 0:t.id,r,v,d,20]);p.useEffect(()=>{t!=null&&t.id&&j()},[t==null?void 0:t.id,j]);const D=_=>{w(b===_?null:_)};return c?o.jsx(k5,{}):o.jsx("div",{className:"flex flex-col gap-4 pb-4",children:l.length===0?o.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):o.jsxs("div",{className:"space-y-2",children:[l.map(_=>o.jsx(Bq,{run:_,isExpanded:b===_.id,onToggle:D,logViewType:C,setLogViewType:E,searchTerm:R,setSearchTerm:T,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id},_.id)),m&&o.jsx("div",{className:"flex justify-center pt-4",children:o.jsx(tu,{variant:"outline",size:"sm",onClick:()=>void O(),disabled:d,className:"flex items-center gap-2",children:d?o.jsxs(o.Fragment,{children:[o.jsx(gL,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const Rse=5e3,Tse=20;function jse(){const{dataMart:e,getDataMartRuns:t}=Hi(),n=p.useMemo(()=>e!=null&&e.id?`data-mart-run-history-auto-refresh-${e.id}`:"",[e==null?void 0:e.id]),[r,s]=p.useState(()=>n?ks.get(n,"boolean")??!1:!1);return p.useEffect(()=>{n&&ks.set(n,r)},[r,n]),M5({enabled:!!(e!=null&&e.id)&&r,intervalMs:Rse,onTick:()=>{e!=null&&e.id&&t(e.id,Tse,0,{silent:!0})}}),o.jsx("div",{className:"flex flex-col gap-4",children:o.jsxs(Rl,{collapsible:!1,name:"run-history",children:[o.jsxs(jo,{children:[o.jsx(To,{icon:F9,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"}),o.jsx(Jf,{children:o.jsxs("div",{className:"flex items-center gap-2 pl-3",children:[o.jsx(j5,{id:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,checked:r,onCheckedChange:l=>{s(!!l)},"aria-label":"Auto refresh"}),o.jsx("label",{htmlFor:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,className:"text-sm",children:"Auto refresh"})]})})]}),o.jsx(_o,{children:o.jsx(Ese,{})})]})})}const _se=[{path:"overview",element:o.jsx(cj,{})},{path:"data-setup",element:o.jsx(hae,{})},{path:"reports",element:o.jsx(Yae,{})},{path:"triggers",element:o.jsx(Wae,{})},{path:"run-history",element:o.jsx(jse,{})},{index:!0,element:o.jsx(cj,{})}];function Nse({to:e="/data-marts"}){const{user:t,status:n}=Ui();if(n===Or.LOADING)return o.jsx(Xc,{fullScreen:!0,message:"Loading..."});if(n===Or.UNAUTHENTICATED||!t)return o.jsx(Xc,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=cp(t.projectId,e);return o.jsx(F8,{to:r,replace:!0})}return o.jsx(Xc,{fullScreen:!0,message:"Project not found"})}const Ase=[{index:!0,path:"/",element:o.jsx(Nse,{})},{path:"/ui/:projectId",element:o.jsx(qG,{}),children:[{path:"about",element:o.jsx(ZG,{})},{index:!0,element:o.jsx(mT,{})},{path:"data-marts",element:o.jsx(mT,{})},{path:"data-marts/create",element:o.jsx(Qae,{})},{path:"data-marts/:id",element:o.jsx(oae,{}),children:_se},{path:"data-storages",element:o.jsx(ase,{})},{path:"data-destinations",element:o.jsx(wse,{})},{path:"*",element:o.jsx(iT,{})}]},{path:"*",element:o.jsx(iT,{})}],L5="gtm-script",P5="gtm-noscript",Dse="GOOGLE_TAG_MANAGER_CONTAINER_ID";function Ose(){return!!document.getElementById(L5)}function Mse(e){const t=document.createElement("script");return t.id=L5,t.innerHTML=`
|
|
734
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
735
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
736
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
737
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
738
|
-
})(window,document,'script','dataLayer','${e}');
|
|
739
|
-
`,t}function kse(e){const t=document.createElement("noscript");return t.id=P5,t.innerHTML=`
|
|
740
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
741
|
-
height="0"
|
|
742
|
-
width="0"
|
|
743
|
-
style="display:none;visibility:hidden">
|
|
744
|
-
</iframe>
|
|
745
|
-
`,t}function Ise(e){if(Ose())return;const t=Mse(e);document.head.prepend(t)}function Lse(e){if(document.getElementById(P5))return;const t=kse(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function Pse(e){try{Ise(e),Lse(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function Use(e){return(e[Dse]??"").trim()}function Fse(){const{flags:e,callState:t}=e1();return p.useEffect(()=>{if(t!==Mr.LOADED||!e)return;const n=Use(e);n&&Pse(n)},[e,t]),null}const zse="INTERCOM_APP_ID",U5="intercom-widget-script";function Vse(){return!!document.getElementById(U5)}function Hse(e,t){if(Vse()){t();return}const n=document.createElement("script");n.id=U5,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function $se(){try{return(await ha.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function Bse(e,t){const n={app_id:e,user_id:t.id};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function Gse(e,t){if(!t)return;const n=Bse(e,t),r=await $se();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function qse(){const{flags:e,callState:t}=e1(),{user:n}=Ui(),r=p.useRef(!1);return p.useEffect(()=>{if(r.current||t!==Mr.LOADED||!e)return;const s=e[zse],l=(typeof s=="string"?s:"").trim();l&&Hse(l,()=>{Gse(l,n).then(()=>{r.current=!0,ab()})})},[e,t,n]),null}function Zse({initialState:e,reducer:t,children:n}){const[r,s]=p.useReducer(t,e),l=p.useMemo(()=>s,[s]);return o.jsx(cA.Provider,{value:r,children:o.jsx(uA.Provider,{value:l,children:n})})}function Kse(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(s=>{const l=e[s],c=t[s],d=l(c,n);d!==c&&(r[s]=d)}),r}}const uj={id:null,title:null},F5="project/SET_PROJECT",Yse="project/CLEAR_PROJECT";function Wse(e){return{type:F5,payload:e}}function Qse(e=uj,t){switch(t.type){case F5:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case Yse:return{...uj};default:return e}}class Xse extends Bl{getFlags(){return this.get("/flags")}}const Jse=new Xse(""),z5={MENU_GITHUB_COMMUNITY_VISIBLE:"true",MENU_UPGRADE_OPTIONS_VISIBLE:"true",MENU_FEEDBACK_VISIBLE:"true",MENU_ISSUES_VISIBLE:"true",MENU_LICENSE_VISIBLE:"true",MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE:"true",MENU_SLACK_COMMUNITY_VISIBLE:"true"},eoe={data:{...z5},callState:Mr.IDLE},V5="settings/LOAD_FLAGS",H5="settings/LOAD_FLAGS_SUCCESS",$5="settings/LOAD_FLAGS_ERROR";function toe(){return{type:V5}}function noe(e){return{type:H5,payload:e}}function roe(e){return{type:$5,payload:e}}function aoe(e=eoe,t){switch(t.type){case V5:return{...e,callState:Mr.LOADING,error:void 0};case H5:return{...e,callState:Mr.LOADED,data:{...z5,...t.payload}};case $5:return{...e,callState:Mr.ERROR,error:t.payload};default:return e}}async function soe(e){try{e(toe());const t=await Jse.getFlags();e(noe(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(roe(n))}}const B5="app/SET_READY";function ooe(e={ready:!1},t){switch(t.type){case B5:return{...e,ready:!!t.payload};default:return e}}const ioe=Kse({project:Qse,flags:aoe,app:ooe});function loe({children:e}){return o.jsx(Zse,{reducer:ioe,initialState:{project:{id:null,title:null},flags:{data:null,callState:Mr.IDLE},app:{ready:!1}},children:e})}function coe({children:e}){const t=_V(),{user:n,status:r}=Ui(),s=ip(h=>h.flags),l=s.callState,c=ip(h=>h.app.ready);p.useEffect(()=>{r===Or.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Wse({id:n.projectId,title:n.projectTitle??null})),l===Mr.IDLE&&soe(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,l,t]),p.useEffect(()=>{const h=r===Or.AUTHENTICATED&&!!(n!=null&&n.projectId)&&l===Mr.LOADED;t({type:B5,payload:h})},[r,n==null?void 0:n.projectId,l,t]);const d=p.useMemo(()=>o.jsx(Xc,{fullScreen:!0,message:"Loading application..."}),[]);return c?o.jsx(o.Fragment,{children:e}):l===Mr.ERROR?o.jsx(Xc,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):d}function uoe(){const e=uI(Ase);return o.jsx(x$,{children:o.jsx(loe,{children:o.jsxs(coe,{children:[o.jsx(Fse,{}),o.jsx(qse,{}),o.jsx(wI,{router:e})]})})})}const G5=document.getElementById("root");if(!G5)throw new Error("Root element not found");uk.createRoot(G5).render(o.jsx(p.StrictMode,{children:o.jsx(uoe,{})}));
|