@owox/web 0.16.0-next-20251216083817 → 0.16.0-next-20251216110343
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,851 +0,0 @@
|
|
|
1
|
-
var w9=Object.defineProperty;var E9=(e,t,n)=>t in e?w9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var to=(e,t,n)=>E9(e,typeof t!="symbol"?t+"":t,n);function R9(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function BN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p0={exports:{}},mf={};/**
|
|
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 fj;function j9(){if(fj)return mf;fj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,i){var c=null;if(i!==void 0&&(c=""+i),s.key!==void 0&&(c=""+s.key),"key"in s){i={};for(var u in s)u!=="key"&&(i[u]=s[u])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:i}}return mf.Fragment=t,mf.jsx=n,mf.jsxs=n,mf}var hj;function T9(){return hj||(hj=1,p0.exports=j9()),p0.exports}var a=T9(),g0={exports:{}},gt={};/**
|
|
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 mj;function _9(){if(mj)return gt;mj=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"),i=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=x&&P[x]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function R(P,U,z){this.props=P,this.context=U,this.refs=w,this.updater=z||C}R.prototype.isReactComponent={},R.prototype.setState=function(P,U){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,U,"setState")},R.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function j(){}j.prototype=R.prototype;function _(P,U,z){this.props=P,this.context=U,this.refs=w,this.updater=z||C}var O=_.prototype=new j;O.constructor=_,S(O,R.prototype),O.isPureReactComponent=!0;var A=Array.isArray;function D(){}var T={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function k(P,U,z){var X=z.ref;return{$$typeof:e,type:P,key:U,ref:X!==void 0?X:null,props:z}}function F(P,U){return k(P.type,U,P.props)}function G(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function Y(P){var U={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(z){return U[z]})}var B=/\/+/g;function Z(P,U){return typeof P=="object"&&P!==null&&P.key!=null?Y(""+P.key):U.toString(36)}function H(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(D,D):(P.status="pending",P.then(function(U){P.status==="pending"&&(P.status="fulfilled",P.value=U)},function(U){P.status==="pending"&&(P.status="rejected",P.reason=U)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function M(P,U,z,X,W){var ae=typeof P;(ae==="undefined"||ae==="boolean")&&(P=null);var J=!1;if(P===null)J=!0;else switch(ae){case"bigint":case"string":case"number":J=!0;break;case"object":switch(P.$$typeof){case e:case t:J=!0;break;case y:return J=P._init,M(J(P._payload),U,z,X,W)}}if(J)return W=W(P),J=X===""?"."+Z(P,0):X,A(W)?(z="",J!=null&&(z=J.replace(B,"$&/")+"/"),M(W,U,z,"",function(Ce){return Ce})):W!=null&&(G(W)&&(W=F(W,z+(W.key==null||P&&P.key===W.key?"":(""+W.key).replace(B,"$&/")+"/")+J)),U.push(W)),1;J=0;var le=X===""?".":X+":";if(A(P))for(var ye=0;ye<P.length;ye++)X=P[ye],ae=le+Z(X,ye),J+=M(X,U,z,ae,W);else if(ye=v(P),typeof ye=="function")for(P=ye.call(P),ye=0;!(X=P.next()).done;)X=X.value,ae=le+Z(X,ye++),J+=M(X,U,z,ae,W);else if(ae==="object"){if(typeof P.then=="function")return M(H(P),U,z,X,W);throw U=String(P),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return J}function V(P,U,z){if(P==null)return P;var X=[],W=0;return M(P,X,"","",function(ae){return U.call(z,ae,W++)}),X}function $(P){if(P._status===-1){var U=P._result;U=U(),U.then(function(z){(P._status===0||P._status===-1)&&(P._status=1,P._result=z)},function(z){(P._status===0||P._status===-1)&&(P._status=2,P._result=z)}),P._status===-1&&(P._status=0,P._result=U)}if(P._status===1)return P._result.default;throw P._result}var oe=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},ge={map:V,forEach:function(P,U,z){V(P,function(){U.apply(this,arguments)},z)},count:function(P){var U=0;return V(P,function(){U++}),U},toArray:function(P){return V(P,function(U){return U})||[]},only:function(P){if(!G(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return gt.Activity=g,gt.Children=ge,gt.Component=R,gt.Fragment=n,gt.Profiler=s,gt.PureComponent=_,gt.StrictMode=r,gt.Suspense=f,gt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,gt.__COMPILER_RUNTIME={__proto__:null,c:function(P){return T.H.useMemoCache(P)}},gt.cache=function(P){return function(){return P.apply(null,arguments)}},gt.cacheSignal=function(){return null},gt.cloneElement=function(P,U,z){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var X=S({},P.props),W=P.key;if(U!=null)for(ae in U.key!==void 0&&(W=""+U.key),U)!I.call(U,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&U.ref===void 0||(X[ae]=U[ae]);var ae=arguments.length-2;if(ae===1)X.children=z;else if(1<ae){for(var J=Array(ae),le=0;le<ae;le++)J[le]=arguments[le+2];X.children=J}return k(P.type,W,X)},gt.createContext=function(P){return P={$$typeof:c,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:i,_context:P},P},gt.createElement=function(P,U,z){var X,W={},ae=null;if(U!=null)for(X in U.key!==void 0&&(ae=""+U.key),U)I.call(U,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(W[X]=U[X]);var J=arguments.length-2;if(J===1)W.children=z;else if(1<J){for(var le=Array(J),ye=0;ye<J;ye++)le[ye]=arguments[ye+2];W.children=le}if(P&&P.defaultProps)for(X in J=P.defaultProps,J)W[X]===void 0&&(W[X]=J[X]);return k(P,ae,W)},gt.createRef=function(){return{current:null}},gt.forwardRef=function(P){return{$$typeof:u,render:P}},gt.isValidElement=G,gt.lazy=function(P){return{$$typeof:y,_payload:{_status:-1,_result:P},_init:$}},gt.memo=function(P,U){return{$$typeof:m,type:P,compare:U===void 0?null:U}},gt.startTransition=function(P){var U=T.T,z={};T.T=z;try{var X=P(),W=T.S;W!==null&&W(z,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(D,oe)}catch(ae){oe(ae)}finally{U!==null&&z.types!==null&&(U.types=z.types),T.T=U}},gt.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},gt.use=function(P){return T.H.use(P)},gt.useActionState=function(P,U,z){return T.H.useActionState(P,U,z)},gt.useCallback=function(P,U){return T.H.useCallback(P,U)},gt.useContext=function(P){return T.H.useContext(P)},gt.useDebugValue=function(){},gt.useDeferredValue=function(P,U){return T.H.useDeferredValue(P,U)},gt.useEffect=function(P,U){return T.H.useEffect(P,U)},gt.useEffectEvent=function(P){return T.H.useEffectEvent(P)},gt.useId=function(){return T.H.useId()},gt.useImperativeHandle=function(P,U,z){return T.H.useImperativeHandle(P,U,z)},gt.useInsertionEffect=function(P,U){return T.H.useInsertionEffect(P,U)},gt.useLayoutEffect=function(P,U){return T.H.useLayoutEffect(P,U)},gt.useMemo=function(P,U){return T.H.useMemo(P,U)},gt.useOptimistic=function(P,U){return T.H.useOptimistic(P,U)},gt.useReducer=function(P,U,z){return T.H.useReducer(P,U,z)},gt.useRef=function(P){return T.H.useRef(P)},gt.useState=function(P){return T.H.useState(P)},gt.useSyncExternalStore=function(P,U,z){return T.H.useSyncExternalStore(P,U,z)},gt.useTransition=function(){return T.H.useTransition()},gt.version="19.2.1",gt}var pj;function Gb(){return pj||(pj=1,g0.exports=_9()),g0.exports}var h=Gb();const re=BN(h),fh=R9({__proto__:null,default:re},[h]);var y0={exports:{}},pf={},x0={exports:{}},v0={};/**
|
|
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 gj;function N9(){return gj||(gj=1,(function(e){function t(M,V){var $=M.length;M.push(V);e:for(;0<$;){var oe=$-1>>>1,ge=M[oe];if(0<s(ge,V))M[oe]=V,M[$]=ge,$=oe;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var V=M[0],$=M.pop();if($!==V){M[0]=$;e:for(var oe=0,ge=M.length,P=ge>>>1;oe<P;){var U=2*(oe+1)-1,z=M[U],X=U+1,W=M[X];if(0>s(z,$))X<ge&&0>s(W,z)?(M[oe]=W,M[X]=$,oe=X):(M[oe]=z,M[U]=$,oe=U);else if(X<ge&&0>s(W,$))M[oe]=W,M[X]=$,oe=X;else break e}}return V}function s(M,V){var $=M.sortIndex-V.sortIndex;return $!==0?$:M.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],m=[],y=1,g=null,x=3,v=!1,C=!1,S=!1,w=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function O(M){for(var V=n(m);V!==null;){if(V.callback===null)r(m);else if(V.startTime<=M)r(m),V.sortIndex=V.expirationTime,t(f,V);else break;V=n(m)}}function A(M){if(S=!1,O(M),!C)if(n(f)!==null)C=!0,D||(D=!0,Y());else{var V=n(m);V!==null&&H(A,V.startTime-M)}}var D=!1,T=-1,I=5,k=-1;function F(){return w?!0:!(e.unstable_now()-k<I)}function G(){if(w=!1,D){var M=e.unstable_now();k=M;var V=!0;try{e:{C=!1,S&&(S=!1,j(T),T=-1),v=!0;var $=x;try{t:{for(O(M),g=n(f);g!==null&&!(g.expirationTime>M&&F());){var oe=g.callback;if(typeof oe=="function"){g.callback=null,x=g.priorityLevel;var ge=oe(g.expirationTime<=M);if(M=e.unstable_now(),typeof ge=="function"){g.callback=ge,O(M),V=!0;break t}g===n(f)&&r(f),O(M)}else r(f);g=n(f)}if(g!==null)V=!0;else{var P=n(m);P!==null&&H(A,P.startTime-M),V=!1}}break e}finally{g=null,x=$,v=!1}V=void 0}}finally{V?Y():D=!1}}}var Y;if(typeof _=="function")Y=function(){_(G)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,Z=B.port2;B.port1.onmessage=G,Y=function(){Z.postMessage(null)}}else Y=function(){R(G,0)};function H(M,V){T=R(function(){M(e.unstable_now())},V)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(M){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var $=x;x=V;try{return M()}finally{x=$}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(M,V){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var $=x;x=M;try{return V()}finally{x=$}},e.unstable_scheduleCallback=function(M,V,$){var oe=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?oe+$:oe):$=oe,M){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=$+ge,M={id:y++,callback:V,priorityLevel:M,startTime:$,expirationTime:ge,sortIndex:-1},$>oe?(M.sortIndex=$,t(m,M),n(f)===null&&M===n(m)&&(S?(j(T),T=-1):S=!0,H(A,$-oe))):(M.sortIndex=ge,t(f,M),C||v||(C=!0,D||(D=!0,Y()))),M},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(M){var V=x;return function(){var $=x;x=V;try{return M.apply(this,arguments)}finally{x=$}}}})(v0)),v0}var yj;function A9(){return yj||(yj=1,x0.exports=N9()),x0.exports}var b0={exports:{}},Br={};/**
|
|
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 xj;function D9(){if(xj)return Br;xj=1;var e=Gb();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+f+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(f,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:g==null?null:""+g,children:f,containerInfo:m,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,m){if(f==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Br.createPortal=function(f,m){var y=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 i(f,m,null,y)},Br.flushSync=function(f){var m=c.T,y=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=y,r.d.f()}},Br.preconnect=function(f,m){typeof f=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(f,m))},Br.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Br.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var y=m.as,g=u(y,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:v}):y==="script"&&r.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Br.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=u(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(f)},Br.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=u(y,m.crossOrigin);r.d.L(f,y,{crossOrigin:g,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})}},Br.preloadModule=function(f,m){if(typeof f=="string")if(m){var y=u(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},Br.requestFormReset=function(f){r.d.r(f)},Br.unstable_batchedUpdates=function(f,m){return f(m)},Br.useFormState=function(f,m,y){return c.H.useFormState(f,m,y)},Br.useFormStatus=function(){return c.H.useHostTransitionStatus()},Br.version="19.2.1",Br}var vj;function qN(){if(vj)return b0.exports;vj=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(),b0.exports=D9(),b0.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 bj;function O9(){if(bj)return pf;bj=1;var e=A9(),t=Gb(),n=qN();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function i(o){var l=o,d=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(d=l.return),o=l.return;while(o)}return l.tag===3?d:null}function c(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function u(o){if(o.tag===31){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function f(o){if(i(o)!==o)throw Error(r(188))}function m(o){var l=o.alternate;if(!l){if(l=i(o),l===null)throw Error(r(188));return l!==o?null:o}for(var d=o,p=l;;){var b=d.return;if(b===null)break;var E=b.alternate;if(E===null){if(p=b.return,p!==null){d=p;continue}break}if(b.child===E.child){for(E=b.child;E;){if(E===d)return f(b),o;if(E===p)return f(b),l;E=E.sibling}throw Error(r(188))}if(d.return!==p.return)d=b,p=E;else{for(var N=!1,L=b.child;L;){if(L===d){N=!0,d=b,p=E;break}if(L===p){N=!0,p=b,d=E;break}L=L.sibling}if(!N){for(L=E.child;L;){if(L===d){N=!0,d=E,p=b;break}if(L===p){N=!0,p=E,d=b;break}L=L.sibling}if(!N)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?o:l}function y(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=y(o),l!==null)return l;o=o.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function Y(o){return o===null||typeof o!="object"?null:(o=G&&o[G]||o["@@iterator"],typeof o=="function"?o:null)}var B=Symbol.for("react.client.reference");function Z(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===B?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case S:return"Fragment";case R:return"Profiler";case w:return"StrictMode";case A:return"Suspense";case D:return"SuspenseList";case k:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case C:return"Portal";case _:return o.displayName||"Context";case j:return(o._context.displayName||"Context")+".Consumer";case O:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case T:return l=o.displayName||null,l!==null?l:Z(o.type)||"Memo";case I:l=o._payload,o=o._init;try{return Z(o(l))}catch{}}return null}var H=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},oe=[],ge=-1;function P(o){return{current:o}}function U(o){0>ge||(o.current=oe[ge],oe[ge]=null,ge--)}function z(o,l){ge++,oe[ge]=o.current,o.current=l}var X=P(null),W=P(null),ae=P(null),J=P(null);function le(o,l){switch(z(ae,l),z(W,o),z(X,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?kR(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=kR(l),o=LR(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}U(X),z(X,o)}function ye(){U(X),U(W),U(ae)}function Ce(o){o.memoizedState!==null&&z(J,o);var l=X.current,d=LR(l,o.type);l!==d&&(z(W,o),z(X,d))}function Ve(o){W.current===o&&(U(X),U(W)),J.current===o&&(U(J),uf._currentValue=$)}var De,et;function rt(o){if(De===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);De=l&&l[1]||"",et=-1<d.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+De+o+et}var dn=!1;function zt(o,l){if(!o||dn)return"";dn=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(pe){var he=pe}Reflect.construct(o,[],be)}else{try{be.call()}catch(pe){he=pe}o.call(be.prototype)}}else{try{throw Error()}catch(pe){he=pe}(be=o())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(pe){if(pe&&he&&typeof pe.stack=="string")return[pe.stack,he.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=p.DetermineComponentFrameRoot(),N=E[0],L=E[1];if(N&&L){var Q=N.split(`
|
|
44
|
-
`),de=L.split(`
|
|
45
|
-
`);for(b=p=0;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;for(;b<de.length&&!de[b].includes("DetermineComponentFrameRoot");)b++;if(p===Q.length||b===de.length)for(p=Q.length-1,b=de.length-1;1<=p&&0<=b&&Q[p]!==de[b];)b--;for(;1<=p&&0<=b;p--,b--)if(Q[p]!==de[b]){if(p!==1||b!==1)do if(p--,b--,0>b||Q[p]!==de[b]){var xe=`
|
|
46
|
-
`+Q[p].replace(" at new "," at ");return o.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",o.displayName)),xe}while(1<=p&&0<=b);break}}}finally{dn=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?rt(d):""}function On(o,l){switch(o.tag){case 26:case 27:case 5:return rt(o.type);case 16:return rt("Lazy");case 13:return o.child!==l&&l!==null?rt("Suspense Fallback"):rt("Suspense");case 19:return rt("SuspenseList");case 0:case 15:return zt(o.type,!1);case 11:return zt(o.type.render,!1);case 1:return zt(o.type,!0);case 31:return rt("Activity");default:return""}}function yn(o){try{var l="",d=null;do l+=On(o,d),d=o,o=o.return;while(o);return l}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var Me=Object.prototype.hasOwnProperty,q=e.unstable_scheduleCallback,ne=e.unstable_cancelCallback,ce=e.unstable_shouldYield,Oe=e.unstable_requestPaint,Ee=e.unstable_now,je=e.unstable_getCurrentPriorityLevel,He=e.unstable_ImmediatePriority,mt=e.unstable_UserBlockingPriority,st=e.unstable_NormalPriority,Wt=e.unstable_LowPriority,sr=e.unstable_IdlePriority,$n=e.log,Dr=e.unstable_setDisableYieldValue,Jr=null,fn=null;function or(o){if(typeof $n=="function"&&Dr(o),fn&&typeof fn.setStrictMode=="function")try{fn.setStrictMode(Jr,o)}catch{}}var kn=Math.clz32?Math.clz32:ea,Ws=Math.log,Aa=Math.LN2;function ea(o){return o>>>=0,o===0?32:31-(Ws(o)/Aa|0)|0}var Da=256,Es=262144,wn=4194304;function In(o){var l=o&42;if(l!==0)return l;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function Ye(o,l,d){var p=o.pendingLanes;if(p===0)return 0;var b=0,E=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var L=p&134217727;return L!==0?(p=L&~E,p!==0?b=In(p):(N&=L,N!==0?b=In(N):d||(d=L&~o,d!==0&&(b=In(d))))):(L=p&~E,L!==0?b=In(L):N!==0?b=In(N):d||(d=p&~o,d!==0&&(b=In(d)))),b===0?0:l!==0&&l!==b&&(l&E)===0&&(E=b&-b,d=l&-l,E>=d||E===32&&(d&4194048)!==0)?l:b}function Gt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function Xt(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+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 l+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 Bt(){var o=wn;return wn<<=1,(wn&62914560)===0&&(wn=4194304),o}function Vn(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function Jt(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Qt(o,l,d,p,b,E){var N=o.pendingLanes;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=d,o.entangledLanes&=d,o.errorRecoveryDisabledLanes&=d,o.shellSuspendCounter=0;var L=o.entanglements,Q=o.expirationTimes,de=o.hiddenUpdates;for(d=N&~d;0<d;){var xe=31-kn(d),be=1<<xe;L[xe]=0,Q[xe]=-1;var he=de[xe];if(he!==null)for(de[xe]=null,xe=0;xe<he.length;xe++){var pe=he[xe];pe!==null&&(pe.lane&=-536870913)}d&=~be}p!==0&&Rr(o,p,0),E!==0&&b===0&&o.tag!==0&&(o.suspendedLanes|=E&~(N&~l))}function Rr(o,l,d){o.pendingLanes|=l,o.suspendedLanes&=~l;var p=31-kn(l);o.entangledLanes|=l,o.entanglements[p]=o.entanglements[p]|1073741824|d&261930}function K(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var p=31-kn(d),b=1<<p;b&l|o[p]&l&&(o[p]|=l),d&=~b}}function ee(o,l){var d=l&-l;return d=(d&42)!==0?1:fe(d),(d&(o.suspendedLanes|l))!==0?0:d}function fe(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Se(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ne(){var o=V.p;return o!==0?o:(o=window.event,o===void 0?32:sj(o.type))}function Be(o,l){var d=V.p;try{return V.p=o,l()}finally{V.p=d}}var Fe=Math.random().toString(36).slice(2),ke="__reactFiber$"+Fe,ze="__reactProps$"+Fe,Xe="__reactContainer$"+Fe,at="__reactEvents$"+Fe,tt="__reactListeners$"+Fe,pt="__reactHandles$"+Fe,hn="__reactResources$"+Fe,Ln="__reactMarker$"+Fe;function Zn(o){delete o[ke],delete o[ze],delete o[at],delete o[tt],delete o[pt]}function an(o){var l=o[ke];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Xe]||d[ke]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=VR(o);o!==null;){if(d=o[ke])return d;o=VR(o)}return l}o=d,d=o.parentNode}return null}function sn(o){if(o=o[ke]||o[Xe]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function Oa(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function ns(o){var l=o[hn];return l||(l=o[hn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Nn(o){o[Ln]=!0}var Ia=new Set,Lc={};function Ma(o,l){pa(o,l),pa(o+"Capture",l)}function pa(o,l){for(Lc[o]=l,o=0;o<l.length;o++)Ia.add(l[o])}var Pc=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]*$"),Ml={},Ft={};function jr(o){return Me.call(Ft,o)?!0:Me.call(Ml,o)?!1:Pc.test(o)?Ft[o]=!0:(Ml[o]=!0,!1)}function Rs(o,l,d){if(jr(l))if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var p=l.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+d)}}function rs(o,l,d){if(d===null)o.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+d)}}function on(o,l,d,p){if(p===null)o.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(d);return}o.setAttributeNS(l,d,""+p)}}function Or(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Rd(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function ix(o,l,d){var p=Object.getOwnPropertyDescriptor(o.constructor.prototype,l);if(!o.hasOwnProperty(l)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,E=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return b.call(this)},set:function(N){d=""+N,E.call(this,N)}}),Object.defineProperty(o,l,{enumerable:p.enumerable}),{getValue:function(){return d},setValue:function(N){d=""+N},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function lx(o){if(!o._valueTracker){var l=Rd(o)?"checked":"value";o._valueTracker=ix(o,l,""+o[l])}}function _C(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return o&&(p=Rd(o)?o.checked?"true":"false":o.value),o=p,o!==d?(l.setValue(o),!0):!1}function Qh(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var y8=/[\n"\\]/g;function as(o){return o.replace(y8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function cx(o,l,d,p,b,E,N,L){o.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?o.type=N:o.removeAttribute("type"),l!=null?N==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+Or(l)):o.value!==""+Or(l)&&(o.value=""+Or(l)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),l!=null?ux(o,N,Or(l)):d!=null?ux(o,N,Or(d)):p!=null&&o.removeAttribute("value"),b==null&&E!=null&&(o.defaultChecked=!!E),b!=null&&(o.checked=b&&typeof b!="function"&&typeof b!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?o.name=""+Or(L):o.removeAttribute("name")}function NC(o,l,d,p,b,E,N,L){if(E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(o.type=E),l!=null||d!=null){if(!(E!=="submit"&&E!=="reset"||l!=null)){lx(o);return}d=d!=null?""+Or(d):"",l=l!=null?""+Or(l):d,L||l===o.value||(o.value=l),o.defaultValue=l}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=L?o.checked:!!p,o.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),lx(o)}function ux(o,l,d){l==="number"&&Qh(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function Uc(o,l,d,p){if(o=o.options,l){l={};for(var b=0;b<d.length;b++)l["$"+d[b]]=!0;for(d=0;d<o.length;d++)b=l.hasOwnProperty("$"+o[d].value),o[d].selected!==b&&(o[d].selected=b),b&&p&&(o[d].defaultSelected=!0)}else{for(d=""+Or(d),l=null,b=0;b<o.length;b++){if(o[b].value===d){o[b].selected=!0,p&&(o[b].defaultSelected=!0);return}l!==null||o[b].disabled||(l=o[b])}l!==null&&(l.selected=!0)}}function AC(o,l,d){if(l!=null&&(l=""+Or(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+Or(d):""}function DC(o,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(H(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=Or(l),o.defaultValue=d,p=o.textContent,p===d&&p!==""&&p!==null&&(o.value=p),lx(o)}function zc(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var x8=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 OC(o,l,d){var p=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?p?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":p?o.setProperty(l,d):typeof d!="number"||d===0||x8.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function IC(o,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,d!=null){for(var p in d)!d.hasOwnProperty(p)||l!=null&&l.hasOwnProperty(p)||(p.indexOf("--")===0?o.setProperty(p,""):p==="float"?o.cssFloat="":o[p]="");for(var b in l)p=l[b],l.hasOwnProperty(b)&&d[b]!==p&&OC(o,b,p)}else for(var E in l)l.hasOwnProperty(E)&&OC(o,E,l[E])}function dx(o){if(o.indexOf("-")===-1)return!1;switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var v8=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"]]),b8=/^[\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 Jh(o){return b8.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function jo(){}var fx=null;function hx(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Fc=null,Hc=null;function MC(o){var l=sn(o);if(l&&(o=l.stateNode)){var d=o[ze]||null;e:switch(o=l.stateNode,l.type){case"input":if(cx(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=o;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+as(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==o&&p.form===o.form){var b=p[ze]||null;if(!b)throw Error(r(90));cx(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(l=0;l<d.length;l++)p=d[l],p.form===o.form&&_C(p)}break e;case"textarea":AC(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&Uc(o,!!d.multiple,l,!1)}}}var mx=!1;function kC(o,l,d){if(mx)return o(l,d);mx=!0;try{var p=o(l);return p}finally{if(mx=!1,(Fc!==null||Hc!==null)&&(Fm(),Fc&&(l=Fc,o=Hc,Hc=Fc=null,MC(l),o)))for(l=0;l<o.length;l++)MC(o[l])}}function jd(o,l){var d=o.stateNode;if(d===null)return null;var p=d[ze]||null;if(p===null)return null;d=p[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(o=o.type,p=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!p;break e;default:o=!1}if(o)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var To=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),px=!1;if(To)try{var Td={};Object.defineProperty(Td,"passive",{get:function(){px=!0}}),window.addEventListener("test",Td,Td),window.removeEventListener("test",Td,Td)}catch{px=!1}var xi=null,gx=null,em=null;function LC(){if(em)return em;var o,l=gx,d=l.length,p,b="value"in xi?xi.value:xi.textContent,E=b.length;for(o=0;o<d&&l[o]===b[o];o++);var N=d-o;for(p=1;p<=N&&l[d-p]===b[E-p];p++);return em=b.slice(o,1<p?1-p:void 0)}function tm(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function nm(){return!0}function PC(){return!1}function ga(o){function l(d,p,b,E,N){this._reactName=d,this._targetInst=b,this.type=p,this.nativeEvent=E,this.target=N,this.currentTarget=null;for(var L in o)o.hasOwnProperty(L)&&(d=o[L],this[L]=d?d(E):E[L]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?nm:PC,this.isPropagationStopped=PC,this}return g(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=nm)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=nm)},persist:function(){},isPersistent:nm}),l}var kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rm=ga(kl),_d=g({},kl,{view:0,detail:0}),S8=ga(_d),yx,xx,Nd,am=g({},_d,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:bx,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Nd&&(Nd&&o.type==="mousemove"?(yx=o.screenX-Nd.screenX,xx=o.screenY-Nd.screenY):xx=yx=0,Nd=o),yx)},movementY:function(o){return"movementY"in o?o.movementY:xx}}),UC=ga(am),C8=g({},am,{dataTransfer:0}),w8=ga(C8),E8=g({},_d,{relatedTarget:0}),vx=ga(E8),R8=g({},kl,{animationName:0,elapsedTime:0,pseudoElement:0}),j8=ga(R8),T8=g({},kl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),_8=ga(T8),N8=g({},kl,{data:0}),zC=ga(N8),A8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D8={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"},O8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function I8(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=O8[o])?!!l[o]:!1}function bx(){return I8}var M8=g({},_d,{key:function(o){if(o.key){var l=A8[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=tm(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?D8[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:bx,charCode:function(o){return o.type==="keypress"?tm(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?tm(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),k8=ga(M8),L8=g({},am,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),FC=ga(L8),P8=g({},_d,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:bx}),U8=ga(P8),z8=g({},kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),F8=ga(z8),H8=g({},am,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),$8=ga(H8),V8=g({},kl,{newState:0,oldState:0}),G8=ga(V8),B8=[9,13,27,32],Sx=To&&"CompositionEvent"in window,Ad=null;To&&"documentMode"in document&&(Ad=document.documentMode);var q8=To&&"TextEvent"in window&&!Ad,HC=To&&(!Sx||Ad&&8<Ad&&11>=Ad),$C=" ",VC=!1;function GC(o,l){switch(o){case"keyup":return B8.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function BC(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var $c=!1;function K8(o,l){switch(o){case"compositionend":return BC(l);case"keypress":return l.which!==32?null:(VC=!0,$C);case"textInput":return o=l.data,o===$C&&VC?null:o;default:return null}}function Z8(o,l){if($c)return o==="compositionend"||!Sx&&GC(o,l)?(o=LC(),em=gx=xi=null,$c=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return HC&&l.locale!=="ko"?null:l.data;default:return null}}var Y8={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 qC(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!Y8[o.type]:l==="textarea"}function KC(o,l,d,p){Fc?Hc?Hc.push(p):Hc=[p]:Fc=p,l=Km(l,"onChange"),0<l.length&&(d=new rm("onChange","change",null,d,p),o.push({event:d,listeners:l}))}var Dd=null,Od=null;function W8(o){NR(o,0)}function sm(o){var l=Oa(o);if(_C(l))return o}function ZC(o,l){if(o==="change")return l}var YC=!1;if(To){var Cx;if(To){var wx="oninput"in document;if(!wx){var WC=document.createElement("div");WC.setAttribute("oninput","return;"),wx=typeof WC.oninput=="function"}Cx=wx}else Cx=!1;YC=Cx&&(!document.documentMode||9<document.documentMode)}function XC(){Dd&&(Dd.detachEvent("onpropertychange",QC),Od=Dd=null)}function QC(o){if(o.propertyName==="value"&&sm(Od)){var l=[];KC(l,Od,o,hx(o)),kC(W8,l)}}function X8(o,l,d){o==="focusin"?(XC(),Dd=l,Od=d,Dd.attachEvent("onpropertychange",QC)):o==="focusout"&&XC()}function Q8(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return sm(Od)}function J8(o,l){if(o==="click")return sm(l)}function ek(o,l){if(o==="input"||o==="change")return sm(l)}function tk(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var ka=typeof Object.is=="function"?Object.is:tk;function Id(o,l){if(ka(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var d=Object.keys(o),p=Object.keys(l);if(d.length!==p.length)return!1;for(p=0;p<d.length;p++){var b=d[p];if(!Me.call(l,b)||!ka(o[b],l[b]))return!1}return!0}function JC(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function ew(o,l){var d=JC(o);o=0;for(var p;d;){if(d.nodeType===3){if(p=o+d.textContent.length,o<=l&&p>=l)return{node:d,offset:l-o};o=p}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=JC(d)}}function tw(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?tw(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function nw(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=Qh(o.document);l instanceof o.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)o=l.contentWindow;else break;l=Qh(o.document)}return l}function Ex(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var nk=To&&"documentMode"in document&&11>=document.documentMode,Vc=null,Rx=null,Md=null,jx=!1;function rw(o,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;jx||Vc==null||Vc!==Qh(p)||(p=Vc,"selectionStart"in p&&Ex(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Md&&Id(Md,p)||(Md=p,p=Km(Rx,"onSelect"),0<p.length&&(l=new rm("onSelect","select",null,l,d),o.push({event:l,listeners:p}),l.target=Vc)))}function Ll(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var Gc={animationend:Ll("Animation","AnimationEnd"),animationiteration:Ll("Animation","AnimationIteration"),animationstart:Ll("Animation","AnimationStart"),transitionrun:Ll("Transition","TransitionRun"),transitionstart:Ll("Transition","TransitionStart"),transitioncancel:Ll("Transition","TransitionCancel"),transitionend:Ll("Transition","TransitionEnd")},Tx={},aw={};To&&(aw=document.createElement("div").style,"AnimationEvent"in window||(delete Gc.animationend.animation,delete Gc.animationiteration.animation,delete Gc.animationstart.animation),"TransitionEvent"in window||delete Gc.transitionend.transition);function Pl(o){if(Tx[o])return Tx[o];if(!Gc[o])return o;var l=Gc[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in aw)return Tx[o]=l[d];return o}var sw=Pl("animationend"),ow=Pl("animationiteration"),iw=Pl("animationstart"),rk=Pl("transitionrun"),ak=Pl("transitionstart"),sk=Pl("transitioncancel"),lw=Pl("transitionend"),cw=new Map,_x="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(" ");_x.push("scrollEnd");function js(o,l){cw.set(o,l),Ma(l,[o])}var om=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},ss=[],Bc=0,Nx=0;function im(){for(var o=Bc,l=Nx=Bc=0;l<o;){var d=ss[l];ss[l++]=null;var p=ss[l];ss[l++]=null;var b=ss[l];ss[l++]=null;var E=ss[l];if(ss[l++]=null,p!==null&&b!==null){var N=p.pending;N===null?b.next=b:(b.next=N.next,N.next=b),p.pending=b}E!==0&&uw(d,b,E)}}function lm(o,l,d,p){ss[Bc++]=o,ss[Bc++]=l,ss[Bc++]=d,ss[Bc++]=p,Nx|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Ax(o,l,d,p){return lm(o,l,d,p),cm(o)}function Ul(o,l){return lm(o,null,null,l),cm(o)}function uw(o,l,d){o.lanes|=d;var p=o.alternate;p!==null&&(p.lanes|=d);for(var b=!1,E=o.return;E!==null;)E.childLanes|=d,p=E.alternate,p!==null&&(p.childLanes|=d),E.tag===22&&(o=E.stateNode,o===null||o._visibility&1||(b=!0)),o=E,E=E.return;return o.tag===3?(E=o.stateNode,b&&l!==null&&(b=31-kn(d),o=E.hiddenUpdates,p=o[b],p===null?o[b]=[l]:p.push(l),l.lane=d|536870912),E):null}function cm(o){if(50<nf)throw nf=0,zv=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var qc={};function ok(o,l,d,p){this.tag=o,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function La(o,l,d,p){return new ok(o,l,d,p)}function Dx(o){return o=o.prototype,!(!o||!o.isReactComponent)}function _o(o,l){var d=o.alternate;return d===null?(d=La(o.tag,l,o.key,o.mode),d.elementType=o.elementType,d.type=o.type,d.stateNode=o.stateNode,d.alternate=o,o.alternate=d):(d.pendingProps=l,d.type=o.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=o.flags&65011712,d.childLanes=o.childLanes,d.lanes=o.lanes,d.child=o.child,d.memoizedProps=o.memoizedProps,d.memoizedState=o.memoizedState,d.updateQueue=o.updateQueue,l=o.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=o.sibling,d.index=o.index,d.ref=o.ref,d.refCleanup=o.refCleanup,d}function dw(o,l){o.flags&=65011714;var d=o.alternate;return d===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=d.childLanes,o.lanes=d.lanes,o.child=d.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=d.memoizedProps,o.memoizedState=d.memoizedState,o.updateQueue=d.updateQueue,o.type=d.type,l=d.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function um(o,l,d,p,b,E){var N=0;if(p=o,typeof o=="function")Dx(o)&&(N=1);else if(typeof o=="string")N=d9(o,d,X.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case k:return o=La(31,d,l,b),o.elementType=k,o.lanes=E,o;case S:return zl(d.children,b,E,l);case w:N=8,b|=24;break;case R:return o=La(12,d,l,b|2),o.elementType=R,o.lanes=E,o;case A:return o=La(13,d,l,b),o.elementType=A,o.lanes=E,o;case D:return o=La(19,d,l,b),o.elementType=D,o.lanes=E,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case _:N=10;break e;case j:N=9;break e;case O:N=11;break e;case T:N=14;break e;case I:N=16,p=null;break e}N=29,d=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=La(N,d,l,b),l.elementType=o,l.type=p,l.lanes=E,l}function zl(o,l,d,p){return o=La(7,o,p,l),o.lanes=d,o}function Ox(o,l,d){return o=La(6,o,null,l),o.lanes=d,o}function fw(o){var l=La(18,null,null,0);return l.stateNode=o,l}function Ix(o,l,d){return l=La(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var hw=new WeakMap;function os(o,l){if(typeof o=="object"&&o!==null){var d=hw.get(o);return d!==void 0?d:(l={value:o,source:l,stack:yn(l)},hw.set(o,l),l)}return{value:o,source:l,stack:yn(l)}}var Kc=[],Zc=0,dm=null,kd=0,is=[],ls=0,vi=null,Xs=1,Qs="";function No(o,l){Kc[Zc++]=kd,Kc[Zc++]=dm,dm=o,kd=l}function mw(o,l,d){is[ls++]=Xs,is[ls++]=Qs,is[ls++]=vi,vi=o;var p=Xs;o=Qs;var b=32-kn(p)-1;p&=~(1<<b),d+=1;var E=32-kn(l)+b;if(30<E){var N=b-b%5;E=(p&(1<<N)-1).toString(32),p>>=N,b-=N,Xs=1<<32-kn(l)+b|d<<b|p,Qs=E+o}else Xs=1<<E|d<<b|p,Qs=o}function Mx(o){o.return!==null&&(No(o,1),mw(o,1,0))}function kx(o){for(;o===dm;)dm=Kc[--Zc],Kc[Zc]=null,kd=Kc[--Zc],Kc[Zc]=null;for(;o===vi;)vi=is[--ls],is[ls]=null,Qs=is[--ls],is[ls]=null,Xs=is[--ls],is[ls]=null}function pw(o,l){is[ls++]=Xs,is[ls++]=Qs,is[ls++]=vi,Xs=l.id,Qs=l.overflow,vi=o}var Ir=null,Pn=null,qt=!1,bi=null,cs=!1,Lx=Error(r(519));function Si(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ld(os(l,o)),Lx}function gw(o){var l=o.stateNode,d=o.type,p=o.memoizedProps;switch(l[ke]=o,l[ze]=p,d){case"dialog":Ut("cancel",l),Ut("close",l);break;case"iframe":case"object":case"embed":Ut("load",l);break;case"video":case"audio":for(d=0;d<af.length;d++)Ut(af[d],l);break;case"source":Ut("error",l);break;case"img":case"image":case"link":Ut("error",l),Ut("load",l);break;case"details":Ut("toggle",l);break;case"input":Ut("invalid",l),NC(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Ut("invalid",l);break;case"textarea":Ut("invalid",l),DC(l,p.value,p.defaultValue,p.children)}d=p.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||p.suppressHydrationWarning===!0||IR(l.textContent,d)?(p.popover!=null&&(Ut("beforetoggle",l),Ut("toggle",l)),p.onScroll!=null&&Ut("scroll",l),p.onScrollEnd!=null&&Ut("scrollend",l),p.onClick!=null&&(l.onclick=jo),l=!0):l=!1,l||Si(o,!0)}function yw(o){for(Ir=o.return;Ir;)switch(Ir.tag){case 5:case 31:case 13:cs=!1;return;case 27:case 3:cs=!0;return;default:Ir=Ir.return}}function Yc(o){if(o!==Ir)return!1;if(!qt)return yw(o),qt=!0,!1;var l=o.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=o.type,d=!(d!=="form"&&d!=="button")||e0(o.type,o.memoizedProps)),d=!d),d&&Pn&&Si(o),yw(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=$R(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=$R(o)}else l===27?(l=Pn,ki(o.type)?(o=s0,s0=null,Pn=o):Pn=l):Pn=Ir?ds(o.stateNode.nextSibling):null;return!0}function Fl(){Pn=Ir=null,qt=!1}function Px(){var o=bi;return o!==null&&(ba===null?ba=o:ba.push.apply(ba,o),bi=null),o}function Ld(o){bi===null?bi=[o]:bi.push(o)}var Ux=P(null),Hl=null,Ao=null;function Ci(o,l,d){z(Ux,l._currentValue),l._currentValue=d}function Do(o){o._currentValue=Ux.current,U(Ux)}function zx(o,l,d){for(;o!==null;){var p=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,p!==null&&(p.childLanes|=l)):p!==null&&(p.childLanes&l)!==l&&(p.childLanes|=l),o===d)break;o=o.return}}function Fx(o,l,d,p){var b=o.child;for(b!==null&&(b.return=o);b!==null;){var E=b.dependencies;if(E!==null){var N=b.child;E=E.firstContext;e:for(;E!==null;){var L=E;E=b;for(var Q=0;Q<l.length;Q++)if(L.context===l[Q]){E.lanes|=d,L=E.alternate,L!==null&&(L.lanes|=d),zx(E.return,d,o),p||(N=null);break e}E=L.next}}else if(b.tag===18){if(N=b.return,N===null)throw Error(r(341));N.lanes|=d,E=N.alternate,E!==null&&(E.lanes|=d),zx(N,d,o),N=null}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===o){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}}function Wc(o,l,d,p){o=null;for(var b=l,E=!1;b!==null;){if(!E){if((b.flags&524288)!==0)E=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var N=b.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var L=b.type;ka(b.pendingProps.value,N.value)||(o!==null?o.push(L):o=[L])}}else if(b===J.current){if(N=b.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(o!==null?o.push(uf):o=[uf])}b=b.return}o!==null&&Fx(l,o,d,p),l.flags|=262144}function fm(o){for(o=o.firstContext;o!==null;){if(!ka(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function $l(o){Hl=o,Ao=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function Mr(o){return xw(Hl,o)}function hm(o,l){return Hl===null&&$l(o),xw(o,l)}function xw(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Ao===null){if(o===null)throw Error(r(308));Ao=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Ao=Ao.next=l;return d}var ik=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(d,p){o.push(p)}};this.abort=function(){l.aborted=!0,o.forEach(function(d){return d()})}},lk=e.unstable_scheduleCallback,ck=e.unstable_NormalPriority,ir={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hx(){return{controller:new ik,data:new Map,refCount:0}}function Pd(o){o.refCount--,o.refCount===0&&lk(ck,function(){o.controller.abort()})}var Ud=null,$x=0,Xc=0,Qc=null;function uk(o,l){if(Ud===null){var d=Ud=[];$x=0,Xc=Bv(),Qc={status:"pending",value:void 0,then:function(p){d.push(p)}}}return $x++,l.then(vw,vw),l}function vw(){if(--$x===0&&Ud!==null){Qc!==null&&(Qc.status="fulfilled");var o=Ud;Ud=null,Xc=0,Qc=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function dk(o,l){var d=[],p={status:"pending",value:null,reason:null,then:function(b){d.push(b)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var b=0;b<d.length;b++)(0,d[b])(l)},function(b){for(p.status="rejected",p.reason=b,b=0;b<d.length;b++)(0,d[b])(void 0)}),p}var bw=M.S;M.S=function(o,l){rR=Ee(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&uk(o,l),bw!==null&&bw(o,l)};var Vl=P(null);function Vx(){var o=Vl.current;return o!==null?o:An.pooledCache}function mm(o,l){l===null?z(Vl,Vl.current):z(Vl,l.pool)}function Sw(){var o=Vx();return o===null?null:{parent:ir._currentValue,pool:o}}var Jc=Error(r(460)),Gx=Error(r(474)),pm=Error(r(542)),gm={then:function(){}};function Cw(o){return o=o.status,o==="fulfilled"||o==="rejected"}function ww(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(jo,jo),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,Rw(o),o;default:if(typeof l.status=="string")l.then(jo,jo);else{if(o=An,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var b=l;b.status="fulfilled",b.value=p}},function(p){if(l.status==="pending"){var b=l;b.status="rejected",b.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,Rw(o),o}throw Bl=l,Jc}}function Gl(o){try{var l=o._init;return l(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Bl=d,Jc):d}}var Bl=null;function Ew(){if(Bl===null)throw Error(r(459));var o=Bl;return Bl=null,o}function Rw(o){if(o===Jc||o===pm)throw Error(r(483))}var eu=null,zd=0;function ym(o){var l=zd;return zd+=1,eu===null&&(eu=[]),ww(eu,o,l)}function Fd(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function xm(o,l){throw l.$$typeof===x?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function jw(o){function l(ie,te){if(o){var ue=ie.deletions;ue===null?(ie.deletions=[te],ie.flags|=16):ue.push(te)}}function d(ie,te){if(!o)return null;for(;te!==null;)l(ie,te),te=te.sibling;return null}function p(ie){for(var te=new Map;ie!==null;)ie.key!==null?te.set(ie.key,ie):te.set(ie.index,ie),ie=ie.sibling;return te}function b(ie,te){return ie=_o(ie,te),ie.index=0,ie.sibling=null,ie}function E(ie,te,ue){return ie.index=ue,o?(ue=ie.alternate,ue!==null?(ue=ue.index,ue<te?(ie.flags|=67108866,te):ue):(ie.flags|=67108866,te)):(ie.flags|=1048576,te)}function N(ie){return o&&ie.alternate===null&&(ie.flags|=67108866),ie}function L(ie,te,ue,ve){return te===null||te.tag!==6?(te=Ox(ue,ie.mode,ve),te.return=ie,te):(te=b(te,ue),te.return=ie,te)}function Q(ie,te,ue,ve){var nt=ue.type;return nt===S?xe(ie,te,ue.props.children,ve,ue.key):te!==null&&(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===I&&Gl(nt)===te.type)?(te=b(te,ue.props),Fd(te,ue),te.return=ie,te):(te=um(ue.type,ue.key,ue.props,null,ie.mode,ve),Fd(te,ue),te.return=ie,te)}function de(ie,te,ue,ve){return te===null||te.tag!==4||te.stateNode.containerInfo!==ue.containerInfo||te.stateNode.implementation!==ue.implementation?(te=Ix(ue,ie.mode,ve),te.return=ie,te):(te=b(te,ue.children||[]),te.return=ie,te)}function xe(ie,te,ue,ve,nt){return te===null||te.tag!==7?(te=zl(ue,ie.mode,ve,nt),te.return=ie,te):(te=b(te,ue),te.return=ie,te)}function be(ie,te,ue){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Ox(""+te,ie.mode,ue),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return ue=um(te.type,te.key,te.props,null,ie.mode,ue),Fd(ue,te),ue.return=ie,ue;case C:return te=Ix(te,ie.mode,ue),te.return=ie,te;case I:return te=Gl(te),be(ie,te,ue)}if(H(te)||Y(te))return te=zl(te,ie.mode,ue,null),te.return=ie,te;if(typeof te.then=="function")return be(ie,ym(te),ue);if(te.$$typeof===_)return be(ie,hm(ie,te),ue);xm(ie,te)}return null}function he(ie,te,ue,ve){var nt=te!==null?te.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return nt!==null?null:L(ie,te,""+ue,ve);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===nt?Q(ie,te,ue,ve):null;case C:return ue.key===nt?de(ie,te,ue,ve):null;case I:return ue=Gl(ue),he(ie,te,ue,ve)}if(H(ue)||Y(ue))return nt!==null?null:xe(ie,te,ue,ve,null);if(typeof ue.then=="function")return he(ie,te,ym(ue),ve);if(ue.$$typeof===_)return he(ie,te,hm(ie,ue),ve);xm(ie,ue)}return null}function pe(ie,te,ue,ve,nt){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ie=ie.get(ue)||null,L(te,ie,""+ve,nt);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return ie=ie.get(ve.key===null?ue:ve.key)||null,Q(te,ie,ve,nt);case C:return ie=ie.get(ve.key===null?ue:ve.key)||null,de(te,ie,ve,nt);case I:return ve=Gl(ve),pe(ie,te,ue,ve,nt)}if(H(ve)||Y(ve))return ie=ie.get(ue)||null,xe(te,ie,ve,nt,null);if(typeof ve.then=="function")return pe(ie,te,ue,ym(ve),nt);if(ve.$$typeof===_)return pe(ie,te,ue,hm(te,ve),nt);xm(te,ve)}return null}function qe(ie,te,ue,ve){for(var nt=null,ln=null,We=te,Tt=te=0,$t=null;We!==null&&Tt<ue.length;Tt++){We.index>Tt?($t=We,We=null):$t=We.sibling;var cn=he(ie,We,ue[Tt],ve);if(cn===null){We===null&&(We=$t);break}o&&We&&cn.alternate===null&&l(ie,We),te=E(cn,te,Tt),ln===null?nt=cn:ln.sibling=cn,ln=cn,We=$t}if(Tt===ue.length)return d(ie,We),qt&&No(ie,Tt),nt;if(We===null){for(;Tt<ue.length;Tt++)We=be(ie,ue[Tt],ve),We!==null&&(te=E(We,te,Tt),ln===null?nt=We:ln.sibling=We,ln=We);return qt&&No(ie,Tt),nt}for(We=p(We);Tt<ue.length;Tt++)$t=pe(We,ie,Tt,ue[Tt],ve),$t!==null&&(o&&$t.alternate!==null&&We.delete($t.key===null?Tt:$t.key),te=E($t,te,Tt),ln===null?nt=$t:ln.sibling=$t,ln=$t);return o&&We.forEach(function(Fi){return l(ie,Fi)}),qt&&No(ie,Tt),nt}function ot(ie,te,ue,ve){if(ue==null)throw Error(r(151));for(var nt=null,ln=null,We=te,Tt=te=0,$t=null,cn=ue.next();We!==null&&!cn.done;Tt++,cn=ue.next()){We.index>Tt?($t=We,We=null):$t=We.sibling;var Fi=he(ie,We,cn.value,ve);if(Fi===null){We===null&&(We=$t);break}o&&We&&Fi.alternate===null&&l(ie,We),te=E(Fi,te,Tt),ln===null?nt=Fi:ln.sibling=Fi,ln=Fi,We=$t}if(cn.done)return d(ie,We),qt&&No(ie,Tt),nt;if(We===null){for(;!cn.done;Tt++,cn=ue.next())cn=be(ie,cn.value,ve),cn!==null&&(te=E(cn,te,Tt),ln===null?nt=cn:ln.sibling=cn,ln=cn);return qt&&No(ie,Tt),nt}for(We=p(We);!cn.done;Tt++,cn=ue.next())cn=pe(We,ie,Tt,cn.value,ve),cn!==null&&(o&&cn.alternate!==null&&We.delete(cn.key===null?Tt:cn.key),te=E(cn,te,Tt),ln===null?nt=cn:ln.sibling=cn,ln=cn);return o&&We.forEach(function(C9){return l(ie,C9)}),qt&&No(ie,Tt),nt}function jn(ie,te,ue,ve){if(typeof ue=="object"&&ue!==null&&ue.type===S&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var nt=ue.key;te!==null;){if(te.key===nt){if(nt=ue.type,nt===S){if(te.tag===7){d(ie,te.sibling),ve=b(te,ue.props.children),ve.return=ie,ie=ve;break e}}else if(te.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===I&&Gl(nt)===te.type){d(ie,te.sibling),ve=b(te,ue.props),Fd(ve,ue),ve.return=ie,ie=ve;break e}d(ie,te);break}else l(ie,te);te=te.sibling}ue.type===S?(ve=zl(ue.props.children,ie.mode,ve,ue.key),ve.return=ie,ie=ve):(ve=um(ue.type,ue.key,ue.props,null,ie.mode,ve),Fd(ve,ue),ve.return=ie,ie=ve)}return N(ie);case C:e:{for(nt=ue.key;te!==null;){if(te.key===nt)if(te.tag===4&&te.stateNode.containerInfo===ue.containerInfo&&te.stateNode.implementation===ue.implementation){d(ie,te.sibling),ve=b(te,ue.children||[]),ve.return=ie,ie=ve;break e}else{d(ie,te);break}else l(ie,te);te=te.sibling}ve=Ix(ue,ie.mode,ve),ve.return=ie,ie=ve}return N(ie);case I:return ue=Gl(ue),jn(ie,te,ue,ve)}if(H(ue))return qe(ie,te,ue,ve);if(Y(ue)){if(nt=Y(ue),typeof nt!="function")throw Error(r(150));return ue=nt.call(ue),ot(ie,te,ue,ve)}if(typeof ue.then=="function")return jn(ie,te,ym(ue),ve);if(ue.$$typeof===_)return jn(ie,te,hm(ie,ue),ve);xm(ie,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,te!==null&&te.tag===6?(d(ie,te.sibling),ve=b(te,ue),ve.return=ie,ie=ve):(d(ie,te),ve=Ox(ue,ie.mode,ve),ve.return=ie,ie=ve),N(ie)):d(ie,te)}return function(ie,te,ue,ve){try{zd=0;var nt=jn(ie,te,ue,ve);return eu=null,nt}catch(We){if(We===Jc||We===pm)throw We;var ln=La(29,We,null,ie.mode);return ln.lanes=ve,ln.return=ie,ln}finally{}}}var ql=jw(!0),Tw=jw(!1),wi=!1;function Bx(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qx(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function Ei(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ri(o,l,d){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(mn&2)!==0){var b=p.pending;return b===null?l.next=l:(l.next=b.next,b.next=l),p.pending=l,l=cm(o),uw(o,null,d),l}return lm(o,p,l,d),cm(o)}function Hd(o,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,K(o,d)}}function Kx(o,l){var d=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var b=null,E=null;if(d=d.firstBaseUpdate,d!==null){do{var N={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};E===null?b=E=N:E=E.next=N,d=d.next}while(d!==null);E===null?b=E=l:E=E.next=l}else b=E=l;d={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:E,shared:p.shared,callbacks:p.callbacks},o.updateQueue=d;return}o=d.lastBaseUpdate,o===null?d.firstBaseUpdate=l:o.next=l,d.lastBaseUpdate=l}var Zx=!1;function $d(){if(Zx){var o=Qc;if(o!==null)throw o}}function Vd(o,l,d,p){Zx=!1;var b=o.updateQueue;wi=!1;var E=b.firstBaseUpdate,N=b.lastBaseUpdate,L=b.shared.pending;if(L!==null){b.shared.pending=null;var Q=L,de=Q.next;Q.next=null,N===null?E=de:N.next=de,N=Q;var xe=o.alternate;xe!==null&&(xe=xe.updateQueue,L=xe.lastBaseUpdate,L!==N&&(L===null?xe.firstBaseUpdate=de:L.next=de,xe.lastBaseUpdate=Q))}if(E!==null){var be=b.baseState;N=0,xe=de=Q=null,L=E;do{var he=L.lane&-536870913,pe=he!==L.lane;if(pe?(Ht&he)===he:(p&he)===he){he!==0&&he===Xc&&(Zx=!0),xe!==null&&(xe=xe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var qe=o,ot=L;he=l;var jn=d;switch(ot.tag){case 1:if(qe=ot.payload,typeof qe=="function"){be=qe.call(jn,be,he);break e}be=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=ot.payload,he=typeof qe=="function"?qe.call(jn,be,he):qe,he==null)break e;be=g({},be,he);break e;case 2:wi=!0}}he=L.callback,he!==null&&(o.flags|=64,pe&&(o.flags|=8192),pe=b.callbacks,pe===null?b.callbacks=[he]:pe.push(he))}else pe={lane:he,tag:L.tag,payload:L.payload,callback:L.callback,next:null},xe===null?(de=xe=pe,Q=be):xe=xe.next=pe,N|=he;if(L=L.next,L===null){if(L=b.shared.pending,L===null)break;pe=L,L=pe.next,pe.next=null,b.lastBaseUpdate=pe,b.shared.pending=null}}while(!0);xe===null&&(Q=be),b.baseState=Q,b.firstBaseUpdate=de,b.lastBaseUpdate=xe,E===null&&(b.shared.lanes=0),Ai|=N,o.lanes=N,o.memoizedState=be}}function _w(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function Nw(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)_w(d[o],l)}var tu=P(null),vm=P(0);function Aw(o,l){o=Fo,z(vm,o),z(tu,l),Fo=o|l.baseLanes}function Yx(){z(vm,Fo),z(tu,tu.current)}function Wx(){Fo=vm.current,U(tu),U(vm)}var Pa=P(null),us=null;function ji(o){var l=o.alternate;z(nr,nr.current&1),z(Pa,o),us===null&&(l===null||tu.current!==null||l.memoizedState!==null)&&(us=o)}function Xx(o){z(nr,nr.current),z(Pa,o),us===null&&(us=o)}function Dw(o){o.tag===22?(z(nr,nr.current),z(Pa,o),us===null&&(us=o)):Ti()}function Ti(){z(nr,nr.current),z(Pa,Pa.current)}function Ua(o){U(Pa),us===o&&(us=null),U(nr)}var nr=P(0);function bm(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||r0(d)||a0(d)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Oo=0,bt=null,En=null,lr=null,Sm=!1,nu=!1,Kl=!1,Cm=0,Gd=0,ru=null,fk=0;function Yn(){throw Error(r(321))}function Qx(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!ka(o[d],l[d]))return!1;return!0}function Jx(o,l,d,p,b,E){return Oo=E,bt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,M.H=o===null||o.memoizedState===null?mE:mv,Kl=!1,E=d(p,b),Kl=!1,nu&&(E=Iw(l,d,p,b)),Ow(o),E}function Ow(o){M.H=Kd;var l=En!==null&&En.next!==null;if(Oo=0,lr=En=bt=null,Sm=!1,Gd=0,ru=null,l)throw Error(r(300));o===null||cr||(o=o.dependencies,o!==null&&fm(o)&&(cr=!0))}function Iw(o,l,d,p){bt=o;var b=0;do{if(nu&&(ru=null),Gd=0,nu=!1,25<=b)throw Error(r(301));if(b+=1,lr=En=null,o.updateQueue!=null){var E=o.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}M.H=pE,E=l(d,p)}while(nu);return E}function hk(){var o=M.H,l=o.useState()[0];return l=typeof l.then=="function"?Bd(l):l,o=o.useState()[0],(En!==null?En.memoizedState:null)!==o&&(bt.flags|=1024),l}function ev(){var o=Cm!==0;return Cm=0,o}function tv(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function nv(o){if(Sm){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}Sm=!1}Oo=0,lr=En=bt=null,nu=!1,Gd=Cm=0,ru=null}function ta(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lr===null?bt.memoizedState=lr=o:lr=lr.next=o,lr}function rr(){if(En===null){var o=bt.alternate;o=o!==null?o.memoizedState:null}else o=En.next;var l=lr===null?bt.memoizedState:lr.next;if(l!==null)lr=l,En=o;else{if(o===null)throw bt.alternate===null?Error(r(467)):Error(r(310));En=o,o={memoizedState:En.memoizedState,baseState:En.baseState,baseQueue:En.baseQueue,queue:En.queue,next:null},lr===null?bt.memoizedState=lr=o:lr=lr.next=o}return lr}function wm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bd(o){var l=Gd;return Gd+=1,ru===null&&(ru=[]),o=ww(ru,o,l),l=bt,(lr===null?l.memoizedState:lr.next)===null&&(l=l.alternate,M.H=l===null||l.memoizedState===null?mE:mv),o}function Em(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Bd(o);if(o.$$typeof===_)return Mr(o)}throw Error(r(438,String(o)))}function rv(o){var l=null,d=bt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=bt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(b){return b.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=wm(),bt.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(o),p=0;p<o;p++)d[p]=F;return l.index++,d}function Io(o,l){return typeof l=="function"?l(o):l}function Rm(o){var l=rr();return av(l,En,o)}function av(o,l,d){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var b=o.baseQueue,E=p.pending;if(E!==null){if(b!==null){var N=b.next;b.next=E.next,E.next=N}l.baseQueue=b=E,p.pending=null}if(E=o.baseState,b===null)o.memoizedState=E;else{l=b.next;var L=N=null,Q=null,de=l,xe=!1;do{var be=de.lane&-536870913;if(be!==de.lane?(Ht&be)===be:(Oo&be)===be){var he=de.revertLane;if(he===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),be===Xc&&(xe=!0);else if((Oo&he)===he){de=de.next,he===Xc&&(xe=!0);continue}else be={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Q===null?(L=Q=be,N=E):Q=Q.next=be,bt.lanes|=he,Ai|=he;be=de.action,Kl&&d(E,be),E=de.hasEagerState?de.eagerState:d(E,be)}else he={lane:be,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},Q===null?(L=Q=he,N=E):Q=Q.next=he,bt.lanes|=be,Ai|=be;de=de.next}while(de!==null&&de!==l);if(Q===null?N=E:Q.next=L,!ka(E,o.memoizedState)&&(cr=!0,xe&&(d=Qc,d!==null)))throw d;o.memoizedState=E,o.baseState=N,o.baseQueue=Q,p.lastRenderedState=E}return b===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function sv(o){var l=rr(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var p=d.dispatch,b=d.pending,E=l.memoizedState;if(b!==null){d.pending=null;var N=b=b.next;do E=o(E,N.action),N=N.next;while(N!==b);ka(E,l.memoizedState)||(cr=!0),l.memoizedState=E,l.baseQueue===null&&(l.baseState=E),d.lastRenderedState=E}return[E,p]}function Mw(o,l,d){var p=bt,b=rr(),E=qt;if(E){if(d===void 0)throw Error(r(407));d=d()}else d=l();var N=!ka((En||b).memoizedState,d);if(N&&(b.memoizedState=d,cr=!0),b=b.queue,lv(Pw.bind(null,p,b,o),[o]),b.getSnapshot!==l||N||lr!==null&&lr.memoizedState.tag&1){if(p.flags|=2048,au(9,{destroy:void 0},Lw.bind(null,p,b,d,l),null),An===null)throw Error(r(349));E||(Oo&127)!==0||kw(p,l,d)}return d}function kw(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=bt.updateQueue,l===null?(l=wm(),bt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function Lw(o,l,d,p){l.value=d,l.getSnapshot=p,Uw(l)&&zw(o)}function Pw(o,l,d){return d(function(){Uw(l)&&zw(o)})}function Uw(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!ka(o,d)}catch{return!0}}function zw(o){var l=Ul(o,2);l!==null&&Sa(l,o,2)}function ov(o){var l=ta();if(typeof o=="function"){var d=o;if(o=d(),Kl){or(!0);try{d()}finally{or(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:o},l}function Fw(o,l,d,p){return o.baseState=d,av(o,En,typeof p=="function"?p:Io)}function mk(o,l,d,p,b){if(_m(o))throw Error(r(485));if(o=l.action,o!==null){var E={payload:b,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){E.listeners.push(N)}};M.T!==null?d(!0):E.isTransition=!1,p(E),d=l.pending,d===null?(E.next=l.pending=E,Hw(l,E)):(E.next=d.next,l.pending=d.next=E)}}function Hw(o,l){var d=l.action,p=l.payload,b=o.state;if(l.isTransition){var E=M.T,N={};M.T=N;try{var L=d(b,p),Q=M.S;Q!==null&&Q(N,L),$w(o,l,L)}catch(de){iv(o,l,de)}finally{E!==null&&N.types!==null&&(E.types=N.types),M.T=E}}else try{E=d(b,p),$w(o,l,E)}catch(de){iv(o,l,de)}}function $w(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){Vw(o,l,p)},function(p){return iv(o,l,p)}):Vw(o,l,d)}function Vw(o,l,d){l.status="fulfilled",l.value=d,Gw(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,Hw(o,d)))}function iv(o,l,d){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,Gw(l),l=l.next;while(l!==p)}o.action=null}function Gw(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function Bw(o,l){return l}function qw(o,l){if(qt){var d=An.formState;if(d!==null){e:{var p=bt;if(qt){if(Pn){t:{for(var b=Pn,E=cs;b.nodeType!==8;){if(!E){b=null;break t}if(b=ds(b.nextSibling),b===null){b=null;break t}}E=b.data,b=E==="F!"||E==="F"?b:null}if(b){Pn=ds(b.nextSibling),p=b.data==="F!";break e}}Si(p)}p=!1}p&&(l=d[0])}}return d=ta(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bw,lastRenderedState:l},d.queue=p,d=dE.bind(null,bt,p),p.dispatch=d,p=ov(!1),E=hv.bind(null,bt,!1,p.queue),p=ta(),b={state:l,dispatch:null,action:o,pending:null},p.queue=b,d=mk.bind(null,bt,b,E,d),b.dispatch=d,p.memoizedState=o,[l,d,!1]}function Kw(o){var l=rr();return Zw(l,En,o)}function Zw(o,l,d){if(l=av(o,l,Bw)[0],o=Rm(Io)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Bd(l)}catch(N){throw N===Jc?pm:N}else p=l;l=rr();var b=l.queue,E=b.dispatch;return d!==l.memoizedState&&(bt.flags|=2048,au(9,{destroy:void 0},pk.bind(null,b,d),null)),[p,E,o]}function pk(o,l){o.action=l}function Yw(o){var l=rr(),d=En;if(d!==null)return Zw(l,d,o);rr(),l=l.memoizedState,d=rr();var p=d.queue.dispatch;return d.memoizedState=o,[l,p,!1]}function au(o,l,d,p){return o={tag:o,create:d,deps:p,inst:l,next:null},l=bt.updateQueue,l===null&&(l=wm(),bt.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=o.next=o:(p=d.next,d.next=o,o.next=p,l.lastEffect=o),o}function Ww(){return rr().memoizedState}function jm(o,l,d,p){var b=ta();bt.flags|=o,b.memoizedState=au(1|l,{destroy:void 0},d,p===void 0?null:p)}function Tm(o,l,d,p){var b=rr();p=p===void 0?null:p;var E=b.memoizedState.inst;En!==null&&p!==null&&Qx(p,En.memoizedState.deps)?b.memoizedState=au(l,E,d,p):(bt.flags|=o,b.memoizedState=au(1|l,E,d,p))}function Xw(o,l){jm(8390656,8,o,l)}function lv(o,l){Tm(2048,8,o,l)}function gk(o){bt.flags|=4;var l=bt.updateQueue;if(l===null)l=wm(),bt.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function Qw(o){var l=rr().memoizedState;return gk({ref:l,nextImpl:o}),function(){if((mn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function Jw(o,l){return Tm(4,2,o,l)}function eE(o,l){return Tm(4,4,o,l)}function tE(o,l){if(typeof l=="function"){o=o();var d=l(o);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function nE(o,l,d){d=d!=null?d.concat([o]):null,Tm(4,4,tE.bind(null,l,o),d)}function cv(){}function rE(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&Qx(l,p[1])?p[0]:(d.memoizedState=[o,l],o)}function aE(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&Qx(l,p[1]))return p[0];if(p=o(),Kl){or(!0);try{o()}finally{or(!1)}}return d.memoizedState=[p,l],p}function uv(o,l,d){return d===void 0||(Oo&1073741824)!==0&&(Ht&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=sR(),bt.lanes|=o,Ai|=o,d)}function sE(o,l,d,p){return ka(d,l)?d:tu.current!==null?(o=uv(o,d,p),ka(o,l)||(cr=!0),o):(Oo&42)===0||(Oo&1073741824)!==0&&(Ht&261930)===0?(cr=!0,o.memoizedState=d):(o=sR(),bt.lanes|=o,Ai|=o,l)}function oE(o,l,d,p,b){var E=V.p;V.p=E!==0&&8>E?E:8;var N=M.T,L={};M.T=L,hv(o,!1,l,d);try{var Q=b(),de=M.S;if(de!==null&&de(L,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var xe=dk(Q,p);qd(o,l,xe,Ha(o))}else qd(o,l,p,Ha(o))}catch(be){qd(o,l,{then:function(){},status:"rejected",reason:be},Ha())}finally{V.p=E,N!==null&&L.types!==null&&(N.types=L.types),M.T=N}}function yk(){}function dv(o,l,d,p){if(o.tag!==5)throw Error(r(476));var b=iE(o).queue;oE(o,b,l,$,d===null?yk:function(){return lE(o),d(p)})}function iE(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:$},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function lE(o){var l=iE(o);l.next===null&&(l=o.alternate.memoizedState),qd(o,l.next.queue,{},Ha())}function fv(){return Mr(uf)}function cE(){return rr().memoizedState}function uE(){return rr().memoizedState}function xk(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=Ha();o=Ei(d);var p=Ri(l,o,d);p!==null&&(Sa(p,l,d),Hd(p,l,d)),l={cache:Hx()},o.payload=l;return}l=l.return}}function vk(o,l,d){var p=Ha();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},_m(o)?fE(l,d):(d=Ax(o,l,d,p),d!==null&&(Sa(d,o,p),hE(d,l,p)))}function dE(o,l,d){var p=Ha();qd(o,l,d,p)}function qd(o,l,d,p){var b={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(_m(o))fE(l,b);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=l.lastRenderedReducer,E!==null))try{var N=l.lastRenderedState,L=E(N,d);if(b.hasEagerState=!0,b.eagerState=L,ka(L,N))return lm(o,l,b,0),An===null&&im(),!1}catch{}finally{}if(d=Ax(o,l,b,p),d!==null)return Sa(d,o,p),hE(d,l,p),!0}return!1}function hv(o,l,d,p){if(p={lane:2,revertLane:Bv(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},_m(o)){if(l)throw Error(r(479))}else l=Ax(o,d,p,2),l!==null&&Sa(l,o,2)}function _m(o){var l=o.alternate;return o===bt||l!==null&&l===bt}function fE(o,l){nu=Sm=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function hE(o,l,d){if((d&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,K(o,d)}}var Kd={readContext:Mr,use:Em,useCallback:Yn,useContext:Yn,useEffect:Yn,useImperativeHandle:Yn,useLayoutEffect:Yn,useInsertionEffect:Yn,useMemo:Yn,useReducer:Yn,useRef:Yn,useState:Yn,useDebugValue:Yn,useDeferredValue:Yn,useTransition:Yn,useSyncExternalStore:Yn,useId:Yn,useHostTransitionStatus:Yn,useFormState:Yn,useActionState:Yn,useOptimistic:Yn,useMemoCache:Yn,useCacheRefresh:Yn};Kd.useEffectEvent=Yn;var mE={readContext:Mr,use:Em,useCallback:function(o,l){return ta().memoizedState=[o,l===void 0?null:l],o},useContext:Mr,useEffect:Xw,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,jm(4194308,4,tE.bind(null,l,o),d)},useLayoutEffect:function(o,l){return jm(4194308,4,o,l)},useInsertionEffect:function(o,l){jm(4,2,o,l)},useMemo:function(o,l){var d=ta();l=l===void 0?null:l;var p=o();if(Kl){or(!0);try{o()}finally{or(!1)}}return d.memoizedState=[p,l],p},useReducer:function(o,l,d){var p=ta();if(d!==void 0){var b=d(l);if(Kl){or(!0);try{d(l)}finally{or(!1)}}}else b=l;return p.memoizedState=p.baseState=b,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:b},p.queue=o,o=o.dispatch=vk.bind(null,bt,o),[p.memoizedState,o]},useRef:function(o){var l=ta();return o={current:o},l.memoizedState=o},useState:function(o){o=ov(o);var l=o.queue,d=dE.bind(null,bt,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:cv,useDeferredValue:function(o,l){var d=ta();return uv(d,o,l)},useTransition:function(){var o=ov(!1);return o=oE.bind(null,bt,o.queue,!0,!1),ta().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var p=bt,b=ta();if(qt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),An===null)throw Error(r(349));(Ht&127)!==0||kw(p,l,d)}b.memoizedState=d;var E={value:d,getSnapshot:l};return b.queue=E,Xw(Pw.bind(null,p,E,o),[o]),p.flags|=2048,au(9,{destroy:void 0},Lw.bind(null,p,E,d,l),null),d},useId:function(){var o=ta(),l=An.identifierPrefix;if(qt){var d=Qs,p=Xs;d=(p&~(1<<32-kn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=Cm++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=fk++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:fv,useFormState:qw,useActionState:qw,useOptimistic:function(o){var l=ta();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=hv.bind(null,bt,!0,d),d.dispatch=l,[o,l]},useMemoCache:rv,useCacheRefresh:function(){return ta().memoizedState=xk.bind(null,bt)},useEffectEvent:function(o){var l=ta(),d={impl:o};return l.memoizedState=d,function(){if((mn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},mv={readContext:Mr,use:Em,useCallback:rE,useContext:Mr,useEffect:lv,useImperativeHandle:nE,useInsertionEffect:Jw,useLayoutEffect:eE,useMemo:aE,useReducer:Rm,useRef:Ww,useState:function(){return Rm(Io)},useDebugValue:cv,useDeferredValue:function(o,l){var d=rr();return sE(d,En.memoizedState,o,l)},useTransition:function(){var o=Rm(Io)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Bd(o),l]},useSyncExternalStore:Mw,useId:cE,useHostTransitionStatus:fv,useFormState:Kw,useActionState:Kw,useOptimistic:function(o,l){var d=rr();return Fw(d,En,o,l)},useMemoCache:rv,useCacheRefresh:uE};mv.useEffectEvent=Qw;var pE={readContext:Mr,use:Em,useCallback:rE,useContext:Mr,useEffect:lv,useImperativeHandle:nE,useInsertionEffect:Jw,useLayoutEffect:eE,useMemo:aE,useReducer:sv,useRef:Ww,useState:function(){return sv(Io)},useDebugValue:cv,useDeferredValue:function(o,l){var d=rr();return En===null?uv(d,o,l):sE(d,En.memoizedState,o,l)},useTransition:function(){var o=sv(Io)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Bd(o),l]},useSyncExternalStore:Mw,useId:cE,useHostTransitionStatus:fv,useFormState:Yw,useActionState:Yw,useOptimistic:function(o,l){var d=rr();return En!==null?Fw(d,En,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:rv,useCacheRefresh:uE};pE.useEffectEvent=Qw;function pv(o,l,d,p){l=o.memoizedState,d=d(p,l),d=d==null?l:g({},l,d),o.memoizedState=d,o.lanes===0&&(o.updateQueue.baseState=d)}var gv={enqueueSetState:function(o,l,d){o=o._reactInternals;var p=Ha(),b=Ei(p);b.payload=l,d!=null&&(b.callback=d),l=Ri(o,b,p),l!==null&&(Sa(l,o,p),Hd(l,o,p))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var p=Ha(),b=Ei(p);b.tag=1,b.payload=l,d!=null&&(b.callback=d),l=Ri(o,b,p),l!==null&&(Sa(l,o,p),Hd(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Ha(),p=Ei(d);p.tag=2,l!=null&&(p.callback=l),l=Ri(o,p,d),l!==null&&(Sa(l,o,d),Hd(l,o,d))}};function gE(o,l,d,p,b,E,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,E,N):l.prototype&&l.prototype.isPureReactComponent?!Id(d,p)||!Id(b,E):!0}function yE(o,l,d,p){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,p),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,p),l.state!==o&&gv.enqueueReplaceState(l,l.state,null)}function Zl(o,l){var d=l;if("ref"in l){d={};for(var p in l)p!=="ref"&&(d[p]=l[p])}if(o=o.defaultProps){d===l&&(d=g({},d));for(var b in o)d[b]===void 0&&(d[b]=o[b])}return d}function xE(o){om(o)}function vE(o){console.error(o)}function bE(o){om(o)}function Nm(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function SE(o,l,d){try{var p=o.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function yv(o,l,d){return d=Ei(d),d.tag=3,d.payload={element:null},d.callback=function(){Nm(o,l)},d}function CE(o){return o=Ei(o),o.tag=3,o}function wE(o,l,d,p){var b=d.type.getDerivedStateFromError;if(typeof b=="function"){var E=p.value;o.payload=function(){return b(E)},o.callback=function(){SE(l,d,p)}}var N=d.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){SE(l,d,p),typeof b!="function"&&(Di===null?Di=new Set([this]):Di.add(this));var L=p.stack;this.componentDidCatch(p.value,{componentStack:L!==null?L:""})})}function bk(o,l,d,p,b){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&Wc(l,d,b,!0),d=Pa.current,d!==null){switch(d.tag){case 31:case 13:return us===null?Hm():d.alternate===null&&Wn===0&&(Wn=3),d.flags&=-257,d.flags|=65536,d.lanes=b,p===gm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),$v(o,p,b)),!1;case 22:return d.flags|=65536,p===gm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([p])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([p]):d.add(p)),$v(o,p,b)),!1}throw Error(r(435,d.tag))}return $v(o,p,b),Hm(),!1}if(qt)return l=Pa.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=b,p!==Lx&&(o=Error(r(422),{cause:p}),Ld(os(o,d)))):(p!==Lx&&(l=Error(r(423),{cause:p}),Ld(os(l,d))),o=o.current.alternate,o.flags|=65536,b&=-b,o.lanes|=b,p=os(p,d),b=yv(o.stateNode,p,b),Kx(o,b),Wn!==4&&(Wn=2)),!1;var E=Error(r(520),{cause:p});if(E=os(E,d),tf===null?tf=[E]:tf.push(E),Wn!==4&&(Wn=2),l===null)return!0;p=os(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=b&-b,d.lanes|=o,o=yv(d.stateNode,p,o),Kx(d,o),!1;case 1:if(l=d.type,E=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Di===null||!Di.has(E))))return d.flags|=65536,b&=-b,d.lanes|=b,b=CE(b),wE(b,o,d,p),Kx(d,b),!1}d=d.return}while(d!==null);return!1}var xv=Error(r(461)),cr=!1;function kr(o,l,d,p){l.child=o===null?Tw(l,null,d,p):ql(l,o.child,d,p)}function EE(o,l,d,p,b){d=d.render;var E=l.ref;if("ref"in p){var N={};for(var L in p)L!=="ref"&&(N[L]=p[L])}else N=p;return $l(l),p=Jx(o,l,d,N,E,b),L=ev(),o!==null&&!cr?(tv(o,l,b),Mo(o,l,b)):(qt&&L&&Mx(l),l.flags|=1,kr(o,l,p,b),l.child)}function RE(o,l,d,p,b){if(o===null){var E=d.type;return typeof E=="function"&&!Dx(E)&&E.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=E,jE(o,l,E,p,b)):(o=um(d.type,null,p,l,l.mode,b),o.ref=l.ref,o.return=l,l.child=o)}if(E=o.child,!jv(o,b)){var N=E.memoizedProps;if(d=d.compare,d=d!==null?d:Id,d(N,p)&&o.ref===l.ref)return Mo(o,l,b)}return l.flags|=1,o=_o(E,p),o.ref=l.ref,o.return=l,l.child=o}function jE(o,l,d,p,b){if(o!==null){var E=o.memoizedProps;if(Id(E,p)&&o.ref===l.ref)if(cr=!1,l.pendingProps=p=E,jv(o,b))(o.flags&131072)!==0&&(cr=!0);else return l.lanes=o.lanes,Mo(o,l,b)}return vv(o,l,d,p,b)}function TE(o,l,d,p){var b=p.children,E=o!==null?o.memoizedState:null;if(o===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((l.flags&128)!==0){if(E=E!==null?E.baseLanes|d:d,o!==null){for(p=l.child=o.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~E}else p=0,l.child=null;return _E(o,l,E,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&mm(l,E!==null?E.cachePool:null),E!==null?Aw(l,E):Yx(),Dw(l);else return p=l.lanes=536870912,_E(o,l,E!==null?E.baseLanes|d:d,d,p)}else E!==null?(mm(l,E.cachePool),Aw(l,E),Ti(),l.memoizedState=null):(o!==null&&mm(l,null),Yx(),Ti());return kr(o,l,b,d),l.child}function Zd(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function _E(o,l,d,p,b){var E=Vx();return E=E===null?null:{parent:ir._currentValue,pool:E},l.memoizedState={baseLanes:d,cachePool:E},o!==null&&mm(l,null),Yx(),Dw(l),o!==null&&Wc(o,l,p,!0),l.childLanes=b,null}function Am(o,l){return l=Om({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function NE(o,l,d){return ql(l,o.child,null,d),o=Am(l,l.pendingProps),o.flags|=2,Ua(l),l.memoizedState=null,o}function Sk(o,l,d){var p=l.pendingProps,b=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(qt){if(p.mode==="hidden")return o=Am(l,p),l.lanes=536870912,Zd(null,o);if(Xx(l),(o=Pn)?(o=HR(o,cs),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:vi!==null?{id:Xs,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},d=fw(o),d.return=l,l.child=d,Ir=l,Pn=null)):o=null,o===null)throw Si(l);return l.lanes=536870912,null}return Am(l,p)}var E=o.memoizedState;if(E!==null){var N=E.dehydrated;if(Xx(l),b)if(l.flags&256)l.flags&=-257,l=NE(o,l,d);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(cr||Wc(o,l,d,!1),b=(d&o.childLanes)!==0,cr||b){if(p=An,p!==null&&(N=ee(p,d),N!==0&&N!==E.retryLane))throw E.retryLane=N,Ul(o,N),Sa(p,o,N),xv;Hm(),l=NE(o,l,d)}else o=E.treeContext,Pn=ds(N.nextSibling),Ir=l,qt=!0,bi=null,cs=!1,o!==null&&pw(l,o),l=Am(l,p),l.flags|=4096;return l}return o=_o(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Dm(o,l){var d=l.ref;if(d===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(o===null||o.ref!==d)&&(l.flags|=4194816)}}function vv(o,l,d,p,b){return $l(l),d=Jx(o,l,d,p,void 0,b),p=ev(),o!==null&&!cr?(tv(o,l,b),Mo(o,l,b)):(qt&&p&&Mx(l),l.flags|=1,kr(o,l,d,b),l.child)}function AE(o,l,d,p,b,E){return $l(l),l.updateQueue=null,d=Iw(l,p,d,b),Ow(o),p=ev(),o!==null&&!cr?(tv(o,l,E),Mo(o,l,E)):(qt&&p&&Mx(l),l.flags|=1,kr(o,l,d,E),l.child)}function DE(o,l,d,p,b){if($l(l),l.stateNode===null){var E=qc,N=d.contextType;typeof N=="object"&&N!==null&&(E=Mr(N)),E=new d(p,E),l.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=gv,l.stateNode=E,E._reactInternals=l,E=l.stateNode,E.props=p,E.state=l.memoizedState,E.refs={},Bx(l),N=d.contextType,E.context=typeof N=="object"&&N!==null?Mr(N):qc,E.state=l.memoizedState,N=d.getDerivedStateFromProps,typeof N=="function"&&(pv(l,d,N,p),E.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(N=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),N!==E.state&&gv.enqueueReplaceState(E,E.state,null),Vd(l,p,E,b),$d(),E.state=l.memoizedState),typeof E.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){E=l.stateNode;var L=l.memoizedProps,Q=Zl(d,L);E.props=Q;var de=E.context,xe=d.contextType;N=qc,typeof xe=="object"&&xe!==null&&(N=Mr(xe));var be=d.getDerivedStateFromProps;xe=typeof be=="function"||typeof E.getSnapshotBeforeUpdate=="function",L=l.pendingProps!==L,xe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(L||de!==N)&&yE(l,E,p,N),wi=!1;var he=l.memoizedState;E.state=he,Vd(l,p,E,b),$d(),de=l.memoizedState,L||he!==de||wi?(typeof be=="function"&&(pv(l,d,be,p),de=l.memoizedState),(Q=wi||gE(l,d,Q,p,he,de,N))?(xe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(l.flags|=4194308)):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=de),E.props=p,E.state=de,E.context=N,p=Q):(typeof E.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{E=l.stateNode,qx(o,l),N=l.memoizedProps,xe=Zl(d,N),E.props=xe,be=l.pendingProps,he=E.context,de=d.contextType,Q=qc,typeof de=="object"&&de!==null&&(Q=Mr(de)),L=d.getDerivedStateFromProps,(de=typeof L=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(N!==be||he!==Q)&&yE(l,E,p,Q),wi=!1,he=l.memoizedState,E.state=he,Vd(l,p,E,b),$d();var pe=l.memoizedState;N!==be||he!==pe||wi||o!==null&&o.dependencies!==null&&fm(o.dependencies)?(typeof L=="function"&&(pv(l,d,L,p),pe=l.memoizedState),(xe=wi||gE(l,d,xe,p,he,pe,Q)||o!==null&&o.dependencies!==null&&fm(o.dependencies))?(de||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(p,pe,Q),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(p,pe,Q)),typeof E.componentDidUpdate=="function"&&(l.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof E.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=pe),E.props=p,E.state=pe,E.context=Q,p=xe):(typeof E.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),p=!1)}return E=p,Dm(o,l),p=(l.flags&128)!==0,E||p?(E=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:E.render(),l.flags|=1,o!==null&&p?(l.child=ql(l,o.child,null,b),l.child=ql(l,null,d,b)):kr(o,l,d,b),l.memoizedState=E.state,o=l.child):o=Mo(o,l,b),o}function OE(o,l,d,p){return Fl(),l.flags|=256,kr(o,l,d,p),l.child}var bv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sv(o){return{baseLanes:o,cachePool:Sw()}}function Cv(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=Fa),o}function IE(o,l,d){var p=l.pendingProps,b=!1,E=(l.flags&128)!==0,N;if((N=E)||(N=o!==null&&o.memoizedState===null?!1:(nr.current&2)!==0),N&&(b=!0,l.flags&=-129),N=(l.flags&32)!==0,l.flags&=-33,o===null){if(qt){if(b?ji(l):Ti(),(o=Pn)?(o=HR(o,cs),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:vi!==null?{id:Xs,overflow:Qs}:null,retryLane:536870912,hydrationErrors:null},d=fw(o),d.return=l,l.child=d,Ir=l,Pn=null)):o=null,o===null)throw Si(l);return a0(o)?l.lanes=32:l.lanes=536870912,null}var L=p.children;return p=p.fallback,b?(Ti(),b=l.mode,L=Om({mode:"hidden",children:L},b),p=zl(p,b,d,null),L.return=l,p.return=l,L.sibling=p,l.child=L,p=l.child,p.memoizedState=Sv(d),p.childLanes=Cv(o,N,d),l.memoizedState=bv,Zd(null,p)):(ji(l),wv(l,L))}var Q=o.memoizedState;if(Q!==null&&(L=Q.dehydrated,L!==null)){if(E)l.flags&256?(ji(l),l.flags&=-257,l=Ev(o,l,d)):l.memoizedState!==null?(Ti(),l.child=o.child,l.flags|=128,l=null):(Ti(),L=p.fallback,b=l.mode,p=Om({mode:"visible",children:p.children},b),L=zl(L,b,d,null),L.flags|=2,p.return=l,L.return=l,p.sibling=L,l.child=p,ql(l,o.child,null,d),p=l.child,p.memoizedState=Sv(d),p.childLanes=Cv(o,N,d),l.memoizedState=bv,l=Zd(null,p));else if(ji(l),a0(L)){if(N=L.nextSibling&&L.nextSibling.dataset,N)var de=N.dgst;N=de,p=Error(r(419)),p.stack="",p.digest=N,Ld({value:p,source:null,stack:null}),l=Ev(o,l,d)}else if(cr||Wc(o,l,d,!1),N=(d&o.childLanes)!==0,cr||N){if(N=An,N!==null&&(p=ee(N,d),p!==0&&p!==Q.retryLane))throw Q.retryLane=p,Ul(o,p),Sa(N,o,p),xv;r0(L)||Hm(),l=Ev(o,l,d)}else r0(L)?(l.flags|=192,l.child=o.child,l=null):(o=Q.treeContext,Pn=ds(L.nextSibling),Ir=l,qt=!0,bi=null,cs=!1,o!==null&&pw(l,o),l=wv(l,p.children),l.flags|=4096);return l}return b?(Ti(),L=p.fallback,b=l.mode,Q=o.child,de=Q.sibling,p=_o(Q,{mode:"hidden",children:p.children}),p.subtreeFlags=Q.subtreeFlags&65011712,de!==null?L=_o(de,L):(L=zl(L,b,d,null),L.flags|=2),L.return=l,p.return=l,p.sibling=L,l.child=p,Zd(null,p),p=l.child,L=o.child.memoizedState,L===null?L=Sv(d):(b=L.cachePool,b!==null?(Q=ir._currentValue,b=b.parent!==Q?{parent:Q,pool:Q}:b):b=Sw(),L={baseLanes:L.baseLanes|d,cachePool:b}),p.memoizedState=L,p.childLanes=Cv(o,N,d),l.memoizedState=bv,Zd(o.child,p)):(ji(l),d=o.child,o=d.sibling,d=_o(d,{mode:"visible",children:p.children}),d.return=l,d.sibling=null,o!==null&&(N=l.deletions,N===null?(l.deletions=[o],l.flags|=16):N.push(o)),l.child=d,l.memoizedState=null,d)}function wv(o,l){return l=Om({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Om(o,l){return o=La(22,o,null,l),o.lanes=0,o}function Ev(o,l,d){return ql(l,o.child,null,d),o=wv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function ME(o,l,d){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),zx(o.return,l,d)}function Rv(o,l,d,p,b,E){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:b,treeForkCount:E}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=d,N.tailMode=b,N.treeForkCount=E)}function kE(o,l,d){var p=l.pendingProps,b=p.revealOrder,E=p.tail;p=p.children;var N=nr.current,L=(N&2)!==0;if(L?(N=N&1|2,l.flags|=128):N&=1,z(nr,N),kr(o,l,p,d),p=qt?kd:0,!L&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&ME(o,d,l);else if(o.tag===19)ME(o,d,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(b){case"forwards":for(d=l.child,b=null;d!==null;)o=d.alternate,o!==null&&bm(o)===null&&(b=d),d=d.sibling;d=b,d===null?(b=l.child,l.child=null):(b=d.sibling,d.sibling=null),Rv(l,!1,b,d,E,p);break;case"backwards":case"unstable_legacy-backwards":for(d=null,b=l.child,l.child=null;b!==null;){if(o=b.alternate,o!==null&&bm(o)===null){l.child=b;break}o=b.sibling,b.sibling=d,d=b,b=o}Rv(l,!0,d,null,E,p);break;case"together":Rv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function Mo(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),Ai|=l.lanes,(d&l.childLanes)===0)if(o!==null){if(Wc(o,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,d=_o(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=_o(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function jv(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&fm(o)))}function Ck(o,l,d){switch(l.tag){case 3:le(l,l.stateNode.containerInfo),Ci(l,ir,o.memoizedState.cache),Fl();break;case 27:case 5:Ce(l);break;case 4:le(l,l.stateNode.containerInfo);break;case 10:Ci(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,Xx(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(ji(l),l.flags|=128,null):(d&l.child.childLanes)!==0?IE(o,l,d):(ji(l),o=Mo(o,l,d),o!==null?o.sibling:null);ji(l);break;case 19:var b=(o.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(Wc(o,l,d,!1),p=(d&l.childLanes)!==0),b){if(p)return kE(o,l,d);l.flags|=128}if(b=l.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),z(nr,nr.current),p)break;return null;case 22:return l.lanes=0,TE(o,l,d,l.pendingProps);case 24:Ci(l,ir,o.memoizedState.cache)}return Mo(o,l,d)}function LE(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)cr=!0;else{if(!jv(o,d)&&(l.flags&128)===0)return cr=!1,Ck(o,l,d);cr=(o.flags&131072)!==0}else cr=!1,qt&&(l.flags&1048576)!==0&&mw(l,kd,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=Gl(l.elementType),l.type=o,typeof o=="function")Dx(o)?(p=Zl(o,p),l.tag=1,l=DE(null,l,o,p,d)):(l.tag=0,l=vv(null,l,o,p,d));else{if(o!=null){var b=o.$$typeof;if(b===O){l.tag=11,l=EE(null,l,o,p,d);break e}else if(b===T){l.tag=14,l=RE(null,l,o,p,d);break e}}throw l=Z(o)||o,Error(r(306,l,""))}}return l;case 0:return vv(o,l,l.type,l.pendingProps,d);case 1:return p=l.type,b=Zl(p,l.pendingProps),DE(o,l,p,b,d);case 3:e:{if(le(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var E=l.memoizedState;b=E.element,qx(o,l),Vd(l,p,null,d);var N=l.memoizedState;if(p=N.cache,Ci(l,ir,p),p!==E.cache&&Fx(l,[ir],d,!0),$d(),p=N.element,E.isDehydrated)if(E={element:p,isDehydrated:!1,cache:N.cache},l.updateQueue.baseState=E,l.memoizedState=E,l.flags&256){l=OE(o,l,p,d);break e}else if(p!==b){b=os(Error(r(424)),l),Ld(b),l=OE(o,l,p,d);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Pn=ds(o.firstChild),Ir=l,qt=!0,bi=null,cs=!0,d=Tw(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Fl(),p===b){l=Mo(o,l,d);break e}kr(o,l,p,d)}l=l.child}return l;case 26:return Dm(o,l),o===null?(d=KR(l.type,null,l.pendingProps,null))?l.memoizedState=d:qt||(d=l.type,o=l.pendingProps,p=Zm(ae.current).createElement(d),p[ke]=l,p[ze]=o,Lr(p,d,o),Nn(p),l.stateNode=p):l.memoizedState=KR(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Ce(l),o===null&&qt&&(p=l.stateNode=GR(l.type,l.pendingProps,ae.current),Ir=l,cs=!0,b=Pn,ki(l.type)?(s0=b,Pn=ds(p.firstChild)):Pn=b),kr(o,l,l.pendingProps.children,d),Dm(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&qt&&((b=p=Pn)&&(p=Qk(p,l.type,l.pendingProps,cs),p!==null?(l.stateNode=p,Ir=l,Pn=ds(p.firstChild),cs=!1,b=!0):b=!1),b||Si(l)),Ce(l),b=l.type,E=l.pendingProps,N=o!==null?o.memoizedProps:null,p=E.children,e0(b,E)?p=null:N!==null&&e0(b,N)&&(l.flags|=32),l.memoizedState!==null&&(b=Jx(o,l,hk,null,null,d),uf._currentValue=b),Dm(o,l),kr(o,l,p,d),l.child;case 6:return o===null&&qt&&((o=d=Pn)&&(d=Jk(d,l.pendingProps,cs),d!==null?(l.stateNode=d,Ir=l,Pn=null,o=!0):o=!1),o||Si(l)),null;case 13:return IE(o,l,d);case 4:return le(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=ql(l,null,p,d):kr(o,l,p,d),l.child;case 11:return EE(o,l,l.type,l.pendingProps,d);case 7:return kr(o,l,l.pendingProps,d),l.child;case 8:return kr(o,l,l.pendingProps.children,d),l.child;case 12:return kr(o,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,Ci(l,l.type,p.value),kr(o,l,p.children,d),l.child;case 9:return b=l.type._context,p=l.pendingProps.children,$l(l),b=Mr(b),p=p(b),l.flags|=1,kr(o,l,p,d),l.child;case 14:return RE(o,l,l.type,l.pendingProps,d);case 15:return jE(o,l,l.type,l.pendingProps,d);case 19:return kE(o,l,d);case 31:return Sk(o,l,d);case 22:return TE(o,l,d,l.pendingProps);case 24:return $l(l),p=Mr(ir),o===null?(b=Vx(),b===null&&(b=An,E=Hx(),b.pooledCache=E,E.refCount++,E!==null&&(b.pooledCacheLanes|=d),b=E),l.memoizedState={parent:p,cache:b},Bx(l),Ci(l,ir,b)):((o.lanes&d)!==0&&(qx(o,l),Vd(l,null,null,d),$d()),b=o.memoizedState,E=l.memoizedState,b.parent!==p?(b={parent:p,cache:p},l.memoizedState=b,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=b),Ci(l,ir,p)):(p=E.cache,Ci(l,ir,p),p!==b.cache&&Fx(l,[ir],d,!0))),kr(o,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function ko(o){o.flags|=4}function Tv(o,l,d,p,b){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(b&335544128)===b)if(o.stateNode.complete)o.flags|=8192;else if(cR())o.flags|=8192;else throw Bl=gm,Gx}else o.flags&=-16777217}function PE(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!QR(l))if(cR())o.flags|=8192;else throw Bl=gm,Gx}function Im(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Bt():536870912,o.lanes|=l,lu|=l)}function Yd(o,l){if(!qt)switch(o.tailMode){case"hidden":l=o.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?o.tail=null:d.sibling=null;break;case"collapsed":d=o.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:p.sibling=null}}function Un(o){var l=o.alternate!==null&&o.alternate.child===o.child,d=0,p=0;if(l)for(var b=o.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=o,b=b.sibling;else for(b=o.child;b!==null;)d|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=o,b=b.sibling;return o.subtreeFlags|=p,o.childLanes=d,l}function wk(o,l,d){var p=l.pendingProps;switch(kx(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Un(l),null;case 1:return Un(l),null;case 3:return d=l.stateNode,p=null,o!==null&&(p=o.memoizedState.cache),l.memoizedState.cache!==p&&(l.flags|=2048),Do(ir),ye(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Yc(l)?ko(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Px())),Un(l),null;case 26:var b=l.type,E=l.memoizedState;return o===null?(ko(l),E!==null?(Un(l),PE(l,E)):(Un(l),Tv(l,b,null,p,d))):E?E!==o.memoizedState?(ko(l),Un(l),PE(l,E)):(Un(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&ko(l),Un(l),Tv(l,b,o,p,d)),null;case 27:if(Ve(l),d=ae.current,b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&ko(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}o=X.current,Yc(l)?gw(l):(o=GR(b,p,d),l.stateNode=o,ko(l))}return Un(l),null;case 5:if(Ve(l),b=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&ko(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}if(E=X.current,Yc(l))gw(l);else{var N=Zm(ae.current);switch(E){case 1:E=N.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:E=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":E=N.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":E=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":E=N.createElement("div"),E.innerHTML="<script><\/script>",E=E.removeChild(E.firstChild);break;case"select":E=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?E.multiple=!0:p.size&&(E.size=p.size);break;default:E=typeof p.is=="string"?N.createElement(b,{is:p.is}):N.createElement(b)}}E[ke]=l,E[ze]=p;e:for(N=l.child;N!==null;){if(N.tag===5||N.tag===6)E.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===l)break e;for(;N.sibling===null;){if(N.return===null||N.return===l)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}l.stateNode=E;e:switch(Lr(E,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&ko(l)}}return Un(l),Tv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,d),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&ko(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=ae.current,Yc(l)){if(o=l.stateNode,d=l.memoizedProps,p=null,b=Ir,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}o[ke]=l,o=!!(o.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||IR(o.nodeValue,d)),o||Si(l,!0)}else o=Zm(o).createTextNode(p),o[ke]=l,l.stateNode=o}return Un(l),null;case 31:if(d=l.memoizedState,o===null||o.memoizedState!==null){if(p=Yc(l),d!==null){if(o===null){if(!p)throw Error(r(318));if(o=l.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[ke]=l}else Fl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),o=!1}else d=Px(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?(Ua(l),l):(Ua(l),null);if((l.flags&128)!==0)throw Error(r(558))}return Un(l),null;case 13:if(p=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(b=Yc(l),p!==null&&p.dehydrated!==null){if(o===null){if(!b)throw Error(r(318));if(b=l.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[ke]=l}else Fl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),b=!1}else b=Px(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=b),b=!0;if(!b)return l.flags&256?(Ua(l),l):(Ua(l),null)}return Ua(l),(l.flags&128)!==0?(l.lanes=d,l):(d=p!==null,o=o!==null&&o.memoizedState!==null,d&&(p=l.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),E=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(E=p.memoizedState.cachePool.pool),E!==b&&(p.flags|=2048)),d!==o&&d&&(l.child.flags|=8192),Im(l,l.updateQueue),Un(l),null);case 4:return ye(),o===null&&Yv(l.stateNode.containerInfo),Un(l),null;case 10:return Do(l.type),Un(l),null;case 19:if(U(nr),p=l.memoizedState,p===null)return Un(l),null;if(b=(l.flags&128)!==0,E=p.rendering,E===null)if(b)Yd(p,!1);else{if(Wn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(E=bm(o),E!==null){for(l.flags|=128,Yd(p,!1),o=E.updateQueue,l.updateQueue=o,Im(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)dw(d,o),d=d.sibling;return z(nr,nr.current&1|2),qt&&No(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&Ee()>Um&&(l.flags|=128,b=!0,Yd(p,!1),l.lanes=4194304)}else{if(!b)if(o=bm(E),o!==null){if(l.flags|=128,b=!0,o=o.updateQueue,l.updateQueue=o,Im(l,o),Yd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!E.alternate&&!qt)return Un(l),null}else 2*Ee()-p.renderingStartTime>Um&&d!==536870912&&(l.flags|=128,b=!0,Yd(p,!1),l.lanes=4194304);p.isBackwards?(E.sibling=l.child,l.child=E):(o=p.last,o!==null?o.sibling=E:l.child=E,p.last=E)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=Ee(),o.sibling=null,d=nr.current,z(nr,b?d&1|2:d&1),qt&&No(l,p.treeForkCount),o):(Un(l),null);case 22:case 23:return Ua(l),Wx(),p=l.memoizedState!==null,o!==null?o.memoizedState!==null!==p&&(l.flags|=8192):p&&(l.flags|=8192),p?(d&536870912)!==0&&(l.flags&128)===0&&(Un(l),l.subtreeFlags&6&&(l.flags|=8192)):Un(l),d=l.updateQueue,d!==null&&Im(l,d.retryQueue),d=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048),o!==null&&U(Vl),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Do(ir),Un(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function Ek(o,l){switch(kx(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Do(ir),ye(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Ve(l),null;case 31:if(l.memoizedState!==null){if(Ua(l),l.alternate===null)throw Error(r(340));Fl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Ua(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Fl()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return U(nr),null;case 4:return ye(),null;case 10:return Do(l.type),null;case 22:case 23:return Ua(l),Wx(),o!==null&&U(Vl),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Do(ir),null;case 25:return null;default:return null}}function UE(o,l){switch(kx(l),l.tag){case 3:Do(ir),ye();break;case 26:case 27:case 5:Ve(l);break;case 4:ye();break;case 31:l.memoizedState!==null&&Ua(l);break;case 13:Ua(l);break;case 19:U(nr);break;case 10:Do(l.type);break;case 22:case 23:Ua(l),Wx(),o!==null&&U(Vl);break;case 24:Do(ir)}}function Wd(o,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var b=p.next;d=b;do{if((d.tag&o)===o){p=void 0;var E=d.create,N=d.inst;p=E(),N.destroy=p}d=d.next}while(d!==b)}}catch(L){bn(l,l.return,L)}}function _i(o,l,d){try{var p=l.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var E=b.next;p=E;do{if((p.tag&o)===o){var N=p.inst,L=N.destroy;if(L!==void 0){N.destroy=void 0,b=l;var Q=d,de=L;try{de()}catch(xe){bn(b,Q,xe)}}}p=p.next}while(p!==E)}}catch(xe){bn(l,l.return,xe)}}function zE(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{Nw(l,d)}catch(p){bn(o,o.return,p)}}}function FE(o,l,d){d.props=Zl(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(p){bn(o,l,p)}}function Xd(o,l){try{var d=o.ref;if(d!==null){switch(o.tag){case 26:case 27:case 5:var p=o.stateNode;break;case 30:p=o.stateNode;break;default:p=o.stateNode}typeof d=="function"?o.refCleanup=d(p):d.current=p}}catch(b){bn(o,l,b)}}function Js(o,l){var d=o.ref,p=o.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(b){bn(o,l,b)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){bn(o,l,b)}else d.current=null}function HE(o){var l=o.type,d=o.memoizedProps,p=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&p.focus();break e;case"img":d.src?p.src=d.src:d.srcSet&&(p.srcset=d.srcSet)}}catch(b){bn(o,o.return,b)}}function _v(o,l,d){try{var p=o.stateNode;qk(p,o.type,d,l),p[ze]=l}catch(b){bn(o,o.return,b)}}function $E(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&ki(o.type)||o.tag===4}function Nv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||$E(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&ki(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Av(o,l,d){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(o,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(o),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=jo));else if(p!==4&&(p===27&&ki(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(Av(o,l,d),o=o.sibling;o!==null;)Av(o,l,d),o=o.sibling}function Mm(o,l,d){var p=o.tag;if(p===5||p===6)o=o.stateNode,l?d.insertBefore(o,l):d.appendChild(o);else if(p!==4&&(p===27&&ki(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(Mm(o,l,d),o=o.sibling;o!==null;)Mm(o,l,d),o=o.sibling}function VE(o){var l=o.stateNode,d=o.memoizedProps;try{for(var p=o.type,b=l.attributes;b.length;)l.removeAttributeNode(b[0]);Lr(l,p,d),l[ke]=o,l[ze]=d}catch(E){bn(o,o.return,E)}}var Lo=!1,ur=!1,Dv=!1,GE=typeof WeakSet=="function"?WeakSet:Set,Tr=null;function Rk(o,l){if(o=o.containerInfo,Qv=tp,o=nw(o),Ex(o)){if("selectionStart"in o)var d={start:o.selectionStart,end:o.selectionEnd};else e:{d=(d=o.ownerDocument)&&d.defaultView||window;var p=d.getSelection&&d.getSelection();if(p&&p.rangeCount!==0){d=p.anchorNode;var b=p.anchorOffset,E=p.focusNode;p=p.focusOffset;try{d.nodeType,E.nodeType}catch{d=null;break e}var N=0,L=-1,Q=-1,de=0,xe=0,be=o,he=null;t:for(;;){for(var pe;be!==d||b!==0&&be.nodeType!==3||(L=N+b),be!==E||p!==0&&be.nodeType!==3||(Q=N+p),be.nodeType===3&&(N+=be.nodeValue.length),(pe=be.firstChild)!==null;)he=be,be=pe;for(;;){if(be===o)break t;if(he===d&&++de===b&&(L=N),he===E&&++xe===p&&(Q=N),(pe=be.nextSibling)!==null)break;be=he,he=be.parentNode}be=pe}d=L===-1||Q===-1?null:{start:L,end:Q}}else d=null}d=d||{start:0,end:0}}else d=null;for(Jv={focusedElem:o,selectionRange:d},tp=!1,Tr=l;Tr!==null;)if(l=Tr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Tr=o;else for(;Tr!==null;){switch(l=Tr,E=l.alternate,o=l.flags,l.tag){case 0:if((o&4)!==0&&(o=l.updateQueue,o=o!==null?o.events:null,o!==null))for(d=0;d<o.length;d++)b=o[d],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&E!==null){o=void 0,d=l,b=E.memoizedProps,E=E.memoizedState,p=d.stateNode;try{var qe=Zl(d.type,b);o=p.getSnapshotBeforeUpdate(qe,E),p.__reactInternalSnapshotBeforeUpdate=o}catch(ot){bn(d,d.return,ot)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)n0(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":n0(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Tr=o;break}Tr=l.return}}function BE(o,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:Uo(o,d),p&4&&Wd(5,d);break;case 1:if(Uo(o,d),p&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(N){bn(d,d.return,N)}else{var b=Zl(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(b,l,o.__reactInternalSnapshotBeforeUpdate)}catch(N){bn(d,d.return,N)}}p&64&&zE(d),p&512&&Xd(d,d.return);break;case 3:if(Uo(o,d),p&64&&(o=d.updateQueue,o!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{Nw(o,l)}catch(N){bn(d,d.return,N)}}break;case 27:l===null&&p&4&&VE(d);case 26:case 5:Uo(o,d),l===null&&p&4&&HE(d),p&512&&Xd(d,d.return);break;case 12:Uo(o,d);break;case 31:Uo(o,d),p&4&&ZE(o,d);break;case 13:Uo(o,d),p&4&&YE(o,d),p&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=Mk.bind(null,d),e9(o,d))));break;case 22:if(p=d.memoizedState!==null||Lo,!p){l=l!==null&&l.memoizedState!==null||ur,b=Lo;var E=ur;Lo=p,(ur=l)&&!E?zo(o,d,(d.subtreeFlags&8772)!==0):Uo(o,d),Lo=b,ur=E}break;case 30:break;default:Uo(o,d)}}function qE(o){var l=o.alternate;l!==null&&(o.alternate=null,qE(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Zn(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var Gn=null,ya=!1;function Po(o,l,d){for(d=d.child;d!==null;)KE(o,l,d),d=d.sibling}function KE(o,l,d){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(Jr,d)}catch{}switch(d.tag){case 26:ur||Js(d,l),Po(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:ur||Js(d,l);var p=Gn,b=ya;ki(d.type)&&(Gn=d.stateNode,ya=!1),Po(o,l,d),of(d.stateNode),Gn=p,ya=b;break;case 5:ur||Js(d,l);case 6:if(p=Gn,b=ya,Gn=null,Po(o,l,d),Gn=p,ya=b,Gn!==null)if(ya)try{(Gn.nodeType===9?Gn.body:Gn.nodeName==="HTML"?Gn.ownerDocument.body:Gn).removeChild(d.stateNode)}catch(E){bn(d,l,E)}else try{Gn.removeChild(d.stateNode)}catch(E){bn(d,l,E)}break;case 18:Gn!==null&&(ya?(o=Gn,zR(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),gu(o)):zR(Gn,d.stateNode));break;case 4:p=Gn,b=ya,Gn=d.stateNode.containerInfo,ya=!0,Po(o,l,d),Gn=p,ya=b;break;case 0:case 11:case 14:case 15:_i(2,d,l),ur||_i(4,d,l),Po(o,l,d);break;case 1:ur||(Js(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&FE(d,l,p)),Po(o,l,d);break;case 21:Po(o,l,d);break;case 22:ur=(p=ur)||d.memoizedState!==null,Po(o,l,d),ur=p;break;default:Po(o,l,d)}}function ZE(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{gu(o)}catch(d){bn(l,l.return,d)}}}function YE(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{gu(o)}catch(d){bn(l,l.return,d)}}function jk(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new GE),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new GE),l;default:throw Error(r(435,o.tag))}}function km(o,l){var d=jk(o);l.forEach(function(p){if(!d.has(p)){d.add(p);var b=kk.bind(null,o,p);p.then(b,b)}})}function xa(o,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var b=d[p],E=o,N=l,L=N;e:for(;L!==null;){switch(L.tag){case 27:if(ki(L.type)){Gn=L.stateNode,ya=!1;break e}break;case 5:Gn=L.stateNode,ya=!1;break e;case 3:case 4:Gn=L.stateNode.containerInfo,ya=!0;break e}L=L.return}if(Gn===null)throw Error(r(160));KE(E,N,b),Gn=null,ya=!1,E=b.alternate,E!==null&&(E.return=null),b.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)WE(l,o),l=l.sibling}var Ts=null;function WE(o,l){var d=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:xa(l,o),va(o),p&4&&(_i(3,o,o.return),Wd(3,o),_i(5,o,o.return));break;case 1:xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),p&64&&Lo&&(o=o.updateQueue,o!==null&&(p=o.callbacks,p!==null&&(d=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=d===null?p:d.concat(p))));break;case 26:var b=Ts;if(xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),p&4){var E=d!==null?d.memoizedState:null;if(p=o.memoizedState,d===null)if(p===null)if(o.stateNode===null){e:{p=o.type,d=o.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":E=b.getElementsByTagName("title")[0],(!E||E[Ln]||E[ke]||E.namespaceURI==="http://www.w3.org/2000/svg"||E.hasAttribute("itemprop"))&&(E=b.createElement(p),b.head.insertBefore(E,b.querySelector("head > title"))),Lr(E,p,d),E[ke]=o,Nn(E),p=E;break e;case"link":var N=WR("link","href",b).get(p+(d.href||""));if(N){for(var L=0;L<N.length;L++)if(E=N[L],E.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&E.getAttribute("rel")===(d.rel==null?null:d.rel)&&E.getAttribute("title")===(d.title==null?null:d.title)&&E.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){N.splice(L,1);break t}}E=b.createElement(p),Lr(E,p,d),b.head.appendChild(E);break;case"meta":if(N=WR("meta","content",b).get(p+(d.content||""))){for(L=0;L<N.length;L++)if(E=N[L],E.getAttribute("content")===(d.content==null?null:""+d.content)&&E.getAttribute("name")===(d.name==null?null:d.name)&&E.getAttribute("property")===(d.property==null?null:d.property)&&E.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&E.getAttribute("charset")===(d.charSet==null?null:d.charSet)){N.splice(L,1);break t}}E=b.createElement(p),Lr(E,p,d),b.head.appendChild(E);break;default:throw Error(r(468,p))}E[ke]=o,Nn(E),p=E}o.stateNode=p}else XR(b,o.type,o.stateNode);else o.stateNode=YR(b,p,o.memoizedProps);else E!==p?(E===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):E.count--,p===null?XR(b,o.type,o.stateNode):YR(b,p,o.memoizedProps)):p===null&&o.stateNode!==null&&_v(o,o.memoizedProps,d.memoizedProps)}break;case 27:xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),d!==null&&p&4&&_v(o,o.memoizedProps,d.memoizedProps);break;case 5:if(xa(l,o),va(o),p&512&&(ur||d===null||Js(d,d.return)),o.flags&32){b=o.stateNode;try{zc(b,"")}catch(qe){bn(o,o.return,qe)}}p&4&&o.stateNode!=null&&(b=o.memoizedProps,_v(o,b,d!==null?d.memoizedProps:b)),p&1024&&(Dv=!0);break;case 6:if(xa(l,o),va(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,d=o.stateNode;try{d.nodeValue=p}catch(qe){bn(o,o.return,qe)}}break;case 3:if(Xm=null,b=Ts,Ts=Ym(l.containerInfo),xa(l,o),Ts=b,va(o),p&4&&d!==null&&d.memoizedState.isDehydrated)try{gu(l.containerInfo)}catch(qe){bn(o,o.return,qe)}Dv&&(Dv=!1,XE(o));break;case 4:p=Ts,Ts=Ym(o.stateNode.containerInfo),xa(l,o),va(o),Ts=p;break;case 12:xa(l,o),va(o);break;case 31:xa(l,o),va(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,km(o,p)));break;case 13:xa(l,o),va(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Pm=Ee()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,km(o,p)));break;case 22:b=o.memoizedState!==null;var Q=d!==null&&d.memoizedState!==null,de=Lo,xe=ur;if(Lo=de||b,ur=xe||Q,xa(l,o),ur=xe,Lo=de,va(o),p&8192)e:for(l=o.stateNode,l._visibility=b?l._visibility&-2:l._visibility|1,b&&(d===null||Q||Lo||ur||Yl(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){Q=d=l;try{if(E=Q.stateNode,b)N=E.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{L=Q.stateNode;var be=Q.memoizedProps.style,he=be!=null&&be.hasOwnProperty("display")?be.display:null;L.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(qe){bn(Q,Q.return,qe)}}}else if(l.tag===6){if(d===null){Q=l;try{Q.stateNode.nodeValue=b?"":Q.memoizedProps}catch(qe){bn(Q,Q.return,qe)}}}else if(l.tag===18){if(d===null){Q=l;try{var pe=Q.stateNode;b?FR(pe,!0):FR(Q.stateNode,!1)}catch(qe){bn(Q,Q.return,qe)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}p&4&&(p=o.updateQueue,p!==null&&(d=p.retryQueue,d!==null&&(p.retryQueue=null,km(o,d))));break;case 19:xa(l,o),va(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,km(o,p)));break;case 30:break;case 21:break;default:xa(l,o),va(o)}}function va(o){var l=o.flags;if(l&2){try{for(var d,p=o.return;p!==null;){if($E(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var b=d.stateNode,E=Nv(o);Mm(o,E,b);break;case 5:var N=d.stateNode;d.flags&32&&(zc(N,""),d.flags&=-33);var L=Nv(o);Mm(o,L,N);break;case 3:case 4:var Q=d.stateNode.containerInfo,de=Nv(o);Av(o,de,Q);break;default:throw Error(r(161))}}catch(xe){bn(o,o.return,xe)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function XE(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;XE(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Uo(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)BE(o,l.alternate,l),l=l.sibling}function Yl(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:_i(4,l,l.return),Yl(l);break;case 1:Js(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&FE(l,l.return,d),Yl(l);break;case 27:of(l.stateNode);case 26:case 5:Js(l,l.return),Yl(l);break;case 22:l.memoizedState===null&&Yl(l);break;case 30:Yl(l);break;default:Yl(l)}o=o.sibling}}function zo(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,b=o,E=l,N=E.flags;switch(E.tag){case 0:case 11:case 15:zo(b,E,d),Wd(4,E);break;case 1:if(zo(b,E,d),p=E,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(de){bn(p,p.return,de)}if(p=E,b=p.updateQueue,b!==null){var L=p.stateNode;try{var Q=b.shared.hiddenCallbacks;if(Q!==null)for(b.shared.hiddenCallbacks=null,b=0;b<Q.length;b++)_w(Q[b],L)}catch(de){bn(p,p.return,de)}}d&&N&64&&zE(E),Xd(E,E.return);break;case 27:VE(E);case 26:case 5:zo(b,E,d),d&&p===null&&N&4&&HE(E),Xd(E,E.return);break;case 12:zo(b,E,d);break;case 31:zo(b,E,d),d&&N&4&&ZE(b,E);break;case 13:zo(b,E,d),d&&N&4&&YE(b,E);break;case 22:E.memoizedState===null&&zo(b,E,d),Xd(E,E.return);break;case 30:break;default:zo(b,E,d)}l=l.sibling}}function Ov(o,l){var d=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==d&&(o!=null&&o.refCount++,d!=null&&Pd(d))}function Iv(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Pd(o))}function _s(o,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)QE(o,l,d,p),l=l.sibling}function QE(o,l,d,p){var b=l.flags;switch(l.tag){case 0:case 11:case 15:_s(o,l,d,p),b&2048&&Wd(9,l);break;case 1:_s(o,l,d,p);break;case 3:_s(o,l,d,p),b&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Pd(o)));break;case 12:if(b&2048){_s(o,l,d,p),o=l.stateNode;try{var E=l.memoizedProps,N=E.id,L=E.onPostCommit;typeof L=="function"&&L(N,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Q){bn(l,l.return,Q)}}else _s(o,l,d,p);break;case 31:_s(o,l,d,p);break;case 13:_s(o,l,d,p);break;case 23:break;case 22:E=l.stateNode,N=l.alternate,l.memoizedState!==null?E._visibility&2?_s(o,l,d,p):Qd(o,l):E._visibility&2?_s(o,l,d,p):(E._visibility|=2,su(o,l,d,p,(l.subtreeFlags&10256)!==0||!1)),b&2048&&Ov(N,l);break;case 24:_s(o,l,d,p),b&2048&&Iv(l.alternate,l);break;default:_s(o,l,d,p)}}function su(o,l,d,p,b){for(b=b&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var E=o,N=l,L=d,Q=p,de=N.flags;switch(N.tag){case 0:case 11:case 15:su(E,N,L,Q,b),Wd(8,N);break;case 23:break;case 22:var xe=N.stateNode;N.memoizedState!==null?xe._visibility&2?su(E,N,L,Q,b):Qd(E,N):(xe._visibility|=2,su(E,N,L,Q,b)),b&&de&2048&&Ov(N.alternate,N);break;case 24:su(E,N,L,Q,b),b&&de&2048&&Iv(N.alternate,N);break;default:su(E,N,L,Q,b)}l=l.sibling}}function Qd(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=o,p=l,b=p.flags;switch(p.tag){case 22:Qd(d,p),b&2048&&Ov(p.alternate,p);break;case 24:Qd(d,p),b&2048&&Iv(p.alternate,p);break;default:Qd(d,p)}l=l.sibling}}var Jd=8192;function ou(o,l,d){if(o.subtreeFlags&Jd)for(o=o.child;o!==null;)JE(o,l,d),o=o.sibling}function JE(o,l,d){switch(o.tag){case 26:ou(o,l,d),o.flags&Jd&&o.memoizedState!==null&&f9(d,Ts,o.memoizedState,o.memoizedProps);break;case 5:ou(o,l,d);break;case 3:case 4:var p=Ts;Ts=Ym(o.stateNode.containerInfo),ou(o,l,d),Ts=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=Jd,Jd=16777216,ou(o,l,d),Jd=p):ou(o,l,d));break;default:ou(o,l,d)}}function eR(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function ef(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Tr=p,nR(p,o)}eR(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)tR(o),o=o.sibling}function tR(o){switch(o.tag){case 0:case 11:case 15:ef(o),o.flags&2048&&_i(9,o,o.return);break;case 3:ef(o);break;case 12:ef(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Lm(o)):ef(o);break;default:ef(o)}}function Lm(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var p=l[d];Tr=p,nR(p,o)}eR(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:_i(8,l,l.return),Lm(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Lm(l));break;default:Lm(l)}o=o.sibling}}function nR(o,l){for(;Tr!==null;){var d=Tr;switch(d.tag){case 0:case 11:case 15:_i(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var p=d.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Pd(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Tr=p;else e:for(d=o;Tr!==null;){p=Tr;var b=p.sibling,E=p.return;if(qE(p),p===d){Tr=null;break e}if(b!==null){b.return=E,Tr=b;break e}Tr=E}}}var Tk={getCacheForType:function(o){var l=Mr(ir),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return Mr(ir).controller.signal}},_k=typeof WeakMap=="function"?WeakMap:Map,mn=0,An=null,Pt=null,Ht=0,vn=0,za=null,Ni=!1,iu=!1,Mv=!1,Fo=0,Wn=0,Ai=0,Wl=0,kv=0,Fa=0,lu=0,tf=null,ba=null,Lv=!1,Pm=0,rR=0,Um=1/0,zm=null,Di=null,mr=0,Oi=null,cu=null,Ho=0,Pv=0,Uv=null,aR=null,nf=0,zv=null;function Ha(){return(mn&2)!==0&&Ht!==0?Ht&-Ht:M.T!==null?Bv():Ne()}function sR(){if(Fa===0)if((Ht&536870912)===0||qt){var o=Es;Es<<=1,(Es&3932160)===0&&(Es=262144),Fa=o}else Fa=536870912;return o=Pa.current,o!==null&&(o.flags|=32),Fa}function Sa(o,l,d){(o===An&&(vn===2||vn===9)||o.cancelPendingCommit!==null)&&(uu(o,0),Ii(o,Ht,Fa,!1)),Jt(o,d),((mn&2)===0||o!==An)&&(o===An&&((mn&2)===0&&(Wl|=d),Wn===4&&Ii(o,Ht,Fa,!1)),eo(o))}function oR(o,l,d){if((mn&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&o.expiredLanes)===0||Gt(o,l),b=p?Dk(o,l):Hv(o,l,!0),E=p;do{if(b===0){iu&&!p&&Ii(o,l,0,!1);break}else{if(d=o.current.alternate,E&&!Nk(d)){b=Hv(o,l,!1),E=!1;continue}if(b===2){if(E=l,o.errorRecoveryDisabledLanes&E)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){l=N;e:{var L=o;b=tf;var Q=L.current.memoizedState.isDehydrated;if(Q&&(uu(L,N).flags|=256),N=Hv(L,N,!1),N!==2){if(Mv&&!Q){L.errorRecoveryDisabledLanes|=E,Wl|=E,b=4;break e}E=ba,ba=b,E!==null&&(ba===null?ba=E:ba.push.apply(ba,E))}b=N}if(E=!1,b!==2)continue}}if(b===1){uu(o,0),Ii(o,l,0,!0);break}e:{switch(p=o,E=b,E){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ii(p,l,Fa,!Ni);break e;case 2:ba=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(b=Pm+300-Ee(),10<b)){if(Ii(p,l,Fa,!Ni),Ye(p,0,!0)!==0)break e;Ho=l,p.timeoutHandle=PR(iR.bind(null,p,d,ba,zm,Lv,l,Fa,Wl,lu,Ni,E,"Throttled",-0,0),b);break e}iR(p,d,ba,zm,Lv,l,Fa,Wl,lu,Ni,E,null,-0,0)}}break}while(!0);eo(o)}function iR(o,l,d,p,b,E,N,L,Q,de,xe,be,he,pe){if(o.timeoutHandle=-1,be=l.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jo},JE(l,E,be);var qe=(E&62914560)===E?Pm-Ee():(E&4194048)===E?rR-Ee():0;if(qe=h9(be,qe),qe!==null){Ho=E,o.cancelPendingCommit=qe(pR.bind(null,o,l,E,d,p,b,N,L,Q,xe,be,null,he,pe)),Ii(o,E,N,!de);return}}pR(o,l,E,d,p,b,N,L,Q)}function Nk(o){for(var l=o;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var p=0;p<d.length;p++){var b=d[p],E=b.getSnapshot;b=b.value;try{if(!ka(E(),b))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ii(o,l,d,p){l&=~kv,l&=~Wl,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var b=l;0<b;){var E=31-kn(b),N=1<<E;p[E]=-1,b&=~N}d!==0&&Rr(o,d,l)}function Fm(){return(mn&6)===0?(rf(0),!1):!0}function Fv(){if(Pt!==null){if(vn===0)var o=Pt.return;else o=Pt,Ao=Hl=null,nv(o),eu=null,zd=0,o=Pt;for(;o!==null;)UE(o.alternate,o),o=o.return;Pt=null}}function uu(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,Yk(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Ho=0,Fv(),An=o,Pt=d=_o(o.current,null),Ht=l,vn=0,za=null,Ni=!1,iu=Gt(o,l),Mv=!1,lu=Fa=kv=Wl=Ai=Wn=0,ba=tf=null,Lv=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var b=31-kn(p),E=1<<b;l|=o[b],p&=~E}return Fo=l,im(),d}function lR(o,l){bt=null,M.H=Kd,l===Jc||l===pm?(l=Ew(),vn=3):l===Gx?(l=Ew(),vn=4):vn=l===xv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,za=l,Pt===null&&(Wn=1,Nm(o,os(l,o.current)))}function cR(){var o=Pa.current;return o===null?!0:(Ht&4194048)===Ht?us===null:(Ht&62914560)===Ht||(Ht&536870912)!==0?o===us:!1}function uR(){var o=M.H;return M.H=Kd,o===null?Kd:o}function dR(){var o=M.A;return M.A=Tk,o}function Hm(){Wn=4,Ni||(Ht&4194048)!==Ht&&Pa.current!==null||(iu=!0),(Ai&134217727)===0&&(Wl&134217727)===0||An===null||Ii(An,Ht,Fa,!1)}function Hv(o,l,d){var p=mn;mn|=2;var b=uR(),E=dR();(An!==o||Ht!==l)&&(zm=null,uu(o,l)),l=!1;var N=Wn;e:do try{if(vn!==0&&Pt!==null){var L=Pt,Q=za;switch(vn){case 8:Fv(),N=6;break e;case 3:case 2:case 9:case 6:Pa.current===null&&(l=!0);var de=vn;if(vn=0,za=null,du(o,L,Q,de),d&&iu){N=0;break e}break;default:de=vn,vn=0,za=null,du(o,L,Q,de)}}Ak(),N=Wn;break}catch(xe){lR(o,xe)}while(!0);return l&&o.shellSuspendCounter++,Ao=Hl=null,mn=p,M.H=b,M.A=E,Pt===null&&(An=null,Ht=0,im()),N}function Ak(){for(;Pt!==null;)fR(Pt)}function Dk(o,l){var d=mn;mn|=2;var p=uR(),b=dR();An!==o||Ht!==l?(zm=null,Um=Ee()+500,uu(o,l)):iu=Gt(o,l);e:do try{if(vn!==0&&Pt!==null){l=Pt;var E=za;t:switch(vn){case 1:vn=0,za=null,du(o,l,E,1);break;case 2:case 9:if(Cw(E)){vn=0,za=null,hR(l);break}l=function(){vn!==2&&vn!==9||An!==o||(vn=7),eo(o)},E.then(l,l);break e;case 3:vn=7;break e;case 4:vn=5;break e;case 7:Cw(E)?(vn=0,za=null,hR(l)):(vn=0,za=null,du(o,l,E,7));break;case 5:var N=null;switch(Pt.tag){case 26:N=Pt.memoizedState;case 5:case 27:var L=Pt;if(N?QR(N):L.stateNode.complete){vn=0,za=null;var Q=L.sibling;if(Q!==null)Pt=Q;else{var de=L.return;de!==null?(Pt=de,$m(de)):Pt=null}break t}}vn=0,za=null,du(o,l,E,5);break;case 6:vn=0,za=null,du(o,l,E,6);break;case 8:Fv(),Wn=6;break e;default:throw Error(r(462))}}Ok();break}catch(xe){lR(o,xe)}while(!0);return Ao=Hl=null,M.H=p,M.A=b,mn=d,Pt!==null?0:(An=null,Ht=0,im(),Wn)}function Ok(){for(;Pt!==null&&!ce();)fR(Pt)}function fR(o){var l=LE(o.alternate,o,Fo);o.memoizedProps=o.pendingProps,l===null?$m(o):Pt=l}function hR(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=AE(d,l,l.pendingProps,l.type,void 0,Ht);break;case 11:l=AE(d,l,l.pendingProps,l.type.render,l.ref,Ht);break;case 5:nv(l);default:UE(d,l),l=Pt=dw(l,Fo),l=LE(d,l,Fo)}o.memoizedProps=o.pendingProps,l===null?$m(o):Pt=l}function du(o,l,d,p){Ao=Hl=null,nv(l),eu=null,zd=0;var b=l.return;try{if(bk(o,b,l,d,Ht)){Wn=1,Nm(o,os(d,o.current)),Pt=null;return}}catch(E){if(b!==null)throw Pt=b,E;Wn=1,Nm(o,os(d,o.current)),Pt=null;return}l.flags&32768?(qt||p===1?o=!0:iu||(Ht&536870912)!==0?o=!1:(Ni=o=!0,(p===2||p===9||p===3||p===6)&&(p=Pa.current,p!==null&&p.tag===13&&(p.flags|=16384))),mR(l,o)):$m(l)}function $m(o){var l=o;do{if((l.flags&32768)!==0){mR(l,Ni);return}o=l.return;var d=wk(l.alternate,l,Fo);if(d!==null){Pt=d;return}if(l=l.sibling,l!==null){Pt=l;return}Pt=l=o}while(l!==null);Wn===0&&(Wn=5)}function mR(o,l){do{var d=Ek(o.alternate,o);if(d!==null){d.flags&=32767,Pt=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Pt=o;return}Pt=o=d}while(o!==null);Wn=6,Pt=null}function pR(o,l,d,p,b,E,N,L,Q){o.cancelPendingCommit=null;do Vm();while(mr!==0);if((mn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(E=l.lanes|l.childLanes,E|=Nx,Qt(o,d,E,N,L,Q),o===An&&(Pt=An=null,Ht=0),cu=l,Oi=o,Ho=d,Pv=E,Uv=b,aR=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,Lk(st,function(){return bR(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=M.T,M.T=null,b=V.p,V.p=2,N=mn,mn|=4;try{Rk(o,l,d)}finally{mn=N,V.p=b,M.T=p}}mr=1,gR(),yR(),xR()}}function gR(){if(mr===1){mr=0;var o=Oi,l=cu,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=M.T,M.T=null;var p=V.p;V.p=2;var b=mn;mn|=4;try{WE(l,o);var E=Jv,N=nw(o.containerInfo),L=E.focusedElem,Q=E.selectionRange;if(N!==L&&L&&L.ownerDocument&&tw(L.ownerDocument.documentElement,L)){if(Q!==null&&Ex(L)){var de=Q.start,xe=Q.end;if(xe===void 0&&(xe=de),"selectionStart"in L)L.selectionStart=de,L.selectionEnd=Math.min(xe,L.value.length);else{var be=L.ownerDocument||document,he=be&&be.defaultView||window;if(he.getSelection){var pe=he.getSelection(),qe=L.textContent.length,ot=Math.min(Q.start,qe),jn=Q.end===void 0?ot:Math.min(Q.end,qe);!pe.extend&&ot>jn&&(N=jn,jn=ot,ot=N);var ie=ew(L,ot),te=ew(L,jn);if(ie&&te&&(pe.rangeCount!==1||pe.anchorNode!==ie.node||pe.anchorOffset!==ie.offset||pe.focusNode!==te.node||pe.focusOffset!==te.offset)){var ue=be.createRange();ue.setStart(ie.node,ie.offset),pe.removeAllRanges(),ot>jn?(pe.addRange(ue),pe.extend(te.node,te.offset)):(ue.setEnd(te.node,te.offset),pe.addRange(ue))}}}}for(be=[],pe=L;pe=pe.parentNode;)pe.nodeType===1&&be.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<be.length;L++){var ve=be[L];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}tp=!!Qv,Jv=Qv=null}finally{mn=b,V.p=p,M.T=d}}o.current=l,mr=2}}function yR(){if(mr===2){mr=0;var o=Oi,l=cu,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=M.T,M.T=null;var p=V.p;V.p=2;var b=mn;mn|=4;try{BE(o,l.alternate,l)}finally{mn=b,V.p=p,M.T=d}}mr=3}}function xR(){if(mr===4||mr===3){mr=0,Oe();var o=Oi,l=cu,d=Ho,p=aR;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?mr=5:(mr=0,cu=Oi=null,vR(o,o.pendingLanes));var b=o.pendingLanes;if(b===0&&(Di=null),Se(d),l=l.stateNode,fn&&typeof fn.onCommitFiberRoot=="function")try{fn.onCommitFiberRoot(Jr,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=M.T,b=V.p,V.p=2,M.T=null;try{for(var E=o.onRecoverableError,N=0;N<p.length;N++){var L=p[N];E(L.value,{componentStack:L.stack})}}finally{M.T=l,V.p=b}}(Ho&3)!==0&&Vm(),eo(o),b=o.pendingLanes,(d&261930)!==0&&(b&42)!==0?o===zv?nf++:(nf=0,zv=o):nf=0,rf(0)}}function vR(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Pd(l)))}function Vm(){return gR(),yR(),xR(),bR()}function bR(){if(mr!==5)return!1;var o=Oi,l=Pv;Pv=0;var d=Se(Ho),p=M.T,b=V.p;try{V.p=32>d?32:d,M.T=null,d=Uv,Uv=null;var E=Oi,N=Ho;if(mr=0,cu=Oi=null,Ho=0,(mn&6)!==0)throw Error(r(331));var L=mn;if(mn|=4,tR(E.current),QE(E,E.current,N,d),mn=L,rf(0,!1),fn&&typeof fn.onPostCommitFiberRoot=="function")try{fn.onPostCommitFiberRoot(Jr,E)}catch{}return!0}finally{V.p=b,M.T=p,vR(o,l)}}function SR(o,l,d){l=os(d,l),l=yv(o.stateNode,l,2),o=Ri(o,l,2),o!==null&&(Jt(o,2),eo(o))}function bn(o,l,d){if(o.tag===3)SR(o,o,d);else for(;l!==null;){if(l.tag===3){SR(l,o,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Di===null||!Di.has(p))){o=os(d,o),d=CE(2),p=Ri(l,d,2),p!==null&&(wE(d,p,l,o),Jt(p,2),eo(p));break}}l=l.return}}function $v(o,l,d){var p=o.pingCache;if(p===null){p=o.pingCache=new _k;var b=new Set;p.set(l,b)}else b=p.get(l),b===void 0&&(b=new Set,p.set(l,b));b.has(d)||(Mv=!0,b.add(d),o=Ik.bind(null,o,l,d),l.then(o,o))}function Ik(o,l,d){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,An===o&&(Ht&d)===d&&(Wn===4||Wn===3&&(Ht&62914560)===Ht&&300>Ee()-Pm?(mn&2)===0&&uu(o,0):kv|=d,lu===Ht&&(lu=0)),eo(o)}function CR(o,l){l===0&&(l=Bt()),o=Ul(o,l),o!==null&&(Jt(o,l),eo(o))}function Mk(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),CR(o,d)}function kk(o,l){var d=0;switch(o.tag){case 31:case 13:var p=o.stateNode,b=o.memoizedState;b!==null&&(d=b.retryLane);break;case 19:p=o.stateNode;break;case 22:p=o.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(l),CR(o,d)}function Lk(o,l){return q(o,l)}var Gm=null,fu=null,Vv=!1,Bm=!1,Gv=!1,Mi=0;function eo(o){o!==fu&&o.next===null&&(fu===null?Gm=fu=o:fu=fu.next=o),Bm=!0,Vv||(Vv=!0,Uk())}function rf(o,l){if(!Gv&&Bm){Gv=!0;do for(var d=!1,p=Gm;p!==null;){if(o!==0){var b=p.pendingLanes;if(b===0)var E=0;else{var N=p.suspendedLanes,L=p.pingedLanes;E=(1<<31-kn(42|o)+1)-1,E&=b&~(N&~L),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(d=!0,jR(p,E))}else E=Ht,E=Ye(p,p===An?E:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(E&3)===0||Gt(p,E)||(d=!0,jR(p,E));p=p.next}while(d);Gv=!1}}function Pk(){wR()}function wR(){Bm=Vv=!1;var o=0;Mi!==0&&Zk()&&(o=Mi);for(var l=Ee(),d=null,p=Gm;p!==null;){var b=p.next,E=ER(p,l);E===0?(p.next=null,d===null?Gm=b:d.next=b,b===null&&(fu=d)):(d=p,(o!==0||(E&3)!==0)&&(Bm=!0)),p=b}mr!==0&&mr!==5||rf(o),Mi!==0&&(Mi=0)}function ER(o,l){for(var d=o.suspendedLanes,p=o.pingedLanes,b=o.expirationTimes,E=o.pendingLanes&-62914561;0<E;){var N=31-kn(E),L=1<<N,Q=b[N];Q===-1?((L&d)===0||(L&p)!==0)&&(b[N]=Xt(L,l)):Q<=l&&(o.expiredLanes|=L),E&=~L}if(l=An,d=Ht,d=Ye(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,d===0||o===l&&(vn===2||vn===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&ne(p),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||Gt(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(p!==null&&ne(p),Se(d)){case 2:case 8:d=mt;break;case 32:d=st;break;case 268435456:d=sr;break;default:d=st}return p=RR.bind(null,o),d=q(d,p),o.callbackPriority=l,o.callbackNode=d,l}return p!==null&&p!==null&&ne(p),o.callbackPriority=2,o.callbackNode=null,2}function RR(o,l){if(mr!==0&&mr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(Vm()&&o.callbackNode!==d)return null;var p=Ht;return p=Ye(o,o===An?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(oR(o,p,l),ER(o,Ee()),o.callbackNode!=null&&o.callbackNode===d?RR.bind(null,o):null)}function jR(o,l){if(Vm())return null;oR(o,l,!0)}function Uk(){Wk(function(){(mn&6)!==0?q(He,Pk):wR()})}function Bv(){if(Mi===0){var o=Xc;o===0&&(o=Da,Da<<=1,(Da&261888)===0&&(Da=256)),Mi=o}return Mi}function TR(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Jh(""+o)}function _R(o,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,o.id&&d.setAttribute("form",o.id),l.parentNode.insertBefore(d,l),o=new FormData(o),d.parentNode.removeChild(d),o}function zk(o,l,d,p,b){if(l==="submit"&&d&&d.stateNode===b){var E=TR((b[ze]||null).action),N=p.submitter;N&&(l=(l=N[ze]||null)?TR(l.formAction):N.getAttribute("formAction"),l!==null&&(E=l,N=null));var L=new rm("action","action",null,p,b);o.push({event:L,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Mi!==0){var Q=N?_R(b,N):new FormData(b);dv(d,{pending:!0,data:Q,method:b.method,action:E},null,Q)}}else typeof E=="function"&&(L.preventDefault(),Q=N?_R(b,N):new FormData(b),dv(d,{pending:!0,data:Q,method:b.method,action:E},E,Q))},currentTarget:b}]})}}for(var qv=0;qv<_x.length;qv++){var Kv=_x[qv],Fk=Kv.toLowerCase(),Hk=Kv[0].toUpperCase()+Kv.slice(1);js(Fk,"on"+Hk)}js(sw,"onAnimationEnd"),js(ow,"onAnimationIteration"),js(iw,"onAnimationStart"),js("dblclick","onDoubleClick"),js("focusin","onFocus"),js("focusout","onBlur"),js(rk,"onTransitionRun"),js(ak,"onTransitionStart"),js(sk,"onTransitionCancel"),js(lw,"onTransitionEnd"),pa("onMouseEnter",["mouseout","mouseover"]),pa("onMouseLeave",["mouseout","mouseover"]),pa("onPointerEnter",["pointerout","pointerover"]),pa("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var af="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(" "),$k=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(af));function NR(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var p=o[d],b=p.event;p=p.listeners;e:{var E=void 0;if(l)for(var N=p.length-1;0<=N;N--){var L=p[N],Q=L.instance,de=L.currentTarget;if(L=L.listener,Q!==E&&b.isPropagationStopped())break e;E=L,b.currentTarget=de;try{E(b)}catch(xe){om(xe)}b.currentTarget=null,E=Q}else for(N=0;N<p.length;N++){if(L=p[N],Q=L.instance,de=L.currentTarget,L=L.listener,Q!==E&&b.isPropagationStopped())break e;E=L,b.currentTarget=de;try{E(b)}catch(xe){om(xe)}b.currentTarget=null,E=Q}}}}function Ut(o,l){var d=l[at];d===void 0&&(d=l[at]=new Set);var p=o+"__bubble";d.has(p)||(AR(l,o,2,!1),d.add(p))}function Zv(o,l,d){var p=0;l&&(p|=4),AR(d,o,p,l)}var qm="_reactListening"+Math.random().toString(36).slice(2);function Yv(o){if(!o[qm]){o[qm]=!0,Ia.forEach(function(d){d!=="selectionchange"&&($k.has(d)||Zv(d,!1,o),Zv(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[qm]||(l[qm]=!0,Zv("selectionchange",!1,l))}}function AR(o,l,d,p){switch(sj(l)){case 2:var b=g9;break;case 8:b=y9;break;default:b=u0}d=b.bind(null,l,d,o),b=void 0,!px||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(b=!0),p?b!==void 0?o.addEventListener(l,d,{capture:!0,passive:b}):o.addEventListener(l,d,!0):b!==void 0?o.addEventListener(l,d,{passive:b}):o.addEventListener(l,d,!1)}function Wv(o,l,d,p,b){var E=p;if((l&1)===0&&(l&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var L=p.stateNode.containerInfo;if(L===b)break;if(N===4)for(N=p.return;N!==null;){var Q=N.tag;if((Q===3||Q===4)&&N.stateNode.containerInfo===b)return;N=N.return}for(;L!==null;){if(N=an(L),N===null)return;if(Q=N.tag,Q===5||Q===6||Q===26||Q===27){p=E=N;continue e}L=L.parentNode}}p=p.return}kC(function(){var de=E,xe=hx(d),be=[];e:{var he=cw.get(o);if(he!==void 0){var pe=rm,qe=o;switch(o){case"keypress":if(tm(d)===0)break e;case"keydown":case"keyup":pe=k8;break;case"focusin":qe="focus",pe=vx;break;case"focusout":qe="blur",pe=vx;break;case"beforeblur":case"afterblur":pe=vx;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=UC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=w8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=U8;break;case sw:case ow:case iw:pe=j8;break;case lw:pe=F8;break;case"scroll":case"scrollend":pe=S8;break;case"wheel":pe=$8;break;case"copy":case"cut":case"paste":pe=_8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=FC;break;case"toggle":case"beforetoggle":pe=G8}var ot=(l&4)!==0,jn=!ot&&(o==="scroll"||o==="scrollend"),ie=ot?he!==null?he+"Capture":null:he;ot=[];for(var te=de,ue;te!==null;){var ve=te;if(ue=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ue===null||ie===null||(ve=jd(te,ie),ve!=null&&ot.push(sf(te,ve,ue))),jn)break;te=te.return}0<ot.length&&(he=new pe(he,qe,null,d,xe),be.push({event:he,listeners:ot}))}}if((l&7)===0){e:{if(he=o==="mouseover"||o==="pointerover",pe=o==="mouseout"||o==="pointerout",he&&d!==fx&&(qe=d.relatedTarget||d.fromElement)&&(an(qe)||qe[Xe]))break e;if((pe||he)&&(he=xe.window===xe?xe:(he=xe.ownerDocument)?he.defaultView||he.parentWindow:window,pe?(qe=d.relatedTarget||d.toElement,pe=de,qe=qe?an(qe):null,qe!==null&&(jn=i(qe),ot=qe.tag,qe!==jn||ot!==5&&ot!==27&&ot!==6)&&(qe=null)):(pe=null,qe=de),pe!==qe)){if(ot=UC,ve="onMouseLeave",ie="onMouseEnter",te="mouse",(o==="pointerout"||o==="pointerover")&&(ot=FC,ve="onPointerLeave",ie="onPointerEnter",te="pointer"),jn=pe==null?he:Oa(pe),ue=qe==null?he:Oa(qe),he=new ot(ve,te+"leave",pe,d,xe),he.target=jn,he.relatedTarget=ue,ve=null,an(xe)===de&&(ot=new ot(ie,te+"enter",qe,d,xe),ot.target=ue,ot.relatedTarget=jn,ve=ot),jn=ve,pe&&qe)t:{for(ot=Vk,ie=pe,te=qe,ue=0,ve=ie;ve;ve=ot(ve))ue++;ve=0;for(var nt=te;nt;nt=ot(nt))ve++;for(;0<ue-ve;)ie=ot(ie),ue--;for(;0<ve-ue;)te=ot(te),ve--;for(;ue--;){if(ie===te||te!==null&&ie===te.alternate){ot=ie;break t}ie=ot(ie),te=ot(te)}ot=null}else ot=null;pe!==null&&DR(be,he,pe,ot,!1),qe!==null&&jn!==null&&DR(be,jn,qe,ot,!0)}}e:{if(he=de?Oa(de):window,pe=he.nodeName&&he.nodeName.toLowerCase(),pe==="select"||pe==="input"&&he.type==="file")var ln=ZC;else if(qC(he))if(YC)ln=ek;else{ln=Q8;var We=X8}else pe=he.nodeName,!pe||pe.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&dx(de.elementType)&&(ln=ZC):ln=J8;if(ln&&(ln=ln(o,de))){KC(be,ln,d,xe);break e}We&&We(o,he,de),o==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&ux(he,"number",he.value)}switch(We=de?Oa(de):window,o){case"focusin":(qC(We)||We.contentEditable==="true")&&(Vc=We,Rx=de,Md=null);break;case"focusout":Md=Rx=Vc=null;break;case"mousedown":jx=!0;break;case"contextmenu":case"mouseup":case"dragend":jx=!1,rw(be,d,xe);break;case"selectionchange":if(nk)break;case"keydown":case"keyup":rw(be,d,xe)}var Tt;if(Sx)e:{switch(o){case"compositionstart":var $t="onCompositionStart";break e;case"compositionend":$t="onCompositionEnd";break e;case"compositionupdate":$t="onCompositionUpdate";break e}$t=void 0}else $c?GC(o,d)&&($t="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&($t="onCompositionStart");$t&&(HC&&d.locale!=="ko"&&($c||$t!=="onCompositionStart"?$t==="onCompositionEnd"&&$c&&(Tt=LC()):(xi=xe,gx="value"in xi?xi.value:xi.textContent,$c=!0)),We=Km(de,$t),0<We.length&&($t=new zC($t,o,null,d,xe),be.push({event:$t,listeners:We}),Tt?$t.data=Tt:(Tt=BC(d),Tt!==null&&($t.data=Tt)))),(Tt=q8?K8(o,d):Z8(o,d))&&($t=Km(de,"onBeforeInput"),0<$t.length&&(We=new zC("onBeforeInput","beforeinput",null,d,xe),be.push({event:We,listeners:$t}),We.data=Tt)),zk(be,o,de,d,xe)}NR(be,l)})}function sf(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Km(o,l){for(var d=l+"Capture",p=[];o!==null;){var b=o,E=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||E===null||(b=jd(o,d),b!=null&&p.unshift(sf(o,b,E)),b=jd(o,l),b!=null&&p.push(sf(o,b,E))),o.tag===3)return p;o=o.return}return[]}function Vk(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function DR(o,l,d,p,b){for(var E=l._reactName,N=[];d!==null&&d!==p;){var L=d,Q=L.alternate,de=L.stateNode;if(L=L.tag,Q!==null&&Q===p)break;L!==5&&L!==26&&L!==27||de===null||(Q=de,b?(de=jd(d,E),de!=null&&N.unshift(sf(d,de,Q))):b||(de=jd(d,E),de!=null&&N.push(sf(d,de,Q)))),d=d.return}N.length!==0&&o.push({event:l,listeners:N})}var Gk=/\r\n?/g,Bk=/\u0000|\uFFFD/g;function OR(o){return(typeof o=="string"?o:""+o).replace(Gk,`
|
|
49
|
-
`).replace(Bk,"")}function IR(o,l){return l=OR(l),OR(o)===l}function Rn(o,l,d,p,b,E){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||zc(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&zc(o,""+p);break;case"className":rs(o,"class",p);break;case"tabIndex":rs(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":rs(o,d,p);break;case"style":IC(o,p,E);break;case"data":if(l!=="object"){rs(o,"data",p);break}case"src":case"href":if(p===""&&(l!=="a"||d!=="href")){o.removeAttribute(d);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Jh(""+p),o.setAttribute(d,p);break;case"action":case"formAction":if(typeof p=="function"){o.setAttribute(d,"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 E=="function"&&(d==="formAction"?(l!=="input"&&Rn(o,l,"name",b.name,b,null),Rn(o,l,"formEncType",b.formEncType,b,null),Rn(o,l,"formMethod",b.formMethod,b,null),Rn(o,l,"formTarget",b.formTarget,b,null)):(Rn(o,l,"encType",b.encType,b,null),Rn(o,l,"method",b.method,b,null),Rn(o,l,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=Jh(""+p),o.setAttribute(d,p);break;case"onClick":p!=null&&(o.onclick=jo);break;case"onScroll":p!=null&&Ut("scroll",o);break;case"onScrollEnd":p!=null&&Ut("scrollend",o);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"multiple":o.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":o.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){o.removeAttribute("xlink:href");break}d=Jh(""+p),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""+p):o.removeAttribute(d);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":p&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,""):o.removeAttribute(d);break;case"capture":case"download":p===!0?o.setAttribute(d,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?o.setAttribute(d,p):o.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?o.setAttribute(d,p):o.removeAttribute(d);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?o.removeAttribute(d):o.setAttribute(d,p);break;case"popover":Ut("beforetoggle",o),Ut("toggle",o),Rs(o,"popover",p);break;case"xlinkActuate":on(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":on(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":on(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":on(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":on(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":on(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":on(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":on(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":on(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Rs(o,"is",p);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=v8.get(d)||d,Rs(o,d,p))}}function Xv(o,l,d,p,b,E){switch(d){case"style":IC(o,p,E);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(b.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"children":typeof p=="string"?zc(o,p):(typeof p=="number"||typeof p=="bigint")&&zc(o,""+p);break;case"onScroll":p!=null&&Ut("scroll",o);break;case"onScrollEnd":p!=null&&Ut("scrollend",o);break;case"onClick":p!=null&&(o.onclick=jo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lc.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(b=d.endsWith("Capture"),l=d.slice(2,b?d.length-7:void 0),E=o[ze]||null,E=E!=null?E[d]:null,typeof E=="function"&&o.removeEventListener(l,E,b),typeof p=="function")){typeof E!="function"&&E!==null&&(d in o?o[d]=null:o.hasAttribute(d)&&o.removeAttribute(d)),o.addEventListener(l,p,b);break e}d in o?o[d]=p:p===!0?o.setAttribute(d,""):Rs(o,d,p)}}}function Lr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ut("error",o),Ut("load",o);var p=!1,b=!1,E;for(E in d)if(d.hasOwnProperty(E)){var N=d[E];if(N!=null)switch(E){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Rn(o,l,E,N,d,null)}}b&&Rn(o,l,"srcSet",d.srcSet,d,null),p&&Rn(o,l,"src",d.src,d,null);return;case"input":Ut("invalid",o);var L=E=N=b=null,Q=null,de=null;for(p in d)if(d.hasOwnProperty(p)){var xe=d[p];if(xe!=null)switch(p){case"name":b=xe;break;case"type":N=xe;break;case"checked":Q=xe;break;case"defaultChecked":de=xe;break;case"value":E=xe;break;case"defaultValue":L=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(r(137,l));break;default:Rn(o,l,p,xe,d,null)}}NC(o,E,L,Q,de,N,b,!1);return;case"select":Ut("invalid",o),p=N=E=null;for(b in d)if(d.hasOwnProperty(b)&&(L=d[b],L!=null))switch(b){case"value":E=L;break;case"defaultValue":N=L;break;case"multiple":p=L;default:Rn(o,l,b,L,d,null)}l=E,d=N,o.multiple=!!p,l!=null?Uc(o,!!p,l,!1):d!=null&&Uc(o,!!p,d,!0);return;case"textarea":Ut("invalid",o),E=b=p=null;for(N in d)if(d.hasOwnProperty(N)&&(L=d[N],L!=null))switch(N){case"value":p=L;break;case"defaultValue":b=L;break;case"children":E=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Rn(o,l,N,L,d,null)}DC(o,p,b,E);return;case"option":for(Q in d)if(d.hasOwnProperty(Q)&&(p=d[Q],p!=null))switch(Q){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Rn(o,l,Q,p,d,null)}return;case"dialog":Ut("beforetoggle",o),Ut("toggle",o),Ut("cancel",o),Ut("close",o);break;case"iframe":case"object":Ut("load",o);break;case"video":case"audio":for(p=0;p<af.length;p++)Ut(af[p],o);break;case"image":Ut("error",o),Ut("load",o);break;case"details":Ut("toggle",o);break;case"embed":case"source":case"link":Ut("error",o),Ut("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in d)if(d.hasOwnProperty(de)&&(p=d[de],p!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Rn(o,l,de,p,d,null)}return;default:if(dx(l)){for(xe in d)d.hasOwnProperty(xe)&&(p=d[xe],p!==void 0&&Xv(o,l,xe,p,d,void 0));return}}for(L in d)d.hasOwnProperty(L)&&(p=d[L],p!=null&&Rn(o,l,L,p,d,null))}function qk(o,l,d,p){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,E=null,N=null,L=null,Q=null,de=null,xe=null;for(pe in d){var be=d[pe];if(d.hasOwnProperty(pe)&&be!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":Q=be;default:p.hasOwnProperty(pe)||Rn(o,l,pe,null,p,be)}}for(var he in p){var pe=p[he];if(be=d[he],p.hasOwnProperty(he)&&(pe!=null||be!=null))switch(he){case"type":E=pe;break;case"name":b=pe;break;case"checked":de=pe;break;case"defaultChecked":xe=pe;break;case"value":N=pe;break;case"defaultValue":L=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,l));break;default:pe!==be&&Rn(o,l,he,pe,p,be)}}cx(o,N,L,Q,de,xe,E,b);return;case"select":pe=N=L=he=null;for(E in d)if(Q=d[E],d.hasOwnProperty(E)&&Q!=null)switch(E){case"value":break;case"multiple":pe=Q;default:p.hasOwnProperty(E)||Rn(o,l,E,null,p,Q)}for(b in p)if(E=p[b],Q=d[b],p.hasOwnProperty(b)&&(E!=null||Q!=null))switch(b){case"value":he=E;break;case"defaultValue":L=E;break;case"multiple":N=E;default:E!==Q&&Rn(o,l,b,E,p,Q)}l=L,d=N,p=pe,he!=null?Uc(o,!!d,he,!1):!!p!=!!d&&(l!=null?Uc(o,!!d,l,!0):Uc(o,!!d,d?[]:"",!1));return;case"textarea":pe=he=null;for(L in d)if(b=d[L],d.hasOwnProperty(L)&&b!=null&&!p.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Rn(o,l,L,null,p,b)}for(N in p)if(b=p[N],E=d[N],p.hasOwnProperty(N)&&(b!=null||E!=null))switch(N){case"value":he=b;break;case"defaultValue":pe=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==E&&Rn(o,l,N,b,p,E)}AC(o,he,pe);return;case"option":for(var qe in d)if(he=d[qe],d.hasOwnProperty(qe)&&he!=null&&!p.hasOwnProperty(qe))switch(qe){case"selected":o.selected=!1;break;default:Rn(o,l,qe,null,p,he)}for(Q in p)if(he=p[Q],pe=d[Q],p.hasOwnProperty(Q)&&he!==pe&&(he!=null||pe!=null))switch(Q){case"selected":o.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Rn(o,l,Q,he,p,pe)}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 ot in d)he=d[ot],d.hasOwnProperty(ot)&&he!=null&&!p.hasOwnProperty(ot)&&Rn(o,l,ot,null,p,he);for(de in p)if(he=p[de],pe=d[de],p.hasOwnProperty(de)&&he!==pe&&(he!=null||pe!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:Rn(o,l,de,he,p,pe)}return;default:if(dx(l)){for(var jn in d)he=d[jn],d.hasOwnProperty(jn)&&he!==void 0&&!p.hasOwnProperty(jn)&&Xv(o,l,jn,void 0,p,he);for(xe in p)he=p[xe],pe=d[xe],!p.hasOwnProperty(xe)||he===pe||he===void 0&&pe===void 0||Xv(o,l,xe,he,p,pe);return}}for(var ie in d)he=d[ie],d.hasOwnProperty(ie)&&he!=null&&!p.hasOwnProperty(ie)&&Rn(o,l,ie,null,p,he);for(be in p)he=p[be],pe=d[be],!p.hasOwnProperty(be)||he===pe||he==null&&pe==null||Rn(o,l,be,he,p,pe)}function MR(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kk(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var b=d[p],E=b.transferSize,N=b.initiatorType,L=b.duration;if(E&&L&&MR(N)){for(N=0,L=b.responseEnd,p+=1;p<d.length;p++){var Q=d[p],de=Q.startTime;if(de>L)break;var xe=Q.transferSize,be=Q.initiatorType;xe&&MR(be)&&(Q=Q.responseEnd,N+=xe*(Q<L?1:(L-de)/(Q-de)))}if(--p,l+=8*(E+N)/(b.duration/1e3),o++,10<o)break}}if(0<o)return l/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Qv=null,Jv=null;function Zm(o){return o.nodeType===9?o:o.ownerDocument}function kR(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function LR(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function e0(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var t0=null;function Zk(){var o=window.event;return o&&o.type==="popstate"?o===t0?!1:(t0=o,!0):(t0=null,!1)}var PR=typeof setTimeout=="function"?setTimeout:void 0,Yk=typeof clearTimeout=="function"?clearTimeout:void 0,UR=typeof Promise=="function"?Promise:void 0,Wk=typeof queueMicrotask=="function"?queueMicrotask:typeof UR<"u"?function(o){return UR.resolve(null).then(o).catch(Xk)}:PR;function Xk(o){setTimeout(function(){throw o})}function ki(o){return o==="head"}function zR(o,l){var d=l,p=0;do{var b=d.nextSibling;if(o.removeChild(d),b&&b.nodeType===8)if(d=b.data,d==="/$"||d==="/&"){if(p===0){o.removeChild(b),gu(l);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")of(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,of(d);for(var E=d.firstChild;E;){var N=E.nextSibling,L=E.nodeName;E[Ln]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&E.rel.toLowerCase()==="stylesheet"||d.removeChild(E),E=N}}else d==="body"&&of(o.ownerDocument.body);d=b}while(d);gu(l)}function FR(o,l){var d=o;o=0;do{var p=d.nextSibling;if(d.nodeType===1?l?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(l?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),p&&p.nodeType===8)if(d=p.data,d==="/$"){if(o===0)break;o--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||o++;d=p}while(d)}function n0(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":n0(d),Zn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function Qk(o,l,d,p){for(;o.nodeType===1;){var b=d;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!p&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(p){if(!o[Ln])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(E=o.getAttribute("rel"),E==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(E!==b.rel||o.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||o.getAttribute("title")!==(b.title==null?null:b.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(E=o.getAttribute("src"),(E!==(b.src==null?null:b.src)||o.getAttribute("type")!==(b.type==null?null:b.type)||o.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&E&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var E=b.name==null?null:""+b.name;if(b.type==="hidden"&&o.getAttribute("name")===E)return o}else return o;if(o=ds(o.nextSibling),o===null)break}return null}function Jk(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=ds(o.nextSibling),o===null))return null;return o}function HR(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=ds(o.nextSibling),o===null))return null;return o}function r0(o){return o.data==="$?"||o.data==="$~"}function a0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function e9(o,l){var d=o.ownerDocument;if(o.data==="$~")o._reactRetry=l;else if(o.data!=="$?"||d.readyState!=="loading")l();else{var p=function(){l(),d.removeEventListener("DOMContentLoaded",p)};d.addEventListener("DOMContentLoaded",p),o._reactRetry=p}}function ds(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return o}var s0=null;function $R(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return ds(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function VR(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(l===0)return o;l--}else d!=="/$"&&d!=="/&"||l++}o=o.previousSibling}return null}function GR(o,l,d){switch(l=Zm(d),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function of(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Zn(o)}var fs=new Map,BR=new Set;function Ym(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var $o=V.d;V.d={f:t9,r:n9,D:r9,C:a9,L:s9,m:o9,X:l9,S:i9,M:c9};function t9(){var o=$o.f(),l=Fm();return o||l}function n9(o){var l=sn(o);l!==null&&l.tag===5&&l.type==="form"?lE(l):$o.r(o)}var hu=typeof document>"u"?null:document;function qR(o,l,d){var p=hu;if(p&&typeof l=="string"&&l){var b=as(l);b='link[rel="'+o+'"][href="'+b+'"]',typeof d=="string"&&(b+='[crossorigin="'+d+'"]'),BR.has(b)||(BR.add(b),o={rel:o,crossOrigin:d,href:l},p.querySelector(b)===null&&(l=p.createElement("link"),Lr(l,"link",o),Nn(l),p.head.appendChild(l)))}}function r9(o){$o.D(o),qR("dns-prefetch",o,null)}function a9(o,l){$o.C(o,l),qR("preconnect",o,l)}function s9(o,l,d){$o.L(o,l,d);var p=hu;if(p&&o&&l){var b='link[rel="preload"][as="'+as(l)+'"]';l==="image"&&d&&d.imageSrcSet?(b+='[imagesrcset="'+as(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(b+='[imagesizes="'+as(d.imageSizes)+'"]')):b+='[href="'+as(o)+'"]';var E=b;switch(l){case"style":E=mu(o);break;case"script":E=pu(o)}fs.has(E)||(o=g({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),fs.set(E,o),p.querySelector(b)!==null||l==="style"&&p.querySelector(lf(E))||l==="script"&&p.querySelector(cf(E))||(l=p.createElement("link"),Lr(l,"link",o),Nn(l),p.head.appendChild(l)))}}function o9(o,l){$o.m(o,l);var d=hu;if(d&&o){var p=l&&typeof l.as=="string"?l.as:"script",b='link[rel="modulepreload"][as="'+as(p)+'"][href="'+as(o)+'"]',E=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":E=pu(o)}if(!fs.has(E)&&(o=g({rel:"modulepreload",href:o},l),fs.set(E,o),d.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(cf(E)))return}p=d.createElement("link"),Lr(p,"link",o),Nn(p),d.head.appendChild(p)}}}function i9(o,l,d){$o.S(o,l,d);var p=hu;if(p&&o){var b=ns(p).hoistableStyles,E=mu(o);l=l||"default";var N=b.get(E);if(!N){var L={loading:0,preload:null};if(N=p.querySelector(lf(E)))L.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},d),(d=fs.get(E))&&o0(o,d);var Q=N=p.createElement("link");Nn(Q),Lr(Q,"link",o),Q._p=new Promise(function(de,xe){Q.onload=de,Q.onerror=xe}),Q.addEventListener("load",function(){L.loading|=1}),Q.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Wm(N,l,p)}N={type:"stylesheet",instance:N,count:1,state:L},b.set(E,N)}}}function l9(o,l){$o.X(o,l);var d=hu;if(d&&o){var p=ns(d).hoistableScripts,b=pu(o),E=p.get(b);E||(E=d.querySelector(cf(b)),E||(o=g({src:o,async:!0},l),(l=fs.get(b))&&i0(o,l),E=d.createElement("script"),Nn(E),Lr(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(b,E))}}function c9(o,l){$o.M(o,l);var d=hu;if(d&&o){var p=ns(d).hoistableScripts,b=pu(o),E=p.get(b);E||(E=d.querySelector(cf(b)),E||(o=g({src:o,async:!0,type:"module"},l),(l=fs.get(b))&&i0(o,l),E=d.createElement("script"),Nn(E),Lr(E,"link",o),d.head.appendChild(E)),E={type:"script",instance:E,count:1,state:null},p.set(b,E))}}function KR(o,l,d,p){var b=(b=ae.current)?Ym(b):null;if(!b)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=mu(d.href),d=ns(b).hoistableStyles,p=d.get(l),p||(p={type:"style",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){o=mu(d.href);var E=ns(b).hoistableStyles,N=E.get(o);if(N||(b=b.ownerDocument||b,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},E.set(o,N),(E=b.querySelector(lf(o)))&&!E._p&&(N.instance=E,N.state.loading=5),fs.has(o)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},fs.set(o,d),E||u9(b,o,d,N.state))),l&&p===null)throw Error(r(528,""));return N}if(l&&p!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=pu(d),d=ns(b).hoistableScripts,p=d.get(l),p||(p={type:"script",instance:null,count:0,state:null},d.set(l,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function mu(o){return'href="'+as(o)+'"'}function lf(o){return'link[rel="stylesheet"]['+o+"]"}function ZR(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function u9(o,l,d,p){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?p.loading=1:(l=o.createElement("link"),p.preload=l,l.addEventListener("load",function(){return p.loading|=1}),l.addEventListener("error",function(){return p.loading|=2}),Lr(l,"link",d),Nn(l),o.head.appendChild(l))}function pu(o){return'[src="'+as(o)+'"]'}function cf(o){return"script[async]"+o}function YR(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+as(d.href)+'"]');if(p)return l.instance=p,Nn(p),p;var b=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),Nn(p),Lr(p,"style",b),Wm(p,d.precedence,o),l.instance=p;case"stylesheet":b=mu(d.href);var E=o.querySelector(lf(b));if(E)return l.state.loading|=4,l.instance=E,Nn(E),E;p=ZR(d),(b=fs.get(b))&&o0(p,b),E=(o.ownerDocument||o).createElement("link"),Nn(E);var N=E;return N._p=new Promise(function(L,Q){N.onload=L,N.onerror=Q}),Lr(E,"link",p),l.state.loading|=4,Wm(E,d.precedence,o),l.instance=E;case"script":return E=pu(d.src),(b=o.querySelector(cf(E)))?(l.instance=b,Nn(b),b):(p=d,(b=fs.get(E))&&(p=g({},d),i0(p,b)),o=o.ownerDocument||o,b=o.createElement("script"),Nn(b),Lr(b,"link",p),o.head.appendChild(b),l.instance=b);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(p=l.instance,l.state.loading|=4,Wm(p,d.precedence,o));return l.instance}function Wm(o,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,E=b,N=0;N<p.length;N++){var L=p[N];if(L.dataset.precedence===l)E=L;else if(E!==b)break}E?E.parentNode.insertBefore(o,E.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(o,l.firstChild))}function o0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function i0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Xm=null;function WR(o,l,d){if(Xm===null){var p=new Map,b=Xm=new Map;b.set(d,p)}else b=Xm,p=b.get(d),p||(p=new Map,b.set(d,p));if(p.has(o))return p;for(p.set(o,null),d=d.getElementsByTagName(o),b=0;b<d.length;b++){var E=d[b];if(!(E[Ln]||E[ke]||o==="link"&&E.getAttribute("rel")==="stylesheet")&&E.namespaceURI!=="http://www.w3.org/2000/svg"){var N=E.getAttribute(l)||"";N=o+N;var L=p.get(N);L?L.push(E):p.set(N,[E])}}return p}function XR(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function d9(o,l,d){if(d===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function QR(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function f9(o,l,d,p){if(d.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=mu(p.href),E=l.querySelector(lf(b));if(E){l=E._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=Qm.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=E,Nn(E);return}E=l.ownerDocument||l,p=ZR(p),(b=fs.get(b))&&o0(p,b),E=E.createElement("link"),Nn(E);var N=E;N._p=new Promise(function(L,Q){N.onload=L,N.onerror=Q}),Lr(E,"link",p),d.instance=E}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(o.count++,d=Qm.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var l0=0;function h9(o,l){return o.stylesheets&&o.count===0&&ep(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var p=setTimeout(function(){if(o.stylesheets&&ep(o,o.stylesheets),o.unsuspend){var E=o.unsuspend;o.unsuspend=null,E()}},6e4+l);0<o.imgBytes&&l0===0&&(l0=62500*Kk());var b=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&ep(o,o.stylesheets),o.unsuspend)){var E=o.unsuspend;o.unsuspend=null,E()}},(o.imgBytes>l0?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function Qm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Jm=null;function ep(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Jm=new Map,l.forEach(m9,o),Jm=null,Qm.call(o))}function m9(o,l){if(!(l.state.loading&4)){var d=Jm.get(o);if(d)var p=d.get(null);else{d=new Map,Jm.set(o,d);for(var b=o.querySelectorAll("link[data-precedence],style[data-precedence]"),E=0;E<b.length;E++){var N=b[E];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(d.set(N.dataset.precedence,N),p=N)}p&&d.set(null,p)}b=l.instance,N=b.getAttribute("data-precedence"),E=d.get(N)||p,E===p&&d.set(null,b),d.set(N,b),this.count++,p=Qm.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),E?E.parentNode.insertBefore(b,E.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(b,o.firstChild)),l.state.loading|=4}}var uf={$$typeof:_,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function p9(o,l,d,p,b,E,N,L,Q){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vn(0),this.hiddenUpdates=Vn(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=E,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function JR(o,l,d,p,b,E,N,L,Q,de,xe,be){return o=new p9(o,l,d,N,Q,de,xe,be,L),l=1,E===!0&&(l|=24),E=La(3,null,null,l),o.current=E,E.stateNode=o,l=Hx(),l.refCount++,o.pooledCache=l,l.refCount++,E.memoizedState={element:p,isDehydrated:d,cache:l},Bx(E),o}function ej(o){return o?(o=qc,o):qc}function tj(o,l,d,p,b,E){b=ej(b),p.context===null?p.context=b:p.pendingContext=b,p=Ei(l),p.payload={element:d},E=E===void 0?null:E,E!==null&&(p.callback=E),d=Ri(o,p,l),d!==null&&(Sa(d,o,l),Hd(d,o,l))}function nj(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function c0(o,l){nj(o,l),(o=o.alternate)&&nj(o,l)}function rj(o){if(o.tag===13||o.tag===31){var l=Ul(o,67108864);l!==null&&Sa(l,o,67108864),c0(o,67108864)}}function aj(o){if(o.tag===13||o.tag===31){var l=Ha();l=fe(l);var d=Ul(o,l);d!==null&&Sa(d,o,l),c0(o,l)}}var tp=!0;function g9(o,l,d,p){var b=M.T;M.T=null;var E=V.p;try{V.p=2,u0(o,l,d,p)}finally{V.p=E,M.T=b}}function y9(o,l,d,p){var b=M.T;M.T=null;var E=V.p;try{V.p=8,u0(o,l,d,p)}finally{V.p=E,M.T=b}}function u0(o,l,d,p){if(tp){var b=d0(p);if(b===null)Wv(o,l,p,np,d),oj(o,p);else if(v9(b,o,l,d,p))p.stopPropagation();else if(oj(o,p),l&4&&-1<x9.indexOf(o)){for(;b!==null;){var E=sn(b);if(E!==null)switch(E.tag){case 3:if(E=E.stateNode,E.current.memoizedState.isDehydrated){var N=In(E.pendingLanes);if(N!==0){var L=E;for(L.pendingLanes|=2,L.entangledLanes|=2;N;){var Q=1<<31-kn(N);L.entanglements[1]|=Q,N&=~Q}eo(E),(mn&6)===0&&(Um=Ee()+500,rf(0))}}break;case 31:case 13:L=Ul(E,2),L!==null&&Sa(L,E,2),Fm(),c0(E,2)}if(E=d0(p),E===null&&Wv(o,l,p,np,d),E===b)break;b=E}b!==null&&p.stopPropagation()}else Wv(o,l,p,null,d)}}function d0(o){return o=hx(o),f0(o)}var np=null;function f0(o){if(np=null,o=an(o),o!==null){var l=i(o);if(l===null)o=null;else{var d=l.tag;if(d===13){if(o=c(l),o!==null)return o;o=null}else if(d===31){if(o=u(l),o!==null)return o;o=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return np=o,null}function sj(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(je()){case He:return 2;case mt:return 8;case st:case Wt:return 32;case sr:return 268435456;default:return 32}default:return 32}}var h0=!1,Li=null,Pi=null,Ui=null,df=new Map,ff=new Map,zi=[],x9="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 oj(o,l){switch(o){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Pi=null;break;case"mouseover":case"mouseout":Ui=null;break;case"pointerover":case"pointerout":df.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ff.delete(l.pointerId)}}function hf(o,l,d,p,b,E){return o===null||o.nativeEvent!==E?(o={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:E,targetContainers:[b]},l!==null&&(l=sn(l),l!==null&&rj(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,b!==null&&l.indexOf(b)===-1&&l.push(b),o)}function v9(o,l,d,p,b){switch(l){case"focusin":return Li=hf(Li,o,l,d,p,b),!0;case"dragenter":return Pi=hf(Pi,o,l,d,p,b),!0;case"mouseover":return Ui=hf(Ui,o,l,d,p,b),!0;case"pointerover":var E=b.pointerId;return df.set(E,hf(df.get(E)||null,o,l,d,p,b)),!0;case"gotpointercapture":return E=b.pointerId,ff.set(E,hf(ff.get(E)||null,o,l,d,p,b)),!0}return!1}function ij(o){var l=an(o.target);if(l!==null){var d=i(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){o.blockedOn=l,Be(o.priority,function(){aj(d)});return}}else if(l===31){if(l=u(d),l!==null){o.blockedOn=l,Be(o.priority,function(){aj(d)});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){o.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}o.blockedOn=null}function rp(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=d0(o.nativeEvent);if(d===null){d=o.nativeEvent;var p=new d.constructor(d.type,d);fx=p,d.target.dispatchEvent(p),fx=null}else return l=sn(d),l!==null&&rj(l),o.blockedOn=d,!1;l.shift()}return!0}function lj(o,l,d){rp(o)&&d.delete(l)}function b9(){h0=!1,Li!==null&&rp(Li)&&(Li=null),Pi!==null&&rp(Pi)&&(Pi=null),Ui!==null&&rp(Ui)&&(Ui=null),df.forEach(lj),ff.forEach(lj)}function ap(o,l){o.blockedOn===l&&(o.blockedOn=null,h0||(h0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,b9)))}var sp=null;function cj(o){sp!==o&&(sp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){sp===o&&(sp=null);for(var l=0;l<o.length;l+=3){var d=o[l],p=o[l+1],b=o[l+2];if(typeof p!="function"){if(f0(p||d)===null)continue;break}var E=sn(d);E!==null&&(o.splice(l,3),l-=3,dv(E,{pending:!0,data:b,method:d.method,action:p},p,b))}}))}function gu(o){function l(Q){return ap(Q,o)}Li!==null&&ap(Li,o),Pi!==null&&ap(Pi,o),Ui!==null&&ap(Ui,o),df.forEach(l),ff.forEach(l);for(var d=0;d<zi.length;d++){var p=zi[d];p.blockedOn===o&&(p.blockedOn=null)}for(;0<zi.length&&(d=zi[0],d.blockedOn===null);)ij(d),d.blockedOn===null&&zi.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var b=d[p],E=d[p+1],N=b[ze]||null;if(typeof E=="function")N||cj(d);else if(N){var L=null;if(E&&E.hasAttribute("formAction")){if(b=E,N=E[ze]||null)L=N.formAction;else if(f0(b)!==null)continue}else L=N.action;typeof L=="function"?d[p+1]=L:(d.splice(p,3),p-=3),cj(d)}}}function uj(){function o(E){E.canIntercept&&E.info==="react-transition"&&E.intercept({handler:function(){return new Promise(function(N){return b=N})},focusReset:"manual",scroll:"manual"})}function l(){b!==null&&(b(),b=null),p||setTimeout(d,20)}function d(){if(!p&&!navigation.transition){var E=navigation.currentEntry;E&&E.url!=null&&navigation.navigate(E.url,{state:E.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(d,100),function(){p=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),b!==null&&(b(),b=null)}}}function m0(o){this._internalRoot=o}op.prototype.render=m0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Ha();tj(d,p,o,l,null,null)},op.prototype.unmount=m0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;tj(o.current,2,null,o,null,null),Fm(),l[Xe]=null}};function op(o){this._internalRoot=o}op.prototype.unstable_scheduleHydration=function(o){if(o){var l=Ne();o={blockedOn:null,target:o,priority:l};for(var d=0;d<zi.length&&l!==0&&l<zi[d].priority;d++);zi.splice(d,0,o),d===0&&ij(o)}};var dj=t.version;if(dj!=="19.2.1")throw Error(r(527,dj,"19.2.1"));V.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=m(l),o=o!==null?y(o):null,o=o===null?null:o.stateNode,o};var S9={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ip.isDisabled&&ip.supportsFiber)try{Jr=ip.inject(S9),fn=ip}catch{}}return pf.createRoot=function(o,l){if(!s(o))throw Error(r(299));var d=!1,p="",b=xE,E=vE,N=bE;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(b=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),l=JR(o,1,!1,null,null,d,p,null,b,E,N,uj),o[Xe]=l.current,Yv(o),new m0(l)},pf.hydrateRoot=function(o,l,d){if(!s(o))throw Error(r(299));var p=!1,b="",E=xE,N=vE,L=bE,Q=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(b=d.identifierPrefix),d.onUncaughtError!==void 0&&(E=d.onUncaughtError),d.onCaughtError!==void 0&&(N=d.onCaughtError),d.onRecoverableError!==void 0&&(L=d.onRecoverableError),d.formState!==void 0&&(Q=d.formState)),l=JR(o,1,!0,l,d??null,p,b,Q,E,N,L,uj),l.context=ej(null),d=l.current,p=Ha(),p=fe(p),b=Ei(p),b.callback=null,Ri(d,b,p),d=p,l.current.lanes=d,Jt(l,d),eo(l),o[Xe]=l.current,Yv(o),new op(l)},pf.version="19.2.1",pf}var Sj;function I9(){if(Sj)return y0.exports;Sj=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(),y0.exports=O9(),y0.exports}var M9=I9();/**
|
|
50
|
-
* react-router v7.10.1
|
|
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 KN=e=>{throw TypeError(e)},k9=(e,t,n)=>t.has(e)||KN("Cannot "+n),S0=(e,t,n)=>(k9(e,t,"read from private field"),n?n.call(e):t.get(e)),L9=(e,t,n)=>t.has(e)?KN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Cj="popstate";function P9(e={}){function t(r,s){let{pathname:i,search:c,hash:u}=r.location;return qf("",{pathname:i,search:c,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:xo(s)}return z9(t,n,null,e)}function Lt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function U9(){return Math.random().toString(36).substring(2,10)}function wj(e,t){return{usr:e.state,key:e.key,idx:t}}function qf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?gl(t):t,state:n,key:t&&t.key||r||U9()}}function xo({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 gl(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 z9(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,c=s.history,u="POP",f=null,m=y();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function y(){return(c.state||{idx:null}).idx}function g(){u="POP";let w=y(),R=w==null?null:w-m;m=w,f&&f({action:u,location:S.location,delta:R})}function x(w,R){u="PUSH";let j=qf(S.location,w,R);m=y()+1;let _=wj(j,m),O=S.createHref(j);try{c.pushState(_,"",O)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(O)}i&&f&&f({action:u,location:S.location,delta:1})}function v(w,R){u="REPLACE";let j=qf(S.location,w,R);m=y();let _=wj(j,m),O=S.createHref(j);c.replaceState(_,"",O),i&&f&&f({action:u,location:S.location,delta:0})}function C(w){return ZN(w)}let S={get action(){return u},get location(){return e(s,c)},listen(w){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(Cj,g),f=w,()=>{s.removeEventListener(Cj,g),f=null}},createHref(w){return t(s,w)},createURL:C,encodeLocation(w){let R=C(w);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:v,go(w){return c.go(w)}};return S}function ZN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Lt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:xo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Nf,Ej=class{constructor(e){if(L9(this,Nf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(S0(this,Nf).has(e))return S0(this,Nf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){S0(this,Nf).set(e,t)}};Nf=new WeakMap;var F9=new Set(["lazy","caseSensitive","path","id","index","children"]);function H9(e){return F9.has(e)}var $9=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function V9(e){return $9.has(e)}function G9(e){return e.index===!0}function Kf(e,t,n=[],r={},s=!1){return e.map((i,c)=>{let u=[...n,String(c)],f=typeof i.id=="string"?i.id:u.join("-");if(Lt(i.index!==!0||!i.children,"Cannot specify children on an index route"),Lt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),G9(i)){let m={...i,id:f};return r[f]=Rj(m,t(m)),m}else{let m={...i,id:f,children:void 0};return r[f]=Rj(m,t(m)),i.children&&(m.children=Kf(i.children,t,u,r,s)),m}})}function Rj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ki(e,t,n="/"){return Af(e,t,n,!1)}function Af(e,t,n,r){let s=typeof t=="string"?gl(t):t,i=ys(s.pathname||"/",n);if(i==null)return null;let c=YN(e);q9(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let m=r7(i);u=t7(c[f],m,r)}return u}function B9(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 YN(e,t=[],n=[],r="",s=!1){let i=(c,u,f=s,m)=>{let y={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&f)return;Lt(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let g=uo([r,y.relativePath]),x=n.concat(y);c.children&&c.children.length>0&&(Lt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),YN(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:J9(g,c.index),routesMeta:x})};return e.forEach((c,u)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))i(c,u);else for(let m of WN(c.path))i(c,u,!0,m)}),t}function WN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let c=WN(r.join("/")),u=[];return u.push(...c.map(f=>f===""?i:[i,f].join("/"))),s&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function q9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:e7(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var K9=/^:[\w-]+$/,Z9=3,Y9=2,W9=1,X9=10,Q9=-2,jj=e=>e==="*";function J9(e,t){let n=e.split("/"),r=n.length;return n.some(jj)&&(r+=Q9),t&&(r+=Y9),n.filter(s=>!jj(s)).reduce((s,i)=>s+(K9.test(i)?Z9:i===""?W9:X9),r)}function e7(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 t7(e,t,n=!1){let{routesMeta:r}=e,s={},i="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],m=u===r.length-1,y=i==="/"?t:t.slice(i.length)||"/",g=Jp({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},y),x=f.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=Jp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},y)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:uo([i,g.pathname]),pathnameBase:i7(uo([i,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(i=uo([i,g.pathnameBase]))}return c}function Jp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=n7(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],c=i.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((m,{paramName:y,isOptional:g},x)=>{if(y==="*"){let C=u[x]||"";c=i.slice(0,i.length-C.length).replace(/(.)\/+$/,"$1")}const v=u[x];return g&&!v?m[y]=void 0:m[y]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:i,pathnameBase:c,pattern:e}}function n7(e,t=!1,n=!0){Kn(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,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).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 r7(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kn(!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 ys(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 a7({basename:e,pathname:t}){return t==="/"?e:uo([e,t])}var s7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gg=e=>s7.test(e);function o7(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?gl(e):e,i;if(n)if(Gg(n))i=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Kn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?i=Tj(n.substring(1),"/"):i=Tj(n,t)}else i=t;return{pathname:i,search:l7(r),hash:c7(s)}}function Tj(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 C0(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 XN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Bg(e){let t=XN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function qg(e,t,n,r=!1){let s;typeof e=="string"?s=gl(e):(s={...e},Lt(!s.pathname||!s.pathname.includes("?"),C0("?","pathname","search",s)),Lt(!s.pathname||!s.pathname.includes("#"),C0("#","pathname","hash",s)),Lt(!s.search||!s.search.includes("#"),C0("#","search","hash",s)));let i=e===""||s.pathname==="",c=i?"/":s.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;s.pathname=x.join("/")}u=g>=0?t[g]:"/"}let f=o7(s,u),m=c&&c!=="/"&&c.endsWith("/"),y=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||y)&&(f.pathname+="/"),f}var uo=e=>e.join("/").replace(/\/\/+/g,"/"),i7=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),l7=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,c7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Kg=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 Zf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function hh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Qi=Symbol("Uninstrumented");function u7(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(i){let c=Object.keys(n);for(let u of c)i[u]&&n[u].push(i[u])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=Mu(n.lazy,t.lazy,()=>{});s&&(r.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(i=>{let c=s[i],u=n[`lazy.${i}`];if(typeof c=="function"&&u.length>0){let f=Mu(u,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[i]:f}))}})}return["loader","action"].forEach(s=>{let i=t[s];if(typeof i=="function"&&n[s].length>0){let c=i[Qi]??i,u=Mu(n[s],c,(...f)=>_j(f[0]));u&&(u[Qi]=c,r[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[Qi]??s,c=Mu(n.middleware,i,(...u)=>_j(u[0]));return c?(c[Qi]=i,c):s})),r}function d7(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(s){let i=Object.keys(s);for(let c of i)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let r=e.navigate[Qi]??e.navigate,s=Mu(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?xo(c):".",...Nj(e,u??{})}});s&&(s[Qi]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[Qi]??e.fetch,s=Mu(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...Nj(e,f??{})}});s&&(s[Qi]=r,e.fetch=s)}return e}function Mu(e,t,n){return e.length===0?null:async(...r)=>{let s=await QN(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function QN(e,t,n,r){let s=e[r],i;if(s){let c,u=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=QN(e,t,n,r-1),i=await c,Lt(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await s(u,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await u(),await c}else try{i={type:"success",value:await n()}}catch(c){i={type:"error",value:c}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function _j(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:f7(t),params:{...r},unstable_pattern:s,context:h7(n)}}function Nj(e,t){return{currentUrl:xo(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function f7(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function h7(e){if(p7(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var m7=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function p7(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===m7}var JN=["POST","PUT","PATCH","DELETE"],g7=new Set(JN),y7=["GET",...JN],x7=new Set(y7),v7=new Set([301,302,303,307,308]),b7=new Set([307,308]),w0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},S7={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},C7=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),eA="remix-router-transitions",tA=Symbol("ResetLoaderData");function w7(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";Lt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||C7,i=s;if(e.unstable_instrumentations){let K=e.unstable_instrumentations;i=ee=>({...s(ee),...u7(K.map(fe=>fe.route).filter(Boolean),ee)})}let c={},u=Kf(e.routes,i,void 0,c),f,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let y=e.dataStrategy||_7,g={...e.future},x=null,v=new Set,C=null,S=null,w=null,R=e.hydrationData!=null,j=Ki(u,e.history.location,m),_=!1,O=null,A;if(j==null&&!e.patchRoutesOnNavigation){let K=hs(404,{pathname:e.history.location.pathname}),{matches:ee,route:fe}=lp(u);A=!0,j=ee,O={[fe.id]:K}}else if(j&&!e.hydrationData&&Bt(j,u,e.history.location.pathname).active&&(j=null),j)if(j.some(K=>K.route.lazy))A=!1;else if(!j.some(K=>Bb(K.route)))A=!0;else{let K=e.hydrationData?e.hydrationData.loaderData:null,ee=e.hydrationData?e.hydrationData.errors:null;if(ee){let fe=j.findIndex(Se=>ee[Se.route.id]!==void 0);A=j.slice(0,fe+1).every(Se=>!_1(Se.route,K,ee))}else A=j.every(fe=>!_1(fe.route,K,ee))}else{A=!1,j=[];let K=Bt(null,u,e.history.location.pathname);K.active&&K.matches&&(_=!0,j=K.matches)}let D,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:A,navigation:w0,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||O,fetchers:new Map,blockers:new Map},I="POP",k=null,F=!1,G,Y=!1,B=new Map,Z=null,H=!1,M=!1,V=new Set,$=new Map,oe=0,ge=-1,P=new Map,U=new Set,z=new Map,X=new Map,W=new Set,ae=new Map,J,le=null;function ye(){if(x=e.history.listen(({action:K,location:ee,delta:fe})=>{if(J){J(),J=void 0;return}Kn(ae.size===0||fe!=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 Se=Es({currentLocation:T.location,nextLocation:ee,historyAction:K});if(Se&&fe!=null){let Ne=new Promise(Be=>{J=Be});e.history.go(fe*-1),Da(Se,{state:"blocked",location:ee,proceed(){Da(Se,{state:"proceeding",proceed:void 0,reset:void 0,location:ee}),Ne.then(()=>e.history.go(fe))},reset(){let Be=new Map(T.blockers);Be.set(Se,gf),De({blockers:Be})}}),k==null||k.resolve(),k=null;return}return zt(K,ee)}),n){G7(t,B);let K=()=>B7(t,B);t.addEventListener("pagehide",K),Z=()=>t.removeEventListener("pagehide",K)}return T.initialized||zt("POP",T.location,{initialHydration:!0}),D}function Ce(){x&&x(),Z&&Z(),v.clear(),G&&G.abort(),T.fetchers.forEach((K,ee)=>Dr(ee)),T.blockers.forEach((K,ee)=>ea(ee))}function Ve(K){return v.add(K),()=>v.delete(K)}function De(K,ee={}){K.matches&&(K.matches=K.matches.map(Ne=>{let Be=c[Ne.route.id],Fe=Ne.route;return Fe.element!==Be.element||Fe.errorElement!==Be.errorElement||Fe.hydrateFallbackElement!==Be.hydrateFallbackElement?{...Ne,route:Be}:Ne})),T={...T,...K};let fe=[],Se=[];T.fetchers.forEach((Ne,Be)=>{Ne.state==="idle"&&(W.has(Be)?fe.push(Be):Se.push(Be))}),W.forEach(Ne=>{!T.fetchers.has(Ne)&&!$.has(Ne)&&fe.push(Ne)}),[...v].forEach(Ne=>Ne(T,{deletedFetchers:fe,newErrors:K.errors??null,viewTransitionOpts:ee.viewTransitionOpts,flushSync:ee.flushSync===!0})),fe.forEach(Ne=>Dr(Ne)),Se.forEach(Ne=>T.fetchers.delete(Ne))}function et(K,ee,{flushSync:fe}={}){var at,tt;let Se=T.actionData!=null&&T.navigation.formMethod!=null&&ra(T.navigation.formMethod)&&T.navigation.state==="loading"&&((at=K.state)==null?void 0:at._isRedirect)!==!0,Ne;ee.actionData?Object.keys(ee.actionData).length>0?Ne=ee.actionData:Ne=null:Se?Ne=T.actionData:Ne=null;let Be=ee.loaderData?zj(T.loaderData,ee.loaderData,ee.matches||[],ee.errors):T.loaderData,Fe=T.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((pt,hn)=>Fe.set(hn,gf)));let ke=H?!1:Xt(K,ee.matches||T.matches),ze=F===!0||T.navigation.formMethod!=null&&ra(T.navigation.formMethod)&&((tt=K.state)==null?void 0:tt._isRedirect)!==!0;f&&(u=f,f=void 0),H||I==="POP"||(I==="PUSH"?e.history.push(K,K.state):I==="REPLACE"&&e.history.replace(K,K.state));let Xe;if(I==="POP"){let pt=B.get(T.location.pathname);pt&&pt.has(K.pathname)?Xe={currentLocation:T.location,nextLocation:K}:B.has(K.pathname)&&(Xe={currentLocation:K,nextLocation:T.location})}else if(Y){let pt=B.get(T.location.pathname);pt?pt.add(K.pathname):(pt=new Set([K.pathname]),B.set(T.location.pathname,pt)),Xe={currentLocation:T.location,nextLocation:K}}De({...ee,actionData:Ne,loaderData:Be,historyAction:I,location:K,initialized:!0,navigation:w0,revalidation:"idle",restoreScrollPosition:ke,preventScrollReset:ze,blockers:Fe},{viewTransitionOpts:Xe,flushSync:fe===!0}),I="POP",F=!1,Y=!1,H=!1,M=!1,k==null||k.resolve(),k=null,le==null||le.resolve(),le=null}async function rt(K,ee){if(k==null||k.resolve(),k=null,typeof K=="number"){k||(k=Vj());let hn=k.promise;return e.history.go(K),hn}let fe=T1(T.location,T.matches,m,K,ee==null?void 0:ee.fromRouteId,ee==null?void 0:ee.relative),{path:Se,submission:Ne,error:Be}=Aj(!1,fe,ee),Fe=T.location,ke=qf(T.location,Se,ee&&ee.state);ke={...ke,...e.history.encodeLocation(ke)};let ze=ee&&ee.replace!=null?ee.replace:void 0,Xe="PUSH";ze===!0?Xe="REPLACE":ze===!1||Ne!=null&&ra(Ne.formMethod)&&Ne.formAction===T.location.pathname+T.location.search&&(Xe="REPLACE");let at=ee&&"preventScrollReset"in ee?ee.preventScrollReset===!0:void 0,tt=(ee&&ee.flushSync)===!0,pt=Es({currentLocation:Fe,nextLocation:ke,historyAction:Xe});if(pt){Da(pt,{state:"blocked",location:ke,proceed(){Da(pt,{state:"proceeding",proceed:void 0,reset:void 0,location:ke}),rt(K,ee)},reset(){let hn=new Map(T.blockers);hn.set(pt,gf),De({blockers:hn})}});return}await zt(Xe,ke,{submission:Ne,pendingError:Be,preventScrollReset:at,replace:ee&&ee.replace,enableViewTransition:ee&&ee.viewTransition,flushSync:tt})}function dn(){le||(le=Vj()),mt(),De({revalidation:"loading"});let K=le.promise;return T.navigation.state==="submitting"?K:T.navigation.state==="idle"?(zt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),K):(zt(I||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:Y===!0}),K)}async function zt(K,ee,fe){G&&G.abort(),G=null,I=K,H=(fe&&fe.startUninterruptedRevalidation)===!0,Gt(T.location,T.matches),F=(fe&&fe.preventScrollReset)===!0,Y=(fe&&fe.enableViewTransition)===!0;let Se=f||u,Ne=fe&&fe.overrideNavigation,Be=fe!=null&&fe.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Ki(Se,ee,m),Fe=(fe&&fe.flushSync)===!0;if(Be&&T.initialized&&!M&&L7(T.location,ee)&&!(fe&&fe.submission&&ra(fe.submission.formMethod))){et(ee,{matches:Be},{flushSync:Fe});return}let ke=Bt(Be,Se,ee.pathname);if(ke.active&&ke.matches&&(Be=ke.matches),!Be){let{error:Zn,notFoundMatches:an,route:sn}=wn(ee.pathname);et(ee,{matches:an,loaderData:{},errors:{[sn.id]:Zn}},{flushSync:Fe});return}G=new AbortController;let ze=ju(e.history,ee,G.signal,fe&&fe.submission),Xe=e.getContext?await e.getContext():new Ej,at;if(fe&&fe.pendingError)at=[Zi(Be).route.id,{type:"error",error:fe.pendingError}];else if(fe&&fe.submission&&ra(fe.submission.formMethod)){let Zn=await On(ze,ee,fe.submission,Be,Xe,ke.active,fe&&fe.initialHydration===!0,{replace:fe.replace,flushSync:Fe});if(Zn.shortCircuited)return;if(Zn.pendingActionResult){let[an,sn]=Zn.pendingActionResult;if(Va(sn)&&Zf(sn.error)&&sn.error.status===404){G=null,et(ee,{matches:Zn.matches,loaderData:{},errors:{[an]:sn.error}});return}}Be=Zn.matches||Be,at=Zn.pendingActionResult,Ne=E0(ee,fe.submission),Fe=!1,ke.active=!1,ze=ju(e.history,ze.url,ze.signal)}let{shortCircuited:tt,matches:pt,loaderData:hn,errors:Ln}=await yn(ze,ee,Be,Xe,ke.active,Ne,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,Fe,at);tt||(G=null,et(ee,{matches:pt||Be,...Fj(at),loaderData:hn,errors:Ln}))}async function On(K,ee,fe,Se,Ne,Be,Fe,ke={}){mt();let ze=$7(ee,fe);if(De({navigation:ze},{flushSync:ke.flushSync===!0}),Be){let tt=await Vn(Se,ee.pathname,K.signal);if(tt.type==="aborted")return{shortCircuited:!0};if(tt.type==="error"){if(tt.partialMatches.length===0){let{matches:hn,route:Ln}=lp(u);return{matches:hn,pendingActionResult:[Ln.id,{type:"error",error:tt.error}]}}let pt=Zi(tt.partialMatches).route.id;return{matches:tt.partialMatches,pendingActionResult:[pt,{type:"error",error:tt.error}]}}else if(tt.matches)Se=tt.matches;else{let{notFoundMatches:pt,error:hn,route:Ln}=wn(ee.pathname);return{matches:pt,pendingActionResult:[Ln.id,{type:"error",error:hn}]}}}let Xe,at=zp(Se,ee);if(!at.route.action&&!at.route.lazy)Xe={type:"error",error:hs(405,{method:K.method,pathname:ee.pathname,routeId:at.route.id})};else{let tt=Pu(i,c,K,Se,at,Fe?[]:r,Ne),pt=await je(K,tt,Ne,null);if(Xe=pt[at.route.id],!Xe){for(let hn of Se)if(pt[hn.route.id]){Xe=pt[hn.route.id];break}}if(K.signal.aborted)return{shortCircuited:!0}}if(nc(Xe)){let tt;return ke&&ke.replace!=null?tt=ke.replace:tt=Lj(Xe.response.headers.get("Location"),new URL(K.url),m)===T.location.pathname+T.location.search,await Ee(K,Xe,!0,{submission:fe,replace:tt}),{shortCircuited:!0}}if(Va(Xe)){let tt=Zi(Se,at.route.id);return(ke&&ke.replace)!==!0&&(I="PUSH"),{matches:Se,pendingActionResult:[tt.route.id,Xe,at.route.id]}}return{matches:Se,pendingActionResult:[at.route.id,Xe]}}async function yn(K,ee,fe,Se,Ne,Be,Fe,ke,ze,Xe,at,tt){let pt=Be||E0(ee,Fe),hn=Fe||ke||$j(pt),Ln=!H&&!Xe;if(Ne){if(Ln){let jr=Me(tt);De({navigation:pt,...jr!==void 0?{actionData:jr}:{}},{flushSync:at})}let Ft=await Vn(fe,ee.pathname,K.signal);if(Ft.type==="aborted")return{shortCircuited:!0};if(Ft.type==="error"){if(Ft.partialMatches.length===0){let{matches:Rs,route:rs}=lp(u);return{matches:Rs,loaderData:{},errors:{[rs.id]:Ft.error}}}let jr=Zi(Ft.partialMatches).route.id;return{matches:Ft.partialMatches,loaderData:{},errors:{[jr]:Ft.error}}}else if(Ft.matches)fe=Ft.matches;else{let{error:jr,notFoundMatches:Rs,route:rs}=wn(ee.pathname);return{matches:Rs,loaderData:{},errors:{[rs.id]:jr}}}}let Zn=f||u,{dsMatches:an,revalidatingFetchers:sn}=Dj(K,Se,i,c,e.history,T,fe,hn,ee,Xe?[]:r,Xe===!0,M,V,W,z,U,Zn,m,e.patchRoutesOnNavigation!=null,tt);if(ge=++oe,!e.dataStrategy&&!an.some(Ft=>Ft.shouldLoad)&&!an.some(Ft=>Ft.route.middleware&&Ft.route.middleware.length>0)&&sn.length===0){let Ft=kn();return et(ee,{matches:fe,loaderData:{},errors:tt&&Va(tt[1])?{[tt[0]]:tt[1].error}:null,...Fj(tt),...Ft?{fetchers:new Map(T.fetchers)}:{}},{flushSync:at}),{shortCircuited:!0}}if(Ln){let Ft={};if(!Ne){Ft.navigation=pt;let jr=Me(tt);jr!==void 0&&(Ft.actionData=jr)}sn.length>0&&(Ft.fetchers=q(sn)),De(Ft,{flushSync:at})}sn.forEach(Ft=>{fn(Ft.key),Ft.controller&&$.set(Ft.key,Ft.controller)});let Oa=()=>sn.forEach(Ft=>fn(Ft.key));G&&G.signal.addEventListener("abort",Oa);let{loaderResults:ns,fetcherResults:Nn}=await He(an,sn,K,Se);if(K.signal.aborted)return{shortCircuited:!0};G&&G.signal.removeEventListener("abort",Oa),sn.forEach(Ft=>$.delete(Ft.key));let Ia=cp(ns);if(Ia)return await Ee(K,Ia.result,!0,{replace:ze}),{shortCircuited:!0};if(Ia=cp(Nn),Ia)return U.add(Ia.key),await Ee(K,Ia.result,!0,{replace:ze}),{shortCircuited:!0};let{loaderData:Lc,errors:Ma}=Uj(T,fe,ns,tt,sn,Nn);Xe&&T.errors&&(Ma={...T.errors,...Ma});let pa=kn(),Pc=Ws(ge),Ml=pa||Pc||sn.length>0;return{matches:fe,loaderData:Lc,errors:Ma,...Ml?{fetchers:new Map(T.fetchers)}:{}}}function Me(K){if(K&&!Va(K[1]))return{[K[0]]:K[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function q(K){return K.forEach(ee=>{let fe=T.fetchers.get(ee.key),Se=yf(void 0,fe?fe.data:void 0);T.fetchers.set(ee.key,Se)}),new Map(T.fetchers)}async function ne(K,ee,fe,Se){fn(K);let Ne=(Se&&Se.flushSync)===!0,Be=f||u,Fe=T1(T.location,T.matches,m,fe,ee,Se==null?void 0:Se.relative),ke=Ki(Be,Fe,m),ze=Bt(ke,Be,Fe);if(ze.active&&ze.matches&&(ke=ze.matches),!ke){Wt(K,ee,hs(404,{pathname:Fe}),{flushSync:Ne});return}let{path:Xe,submission:at,error:tt}=Aj(!0,Fe,Se);if(tt){Wt(K,ee,tt,{flushSync:Ne});return}let pt=e.getContext?await e.getContext():new Ej,hn=(Se&&Se.preventScrollReset)===!0;if(at&&ra(at.formMethod)){await ce(K,ee,Xe,ke,pt,ze.active,Ne,hn,at);return}z.set(K,{routeId:ee,path:Xe}),await Oe(K,ee,Xe,ke,pt,ze.active,Ne,hn,at)}async function ce(K,ee,fe,Se,Ne,Be,Fe,ke,ze){mt(),z.delete(K);let Xe=T.fetchers.get(K);st(K,V7(ze,Xe),{flushSync:Fe});let at=new AbortController,tt=ju(e.history,fe,at.signal,ze);if(Be){let on=await Vn(Se,new URL(tt.url).pathname,tt.signal,K);if(on.type==="aborted")return;if(on.type==="error"){Wt(K,ee,on.error,{flushSync:Fe});return}else if(on.matches)Se=on.matches;else{Wt(K,ee,hs(404,{pathname:fe}),{flushSync:Fe});return}}let pt=zp(Se,fe);if(!pt.route.action&&!pt.route.lazy){let on=hs(405,{method:ze.formMethod,pathname:fe,routeId:ee});Wt(K,ee,on,{flushSync:Fe});return}$.set(K,at);let hn=oe,Ln=Pu(i,c,tt,Se,pt,r,Ne),Zn=await je(tt,Ln,Ne,K),an=Zn[pt.route.id];if(!an){for(let on of Ln)if(Zn[on.route.id]){an=Zn[on.route.id];break}}if(tt.signal.aborted){$.get(K)===at&&$.delete(K);return}if(W.has(K)){if(nc(an)||Va(an)){st(K,qo(void 0));return}}else{if(nc(an))if($.delete(K),ge>hn){st(K,qo(void 0));return}else return U.add(K),st(K,yf(ze)),Ee(tt,an,!1,{fetcherSubmission:ze,preventScrollReset:ke});if(Va(an)){Wt(K,ee,an.error);return}}let sn=T.navigation.location||T.location,Oa=ju(e.history,sn,at.signal),ns=f||u,Nn=T.navigation.state!=="idle"?Ki(ns,T.navigation.location,m):T.matches;Lt(Nn,"Didn't find any matches after fetcher action");let Ia=++oe;P.set(K,Ia);let Lc=yf(ze,an.data);T.fetchers.set(K,Lc);let{dsMatches:Ma,revalidatingFetchers:pa}=Dj(Oa,Ne,i,c,e.history,T,Nn,ze,sn,r,!1,M,V,W,z,U,ns,m,e.patchRoutesOnNavigation!=null,[pt.route.id,an]);pa.filter(on=>on.key!==K).forEach(on=>{let Or=on.key,Rd=T.fetchers.get(Or),ix=yf(void 0,Rd?Rd.data:void 0);T.fetchers.set(Or,ix),fn(Or),on.controller&&$.set(Or,on.controller)}),De({fetchers:new Map(T.fetchers)});let Pc=()=>pa.forEach(on=>fn(on.key));at.signal.addEventListener("abort",Pc);let{loaderResults:Ml,fetcherResults:Ft}=await He(Ma,pa,Oa,Ne);if(at.signal.aborted)return;if(at.signal.removeEventListener("abort",Pc),P.delete(K),$.delete(K),pa.forEach(on=>$.delete(on.key)),T.fetchers.has(K)){let on=qo(an.data);T.fetchers.set(K,on)}let jr=cp(Ml);if(jr)return Ee(Oa,jr.result,!1,{preventScrollReset:ke});if(jr=cp(Ft),jr)return U.add(jr.key),Ee(Oa,jr.result,!1,{preventScrollReset:ke});let{loaderData:Rs,errors:rs}=Uj(T,Nn,Ml,void 0,pa,Ft);Ws(Ia),T.navigation.state==="loading"&&Ia>ge?(Lt(I,"Expected pending action"),G&&G.abort(),et(T.navigation.location,{matches:Nn,loaderData:Rs,errors:rs,fetchers:new Map(T.fetchers)})):(De({errors:rs,loaderData:zj(T.loaderData,Rs,Nn,rs),fetchers:new Map(T.fetchers)}),M=!1)}async function Oe(K,ee,fe,Se,Ne,Be,Fe,ke,ze){let Xe=T.fetchers.get(K);st(K,yf(ze,Xe?Xe.data:void 0),{flushSync:Fe});let at=new AbortController,tt=ju(e.history,fe,at.signal);if(Be){let sn=await Vn(Se,new URL(tt.url).pathname,tt.signal,K);if(sn.type==="aborted")return;if(sn.type==="error"){Wt(K,ee,sn.error,{flushSync:Fe});return}else if(sn.matches)Se=sn.matches;else{Wt(K,ee,hs(404,{pathname:fe}),{flushSync:Fe});return}}let pt=zp(Se,fe);$.set(K,at);let hn=oe,Ln=Pu(i,c,tt,Se,pt,r,Ne),an=(await je(tt,Ln,Ne,K))[pt.route.id];if($.get(K)===at&&$.delete(K),!tt.signal.aborted){if(W.has(K)){st(K,qo(void 0));return}if(nc(an))if(ge>hn){st(K,qo(void 0));return}else{U.add(K),await Ee(tt,an,!1,{preventScrollReset:ke});return}if(Va(an)){Wt(K,ee,an.error);return}st(K,qo(an.data))}}async function Ee(K,ee,fe,{submission:Se,fetcherSubmission:Ne,preventScrollReset:Be,replace:Fe}={}){fe||(k==null||k.resolve(),k=null),ee.response.headers.has("X-Remix-Revalidate")&&(M=!0);let ke=ee.response.headers.get("Location");Lt(ke,"Expected a Location header on the redirect Response"),ke=Lj(ke,new URL(K.url),m);let ze=qf(T.location,ke,{_isRedirect:!0});if(n){let Ln=!1;if(ee.response.headers.has("X-Remix-Reload-Document"))Ln=!0;else if(Gg(ke)){const Zn=ZN(ke,!0);Ln=Zn.origin!==t.location.origin||ys(Zn.pathname,m)==null}if(Ln){Fe?t.location.replace(ke):t.location.assign(ke);return}}G=null;let Xe=Fe===!0||ee.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:at,formAction:tt,formEncType:pt}=T.navigation;!Se&&!Ne&&at&&tt&&pt&&(Se=$j(T.navigation));let hn=Se||Ne;if(b7.has(ee.response.status)&&hn&&ra(hn.formMethod))await zt(Xe,ze,{submission:{...hn,formAction:ke},preventScrollReset:Be||F,enableViewTransition:fe?Y:void 0});else{let Ln=E0(ze,Se);await zt(Xe,ze,{overrideNavigation:Ln,fetcherSubmission:Ne,preventScrollReset:Be||F,enableViewTransition:fe?Y:void 0})}}async function je(K,ee,fe,Se){let Ne,Be={};try{Ne=await A7(y,K,ee,Se,fe,!1)}catch(Fe){return ee.filter(ke=>ke.shouldLoad).forEach(ke=>{Be[ke.route.id]={type:"error",error:Fe}}),Be}if(K.signal.aborted)return Be;for(let[Fe,ke]of Object.entries(Ne))if(F7(ke)){let ze=ke.result;Be[Fe]={type:"redirect",response:M7(ze,K,Fe,ee,m)}}else Be[Fe]=await I7(ke);return Be}async function He(K,ee,fe,Se){let Ne=je(fe,K,Se,null),Be=Promise.all(ee.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let at=(await je(ze.request,ze.matches,Se,ze.key))[ze.match.route.id];return{[ze.key]:at}}else return Promise.resolve({[ze.key]:{type:"error",error:hs(404,{pathname:ze.path})}})})),Fe=await Ne,ke=(await Be).reduce((ze,Xe)=>Object.assign(ze,Xe),{});return{loaderResults:Fe,fetcherResults:ke}}function mt(){M=!0,z.forEach((K,ee)=>{$.has(ee)&&V.add(ee),fn(ee)})}function st(K,ee,fe={}){T.fetchers.set(K,ee),De({fetchers:new Map(T.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function Wt(K,ee,fe,Se={}){let Ne=Zi(T.matches,ee);Dr(K),De({errors:{[Ne.route.id]:fe},fetchers:new Map(T.fetchers)},{flushSync:(Se&&Se.flushSync)===!0})}function sr(K){return X.set(K,(X.get(K)||0)+1),W.has(K)&&W.delete(K),T.fetchers.get(K)||S7}function $n(K,ee){fn(K,ee==null?void 0:ee.reason),st(K,qo(null))}function Dr(K){let ee=T.fetchers.get(K);$.has(K)&&!(ee&&ee.state==="loading"&&P.has(K))&&fn(K),z.delete(K),P.delete(K),U.delete(K),W.delete(K),V.delete(K),T.fetchers.delete(K)}function Jr(K){let ee=(X.get(K)||0)-1;ee<=0?(X.delete(K),W.add(K)):X.set(K,ee),De({fetchers:new Map(T.fetchers)})}function fn(K,ee){let fe=$.get(K);fe&&(fe.abort(ee),$.delete(K))}function or(K){for(let ee of K){let fe=sr(ee),Se=qo(fe.data);T.fetchers.set(ee,Se)}}function kn(){let K=[],ee=!1;for(let fe of U){let Se=T.fetchers.get(fe);Lt(Se,`Expected fetcher: ${fe}`),Se.state==="loading"&&(U.delete(fe),K.push(fe),ee=!0)}return or(K),ee}function Ws(K){let ee=[];for(let[fe,Se]of P)if(Se<K){let Ne=T.fetchers.get(fe);Lt(Ne,`Expected fetcher: ${fe}`),Ne.state==="loading"&&(fn(fe),P.delete(fe),ee.push(fe))}return or(ee),ee.length>0}function Aa(K,ee){let fe=T.blockers.get(K)||gf;return ae.get(K)!==ee&&ae.set(K,ee),fe}function ea(K){T.blockers.delete(K),ae.delete(K)}function Da(K,ee){let fe=T.blockers.get(K)||gf;Lt(fe.state==="unblocked"&&ee.state==="blocked"||fe.state==="blocked"&&ee.state==="blocked"||fe.state==="blocked"&&ee.state==="proceeding"||fe.state==="blocked"&&ee.state==="unblocked"||fe.state==="proceeding"&&ee.state==="unblocked",`Invalid blocker state transition: ${fe.state} -> ${ee.state}`);let Se=new Map(T.blockers);Se.set(K,ee),De({blockers:Se})}function Es({currentLocation:K,nextLocation:ee,historyAction:fe}){if(ae.size===0)return;ae.size>1&&Kn(!1,"A router only supports one blocker at a time");let Se=Array.from(ae.entries()),[Ne,Be]=Se[Se.length-1],Fe=T.blockers.get(Ne);if(!(Fe&&Fe.state==="proceeding")&&Be({currentLocation:K,nextLocation:ee,historyAction:fe}))return Ne}function wn(K){let ee=hs(404,{pathname:K}),fe=f||u,{matches:Se,route:Ne}=lp(fe);return{notFoundMatches:Se,route:Ne,error:ee}}function In(K,ee,fe){if(C=K,w=ee,S=fe||null,!R&&T.navigation===w0){R=!0;let Se=Xt(T.location,T.matches);Se!=null&&De({restoreScrollPosition:Se})}return()=>{C=null,w=null,S=null}}function Ye(K,ee){return S&&S(K,ee.map(Se=>B9(Se,T.loaderData)))||K.key}function Gt(K,ee){if(C&&w){let fe=Ye(K,ee);C[fe]=w()}}function Xt(K,ee){if(C){let fe=Ye(K,ee),Se=C[fe];if(typeof Se=="number")return Se}return null}function Bt(K,ee,fe){if(e.patchRoutesOnNavigation)if(K){if(Object.keys(K[0].params).length>0)return{active:!0,matches:Af(ee,fe,m,!0)}}else return{active:!0,matches:Af(ee,fe,m,!0)||[]};return{active:!1,matches:null}}async function Vn(K,ee,fe,Se){if(!e.patchRoutesOnNavigation)return{type:"success",matches:K};let Ne=K;for(;;){let Be=f==null,Fe=f||u,ke=c;try{await e.patchRoutesOnNavigation({signal:fe,path:ee,matches:Ne,fetcherKey:Se,patch:(at,tt)=>{fe.aborted||Oj(at,tt,Fe,ke,i,!1)}})}catch(at){return{type:"error",error:at,partialMatches:Ne}}finally{Be&&!fe.aborted&&(u=[...u])}if(fe.aborted)return{type:"aborted"};let ze=Ki(Fe,ee,m),Xe=null;if(ze){if(Object.keys(ze[0].params).length===0)return{type:"success",matches:ze};if(Xe=Af(Fe,ee,m,!0),!(Xe&&Ne.length<Xe.length&&Jt(Ne,Xe.slice(0,Ne.length))))return{type:"success",matches:ze}}if(Xe||(Xe=Af(Fe,ee,m,!0)),!Xe||Jt(Ne,Xe))return{type:"success",matches:null};Ne=Xe}}function Jt(K,ee){return K.length===ee.length&&K.every((fe,Se)=>fe.route.id===ee[Se].route.id)}function Qt(K){c={},f=Kf(K,i,void 0,c)}function Rr(K,ee,fe=!1){let Se=f==null;Oj(K,ee,f||u,c,i,fe),Se&&(u=[...u],De({}))}return D={get basename(){return m},get future(){return g},get state(){return T},get routes(){return u},get window(){return t},initialize:ye,subscribe:Ve,enableScrollRestoration:In,navigate:rt,fetch:ne,revalidate:dn,createHref:K=>e.history.createHref(K),encodeLocation:K=>e.history.encodeLocation(K),getFetcher:sr,resetFetcher:$n,deleteFetcher:Jr,dispose:Ce,getBlocker:Aa,deleteBlocker:ea,patchRoutes:Rr,_internalFetchControllers:$,_internalSetRoutes:Qt,_internalSetStateDoNotUseOrYouWillBreakYourApp(K){De(K)}},e.unstable_instrumentations&&(D=d7(D,e.unstable_instrumentations.map(K=>K.router).filter(Boolean))),D}function E7(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function T1(e,t,n,r,s,i){let c,u;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){u=m;break}}else c=t,u=t[t.length-1];let f=qg(r||".",Bg(c),ys(e.pathname,n)||e.pathname,i==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let m=qb(f.search);if(u.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&m){let y=new URLSearchParams(f.search),g=y.getAll("index");y.delete("index"),g.filter(v=>v).forEach(v=>y.append("index",v));let x=y.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=a7({basename:n,pathname:f.pathname})),xo(f)}function Aj(e,t,n){if(!n||!E7(n))return{path:t};if(n.formMethod&&!H7(n.formMethod))return{path:t,error:hs(405,{method:n.formMethod})};let r=()=>({path:t,error:hs(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=iA(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ra(i))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[v,C])=>`${x}${v}=${C}
|
|
59
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!ra(i))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}Lt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=A1(n.formData),f=n.formData;else if(n.body instanceof FormData)u=A1(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=Pj(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=Pj(u)}catch{return r()}let m={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(ra(m.formMethod))return{path:t,submission:m};let y=gl(t);return e&&y.search&&qb(y.search)&&u.append("index",""),y.search=`?${u}`,{path:xo(y),submission:m}}function Dj(e,t,n,r,s,i,c,u,f,m,y,g,x,v,C,S,w,R,j,_){var Z;let O=_?Va(_[1])?_[1].error:_[1].data:void 0,A=s.createURL(i.location),D=s.createURL(f),T;if(y&&i.errors){let H=Object.keys(i.errors)[0];T=c.findIndex(M=>M.route.id===H)}else if(_&&Va(_[1])){let H=_[0];T=c.findIndex(M=>M.route.id===H)-1}let I=_?_[1].statusCode:void 0,k=I&&I>=400,F={currentUrl:A,currentParams:((Z=i.matches[0])==null?void 0:Z.params)||{},nextUrl:D,nextParams:c[0].params,...u,actionResult:O,actionStatus:I},G=hh(c),Y=c.map((H,M)=>{let{route:V}=H,$=null;if(T!=null&&M>T?$=!1:V.lazy?$=!0:Bb(V)?y?$=_1(V,i.loaderData,i.errors):R7(i.loaderData,i.matches[M],H)&&($=!0):$=!1,$!==null)return N1(n,r,e,G,H,m,t,$);let oe=k?!1:g||A.pathname+A.search===D.pathname+D.search||A.search!==D.search||j7(i.matches[M],H),ge={...F,defaultShouldRevalidate:oe},P=eg(H,ge);return N1(n,r,e,G,H,m,t,P,ge)}),B=[];return C.forEach((H,M)=>{if(y||!c.some(X=>X.route.id===H.routeId)||v.has(M))return;let V=i.fetchers.get(M),$=V&&V.state!=="idle"&&V.data===void 0,oe=Ki(w,H.path,R);if(!oe){if(j&&$)return;B.push({key:M,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(S.has(M))return;let ge=zp(oe,H.path),P=new AbortController,U=ju(s,H.path,P.signal),z=null;if(x.has(M))x.delete(M),z=Pu(n,r,U,oe,ge,m,t);else if($)g&&(z=Pu(n,r,U,oe,ge,m,t));else{let X={...F,defaultShouldRevalidate:k?!1:g};eg(ge,X)&&(z=Pu(n,r,U,oe,ge,m,t,X))}z&&B.push({key:M,routeId:H.routeId,path:H.path,matches:z,match:ge,request:U,controller:P})}),{dsMatches:Y,revalidatingFetchers:B}}function Bb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function _1(e,t,n){if(e.lazy)return!0;if(!Bb(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 R7(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function j7(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function eg(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Oj(e,t,n,r,s,i){let c;if(e){let m=r[e];Lt(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let u=[],f=[];if(t.forEach(m=>{let y=c.find(g=>nA(m,g));y?f.push({existingRoute:y,newRoute:m}):u.push(m)}),u.length>0){let m=Kf(u,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...m)}if(i&&f.length>0)for(let m=0;m<f.length;m++){let{existingRoute:y,newRoute:g}=f[m],x=y,[v]=Kf([g],s,[],{},!0);Object.assign(x,{element:v.element?v.element:x.element,errorElement:v.errorElement?v.errorElement:x.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:x.hydrateFallbackElement})}}function nA(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var s;return(s=t.children)==null?void 0:s.some(i=>nA(n,i))}):!1}var Ij=new WeakMap,rA=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(Lt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let c=Ij.get(s);c||(c={},Ij.set(s,c));let u=c[e];if(u)return u;let f=(async()=>{let m=H9(e),g=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)Kn(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Kn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await i();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]=f,f},Mj=new WeakMap;function T7(e,t,n,r,s){let i=n[e.id];if(Lt(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=Mj.get(i);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let g=(async()=>{Lt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),v={};for(let C in x){let S=x[C];if(S===void 0)continue;let w=V9(C),j=i[C]!==void 0&&C!=="hasErrorBoundary";w?Kn(!w,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?Kn(!j,`Route "${i.id}" has a static property "${C}" defined but its lazy function is also returning a value for this property. The lazy route property "${C}" will be ignored.`):v[C]=S}Object.assign(i,v),Object.assign(i,{...r(i),lazy:void 0})})();return Mj.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let y of c){if(s&&s.includes(y))continue;let g=rA({key:y,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),y===t&&(f=g))}let m=u.length>0?Promise.all(u).then(()=>{}):void 0;return m==null||m.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:f}}async function kj(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,i)=>{n[t[i].route.id]=s}),n}async function _7(e){return e.matches.some(t=>t.route.middleware)?aA(e,()=>kj(e)):kj(e)}function aA(e,t){return N7(e,t,r=>r,U7,n);function n(r,s,i){if(i)return Promise.resolve(Object.assign(i.value,{[s]:{type:"error",result:r}}));{let{matches:c}=e,u=Math.min(Math.max(c.findIndex(m=>m.route.id===s),0),Math.max(c.findIndex(m=>m.shouldCallHandler()),0)),f=Zi(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function N7(e,t,n,r,s){let{matches:i,request:c,params:u,context:f,unstable_pattern:m}=e,y=i.flatMap(x=>x.route.middleware?x.route.middleware.map(v=>[x.route.id,v]):[]);return await sA({request:c,params:u,context:f,unstable_pattern:m},y,t,n,r,s)}async function sA(e,t,n,r,s,i,c=0){let{request:u}=e;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let f=t[c];if(!f)return await n();let[m,y]=f,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await sA(e,t,n,r,s,i,c+1)},g.value}catch(v){return g={value:await i(v,m,g)},g.value}};try{let v=await y(e,x),C=v!=null?r(v):void 0;return s(C)?C:g?C??g.value:(g={value:await x()},g.value)}catch(v){return await i(v,m,g)}}function oA(e,t,n,r,s){let i=rA({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=T7(r.route,ra(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function N1(e,t,n,r,s,i,c,u,f=null){let m=!1,y=oA(e,t,n,s,i);return{...s,_lazyPromises:y,shouldLoad:u,shouldRevalidateArgs:f,shouldCallHandler(g){return m=!0,f?typeof g=="boolean"?eg(s,{...f,defaultShouldRevalidate:g}):eg(s,f):u},resolve(g){let{lazy:x,loader:v,middleware:C}=s.route,S=m||u||g&&!ra(n.method)&&(x||v),w=C&&C.length>0&&!v&&!x;return S&&(ra(n.method)||!w)?D7({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:y==null?void 0:y.handler,lazyRoutePromise:y==null?void 0:y.route,handlerOverride:g,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function Pu(e,t,n,r,s,i,c,u=null){return r.map(f=>f.route.id!==s.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:u,shouldCallHandler:()=>!1,_lazyPromises:oA(e,t,n,f,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:N1(e,t,n,hh(r),f,i,c,!0,u))}async function A7(e,t,n,r,s,i){n.some(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware})&&await Promise.all(n.map(m=>{var y;return(y=m._lazyPromises)==null?void 0:y.middleware}));let c={request:t,unstable_pattern:hh(n),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let y=c;return aA(y,()=>m({...y,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var y,g;return[(y=m._lazyPromises)==null?void 0:y.handler,(g=m._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function D7({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let u,f,m=ra(e.method),y=m?"action":"loader",g=x=>{let v,C=new Promise((R,j)=>v=j);f=()=>v(),e.signal.addEventListener("abort",f);let S=R=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${n.route.id}]`)):x({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),w=(async()=>{try{return{type:"data",result:await(i?i(j=>S(j)):S())}}catch(R){return{type:"error",result:R}}})();return Promise.race([w,C])};try{let x=m?n.route.action:n.route.loader;if(r||s)if(x){let v,[C]=await Promise.all([g(x).catch(S=>{v=S}),r,s]);if(v!==void 0)throw v;u=C}else{await r;let v=m?n.route.action:n.route.loader;if(v)[u]=await Promise.all([g(v),s]);else if(y==="action"){let C=new URL(e.url),S=C.pathname+C.search;throw hs(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(x)u=await g(x);else{let v=new URL(e.url),C=v.pathname+v.search;throw hs(404,{pathname:C})}}catch(x){return{type:"error",result:x}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function O7(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 I7(e){var r,s,i,c,u;let{result:t,type:n}=e;if(lA(t)){let f;try{f=await O7(t)}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Kg(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?Hj(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:P7(t),statusCode:Zf(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Zf(t)?t.status:void 0}:Hj(t)?{type:"data",data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function M7(e,t,n,r,s){let i=e.headers.get("Location");if(Lt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Gg(i)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=T1(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function Lj(e,t,n){if(Gg(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=ys(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function ju(e,t,n,r){let s=e.createURL(iA(t)).toString(),i={signal:n};if(r&&ra(r.formMethod)){let{formMethod:c,formEncType:u}=r;i.method=c.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=A1(r.formData):i.body=r.formData}return new Request(s,i)}function A1(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Pj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function k7(e,t,n,r=!1,s=!1){let i={},c=null,u,f=!1,m={},y=n&&Va(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let x=g.route.id,v=t[x];if(Lt(!nc(v),"Cannot handle redirect results in processLoaderData"),Va(v)){let C=v.error;if(y!==void 0&&(C=y,y=void 0),c=c||{},s)c[x]=C;else{let S=Zi(e,x);c[S.route.id]==null&&(c[S.route.id]=C)}r||(i[x]=tA),f||(f=!0,u=Zf(v.error)?v.error.status:500),v.headers&&(m[x]=v.headers)}else i[x]=v.data,v.statusCode&&v.statusCode!==200&&!f&&(u=v.statusCode),v.headers&&(m[x]=v.headers)}),y!==void 0&&n&&(c={[n[0]]:y},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:u||200,loaderHeaders:m}}function Uj(e,t,n,r,s,i){let{loaderData:c,errors:u}=k7(t,n,r);return s.filter(f=>!f.matches||f.matches.some(m=>m.shouldLoad)).forEach(f=>{let{key:m,match:y,controller:g}=f;if(g&&g.signal.aborted)return;let x=i[m];if(Lt(x,"Did not find corresponding fetcher result"),Va(x)){let v=Zi(e.matches,y==null?void 0:y.route.id);u&&u[v.route.id]||(u={...u,[v.route.id]:x.error}),e.fetchers.delete(m)}else if(nc(x))Lt(!1,"Unhandled fetcher revalidation redirect");else{let v=qo(x.data);e.fetchers.set(m,v)}}),{loaderData:c,errors:u}}function zj(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==tA).reduce((i,[c,u])=>(i[c]=u,i),{});for(let i of n){let c=i.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&i.route.loader&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function Fj(e){return e?Va(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Zi(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 lp(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 hs(e,{pathname:t,routeId:n,method:r,type:s,message:i}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`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"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`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&&(u=`Invalid request method "${r.toUpperCase()}"`)),new Kg(e||500,c,new Error(u),!0)}function cp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(nc(s))return{key:r,result:s}}}function iA(e){let t=typeof e=="string"?gl(e):e;return xo({...t,hash:""})}function L7(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function P7(e){var t,n;return new Kg(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function U7(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&z7(n))}function z7(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function F7(e){return lA(e.result)&&v7.has(e.result.status)}function Va(e){return e.type==="error"}function nc(e){return(e&&e.type)==="redirect"}function Hj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function lA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function H7(e){return x7.has(e.toUpperCase())}function ra(e){return g7.has(e.toUpperCase())}function qb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function zp(e,t){let n=typeof t=="string"?gl(t).search:t.search;if(e[e.length-1].route.index&&qb(n||""))return e[e.length-1];let r=XN(e);return r[r.length-1]}function $j(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:i,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(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,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 E0(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 $7(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 yf(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 V7(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 qo(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 G7(e,t){try{let n=e.sessionStorage.getItem(eA);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function B7(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(eA,JSON.stringify(n))}catch(r){Kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function Vj(){let e,t,n=new Promise((r,s)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{s(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Cc=h.createContext(null);Cc.displayName="DataRouter";var mh=h.createContext(null);mh.displayName="DataRouterState";h.createContext(!1);var Kb=h.createContext({isTransitioning:!1});Kb.displayName="ViewTransition";var cA=h.createContext(new Map);cA.displayName="Fetchers";var q7=h.createContext(null);q7.displayName="Await";var xs=h.createContext(null);xs.displayName="Navigation";var Zg=h.createContext(null);Zg.displayName="Location";var vs=h.createContext({outlet:null,matches:[],isDataRoute:!1});vs.displayName="Route";var Zb=h.createContext(null);Zb.displayName="RouteError";function K7(e,{relative:t}={}){Lt(sd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(xs),{hash:s,pathname:i,search:c}=ph(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:uo([n,i])),r.createHref({pathname:u,search:c,hash:s})}function sd(){return h.useContext(Zg)!=null}function Bs(){return Lt(sd(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Zg).location}var uA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function dA(e){h.useContext(xs).static||h.useLayoutEffect(e)}function wc(){let{isDataRoute:e}=h.useContext(vs);return e?iL():Z7()}function Z7(){Lt(sd(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(Cc),{basename:t,navigator:n}=h.useContext(xs),{matches:r}=h.useContext(vs),{pathname:s}=Bs(),i=JSON.stringify(Bg(r)),c=h.useRef(!1);return dA(()=>{c.current=!0}),h.useCallback((f,m={})=>{if(Kn(c.current,uA),!c.current)return;if(typeof f=="number"){n.go(f);return}let y=qg(f,JSON.parse(i),s,m.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:uo([t,y.pathname])),(m.replace?n.replace:n.push)(y,m.state,m)},[t,n,i,s,e])}var fA=h.createContext(null);function bs(){return h.useContext(fA)}function Y7(e){let t=h.useContext(vs).outlet;return h.useMemo(()=>t&&h.createElement(fA.Provider,{value:e},t),[t,e])}function Yg(){let{matches:e}=h.useContext(vs),t=e[e.length-1];return t?t.params:{}}function ph(e,{relative:t}={}){let{matches:n}=h.useContext(vs),{pathname:r}=Bs(),s=JSON.stringify(Bg(n));return h.useMemo(()=>qg(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function W7(e,t,n,r,s){Lt(sd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=h.useContext(xs),{matches:c}=h.useContext(vs),u=c[c.length-1],f=u?u.params:{},m=u?u.pathname:"/",y=u?u.pathnameBase:"/",g=u&&u.route;{let j=g&&g.path||"";hA(m,!g||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${j}">) 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="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let x=Bs(),v;v=x;let C=v.pathname||"/",S=C;if(y!=="/"){let j=y.replace(/^\//,"").split("/");S="/"+C.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=Ki(e,{pathname:S});return Kn(g||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Kn(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`),tL(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:uo([y,i.encodeLocation?i.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?y:uo([y,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,s)}function X7(){let e=oL(),t=Zf(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:i},"ErrorBoundary")," or"," ",h.createElement("code",{style:i},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:s},n):null,c)}var Q7=h.createElement(X7,null),J7=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?h.createElement(vs.Provider,{value:this.props.routeContext},h.createElement(Zb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function eL({routeContext:e,match:t,children:n}){let r=h.useContext(Cc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(vs.Provider,{value:e},n)}function tL(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,c=n==null?void 0:n.errors;if(c!=null){let y=i.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);Lt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,y+1))}let u=!1,f=-1;if(n)for(let y=0;y<i.length;y++){let g=i[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=y),g.route.id){let{loaderData:x,errors:v}=n,C=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||C){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}let m=n&&r?(y,g)=>{var x,v;r(y,{location:n.location,params:((v=(x=n.matches)==null?void 0:x[0])==null?void 0:v.params)??{},unstable_pattern:hh(n.matches),errorInfo:g})}:void 0;return i.reduceRight((y,g,x)=>{let v,C=!1,S=null,w=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,S=g.route.errorElement||Q7,u&&(f<0&&x===0?(hA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,w=null):f===x&&(C=!0,w=g.route.hydrateFallbackElement||null)));let R=t.concat(i.slice(0,x+1)),j=()=>{let _;return v?_=S:C?_=w:g.route.Component?_=h.createElement(g.route.Component,null):g.route.element?_=g.route.element:_=y,h.createElement(eL,{match:g,routeContext:{outlet:y,matches:R,isDataRoute:n!=null},children:_})};return n&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?h.createElement(J7,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:j(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:m}):j()},null)}function Yb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nL(e){let t=h.useContext(Cc);return Lt(t,Yb(e)),t}function rL(e){let t=h.useContext(mh);return Lt(t,Yb(e)),t}function aL(e){let t=h.useContext(vs);return Lt(t,Yb(e)),t}function Wb(e){let t=aL(e),n=t.matches[t.matches.length-1];return Lt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function sL(){return Wb("useRouteId")}function oL(){var r;let e=h.useContext(Zb),t=rL("useRouteError"),n=Wb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function iL(){let{router:e}=nL("useNavigate"),t=Wb("useNavigate"),n=h.useRef(!1);return dA(()=>{n.current=!0}),h.useCallback(async(s,i={})=>{Kn(n.current,uA),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var Gj={};function hA(e,t,n){!t&&!Gj[e]&&(Gj[e]=!0,Kn(!1,n))}var Bj={};function qj(e,t){!e&&!Bj[t]&&(Bj[t]=!0,console.warn(t))}var lL="useOptimistic",Kj=fh[lL],cL=()=>{};function uL(e){return Kj?Kj(e):[e,cL]}function dL(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Kn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Kn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Kn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var fL=["HydrateFallback","hydrateFallbackElement"],hL=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 mL({router:e,flushSync:t,unstable_onError:n,unstable_useTransitions:r}){let[s,i]=h.useState(e.state),[c,u]=uL(s),[f,m]=h.useState(),[y,g]=h.useState({isTransitioning:!1}),[x,v]=h.useState(),[C,S]=h.useState(),[w,R]=h.useState(),j=h.useRef(new Map),_=h.useCallback((T,{deletedFetchers:I,newErrors:k,flushSync:F,viewTransitionOpts:G})=>{k&&n&&Object.values(k).forEach(B=>{var Z;return n(B,{location:T.location,params:((Z=T.matches[0])==null?void 0:Z.params)??{},unstable_pattern:hh(T.matches)})}),T.fetchers.forEach((B,Z)=>{B.data!==void 0&&j.current.set(Z,B.data)}),I.forEach(B=>j.current.delete(B)),qj(F===!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 Y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(qj(G==null||Y,"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."),!G||!Y){t&&F?t(()=>i(T)):r===!1?i(T):h.startTransition(()=>{r===!0&&u(B=>Zj(B,T)),i(T)});return}if(t&&F){t(()=>{C&&(x==null||x.resolve(),C.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:G.currentLocation,nextLocation:G.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>i(T))});B.finished.finally(()=>{t(()=>{v(void 0),S(void 0),m(void 0),g({isTransitioning:!1})})}),t(()=>S(B));return}C?(x==null||x.resolve(),C.skipTransition(),R({state:T,currentLocation:G.currentLocation,nextLocation:G.nextLocation})):(m(T),g({isTransitioning:!0,flushSync:!1,currentLocation:G.currentLocation,nextLocation:G.nextLocation}))},[e.window,t,C,x,r,u,n]);h.useLayoutEffect(()=>e.subscribe(_),[e,_]),h.useEffect(()=>{y.isTransitioning&&!y.flushSync&&v(new hL)},[y]),h.useEffect(()=>{if(x&&f&&e.window){let T=f,I=x.promise,k=e.window.document.startViewTransition(async()=>{r===!1?i(T):h.startTransition(()=>{r===!0&&u(F=>Zj(F,T)),i(T)}),await I});k.finished.finally(()=>{v(void 0),S(void 0),m(void 0),g({isTransitioning:!1})}),S(k)}},[f,x,e.window,r,u]),h.useEffect(()=>{x&&f&&c.location.key===f.location.key&&x.resolve()},[x,C,c.location,f]),h.useEffect(()=>{!y.isTransitioning&&w&&(m(w.state),g({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),R(void 0))},[y.isTransitioning,w]);let O=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,I,k)=>e.navigate(T,{state:I,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(T,I,k)=>e.navigate(T,{replace:!0,state:I,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[e]),A=e.basename||"/",D=h.useMemo(()=>({router:e,navigator:O,static:!1,basename:A,unstable_onError:n}),[e,O,A,n]);return h.createElement(h.Fragment,null,h.createElement(Cc.Provider,{value:D},h.createElement(mh.Provider,{value:c},h.createElement(cA.Provider,{value:j.current},h.createElement(Kb.Provider,{value:y},h.createElement(xL,{basename:A,location:c.location,navigationType:c.historyAction,navigator:O,unstable_useTransitions:r===!0},h.createElement(pL,{routes:e.routes,future:e.future,state:c,unstable_onError:n})))))),null)}function Zj(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var pL=h.memo(gL);function gL({routes:e,future:t,state:n,unstable_onError:r}){return W7(e,void 0,n,r,t)}function yL({to:e,replace:t,state:n,relative:r}){Lt(sd(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=h.useContext(xs);Kn(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=h.useContext(vs),{pathname:c}=Bs(),u=wc(),f=qg(e,Bg(i),c,r==="path"),m=JSON.stringify(f);return h.useEffect(()=>{u(JSON.parse(m),{replace:t,state:n,relative:r})},[u,m,r,t,n]),null}function Xb(e){return Y7(e.context)}function xL({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:c}){Lt(!sd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),f=h.useMemo(()=>({basename:u,navigator:s,static:i,unstable_useTransitions:c,future:{}}),[u,s,i,c]);typeof n=="string"&&(n=gl(n));let{pathname:m="/",search:y="",hash:g="",state:x=null,key:v="default"}=n,C=h.useMemo(()=>{let S=ys(m,u);return S==null?null:{location:{pathname:S,search:y,hash:g,state:x,key:v},navigationType:r}},[u,m,y,g,x,v,r]);return Kn(C!=null,`<Router basename="${u}"> is not able to match the URL "${m}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:h.createElement(xs.Provider,{value:f},h.createElement(Zg.Provider,{children:t,value:C}))}var Fp="get",Hp="application/x-www-form-urlencoded";function Wg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function vL(e){return Wg(e)&&e.tagName.toLowerCase()==="button"}function bL(e){return Wg(e)&&e.tagName.toLowerCase()==="form"}function SL(e){return Wg(e)&&e.tagName.toLowerCase()==="input"}function CL(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wL(e,t){return e.button===0&&(!t||t==="_self")&&!CL(e)}function D1(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 EL(e,t){let n=D1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var up=null;function RL(){if(up===null)try{new FormData(document.createElement("form"),0),up=!1}catch{up=!0}return up}var jL=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function R0(e){return e!=null&&!jL.has(e)?(Kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hp}"`),null):e}function TL(e,t){let n,r,s,i,c;if(bL(e)){let u=e.getAttribute("action");r=u?ys(u,t):null,n=e.getAttribute("method")||Fp,s=R0(e.getAttribute("enctype"))||Hp,i=new FormData(e)}else if(vL(e)||SL(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?ys(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Fp,s=R0(e.getAttribute("formenctype"))||R0(u.getAttribute("enctype"))||Hp,i=new FormData(u,e),!RL()){let{name:m,type:y,value:g}=e;if(y==="image"){let x=m?`${m}.`:"";i.append(`${x}x`,"0"),i.append(`${x}y`,"0")}else m&&i.append(m,g)}}else{if(Wg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Fp,r=null,s=Hp,c=e}return i&&s==="text/plain"&&(c=i,i=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:i,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Qb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _L(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&&ys(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function NL(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 AL(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 DL(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await NL(i,n);return c.links?c.links():[]}return[]}));return kL(r.flat(1).filter(AL).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Yj(e,t,n,r,s,i){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,u=(f,m)=>{var y;return n[m].pathname!==f.pathname||((y=n[m].route.path)==null?void 0:y.endsWith("*"))&&n[m].params["*"]!==f.params["*"]};return i==="assets"?t.filter((f,m)=>c(f,m)||u(f,m)):i==="data"?t.filter((f,m)=>{var g;let y=r.routes[f.route.id];if(!y||!y.hasLoader)return!1;if(c(f,m)||u(f,m))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function OL(e,t,{includeHydrateFallback:n}={}){return IL(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function IL(e){return[...new Set(e)]}function ML(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function kL(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(ML(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function mA(){let e=h.useContext(Cc);return Qb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function LL(){let e=h.useContext(mh);return Qb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Jb=h.createContext(void 0);Jb.displayName="FrameworkContext";function pA(){let e=h.useContext(Jb);return Qb(e,"You must render this element inside a <HydratedRouter> element"),e}function PL(e,t){let n=h.useContext(Jb),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:m,onMouseLeave:y,onTouchStart:g}=t,x=h.useRef(null);h.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=R=>{R.forEach(j=>{c(j.isIntersecting)})},w=new IntersectionObserver(S,{threshold:.5});return x.current&&w.observe(x.current),()=>{w.disconnect()}}},[e]),h.useEffect(()=>{if(r){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[r]);let v=()=>{s(!0)},C=()=>{s(!1),c(!1)};return n?e!=="intent"?[i,x,{}]:[i,x,{onFocus:xf(u,v),onBlur:xf(f,C),onMouseEnter:xf(m,v),onMouseLeave:xf(y,C),onTouchStart:xf(g,v)}]:[!1,x,{}]}function xf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function UL({page:e,...t}){let{router:n}=mA(),r=h.useMemo(()=>Ki(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(FL,{page:e,matches:r,...t}):null}function zL(e){let{manifest:t,routeModules:n}=pA(),[r,s]=h.useState([]);return h.useEffect(()=>{let i=!1;return DL(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),r}function FL({page:e,matches:t,...n}){let r=Bs(),{manifest:s,routeModules:i}=pA(),{basename:c}=mA(),{loaderData:u,matches:f}=LL(),m=h.useMemo(()=>Yj(e,t,f,s,r,"data"),[e,t,f,s,r]),y=h.useMemo(()=>Yj(e,t,f,s,r,"assets"),[e,t,f,s,r]),g=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,S=!1;if(t.forEach(R=>{var _;let j=s.routes[R.route.id];!j||!j.hasLoader||(!m.some(O=>O.route.id===R.route.id)&&R.route.id in u&&((_=i[R.route.id])!=null&&_.shouldRevalidate)||j.hasClientLoader?S=!0:C.add(R.route.id))}),C.size===0)return[];let w=_L(e,c,"data");return S&&C.size>0&&w.searchParams.set("_routes",t.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[w.pathname+w.search]},[c,u,r,s,m,t,e,i]),x=h.useMemo(()=>OL(y,s),[y,s]),v=zL(y);return h.createElement(h.Fragment,null,g.map(C=>h.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),x.map(C=>h.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),v.map(({key:C,link:S})=>h.createElement("link",{key:C,nonce:n.nonce,...S})))}function HL(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var gA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{gA&&(window.__reactRouterVersion="7.10.1")}catch{}function $L(e,t){return w7({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:P9({window:t==null?void 0:t.window}),hydrationData:VL(),routes:e,mapRouteProperties:dL,hydrationRouteProperties:fL,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function VL(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:GL(e.errors)}),e}function GL(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 Kg(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let c=new i(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}var yA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wr=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:c,state:u,target:f,to:m,preventScrollReset:y,viewTransition:g,...x},v){let{basename:C,unstable_useTransitions:S}=h.useContext(xs),w=typeof m=="string"&&yA.test(m),R,j=!1;if(typeof m=="string"&&w&&(R=m,gA))try{let F=new URL(window.location.href),G=m.startsWith("//")?new URL(F.protocol+m):new URL(m),Y=ys(G.pathname,C);G.origin===F.origin&&Y!=null?m=Y+G.search+G.hash:j=!0}catch{Kn(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let _=K7(m,{relative:s}),[O,A,D]=PL(r,x),T=KL(m,{replace:c,state:u,target:f,preventScrollReset:y,relative:s,viewTransition:g,unstable_useTransitions:S});function I(F){t&&t(F),F.defaultPrevented||T(F)}let k=h.createElement("a",{...x,...D,href:R||_,onClick:j||i?t:I,ref:HL(v,A),target:f,"data-discover":!w&&n==="render"?"true":void 0});return O&&!w?h.createElement(h.Fragment,null,k,h.createElement(UL,{page:_})):k});Wr.displayName="Link";var gh=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:f,...m},y){let g=ph(c,{relative:m.relative}),x=Bs(),v=h.useContext(mh),{navigator:C,basename:S}=h.useContext(xs),w=v!=null&&JL(g)&&u===!0,R=C.encodeLocation?C.encodeLocation(g).pathname:g.pathname,j=x.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(j=j.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&S&&(_=ys(_,S)||_);const O=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=j===R||!s&&j.startsWith(R)&&j.charAt(O)==="/",D=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),T={isActive:A,isPending:D,isTransitioning:w},I=A?t:void 0,k;typeof r=="function"?k=r(T):k=[r,A?"active":null,D?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let F=typeof i=="function"?i(T):i;return h.createElement(Wr,{...m,"aria-current":I,className:k,ref:y,style:F,to:c,viewTransition:u},typeof f=="function"?f(T):f)});gh.displayName="NavLink";var BL=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:c=Fp,action:u,onSubmit:f,relative:m,preventScrollReset:y,viewTransition:g,...x},v)=>{let{unstable_useTransitions:C}=h.useContext(xs),S=XL(),w=QL(u,{relative:m}),R=c.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&yA.test(u),_=O=>{if(f&&f(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,D=(A==null?void 0:A.getAttribute("formmethod"))||c,T=()=>S(A||O.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:s,state:i,relative:m,preventScrollReset:y,viewTransition:g});C&&n!==!1?h.startTransition(()=>T()):T()};return h.createElement("form",{ref:v,method:R,action:w,onSubmit:r?f:_,...x,"data-discover":!j&&e==="render"?"true":void 0})});BL.displayName="Form";function qL(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xA(e){let t=h.useContext(Cc);return Lt(t,qL(e)),t}function KL(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:c,unstable_useTransitions:u}={}){let f=wc(),m=Bs(),y=ph(e,{relative:i});return h.useCallback(g=>{if(wL(g,t)){g.preventDefault();let x=n!==void 0?n:xo(m)===xo(y),v=()=>f(e,{replace:x,state:r,preventScrollReset:s,relative:i,viewTransition:c});u?h.startTransition(()=>v()):v()}},[m,f,y,n,r,t,e,s,i,c,u])}function ZL(e){Kn(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=h.useRef(D1(e)),n=h.useRef(!1),r=Bs(),s=h.useMemo(()=>EL(r.search,n.current?null:t.current),[r.search]),i=wc(),c=h.useCallback((u,f)=>{const m=D1(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,i("?"+m,f)},[i,s]);return[s,c]}var YL=0,WL=()=>`__${String(++YL)}__`;function XL(){let{router:e}=xA("useSubmit"),{basename:t}=h.useContext(xs),n=sL(),r=e.fetch,s=e.navigate;return h.useCallback(async(i,c={})=>{let{action:u,method:f,encType:m,formData:y,body:g}=TL(i,t);if(c.navigate===!1){let x=c.fetcherKey||WL();await r(x,n,c.action||u,{preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||f,formEncType:c.encType||m,flushSync:c.flushSync})}else await s(c.action||u,{preventScrollReset:c.preventScrollReset,formData:y,body:g,formMethod:c.method||f,formEncType:c.encType||m,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[r,s,t,n])}function QL(e,{relative:t}={}){let{basename:n}=h.useContext(xs),r=h.useContext(vs);Lt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...ph(e||".",{relative:t})},c=Bs();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(y=>y==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let y=u.toString();i.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:uo([n,i.pathname])),xo(i)}function JL(e,{relative:t}={}){let n=h.useContext(Kb);Lt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=xA("useViewTransitionState"),s=ph(e,{relative:t});if(!n.isTransitioning)return!1;let i=ys(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ys(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Jp(s.pathname,c)!=null||Jp(s.pathname,i)!=null}var Ls=qN();const vA=BN(Ls);function eP(e){return h.createElement(mL,{flushSync:Ls.flushSync,...e})}function Wj(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xr(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Wj(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Wj(e[s],null)}}}}function ht(...e){return h.useCallback(Xr(...e),e)}var tP=Symbol.for("react.lazy"),tg=fh[" use ".trim().toString()];function nP(e){return typeof e=="object"&&e!==null&&"then"in e}function bA(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===tP&&"_payload"in e&&nP(e._payload)}function eS(e){const t=rP(e),n=h.forwardRef((r,s)=>{let{children:i,...c}=r;bA(i)&&typeof tg=="function"&&(i=tg(i._payload));const u=h.Children.toArray(i),f=u.find(sP);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var yh=eS("Slot");function rP(e){const t=h.forwardRef((n,r)=>{let{children:s,...i}=n;if(bA(s)&&typeof tg=="function"&&(s=tg(s._payload)),h.isValidElement(s)){const c=iP(s),u=oP(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aP=Symbol("radix.slottable");function sP(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aP}function oP(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function iP(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 SA(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=SA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function CA(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=SA(e))&&(r&&(r+=" "),r+=t);return r}const Xj=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Qj=CA,Ec=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Qj(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,c=Object.keys(s).map(m=>{const y=n==null?void 0:n[m],g=i==null?void 0:i[m];if(y===null)return null;const x=Xj(y)||Xj(g);return s[m][x]}),u=n&&Object.entries(n).reduce((m,y)=>{let[g,x]=y;return x===void 0||(m[g]=x),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,y)=>{let{class:g,className:x,...v}=y;return Object.entries(v).every(C=>{let[S,w]=C;return Array.isArray(w)?w.includes({...i,...u}[S]):{...i,...u}[S]===w})?[...m,g,x]:m},[]);return Qj(e,c,f,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 lP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wA=(...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 cP={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 uP=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:c,...u},f)=>h.createElement("svg",{ref:f,...cP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wA("lucide",s),...u},[...c.map(([m,y])=>h.createElement(m,y)),...Array.isArray(i)?i:[i]]));/**
|
|
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 _e=(e,t)=>{const n=h.forwardRef(({className:r,...s},i)=>h.createElement(uP,{ref:i,iconNode:t,className:wA(`lucide-${lP(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 dP=[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]],Jj=_e("Airplay",dP);/**
|
|
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 fP=[["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"}]],tS=_e("ArchiveRestore",fP);/**
|
|
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 hP=[["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"}]],eT=_e("ArrowDownZA",hP);/**
|
|
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 mP=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],pP=_e("ArrowLeft",mP);/**
|
|
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 gP=[["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"}]],yP=_e("ArrowRightLeft",gP);/**
|
|
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 xP=[["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"}]],tT=_e("ArrowUpAZ",xP);/**
|
|
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 vP=[["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"}]],nT=_e("ArrowUpDown",vP);/**
|
|
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 bP=[["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"}]],SP=_e("Asterisk",bP);/**
|
|
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 CP=[["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"}]],wP=_e("BadgeAlert",CP);/**
|
|
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 EP=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],RP=_e("Blocks",EP);/**
|
|
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 jP=[["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"}]],TP=_e("BookOpen",jP);/**
|
|
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 _P=[["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"}]],ng=_e("Box",_P);/**
|
|
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 NP=[["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"}]],AP=_e("BriefcaseBusiness",NP);/**
|
|
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 DP=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],nS=_e("CalendarClock",DP);/**
|
|
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 OP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],oa=_e("Check",OP);/**
|
|
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 IP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ss=_e("ChevronDown",IP);/**
|
|
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 MP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],kP=_e("ChevronLeft",MP);/**
|
|
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 LP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_a=_e("ChevronRight",LP);/**
|
|
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 PP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Zu=_e("ChevronUp",PP);/**
|
|
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 UP=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],zP=_e("ChevronsDownUp",UP);/**
|
|
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 FP=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],rS=_e("ChevronsUpDown",FP);/**
|
|
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 HP=[["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"}]],xh=_e("CircleAlert",HP);/**
|
|
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 $P=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],VP=_e("CircleCheckBig",$P);/**
|
|
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 GP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vh=_e("CircleCheck",GP);/**
|
|
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 BP=[["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"}]],rg=_e("CircleX",BP);/**
|
|
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 qP=[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]],KP=_e("Clapperboard",qP);/**
|
|
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 ZP=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],aS=_e("Code",ZP);/**
|
|
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 YP=[["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"}]],WP=_e("Columns3",YP);/**
|
|
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 XP=[["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"}]],Yu=_e("Copy",XP);/**
|
|
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 QP=[["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"}]],EA=_e("DatabaseZap",QP);/**
|
|
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 JP=[["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"}]],cc=_e("Database",JP);/**
|
|
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 eU=[["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"}]],tU=_e("Download",eU);/**
|
|
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 nU=[["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"}]],RA=_e("EllipsisVertical",nU);/**
|
|
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 rU=[["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"}]],qs=_e("Ellipsis",rU);/**
|
|
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 aU=[["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"}]],ai=_e("ExternalLink",aU);/**
|
|
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 sU=[["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"}]],oU=_e("EyeOff",sU);/**
|
|
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 iU=[["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"}]],jA=_e("Eye",iU);/**
|
|
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 lU=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]],cU=_e("FilePenLine",lU);/**
|
|
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 uU=[["path",{d:"M20 10V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h4",key:"1rdf37"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M16 14a2 2 0 0 0-2 2",key:"ceaadl"}],["path",{d:"M20 14a2 2 0 0 1 2 2",key:"1ny6zw"}],["path",{d:"M20 22a2 2 0 0 0 2-2",key:"1l9q4k"}],["path",{d:"M16 22a2 2 0 0 1-2-2",key:"1wqh5n"}]],dU=_e("FileScan",uU);/**
|
|
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 fU=[["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"}]],hU=_e("FileText",fU);/**
|
|
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 mU=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],pU=_e("FlaskConical",mU);/**
|
|
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 gU=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],yU=_e("FolderTree",gU);/**
|
|
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 xU=[["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"}]],rT=_e("Gem",xU);/**
|
|
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 vU=[["path",{d:"M12 13V2l8 4-8 4",key:"5wlwwj"}],["path",{d:"M20.561 10.222a9 9 0 1 1-12.55-5.29",key:"1c0wjv"}],["path",{d:"M8.002 9.997a5 5 0 1 0 8.9 2.02",key:"gb1g7m"}]],bU=_e("Goal",vU);/**
|
|
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 SU=[["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"}]],CU=_e("GraduationCap",SU);/**
|
|
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 wU=[["path",{d:"M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3",key:"11za1p"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],EU=_e("Grid2x2Check",wU);/**
|
|
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 RU=[["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"}]],TA=_e("GripVertical",RU);/**
|
|
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 jU=[["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"}]],TU=_e("Grip",jU);/**
|
|
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 _U=[["path",{d:"M3 7V5c0-1.1.9-2 2-2h2",key:"adw53z"}],["path",{d:"M17 3h2c1.1 0 2 .9 2 2v2",key:"an4l38"}],["path",{d:"M21 17v2c0 1.1-.9 2-2 2h-2",key:"144t0e"}],["path",{d:"M7 21H5c-1.1 0-2-.9-2-2v-2",key:"rtnfgi"}],["rect",{width:"7",height:"5",x:"7",y:"7",rx:"1",key:"1eyiv7"}],["rect",{width:"7",height:"5",x:"10",y:"12",rx:"1",key:"1qlmkx"}]],NU=_e("Group",_U);/**
|
|
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 AU=[["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"}]],DU=_e("History",AU);/**
|
|
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 OU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fr=_e("Info",OU);/**
|
|
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 IU=[["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"}]],O1=_e("KeyRound",IU);/**
|
|
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 MU=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],kU=_e("Layers",MU);/**
|
|
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 LU=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],PU=_e("ListChecks",LU);/**
|
|
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 UU=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Rc=_e("LoaderCircle",UU);/**
|
|
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 zU=[["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"}]],FU=_e("Lock",zU);/**
|
|
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 HU=[["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"}]],$U=_e("LogOut",HU);/**
|
|
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 VU=[["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"}]],GU=_e("Menu",VU);/**
|
|
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 BU=[["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"}]],_A=_e("MessageCircleQuestion",BU);/**
|
|
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 qU=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],KU=_e("MessageCircle",qU);/**
|
|
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 ZU=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],YU=_e("MessagesSquare",ZU);/**
|
|
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 WU=[["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"}]],NA=_e("Monitor",WU);/**
|
|
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 XU=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],AA=_e("Moon",XU);/**
|
|
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 QU=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],JU=_e("Network",QU);/**
|
|
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 ez=[["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"}]],tz=_e("OctagonAlert",ez);/**
|
|
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 nz=[["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"}]],DA=_e("OctagonX",nz);/**
|
|
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 rz=[["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"}]],az=_e("PackageSearch",rz);/**
|
|
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 sz=[["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"}]],oz=_e("PenLine",sz);/**
|
|
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 iz=[["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"}]],od=_e("Pencil",iz);/**
|
|
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 lz=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Xg=_e("Play",lz);/**
|
|
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 cz=[["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"}]],sS=_e("Plug",cz);/**
|
|
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 uz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ma=_e("Plus",uz);/**
|
|
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 dz=[["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"}]],fz=_e("RefreshCw",dz);/**
|
|
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 hz=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],mz=_e("Rocket",hz);/**
|
|
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 pz=[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]],gz=_e("Route",pz);/**
|
|
457
|
-
* @license lucide-react v0.475.0 - ISC
|
|
458
|
-
*
|
|
459
|
-
* This source code is licensed under the ISC license.
|
|
460
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
-
*/const yz=[["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"}]],xz=_e("Scale",yz);/**
|
|
462
|
-
* @license lucide-react v0.475.0 - ISC
|
|
463
|
-
*
|
|
464
|
-
* This source code is licensed under the ISC license.
|
|
465
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
-
*/const vz=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]],bz=_e("ScanSearch",vz);/**
|
|
467
|
-
* @license lucide-react v0.475.0 - ISC
|
|
468
|
-
*
|
|
469
|
-
* This source code is licensed under the ISC license.
|
|
470
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
-
*/const Sz=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]],Cz=_e("ScanText",Sz);/**
|
|
472
|
-
* @license lucide-react v0.475.0 - ISC
|
|
473
|
-
*
|
|
474
|
-
* This source code is licensed under the ISC license.
|
|
475
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
-
*/const wz=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],jc=_e("Search",wz);/**
|
|
477
|
-
* @license lucide-react v0.475.0 - ISC
|
|
478
|
-
*
|
|
479
|
-
* This source code is licensed under the ISC license.
|
|
480
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
481
|
-
*/const Ez=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Rz=_e("Send",Ez);/**
|
|
482
|
-
* @license lucide-react v0.475.0 - ISC
|
|
483
|
-
*
|
|
484
|
-
* This source code is licensed under the ISC license.
|
|
485
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
486
|
-
*/const jz=[["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"}]],OA=_e("Settings",jz);/**
|
|
487
|
-
* @license lucide-react v0.475.0 - ISC
|
|
488
|
-
*
|
|
489
|
-
* This source code is licensed under the ISC license.
|
|
490
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
491
|
-
*/const Tz=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Ji=_e("Sparkles",Tz);/**
|
|
492
|
-
* @license lucide-react v0.475.0 - ISC
|
|
493
|
-
*
|
|
494
|
-
* This source code is licensed under the ISC license.
|
|
495
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
496
|
-
*/const _z=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 8h7",key:"kbo1nt"}],["path",{d:"M8 12h6",key:"ikassy"}],["path",{d:"M11 16h5",key:"oq65wt"}]],Nz=_e("SquareChartGantt",_z);/**
|
|
497
|
-
* @license lucide-react v0.475.0 - ISC
|
|
498
|
-
*
|
|
499
|
-
* This source code is licensed under the ISC license.
|
|
500
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
501
|
-
*/const Az=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Dz=_e("SquareCheckBig",Az);/**
|
|
502
|
-
* @license lucide-react v0.475.0 - ISC
|
|
503
|
-
*
|
|
504
|
-
* This source code is licensed under the ISC license.
|
|
505
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
506
|
-
*/const Oz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],IA=_e("SquarePlay",Oz);/**
|
|
507
|
-
* @license lucide-react v0.475.0 - ISC
|
|
508
|
-
*
|
|
509
|
-
* This source code is licensed under the ISC license.
|
|
510
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
511
|
-
*/const Iz=[["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"}]],MA=_e("Sun",Iz);/**
|
|
512
|
-
* @license lucide-react v0.475.0 - ISC
|
|
513
|
-
*
|
|
514
|
-
* This source code is licensed under the ISC license.
|
|
515
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
516
|
-
*/const Mz=[["path",{d:"M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z",key:"1ldrpk"}],["path",{d:"M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7",key:"11i5po"}],["path",{d:"M 7 17h.01",key:"1euzgo"}],["path",{d:"m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8",key:"o2gii7"}]],kz=_e("SwatchBook",Mz);/**
|
|
517
|
-
* @license lucide-react v0.475.0 - ISC
|
|
518
|
-
*
|
|
519
|
-
* This source code is licensed under the ISC license.
|
|
520
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
521
|
-
*/const Lz=[["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"}]],kA=_e("Table",Lz);/**
|
|
522
|
-
* @license lucide-react v0.475.0 - ISC
|
|
523
|
-
*
|
|
524
|
-
* This source code is licensed under the ISC license.
|
|
525
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
526
|
-
*/const Pz=[["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"}]],Uz=_e("Telescope",Pz);/**
|
|
527
|
-
* @license lucide-react v0.475.0 - ISC
|
|
528
|
-
*
|
|
529
|
-
* This source code is licensed under the ISC license.
|
|
530
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
531
|
-
*/const zz=[["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"}]],es=_e("Trash2",zz);/**
|
|
532
|
-
* @license lucide-react v0.475.0 - ISC
|
|
533
|
-
*
|
|
534
|
-
* This source code is licensed under the ISC license.
|
|
535
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
536
|
-
*/const Fz=[["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"}]],bh=_e("TriangleAlert",Fz);/**
|
|
537
|
-
* @license lucide-react v0.475.0 - ISC
|
|
538
|
-
*
|
|
539
|
-
* This source code is licensed under the ISC license.
|
|
540
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
541
|
-
*/const Hz=[["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"}]],Yf=_e("Unplug",Hz);/**
|
|
542
|
-
* @license lucide-react v0.475.0 - ISC
|
|
543
|
-
*
|
|
544
|
-
* This source code is licensed under the ISC license.
|
|
545
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
546
|
-
*/const $z=[["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"}]],aT=_e("Users",$z);/**
|
|
547
|
-
* @license lucide-react v0.475.0 - ISC
|
|
548
|
-
*
|
|
549
|
-
* This source code is licensed under the ISC license.
|
|
550
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
551
|
-
*/const Vz=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uc=_e("X",Vz),j0=768;function Gz(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${j0-1}px)`),r=()=>{t(window.innerWidth<j0)};return n.addEventListener("change",r),t(window.innerWidth<j0),()=>n.removeEventListener("change",r)},[]),!!e}const Bz=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},qz=(e,t)=>({classGroupId:e,validator:t}),LA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ag="-",sT=[],Kz="arbitrary..",Zz=e=>{const t=Wz(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Yz(c);const u=c.split(ag),f=u[0]===""&&u.length>1?1:0;return PA(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],m=n[c];return f?m?Bz(m,f):f:m||sT}return n[c]||sT}}},PA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const m=PA(e,t+1,i);if(m)return m}const c=n.validators;if(c===null)return;const u=t===0?e.join(ag):e.slice(t).join(ag),f=c.length;for(let m=0;m<f;m++){const y=c[m];if(y.validator(u))return y.classGroupId}},Yz=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Kz+r:void 0})(),Wz=e=>{const{theme:t,classGroups:n}=e;return Xz(n,t)},Xz=(e,t)=>{const n=LA();for(const r in e){const s=e[r];oS(s,n,r,t)}return n},oS=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];Qz(c,t,n,r)}},Qz=(e,t,n,r)=>{if(typeof e=="string"){Jz(e,t,n);return}if(typeof e=="function"){eF(e,t,n,r);return}tF(e,t,n,r)},Jz=(e,t,n)=>{const r=e===""?t:UA(t,e);r.classGroupId=n},eF=(e,t,n,r)=>{if(nF(e)){oS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(qz(n,e))},tF=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[u,f]=s[c];oS(f,UA(t,u),n,r)}},UA=(e,t)=>{let n=e;const r=t.split(ag),s=r.length;for(let i=0;i<s;i++){const c=r[i];let u=n.nextPart.get(c);u||(u=LA(),n.nextPart.set(c,u)),n=u}return n},nF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,rF=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(i,c)=>{n[i]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let c=n[i];if(c!==void 0)return c;if((c=r[i])!==void 0)return s(i,c),c},set(i,c){i in n?n[i]=c:s(i,c)}}},I1="!",oT=":",aF=[],iT=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),sF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const i=[];let c=0,u=0,f=0,m;const y=s.length;for(let S=0;S<y;S++){const w=s[S];if(c===0&&u===0){if(w===oT){i.push(s.slice(f,S)),f=S+1;continue}if(w==="/"){m=S;continue}}w==="["?c++:w==="]"?c--:w==="("?u++:w===")"&&u--}const g=i.length===0?s:s.slice(f);let x=g,v=!1;g.endsWith(I1)?(x=g.slice(0,-1),v=!0):g.startsWith(I1)&&(x=g.slice(1),v=!0);const C=m&&m>f?m-f:void 0;return iT(i,v,x,C)};if(t){const s=t+oT,i=r;r=c=>c.startsWith(s)?i(c.slice(s.length)):iT(aF,!1,c,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},oF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let i=0;i<n.length;i++){const c=n[i],u=c[0]==="[",f=t.has(c);u||f?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(c)):s.push(c)}return s.length>0&&(s.sort(),r.push(...s)),r}},iF=e=>({cache:rF(e.cacheSize),parseClassName:sF(e),sortModifiers:oF(e),...Zz(e)}),lF=/\s+/,cF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],u=e.trim().split(lF);let f="";for(let m=u.length-1;m>=0;m-=1){const y=u[m],{isExternal:g,modifiers:x,hasImportantModifier:v,baseClassName:C,maybePostfixModifierPosition:S}=n(y);if(g){f=y+(f.length>0?" "+f:f);continue}let w=!!S,R=r(w?C.substring(0,S):C);if(!R){if(!w){f=y+(f.length>0?" "+f:f);continue}if(R=r(C),!R){f=y+(f.length>0?" "+f:f);continue}w=!1}const j=x.length===0?"":x.length===1?x[0]:i(x).join(":"),_=v?j+I1:j,O=_+R;if(c.indexOf(O)>-1)continue;c.push(O);const A=s(R,w);for(let D=0;D<A.length;++D){const T=A[D];c.push(_+T)}f=y+(f.length>0?" "+f:f)}return f},uF=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=zA(n))&&(s&&(s+=" "),s+=r);return s},zA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=zA(e[r]))&&(n&&(n+=" "),n+=t);return n},dF=(e,...t)=>{let n,r,s,i;const c=f=>{const m=t.reduce((y,g)=>g(y),e());return n=iF(m),r=n.cache.get,s=n.cache.set,i=u,u(f)},u=f=>{const m=r(f);if(m)return m;const y=cF(f,n);return s(f,y),y};return i=c,(...f)=>i(uF(...f))},fF=[],pr=e=>{const t=n=>n[e]||fF;return t.isThemeGetter=!0,t},FA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,hF=/^\d+\/\d+$/,mF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pF=/\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$/,gF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yu=e=>hF.test(e),kt=e=>!!e&&!Number.isNaN(Number(e)),Hi=e=>!!e&&Number.isInteger(Number(e)),T0=e=>e.endsWith("%")&&kt(e.slice(0,-1)),Vo=e=>mF.test(e),vF=()=>!0,bF=e=>pF.test(e)&&!gF.test(e),$A=()=>!1,SF=e=>yF.test(e),CF=e=>xF.test(e),wF=e=>!Ke(e)&&!Ze(e),EF=e=>id(e,BA,$A),Ke=e=>FA.test(e),Xl=e=>id(e,qA,bF),_0=e=>id(e,NF,kt),lT=e=>id(e,VA,$A),RF=e=>id(e,GA,CF),dp=e=>id(e,KA,SF),Ze=e=>HA.test(e),vf=e=>ld(e,qA),jF=e=>ld(e,AF),cT=e=>ld(e,VA),TF=e=>ld(e,BA),_F=e=>ld(e,GA),fp=e=>ld(e,KA,!0),id=(e,t,n)=>{const r=FA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ld=(e,t,n=!1)=>{const r=HA.exec(e);return r?r[1]?t(r[1]):n:!1},VA=e=>e==="position"||e==="percentage",GA=e=>e==="image"||e==="url",BA=e=>e==="length"||e==="size"||e==="bg-size",qA=e=>e==="length",NF=e=>e==="number",AF=e=>e==="family-name",KA=e=>e==="shadow",DF=()=>{const e=pr("color"),t=pr("font"),n=pr("text"),r=pr("font-weight"),s=pr("tracking"),i=pr("leading"),c=pr("breakpoint"),u=pr("container"),f=pr("spacing"),m=pr("radius"),y=pr("shadow"),g=pr("inset-shadow"),x=pr("text-shadow"),v=pr("drop-shadow"),C=pr("blur"),S=pr("perspective"),w=pr("aspect"),R=pr("ease"),j=pr("animate"),_=()=>["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"],A=()=>[...O(),Ze,Ke],D=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],I=()=>[Ze,Ke,f],k=()=>[yu,"full","auto",...I()],F=()=>[Hi,"none","subgrid",Ze,Ke],G=()=>["auto",{span:["full",Hi,Ze,Ke]},Hi,Ze,Ke],Y=()=>[Hi,"auto",Ze,Ke],B=()=>["auto","min","max","fr",Ze,Ke],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...I()],V=()=>[yu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],$=()=>[e,Ze,Ke],oe=()=>[...O(),cT,lT,{position:[Ze,Ke]}],ge=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",TF,EF,{size:[Ze,Ke]}],U=()=>[T0,vf,Xl],z=()=>["","none","full",m,Ze,Ke],X=()=>["",kt,vf,Xl],W=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[kt,T0,cT,lT],le=()=>["","none",C,Ze,Ke],ye=()=>["none",kt,Ze,Ke],Ce=()=>["none",kt,Ze,Ke],Ve=()=>[kt,Ze,Ke],De=()=>[yu,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Vo],breakpoint:[Vo],color:[vF],container:[Vo],"drop-shadow":[Vo],ease:["in","out","in-out"],font:[wF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Vo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Vo],shadow:[Vo],spacing:["px",kt],text:[Vo],"text-shadow":[Vo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yu,Ke,Ze,w]}],container:["container"],columns:[{columns:[kt,Ke,Ze,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:A()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Hi,"auto",Ze,Ke]}],basis:[{basis:[yu,"full","auto",u,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[kt,yu,"auto","initial","none",Ke]}],grow:[{grow:["",kt,Ze,Ke]}],shrink:[{shrink:["",kt,Ze,Ke]}],order:[{order:[Hi,"first","last","none",Ze,Ke]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[u,"screen",...V()]}],"min-w":[{"min-w":[u,"screen","none",...V()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,vf,Xl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ze,_0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",T0,Ke]}],"font-family":[{font:[jF,Ke,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,Ze,Ke]}],"line-clamp":[{"line-clamp":[kt,"none",Ze,_0]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",Ze,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ze,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:[kt,"from-font","auto",Ze,Xl]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[kt,"auto",Ze,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ze,Ke]}],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",Ze,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:ge()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Hi,Ze,Ke],radial:["",Ze,Ke],conic:[Hi,Ze,Ke]},_F,RF]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...W(),"hidden","none"]}],"divide-style":[{divide:[...W(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...W(),"none","hidden"]}],"outline-offset":[{"outline-offset":[kt,Ze,Ke]}],"outline-w":[{outline:["",kt,vf,Xl]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",y,fp,dp]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",g,fp,dp]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[kt,Xl]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",x,fp,dp]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[kt,Ze,Ke]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[kt]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Ze,Ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":[kt]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:ge()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ze,Ke]}],filter:[{filter:["","none",Ze,Ke]}],blur:[{blur:le()}],brightness:[{brightness:[kt,Ze,Ke]}],contrast:[{contrast:[kt,Ze,Ke]}],"drop-shadow":[{"drop-shadow":["","none",v,fp,dp]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",kt,Ze,Ke]}],"hue-rotate":[{"hue-rotate":[kt,Ze,Ke]}],invert:[{invert:["",kt,Ze,Ke]}],saturate:[{saturate:[kt,Ze,Ke]}],sepia:[{sepia:["",kt,Ze,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ze,Ke]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[kt,Ze,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[kt,Ze,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",kt,Ze,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[kt,Ze,Ke]}],"backdrop-invert":[{"backdrop-invert":["",kt,Ze,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[kt,Ze,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[kt,Ze,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",kt,Ze,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ze,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[kt,"initial",Ze,Ke]}],ease:[{ease:["linear","initial",R,Ze,Ke]}],delay:[{delay:[kt,Ze,Ke]}],animate:[{animate:["none",j,Ze,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ze,Ke]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:Ve()}],"skew-x":[{"skew-x":Ve()}],"skew-y":[{"skew-y":Ve()}],transform:[{transform:[Ze,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",Ze,Ke]}],"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":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",Ze,Ke]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[kt,vf,Xl,_0]}],stroke:[{stroke:["none",...$()]}],"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"]}},OF=dF(DF);function se(...e){return OF(CA(e))}const iS=Ec("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","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function we({className:e,variant:t,size:n,asChild:r=!1,...s}){const i=r?yh:"button";return a.jsx(i,{"data-slot":"button",className:se(iS({variant:t,size:n,className:e})),...s})}function It({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:se("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 IF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],MF=IF.reduce((e,t)=>{const n=eS(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),kF="Separator",uT="horizontal",LF=["horizontal","vertical"],ZA=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=uT,...s}=e,i=PF(r)?r:uT,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(MF.div,{"data-orientation":i,...u,...s,ref:t})});ZA.displayName=kF;function PF(e){return LF.includes(e)}var UF=ZA;function lS({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx(UF,{"data-slot":"separator",decorative:n,orientation:t,className:se("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 Ie(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 zF(e,t){const n=h.createContext(t),r=i=>{const{children:c,...u}=i,f=h.useMemo(()=>u,Object.values(u));return a.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function s(i){const c=h.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function Sr(e,t=[]){let n=[];function r(i,c){const u=h.createContext(c),f=n.length;n=[...n,c];const m=g=>{var R;const{scope:x,children:v,...C}=g,S=((R=x==null?void 0:x[e])==null?void 0:R[f])||u,w=h.useMemo(()=>C,Object.values(C));return a.jsx(S.Provider,{value:w,children:v})};m.displayName=i+"Provider";function y(g,x){var S;const v=((S=x==null?void 0:x[e])==null?void 0:S[f])||u,C=h.useContext(v);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,y]}const s=()=>{const i=n.map(c=>h.createContext(c));return function(u){const f=(u==null?void 0:u[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return s.scopeName=e,[r,FF(s,...t)]}function FF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const c=r.reduce((u,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...u,...g}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Hr=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},HF=fh[" useId ".trim().toString()]||(()=>{}),$F=0;function er(e){const[t,n]=h.useState(HF());return Hr(()=>{n(r=>r??String($F++))},[e]),e||(t?`radix-${t}`:"")}var VF=fh[" useInsertionEffect ".trim().toString()]||Hr;function ia({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,c]=GF({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:s;{const y=h.useRef(e!==void 0);h.useEffect(()=>{const g=y.current;g!==u&&console.warn(`${r} is changing from ${g?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=u},[u,r])}const m=h.useCallback(y=>{var g;if(u){const x=BF(y)?y(e):y;x!==e&&((g=c.current)==null||g.call(c,x))}else i(y)},[u,e,i,c]);return[f,m]}function GF({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return VF(()=>{i.current=t},[t]),h.useEffect(()=>{var c;s.current!==n&&((c=i.current)==null||c.call(i,n),s.current=n)},[n,s]),[n,r,i]}function BF(e){return typeof e=="function"}function qF(e){const t=KF(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(YF);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function KF(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=XF(s),u=WF(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZF=Symbol("radix.slottable");function YF(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZF}function WF(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function XF(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 QF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=QF.reduce((e,t)=>{const n=qF(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function YA(e,t){e&&Ls.flushSync(()=>e.dispatchEvent(t))}function Fs(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function JF(e,t=globalThis==null?void 0:globalThis.document){const n=Fs(e);h.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 eH="DismissableLayer",M1="dismissableLayer.update",tH="dismissableLayer.pointerDownOutside",nH="dismissableLayer.focusOutside",dT,WA=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tc=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...f}=e,m=h.useContext(WA),[y,g]=h.useState(null),x=(y==null?void 0:y.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),C=ht(t,T=>g(T)),S=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(w),j=y?S.indexOf(y):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,O=j>=R,A=sH(T=>{const I=T.target,k=[...m.branches].some(F=>F.contains(I));!O||k||(s==null||s(T),c==null||c(T),T.defaultPrevented||u==null||u())},x),D=oH(T=>{const I=T.target;[...m.branches].some(F=>F.contains(I))||(i==null||i(T),c==null||c(T),T.defaultPrevented||u==null||u())},x);return JF(T=>{j===m.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},x),h.useEffect(()=>{if(y)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(dT=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(y)),m.layers.add(y),fT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=dT)}},[y,x,n,m]),h.useEffect(()=>()=>{y&&(m.layers.delete(y),m.layersWithOutsidePointerEventsDisabled.delete(y),fT())},[y,m]),h.useEffect(()=>{const T=()=>v({});return document.addEventListener(M1,T),()=>document.removeEventListener(M1,T)},[]),a.jsx(Je.div,{...f,ref:C,style:{pointerEvents:_?O?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,A.onPointerDownCapture)})});Tc.displayName=eH;var rH="DismissableLayerBranch",aH=h.forwardRef((e,t)=>{const n=h.useContext(WA),r=h.useRef(null),s=ht(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(Je.div,{...e,ref:s})});aH.displayName=rH;function sH(e,t=globalThis==null?void 0:globalThis.document){const n=Fs(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let f=function(){XA(tH,n,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function oH(e,t=globalThis==null?void 0:globalThis.document){const n=Fs(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&XA(nH,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fT(){const e=new CustomEvent(M1);document.dispatchEvent(e)}function XA(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?YA(s,i):s.dispatchEvent(i)}var N0="focusScope.autoFocusOnMount",A0="focusScope.autoFocusOnUnmount",hT={bubbles:!1,cancelable:!0},iH="FocusScope",Sh=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[u,f]=h.useState(null),m=Fs(s),y=Fs(i),g=h.useRef(null),x=ht(t,S=>f(S)),v=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let S=function(_){if(v.paused||!u)return;const O=_.target;u.contains(O)?g.current=O:Vi(g.current,{select:!0})},w=function(_){if(v.paused||!u)return;const O=_.relatedTarget;O!==null&&(u.contains(O)||Vi(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Vi(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",w);const j=new MutationObserver(R);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",w),j.disconnect()}}},[r,u,v.paused]),h.useEffect(()=>{if(u){pT.add(v);const S=document.activeElement;if(!u.contains(S)){const R=new CustomEvent(N0,hT);u.addEventListener(N0,m),u.dispatchEvent(R),R.defaultPrevented||(lH(hH(QA(u)),{select:!0}),document.activeElement===S&&Vi(u))}return()=>{u.removeEventListener(N0,m),setTimeout(()=>{const R=new CustomEvent(A0,hT);u.addEventListener(A0,y),u.dispatchEvent(R),R.defaultPrevented||Vi(S??document.body,{select:!0}),u.removeEventListener(A0,y),pT.remove(v)},0)}}},[u,m,y,v]);const C=h.useCallback(S=>{if(!n&&!r||v.paused)return;const w=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,R=document.activeElement;if(w&&R){const j=S.currentTarget,[_,O]=cH(j);_&&O?!S.shiftKey&&R===O?(S.preventDefault(),n&&Vi(_,{select:!0})):S.shiftKey&&R===_&&(S.preventDefault(),n&&Vi(O,{select:!0})):R===j&&S.preventDefault()}},[n,r,v.paused]);return a.jsx(Je.div,{tabIndex:-1,...c,ref:x,onKeyDown:C})});Sh.displayName=iH;function lH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Vi(r,{select:t}),document.activeElement!==n)return}function cH(e){const t=QA(e),n=mT(t,e),r=mT(t.reverse(),e);return[n,r]}function QA(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 mT(e,t){for(const n of e)if(!uH(n,{upTo:t}))return n}function uH(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 dH(e){return e instanceof HTMLInputElement&&"select"in e}function Vi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dH(e)&&t&&e.select()}}var pT=fH();function fH(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=gT(e,t),e.unshift(t)},remove(t){var n;e=gT(e,t),(n=e[0])==null||n.resume()}}}function gT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function hH(e){return e.filter(t=>t.tagName!=="A")}var mH="Portal",_c=h.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,i]=h.useState(!1);Hr(()=>i(!0),[]);const c=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?vA.createPortal(a.jsx(Je.div,{...r,ref:t}),c):null});_c.displayName=mH;function pH(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Vr=e=>{const{present:t,children:n}=e,r=gH(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=ht(r.ref,yH(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};Vr.displayName="Presence";function gH(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),c=e?"mounted":"unmounted",[u,f]=pH(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const m=hp(r.current);i.current=u==="mounted"?m:"none"},[u]),Hr(()=>{const m=r.current,y=s.current;if(y!==e){const x=i.current,v=hp(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(y&&x!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Hr(()=>{if(t){let m;const y=t.ownerDocument.defaultView??window,g=v=>{const S=hp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&S&&(f("ANIMATION_END"),!s.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=y.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},x=v=>{v.target===t&&(i.current=hp(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{y.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:h.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function hp(e){return(e==null?void 0:e.animationName)||"none"}function yH(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 D0=0;function Qg(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yT()),document.body.insertAdjacentElement("beforeend",e[1]??yT()),D0++,()=>{D0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),D0--}},[])}function yT(){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 io=function(){return io=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},io.apply(this,arguments)};function JA(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 xH(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var $p="right-scroll-bar-position",Vp="width-before-scroll-bar",vH="with-scroll-bars-hidden",bH="--removed-body-scroll-bar-size";function O0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function SH(e,t){var n=h.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 CH=typeof window<"u"?h.useLayoutEffect:h.useEffect,xT=new WeakMap;function wH(e,t){var n=SH(null,function(r){return e.forEach(function(s){return O0(s,r)})});return CH(function(){var r=xT.get(n);if(r){var s=new Set(r),i=new Set(e),c=n.current;s.forEach(function(u){i.has(u)||O0(u,null)}),i.forEach(function(u){s.has(u)||O0(u,c)})}xT.set(n,e)},[e]),n}function EH(e){return e}function RH(e,t){t===void 0&&(t=EH);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var c=t(i,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(i){for(r=!0;n.length;){var c=n;n=[],c.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(i),c=n}var f=function(){var y=c;c=[],y.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(y){c.push(y),m()},filter:function(y){return c=c.filter(y),n}}}};return s}function jH(e){e===void 0&&(e={});var t=RH(null);return t.options=io({async:!0,ssr:!1},e),t}var e4=function(e){var t=e.sideCar,n=JA(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 h.createElement(r,io({},n))};e4.isSideCarExport=!0;function TH(e,t){return e.useMedium(t),e4}var t4=jH(),I0=function(){},Jg=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:I0,onWheelCapture:I0,onTouchMoveCapture:I0}),s=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,y=e.enabled,g=e.shards,x=e.sideCar,v=e.noRelative,C=e.noIsolation,S=e.inert,w=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,O=JA(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=x,D=wH([n,t]),T=io(io({},O),s);return h.createElement(h.Fragment,null,y&&h.createElement(A,{sideCar:t4,removeScrollBar:m,shards:g,noRelative:v,noIsolation:C,inert:S,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:_}),c?h.cloneElement(h.Children.only(u),io(io({},T),{ref:D})):h.createElement(j,io({},T,{className:f,ref:D}),u))});Jg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jg.classNames={fullWidth:Vp,zeroRight:$p};var _H=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function NH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_H();return t&&e.setAttribute("nonce",t),e}function AH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var OH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=NH())&&(AH(t,n),DH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IH=function(){var e=OH();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},n4=function(){var e=IH(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},MH={left:0,top:0,right:0,gap:0},M0=function(e){return parseInt(e||"",10)||0},kH=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[M0(n),M0(r),M0(s)]},LH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return MH;var t=kH(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])}},PH=n4(),Uu="data-scroll-locked",UH=function(e,t,n,r){var s=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
552
|
-
.`.concat(vH,` {
|
|
553
|
-
overflow: hidden `).concat(r,`;
|
|
554
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
555
|
-
}
|
|
556
|
-
body[`).concat(Uu,`] {
|
|
557
|
-
overflow: hidden `).concat(r,`;
|
|
558
|
-
overscroll-behavior: contain;
|
|
559
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
560
|
-
padding-left: `.concat(s,`px;
|
|
561
|
-
padding-top: `).concat(i,`px;
|
|
562
|
-
padding-right: `).concat(c,`px;
|
|
563
|
-
margin-left:0;
|
|
564
|
-
margin-top:0;
|
|
565
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
566
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
.`).concat($p,` {
|
|
570
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
.`).concat(Vp,` {
|
|
574
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
.`).concat($p," .").concat($p,` {
|
|
578
|
-
right: 0 `).concat(r,`;
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
.`).concat(Vp," .").concat(Vp,` {
|
|
582
|
-
margin-right: 0 `).concat(r,`;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
body[`).concat(Uu,`] {
|
|
586
|
-
`).concat(bH,": ").concat(u,`px;
|
|
587
|
-
}
|
|
588
|
-
`)},vT=function(){var e=parseInt(document.body.getAttribute(Uu)||"0",10);return isFinite(e)?e:0},zH=function(){h.useEffect(function(){return document.body.setAttribute(Uu,(vT()+1).toString()),function(){var e=vT()-1;e<=0?document.body.removeAttribute(Uu):document.body.setAttribute(Uu,e.toString())}},[])},FH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;zH();var i=h.useMemo(function(){return LH(s)},[s]);return h.createElement(PH,{styles:UH(i,!t,s,n?"":"!important")})},k1=!1;if(typeof window<"u")try{var mp=Object.defineProperty({},"passive",{get:function(){return k1=!0,!0}});window.addEventListener("test",mp,mp),window.removeEventListener("test",mp,mp)}catch{k1=!1}var xu=k1?{passive:!1}:!1,HH=function(e){return e.tagName==="TEXTAREA"},r4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!HH(e)&&n[t]==="visible")},$H=function(e){return r4(e,"overflowY")},VH=function(e){return r4(e,"overflowX")},bT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=a4(e,r);if(s){var i=s4(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},GH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},BH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},a4=function(e,t){return e==="v"?$H(t):VH(t)},s4=function(e,t){return e==="v"?GH(t):BH(t)},qH=function(e,t){return e==="h"&&t==="rtl"?-1:1},KH=function(e,t,n,r,s){var i=qH(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),m=!1,y=c>0,g=0,x=0;do{if(!u)break;var v=s4(e,u),C=v[0],S=v[1],w=v[2],R=S-w-i*C;(C||R)&&a4(e,u)&&(g+=R,x+=C);var j=u.parentNode;u=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(y&&Math.abs(g)<1||!y&&Math.abs(x)<1)&&(m=!0),m},pp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ST=function(e){return[e.deltaX,e.deltaY]},CT=function(e){return e&&"current"in e?e.current:e},ZH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},YH=function(e){return`
|
|
589
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
590
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
591
|
-
`)},WH=0,vu=[];function XH(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(WH++)[0],i=h.useState(n4)[0],c=h.useRef(e);h.useEffect(function(){c.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=xH([e.lockRef.current],(e.shards||[]).map(CT),!0).filter(Boolean);return S.forEach(function(w){return w.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=h.useCallback(function(S,w){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var R=pp(S),j=n.current,_="deltaX"in S?S.deltaX:j[0]-R[0],O="deltaY"in S?S.deltaY:j[1]-R[1],A,D=S.target,T=Math.abs(_)>Math.abs(O)?"h":"v";if("touches"in S&&T==="h"&&D.type==="range")return!1;var I=window.getSelection(),k=I&&I.anchorNode,F=k?k===D||k.contains(D):!1;if(F)return!1;var G=bT(T,D);if(!G)return!0;if(G?A=T:(A=T==="v"?"h":"v",G=bT(T,D)),!G)return!1;if(!r.current&&"changedTouches"in S&&(_||O)&&(r.current=A),!A)return!0;var Y=r.current||A;return KH(Y,w,S,Y==="h"?_:O)},[]),f=h.useCallback(function(S){var w=S;if(!(!vu.length||vu[vu.length-1]!==i)){var R="deltaY"in w?ST(w):pp(w),j=t.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&ZH(A.delta,R)})[0];if(j&&j.should){w.cancelable&&w.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(CT).filter(Boolean).filter(function(A){return A.contains(w.target)}),O=_.length>0?u(w,_[0]):!c.current.noIsolation;O&&w.cancelable&&w.preventDefault()}}},[]),m=h.useCallback(function(S,w,R,j){var _={name:S,delta:w,target:R,should:j,shadowParent:QH(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(O){return O!==_})},1)},[]),y=h.useCallback(function(S){n.current=pp(S),r.current=void 0},[]),g=h.useCallback(function(S){m(S.type,ST(S),S.target,u(S,e.lockRef.current))},[]),x=h.useCallback(function(S){m(S.type,pp(S),S.target,u(S,e.lockRef.current))},[]);h.useEffect(function(){return vu.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",f,xu),document.addEventListener("touchmove",f,xu),document.addEventListener("touchstart",y,xu),function(){vu=vu.filter(function(S){return S!==i}),document.removeEventListener("wheel",f,xu),document.removeEventListener("touchmove",f,xu),document.removeEventListener("touchstart",y,xu)}},[]);var v=e.removeScrollBar,C=e.inert;return h.createElement(h.Fragment,null,C?h.createElement(i,{styles:YH(s)}):null,v?h.createElement(FH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function QH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JH=TH(t4,XH);var Ch=h.forwardRef(function(e,t){return h.createElement(Jg,io({},e,{ref:t,sideCar:JH}))});Ch.classNames=Jg.classNames;var e$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bu=new WeakMap,gp=new WeakMap,yp={},k0=0,o4=function(e){return e&&(e.host||o4(e.parentNode))},t$=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=o4(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})},n$=function(e,t,n,r){var s=t$(t,Array.isArray(e)?e:[e]);yp[n]||(yp[n]=new WeakMap);var i=yp[n],c=[],u=new Set,f=new Set(s),m=function(g){!g||u.has(g)||(u.add(g),m(g.parentNode))};s.forEach(m);var y=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(x){if(u.has(x))y(x);else try{var v=x.getAttribute(r),C=v!==null&&v!=="false",S=(bu.get(x)||0)+1,w=(i.get(x)||0)+1;bu.set(x,S),i.set(x,w),c.push(x),S===1&&C&&gp.set(x,!0),w===1&&x.setAttribute(n,"true"),C||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return y(t),u.clear(),k0++,function(){c.forEach(function(g){var x=bu.get(g)-1,v=i.get(g)-1;bu.set(g,x),i.set(g,v),x||(gp.has(g)||g.removeAttribute(r),gp.delete(g)),v||g.removeAttribute(n)}),k0--,k0||(bu=new WeakMap,bu=new WeakMap,gp=new WeakMap,yp={})}},ey=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=e$(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),n$(r,s,n,"aria-hidden")):function(){return null}};function r$(e){const t=a$(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(o$);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function a$(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=l$(s),u=i$(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var s$=Symbol("radix.slottable");function o$(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===s$}function i$(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function l$(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 ty="Dialog",[i4,l4]=Sr(ty),[c$,Ks]=i4(ty),c4=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!0}=e,u=h.useRef(null),f=h.useRef(null),[m,y]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:ty});return a.jsx(c$,{scope:t,triggerRef:u,contentRef:f,contentId:er(),titleId:er(),descriptionId:er(),open:m,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(g=>!g),[y]),modal:c,children:n})};c4.displayName=ty;var u4="DialogTrigger",d4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(u4,n),i=ht(t,s.triggerRef);return a.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":dS(s.open),...r,ref:i,onClick:Ie(e.onClick,s.onOpenToggle)})});d4.displayName=u4;var cS="DialogPortal",[u$,f4]=i4(cS,{forceMount:void 0}),h4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Ks(cS,t);return a.jsx(u$,{scope:t,forceMount:n,children:h.Children.map(r,c=>a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:c})}))})};h4.displayName=cS;var sg="DialogOverlay",m4=h.forwardRef((e,t)=>{const n=f4(sg,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ks(sg,e.__scopeDialog);return i.modal?a.jsx(Vr,{present:r||i.open,children:a.jsx(f$,{...s,ref:t})}):null});m4.displayName=sg;var d$=r$("DialogOverlay.RemoveScroll"),f$=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(sg,n);return a.jsx(Ch,{as:d$,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(Je.div,{"data-state":dS(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),dc="DialogContent",p4=h.forwardRef((e,t)=>{const n=f4(dc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ks(dc,e.__scopeDialog);return a.jsx(Vr,{present:r||i.open,children:i.modal?a.jsx(h$,{...s,ref:t}):a.jsx(m$,{...s,ref:t})})});p4.displayName=dc;var h$=h.forwardRef((e,t)=>{const n=Ks(dc,e.__scopeDialog),r=h.useRef(null),s=ht(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return ey(i)},[]),a.jsx(g4,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault())})}),m$=h.forwardRef((e,t)=>{const n=Ks(dc,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(g4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),g4=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,u=Ks(dc,n),f=h.useRef(null),m=ht(t,f);return Qg(),a.jsxs(a.Fragment,{children:[a.jsx(Sh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Tc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":dS(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(g$,{titleId:u.titleId}),a.jsx(x$,{contentRef:f,descriptionId:u.descriptionId})]})]})}),uS="DialogTitle",y4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(uS,n);return a.jsx(Je.h2,{id:s.titleId,...r,ref:t})});y4.displayName=uS;var x4="DialogDescription",v4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(x4,n);return a.jsx(Je.p,{id:s.descriptionId,...r,ref:t})});v4.displayName=x4;var b4="DialogClose",S4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ks(b4,n);return a.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>s.onOpenChange(!1))})});S4.displayName=b4;function dS(e){return e?"open":"closed"}var C4="DialogTitleWarning",[p$,w4]=zF(C4,{contentName:dc,titleName:uS,docsSlug:"dialog"}),g$=({titleId:e})=>{const t=w4(C4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
592
|
-
|
|
593
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
594
|
-
|
|
595
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},y$="DialogDescriptionWarning",x$=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${w4(y$).contentName}}.`;return h.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},ny=c4,v$=d4,ry=h4,ay=m4,sy=p4,fS=y4,hS=v4,oy=S4;function ci({...e}){return a.jsx(ny,{"data-slot":"sheet",...e})}function b$({...e}){return a.jsx(ry,{"data-slot":"sheet-portal",...e})}function S$({className:e,...t}){return a.jsx(ay,{"data-slot":"sheet-overlay",className:se("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 ui({className:e,children:t,side:n="right",...r}){return a.jsxs(b$,{children:[a.jsx(S$,{}),a.jsxs(sy,{"data-slot":"sheet-content",className:se("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,a.jsxs(oy,{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:[a.jsx(uc,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function di({className:e,...t}){return a.jsx("div",{"data-slot":"sheet-header",className:se("flex flex-col gap-1 border-b p-4",e),...t})}function fi({className:e,...t}){return a.jsx(fS,{"data-slot":"sheet-title",className:se("text-foreground font-semibold",e),...t})}function yl({className:e,...t}){return a.jsx(hS,{"data-slot":"sheet-description",className:se("text-muted-foreground text-sm",e),...t})}function Ur({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:se("bg-accent animate-pulse rounded-md",e),...t})}const C$=["top","right","bottom","left"],dl=Math.min,Ka=Math.max,og=Math.round,xp=Math.floor,fo=e=>({x:e,y:e}),w$={left:"right",right:"left",bottom:"top",top:"bottom"},E$={start:"end",end:"start"};function L1(e,t,n){return Ka(e,dl(t,n))}function si(e,t){return typeof e=="function"?e(t):e}function oi(e){return e.split("-")[0]}function cd(e){return e.split("-")[1]}function mS(e){return e==="x"?"y":"x"}function pS(e){return e==="y"?"height":"width"}const R$=new Set(["top","bottom"]);function lo(e){return R$.has(oi(e))?"y":"x"}function gS(e){return mS(lo(e))}function j$(e,t,n){n===void 0&&(n=!1);const r=cd(e),s=gS(e),i=pS(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=ig(c)),[c,ig(c)]}function T$(e){const t=ig(e);return[P1(e),t,P1(t)]}function P1(e){return e.replace(/start|end/g,t=>E$[t])}const wT=["left","right"],ET=["right","left"],_$=["top","bottom"],N$=["bottom","top"];function A$(e,t,n){switch(e){case"top":case"bottom":return n?t?ET:wT:t?wT:ET;case"left":case"right":return t?_$:N$;default:return[]}}function D$(e,t,n,r){const s=cd(e);let i=A$(oi(e),n==="start",r);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map(P1)))),i}function ig(e){return e.replace(/left|right|bottom|top/g,t=>w$[t])}function O$(e){return{top:0,right:0,bottom:0,left:0,...e}}function E4(e){return typeof e!="number"?O$(e):{top:e,right:e,bottom:e,left:e}}function lg(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 RT(e,t,n){let{reference:r,floating:s}=e;const i=lo(t),c=gS(t),u=pS(c),f=oi(t),m=i==="y",y=r.x+r.width/2-s.width/2,g=r.y+r.height/2-s.height/2,x=r[u]/2-s[u]/2;let v;switch(f){case"top":v={x:y,y:r.y-s.height};break;case"bottom":v={x:y,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:g};break;case"left":v={x:r.x-s.width,y:g};break;default:v={x:r.x,y:r.y}}switch(cd(t)){case"start":v[c]-=x*(n&&m?-1:1);break;case"end":v[c]+=x*(n&&m?-1:1);break}return v}const I$=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:c}=n,u=i.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:y,y:g}=RT(m,r,f),x=r,v={},C=0;for(let S=0;S<u.length;S++){const{name:w,fn:R}=u[S],{x:j,y:_,data:O,reset:A}=await R({x:y,y:g,initialPlacement:r,placement:x,strategy:s,middlewareData:v,rects:m,platform:c,elements:{reference:e,floating:t}});y=j??y,g=_??g,v={...v,[w]:{...v[w],...O}},A&&C<=50&&(C++,typeof A=="object"&&(A.placement&&(x=A.placement),A.rects&&(m=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:y,y:g}=RT(m,x,f)),S=-1)}return{x:y,y:g,placement:x,strategy:s,middlewareData:v}};async function Wf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:c,elements:u,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:x=!1,padding:v=0}=si(t,e),C=E4(v),w=u[x?g==="floating"?"reference":"floating":g],R=lg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:m,rootBoundary:y,strategy:f})),j=g==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),O=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},A=lg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:j,offsetParent:_,strategy:f}):j);return{top:(R.top-A.top+C.top)/O.y,bottom:(A.bottom-R.bottom+C.bottom)/O.y,left:(R.left-A.left+C.left)/O.x,right:(A.right-R.right+C.right)/O.x}}const M$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:c,elements:u,middlewareData:f}=t,{element:m,padding:y=0}=si(e,t)||{};if(m==null)return{};const g=E4(y),x={x:n,y:r},v=gS(s),C=pS(v),S=await c.getDimensions(m),w=v==="y",R=w?"top":"left",j=w?"bottom":"right",_=w?"clientHeight":"clientWidth",O=i.reference[C]+i.reference[v]-x[v]-i.floating[C],A=x[v]-i.reference[v],D=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let T=D?D[_]:0;(!T||!await(c.isElement==null?void 0:c.isElement(D)))&&(T=u.floating[_]||i.floating[C]);const I=O/2-A/2,k=T/2-S[C]/2-1,F=dl(g[R],k),G=dl(g[j],k),Y=F,B=T-S[C]-G,Z=T/2-S[C]/2+I,H=L1(Y,Z,B),M=!f.arrow&&cd(s)!=null&&Z!==H&&i.reference[C]/2-(Z<Y?F:G)-S[C]/2<0,V=M?Z<Y?Z-Y:Z-B:0;return{[v]:x[v]+V,data:{[v]:H,centerOffset:Z-H-V,...M&&{alignmentOffset:V}},reset:M}}}),k$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:c,initialPlacement:u,platform:f,elements:m}=t,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...w}=si(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const R=oi(s),j=lo(u),_=oi(u)===u,O=await(f.isRTL==null?void 0:f.isRTL(m.floating)),A=x||(_||!S?[ig(u)]:T$(u)),D=C!=="none";!x&&D&&A.push(...D$(u,S,C,O));const T=[u,...A],I=await Wf(t,w),k=[];let F=((r=i.flip)==null?void 0:r.overflows)||[];if(y&&k.push(I[R]),g){const Z=j$(s,c,O);k.push(I[Z[0]],I[Z[1]])}if(F=[...F,{placement:s,overflows:k}],!k.every(Z=>Z<=0)){var G,Y;const Z=(((G=i.flip)==null?void 0:G.index)||0)+1,H=T[Z];if(H&&(!(g==="alignment"?j!==lo(H):!1)||F.every($=>lo($.placement)===j?$.overflows[0]>0:!0)))return{data:{index:Z,overflows:F},reset:{placement:H}};let M=(Y=F.filter(V=>V.overflows[0]<=0).sort((V,$)=>V.overflows[1]-$.overflows[1])[0])==null?void 0:Y.placement;if(!M)switch(v){case"bestFit":{var B;const V=(B=F.filter($=>{if(D){const oe=lo($.placement);return oe===j||oe==="y"}return!0}).map($=>[$.placement,$.overflows.filter(oe=>oe>0).reduce((oe,ge)=>oe+ge,0)]).sort(($,oe)=>$[1]-oe[1])[0])==null?void 0:B[0];V&&(M=V);break}case"initialPlacement":M=u;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function jT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TT(e){return C$.some(t=>e[t]>=0)}const L$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=si(e,t);switch(r){case"referenceHidden":{const i=await Wf(t,{...s,elementContext:"reference"}),c=jT(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:TT(c)}}}case"escaped":{const i=await Wf(t,{...s,altBoundary:!0}),c=jT(i,n.floating);return{data:{escapedOffsets:c,escaped:TT(c)}}}default:return{}}}}},R4=new Set(["left","top"]);async function P$(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=oi(n),u=cd(n),f=lo(n)==="y",m=R4.has(c)?-1:1,y=i&&f?-1:1,g=si(t,e);let{mainAxis:x,crossAxis:v,alignmentAxis:C}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof C=="number"&&(v=u==="end"?C*-1:C),f?{x:v*y,y:x*m}:{x:x*m,y:v*y}}const U$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:c,middlewareData:u}=t,f=await P$(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+f.x,y:i+f.y,data:{...f,placement:c}}}}},z$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:u={fn:w=>{let{x:R,y:j}=w;return{x:R,y:j}}},...f}=si(e,t),m={x:n,y:r},y=await Wf(t,f),g=lo(oi(s)),x=mS(g);let v=m[x],C=m[g];if(i){const w=x==="y"?"top":"left",R=x==="y"?"bottom":"right",j=v+y[w],_=v-y[R];v=L1(j,v,_)}if(c){const w=g==="y"?"top":"left",R=g==="y"?"bottom":"right",j=C+y[w],_=C-y[R];C=L1(j,C,_)}const S=u.fn({...t,[x]:v,[g]:C});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[x]:i,[g]:c}}}}}},F$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:m=!0}=si(e,t),y={x:n,y:r},g=lo(s),x=mS(g);let v=y[x],C=y[g];const S=si(u,t),w=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const _=x==="y"?"height":"width",O=i.reference[x]-i.floating[_]+w.mainAxis,A=i.reference[x]+i.reference[_]-w.mainAxis;v<O?v=O:v>A&&(v=A)}if(m){var R,j;const _=x==="y"?"width":"height",O=R4.has(oi(s)),A=i.reference[g]-i.floating[_]+(O&&((R=c.offset)==null?void 0:R[g])||0)+(O?0:w.crossAxis),D=i.reference[g]+i.reference[_]+(O?0:((j=c.offset)==null?void 0:j[g])||0)-(O?w.crossAxis:0);C<A?C=A:C>D&&(C=D)}return{[x]:v,[g]:C}}}},H$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:c,elements:u}=t,{apply:f=()=>{},...m}=si(e,t),y=await Wf(t,m),g=oi(s),x=cd(s),v=lo(s)==="y",{width:C,height:S}=i.floating;let w,R;g==="top"||g==="bottom"?(w=g,R=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,w=x==="end"?"top":"bottom");const j=S-y.top-y.bottom,_=C-y.left-y.right,O=dl(S-y[w],j),A=dl(C-y[R],_),D=!t.middlewareData.shift;let T=O,I=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),D&&!x){const F=Ka(y.left,0),G=Ka(y.right,0),Y=Ka(y.top,0),B=Ka(y.bottom,0);v?I=C-2*(F!==0||G!==0?F+G:Ka(y.left,y.right)):T=S-2*(Y!==0||B!==0?Y+B:Ka(y.top,y.bottom))}await f({...t,availableWidth:I,availableHeight:T});const k=await c.getDimensions(u.floating);return C!==k.width||S!==k.height?{reset:{rects:!0}}:{}}}};function iy(){return typeof window<"u"}function ud(e){return j4(e)?(e.nodeName||"").toLowerCase():"#document"}function Wa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){var t;return(t=(j4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j4(e){return iy()?e instanceof Node||e instanceof Wa(e).Node:!1}function Hs(e){return iy()?e instanceof Element||e instanceof Wa(e).Element:!1}function vo(e){return iy()?e instanceof HTMLElement||e instanceof Wa(e).HTMLElement:!1}function _T(e){return!iy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wa(e).ShadowRoot}const $$=new Set(["inline","contents"]);function wh(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=$s(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!$$.has(s)}const V$=new Set(["table","td","th"]);function G$(e){return V$.has(ud(e))}const B$=[":popover-open",":modal"];function ly(e){return B$.some(t=>{try{return e.matches(t)}catch{return!1}})}const q$=["transform","translate","scale","rotate","perspective"],K$=["transform","translate","scale","rotate","perspective","filter"],Z$=["paint","layout","strict","content"];function yS(e){const t=xS(),n=Hs(e)?$s(e):e;return q$.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)||K$.some(r=>(n.willChange||"").includes(r))||Z$.some(r=>(n.contain||"").includes(r))}function Y$(e){let t=fl(e);for(;vo(t)&&!Wu(t);){if(yS(t))return t;if(ly(t))return null;t=fl(t)}return null}function xS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const W$=new Set(["html","body","#document"]);function Wu(e){return W$.has(ud(e))}function $s(e){return Wa(e).getComputedStyle(e)}function cy(e){return Hs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fl(e){if(ud(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_T(e)&&e.host||Co(e);return _T(t)?t.host:t}function T4(e){const t=fl(e);return Wu(t)?e.ownerDocument?e.ownerDocument.body:e.body:vo(t)&&wh(t)?t:T4(t)}function Xf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=T4(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),c=Wa(s);if(i){const u=U1(c);return t.concat(c,c.visualViewport||[],wh(s)?s:[],u&&n?Xf(u):[])}return t.concat(s,Xf(s,[],n))}function U1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _4(e){const t=$s(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=vo(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=og(n)!==i||og(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function vS(e){return Hs(e)?e:e.contextElement}function zu(e){const t=vS(e);if(!vo(t))return fo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=_4(t);let c=(i?og(n.width):n.width)/r,u=(i?og(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const X$=fo(0);function N4(e){const t=Wa(e);return!xS()||!t.visualViewport?X$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Q$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wa(e)?!1:t}function fc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=vS(e);let c=fo(1);t&&(r?Hs(r)&&(c=zu(r)):c=zu(e));const u=Q$(i,n,r)?N4(i):fo(0);let f=(s.left+u.x)/c.x,m=(s.top+u.y)/c.y,y=s.width/c.x,g=s.height/c.y;if(i){const x=Wa(i),v=r&&Hs(r)?Wa(r):r;let C=x,S=U1(C);for(;S&&r&&v!==C;){const w=zu(S),R=S.getBoundingClientRect(),j=$s(S),_=R.left+(S.clientLeft+parseFloat(j.paddingLeft))*w.x,O=R.top+(S.clientTop+parseFloat(j.paddingTop))*w.y;f*=w.x,m*=w.y,y*=w.x,g*=w.y,f+=_,m+=O,C=Wa(S),S=U1(C)}}return lg({width:y,height:g,x:f,y:m})}function uy(e,t){const n=cy(e).scrollLeft;return t?t.left+n:fc(Co(e)).left+n}function A4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-uy(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function J$(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",c=Co(r),u=t?ly(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},m=fo(1);const y=fo(0),g=vo(r);if((g||!g&&!i)&&((ud(r)!=="body"||wh(c))&&(f=cy(r)),vo(r))){const v=fc(r);m=zu(r),y.x=v.x+r.clientLeft,y.y=v.y+r.clientTop}const x=c&&!g&&!i?A4(c,f):fo(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+y.x+x.x,y:n.y*m.y-f.scrollTop*m.y+y.y+x.y}}function eV(e){return Array.from(e.getClientRects())}function tV(e){const t=Co(e),n=cy(e),r=e.ownerDocument.body,s=Ka(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ka(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+uy(e);const u=-n.scrollTop;return $s(r).direction==="rtl"&&(c+=Ka(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:c,y:u}}const NT=25;function nV(e,t){const n=Wa(e),r=Co(e),s=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,u=0,f=0;if(s){i=s.width,c=s.height;const y=xS();(!y||y&&t==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}const m=uy(r);if(m<=0){const y=r.ownerDocument,g=y.body,x=getComputedStyle(g),v=y.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,C=Math.abs(r.clientWidth-g.clientWidth-v);C<=NT&&(i-=C)}else m<=NT&&(i+=m);return{width:i,height:c,x:u,y:f}}const rV=new Set(["absolute","fixed"]);function aV(e,t){const n=fc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=vo(e)?zu(e):fo(1),c=e.clientWidth*i.x,u=e.clientHeight*i.y,f=s*i.x,m=r*i.y;return{width:c,height:u,x:f,y:m}}function AT(e,t,n){let r;if(t==="viewport")r=nV(e,n);else if(t==="document")r=tV(Co(e));else if(Hs(t))r=aV(t,n);else{const s=N4(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return lg(r)}function D4(e,t){const n=fl(e);return n===t||!Hs(n)||Wu(n)?!1:$s(n).position==="fixed"||D4(n,t)}function sV(e,t){const n=t.get(e);if(n)return n;let r=Xf(e,[],!1).filter(u=>Hs(u)&&ud(u)!=="body"),s=null;const i=$s(e).position==="fixed";let c=i?fl(e):e;for(;Hs(c)&&!Wu(c);){const u=$s(c),f=yS(c);!f&&u.position==="fixed"&&(s=null),(i?!f&&!s:!f&&u.position==="static"&&!!s&&rV.has(s.position)||wh(c)&&!f&&D4(e,c))?r=r.filter(y=>y!==c):s=u,c=fl(c)}return t.set(e,r),r}function oV(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?ly(t)?[]:sV(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((m,y)=>{const g=AT(t,y,s);return m.top=Ka(g.top,m.top),m.right=dl(g.right,m.right),m.bottom=dl(g.bottom,m.bottom),m.left=Ka(g.left,m.left),m},AT(t,u,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function iV(e){const{width:t,height:n}=_4(e);return{width:t,height:n}}function lV(e,t,n){const r=vo(t),s=Co(t),i=n==="fixed",c=fc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=fo(0);function m(){f.x=uy(s)}if(r||!r&&!i)if((ud(t)!=="body"||wh(s))&&(u=cy(t)),r){const v=fc(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else s&&m();i&&!r&&s&&m();const y=s&&!r&&!i?A4(s,u):fo(0),g=c.left+u.scrollLeft-f.x-y.x,x=c.top+u.scrollTop-f.y-y.y;return{x:g,y:x,width:c.width,height:c.height}}function L0(e){return $s(e).position==="static"}function DT(e,t){if(!vo(e)||$s(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Co(e)===n&&(n=n.ownerDocument.body),n}function O4(e,t){const n=Wa(e);if(ly(e))return n;if(!vo(e)){let s=fl(e);for(;s&&!Wu(s);){if(Hs(s)&&!L0(s))return s;s=fl(s)}return n}let r=DT(e,t);for(;r&&G$(r)&&L0(r);)r=DT(r,t);return r&&Wu(r)&&L0(r)&&!yS(r)?n:r||Y$(e)||n}const cV=async function(e){const t=this.getOffsetParent||O4,n=this.getDimensions,r=await n(e.floating);return{reference:lV(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uV(e){return $s(e).direction==="rtl"}const dV={convertOffsetParentRelativeRectToViewportRelativeRect:J$,getDocumentElement:Co,getClippingRect:oV,getOffsetParent:O4,getElementRects:cV,getClientRects:eV,getDimensions:iV,getScale:zu,isElement:Hs,isRTL:uV};function I4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fV(e,t){let n=null,r;const s=Co(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),i();const m=e.getBoundingClientRect(),{left:y,top:g,width:x,height:v}=m;if(u||t(),!x||!v)return;const C=xp(g),S=xp(s.clientWidth-(y+x)),w=xp(s.clientHeight-(g+v)),R=xp(y),_={rootMargin:-C+"px "+-S+"px "+-w+"px "+-R+"px",threshold:Ka(0,dl(1,f))||1};let O=!0;function A(D){const T=D[0].intersectionRatio;if(T!==f){if(!O)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!I4(m,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(A,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return c(!0),i}function hV(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,m=vS(e),y=s||i?[...m?Xf(m):[],...Xf(t)]:[];y.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=m&&u?fV(m,n):null;let x=-1,v=null;c&&(v=new ResizeObserver(R=>{let[j]=R;j&&j.target===m&&v&&(v.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),m&&!f&&v.observe(m),v.observe(t));let C,S=f?fc(e):null;f&&w();function w(){const R=fc(e);S&&!I4(S,R)&&n(),S=R,C=requestAnimationFrame(w)}return n(),()=>{var R;y.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),g==null||g(),(R=v)==null||R.disconnect(),v=null,f&&cancelAnimationFrame(C)}}const mV=U$,pV=z$,gV=k$,yV=H$,xV=L$,OT=M$,vV=F$,bV=(e,t,n)=>{const r=new Map,s={platform:dV,...n},i={...s.platform,_c:r};return I$(e,t,{...s,platform:i})};var SV=typeof document<"u",CV=function(){},Gp=SV?h.useLayoutEffect:CV;function cg(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(!cg(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!cg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function M4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IT(e,t){const n=M4(e);return Math.round(t*n)/n}function P0(e){const t=h.useRef(e);return Gp(()=>{t.current=e}),t}function wV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:c}={},transform:u=!0,whileElementsMounted:f,open:m}=e,[y,g]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,v]=h.useState(r);cg(x,r)||v(r);const[C,S]=h.useState(null),[w,R]=h.useState(null),j=h.useCallback($=>{$!==D.current&&(D.current=$,S($))},[]),_=h.useCallback($=>{$!==T.current&&(T.current=$,R($))},[]),O=i||C,A=c||w,D=h.useRef(null),T=h.useRef(null),I=h.useRef(y),k=f!=null,F=P0(f),G=P0(s),Y=P0(m),B=h.useCallback(()=>{if(!D.current||!T.current)return;const $={placement:t,strategy:n,middleware:x};G.current&&($.platform=G.current),bV(D.current,T.current,$).then(oe=>{const ge={...oe,isPositioned:Y.current!==!1};Z.current&&!cg(I.current,ge)&&(I.current=ge,Ls.flushSync(()=>{g(ge)}))})},[x,t,n,G,Y]);Gp(()=>{m===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[m]);const Z=h.useRef(!1);Gp(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Gp(()=>{if(O&&(D.current=O),A&&(T.current=A),O&&A){if(F.current)return F.current(O,A,B);B()}},[O,A,B,F,k]);const H=h.useMemo(()=>({reference:D,floating:T,setReference:j,setFloating:_}),[j,_]),M=h.useMemo(()=>({reference:O,floating:A}),[O,A]),V=h.useMemo(()=>{const $={position:n,left:0,top:0};if(!M.floating)return $;const oe=IT(M.floating,y.x),ge=IT(M.floating,y.y);return u?{...$,transform:"translate("+oe+"px, "+ge+"px)",...M4(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:oe,top:ge}},[n,u,M.floating,y.x,y.y]);return h.useMemo(()=>({...y,update:B,refs:H,elements:M,floatingStyles:V}),[y,B,H,M,V])}const EV=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?OT({element:r.current,padding:s}).fn(n):{}:r?OT({element:r,padding:s}).fn(n):{}}}},RV=(e,t)=>({...mV(e),options:[e,t]}),jV=(e,t)=>({...pV(e),options:[e,t]}),TV=(e,t)=>({...vV(e),options:[e,t]}),_V=(e,t)=>({...gV(e),options:[e,t]}),NV=(e,t)=>({...yV(e),options:[e,t]}),AV=(e,t)=>({...xV(e),options:[e,t]}),DV=(e,t)=>({...EV(e),options:[e,t]});var OV="Arrow",k4=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(Je.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});k4.displayName=OV;var IV=k4;function bS(e){const[t,n]=h.useState(void 0);return Hr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let c,u;if("borderBoxSize"in i){const f=i.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,u=m.blockSize}else c=e.offsetWidth,u=e.offsetHeight;n({width:c,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var SS="Popper",[L4,wo]=Sr(SS),[MV,P4]=L4(SS),U4=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return a.jsx(MV,{scope:t,anchor:r,onAnchorChange:s,children:n})};U4.displayName=SS;var z4="PopperAnchor",F4=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=P4(z4,n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return h.useEffect(()=>{const m=f.current;f.current=(r==null?void 0:r.current)||c.current,m!==f.current&&i.onAnchorChange(f.current)}),r?null:a.jsx(Je.div,{...s,ref:u})});F4.displayName=z4;var CS="PopperContent",[kV,LV]=L4(CS),H4=h.forwardRef((e,t)=>{var J,le,ye,Ce,Ve,De;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:y=0,sticky:g="partial",hideWhenDetached:x=!1,updatePositionStrategy:v="optimized",onPlaced:C,...S}=e,w=P4(CS,n),[R,j]=h.useState(null),_=ht(t,et=>j(et)),[O,A]=h.useState(null),D=bS(O),T=(D==null?void 0:D.width)??0,I=(D==null?void 0:D.height)??0,k=r+(i!=="center"?"-"+i:""),F=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},G=Array.isArray(m)?m:[m],Y=G.length>0,B={padding:F,boundary:G.filter(UV),altBoundary:Y},{refs:Z,floatingStyles:H,placement:M,isPositioned:V,middlewareData:$}=wV({strategy:"fixed",placement:k,whileElementsMounted:(...et)=>hV(...et,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[RV({mainAxis:s+I,alignmentAxis:c}),f&&jV({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?TV():void 0,...B}),f&&_V({...B}),NV({...B,apply:({elements:et,rects:rt,availableWidth:dn,availableHeight:zt})=>{const{width:On,height:yn}=rt.reference,Me=et.floating.style;Me.setProperty("--radix-popper-available-width",`${dn}px`),Me.setProperty("--radix-popper-available-height",`${zt}px`),Me.setProperty("--radix-popper-anchor-width",`${On}px`),Me.setProperty("--radix-popper-anchor-height",`${yn}px`)}}),O&&DV({element:O,padding:u}),zV({arrowWidth:T,arrowHeight:I}),x&&AV({strategy:"referenceHidden",...B})]}),[oe,ge]=G4(M),P=Fs(C);Hr(()=>{V&&(P==null||P())},[V,P]);const U=(J=$.arrow)==null?void 0:J.x,z=(le=$.arrow)==null?void 0:le.y,X=((ye=$.arrow)==null?void 0:ye.centerOffset)!==0,[W,ae]=h.useState();return Hr(()=>{R&&ae(window.getComputedStyle(R).zIndex)},[R]),a.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:V?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:W,"--radix-popper-transform-origin":[(Ce=$.transformOrigin)==null?void 0:Ce.x,(Ve=$.transformOrigin)==null?void 0:Ve.y].join(" "),...((De=$.hide)==null?void 0:De.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(kV,{scope:n,placedSide:oe,onArrowChange:A,arrowX:U,arrowY:z,shouldHideArrow:X,children:a.jsx(Je.div,{"data-side":oe,"data-align":ge,...S,ref:_,style:{...S.style,animation:V?void 0:"none"}})})})});H4.displayName=CS;var $4="PopperArrow",PV={top:"bottom",right:"left",bottom:"top",left:"right"},V4=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=LV($4,r),c=PV[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(IV,{...s,ref:n,style:{...s.style,display:"block"}})})});V4.displayName=$4;function UV(e){return e!==null}var zV=e=>({name:"transformOrigin",options:e,fn(t){var w,R,j;const{placement:n,rects:r,middlewareData:s}=t,c=((w=s.arrow)==null?void 0:w.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,y]=G4(n),g={start:"0%",center:"50%",end:"100%"}[y],x=(((R=s.arrow)==null?void 0:R.x)??0)+u/2,v=(((j=s.arrow)==null?void 0:j.y)??0)+f/2;let C="",S="";return m==="bottom"?(C=c?g:`${x}px`,S=`${-f}px`):m==="top"?(C=c?g:`${x}px`,S=`${r.floating.height+f}px`):m==="right"?(C=`${-f}px`,S=c?g:`${v}px`):m==="left"&&(C=`${r.floating.width+f}px`,S=c?g:`${v}px`),{data:{x:C,y:S}}}});function G4(e){const[t,n="center"]=e.split("-");return[t,n]}var dd=U4,fd=F4,Eh=H4,Rh=V4,FV=Symbol("radix.slottable");function HV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=FV,t}var B4=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"}),$V="VisuallyHidden",q4=h.forwardRef((e,t)=>a.jsx(Je.span,{...e,ref:t,style:{...B4,...e.style}}));q4.displayName=$V;var VV=q4,[dy]=Sr("Tooltip",[wo]),fy=wo(),K4="TooltipProvider",GV=700,z1="tooltip.open",[BV,wS]=dy(K4),Z4=e=>{const{__scopeTooltip:t,delayDuration:n=GV,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,c=h.useRef(!0),u=h.useRef(!1),f=h.useRef(0);return h.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),a.jsx(BV,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:h.useCallback(m=>{u.current=m},[]),disableHoverableContent:s,children:i})};Z4.displayName=K4;var Qf="Tooltip",[qV,jh]=dy(Qf),Y4=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=wS(Qf,e.__scopeTooltip),m=fy(t),[y,g]=h.useState(null),x=er(),v=h.useRef(0),C=c??f.disableHoverableContent,S=u??f.delayDuration,w=h.useRef(!1),[R,j]=ia({prop:r,defaultProp:s??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(z1))):f.onClose(),i==null||i(T)},caller:Qf}),_=h.useMemo(()=>R?w.current?"delayed-open":"instant-open":"closed",[R]),O=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,j(!0)},[j]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,j(!1)},[j]),D=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,j(!0),v.current=0},S)},[S,j]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(dd,{...m,children:a.jsx(qV,{scope:t,contentId:x,open:R,stateAttribute:_,trigger:y,onTriggerChange:g,onTriggerEnter:h.useCallback(()=>{f.isOpenDelayedRef.current?D():O()},[f.isOpenDelayedRef,D,O]),onTriggerLeave:h.useCallback(()=>{C?A():(window.clearTimeout(v.current),v.current=0)},[A,C]),onOpen:O,onClose:A,disableHoverableContent:C,children:n})})};Y4.displayName=Qf;var F1="TooltipTrigger",W4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=jh(F1,n),i=wS(F1,n),c=fy(n),u=h.useRef(null),f=ht(t,u,s.onTriggerChange),m=h.useRef(!1),y=h.useRef(!1),g=h.useCallback(()=>m.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),a.jsx(fd,{asChild:!0,...c,children:a.jsx(Je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Ie(e.onPointerMove,x=>{x.pointerType!=="touch"&&!y.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),y.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{s.onTriggerLeave(),y.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Ie(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Ie(e.onBlur,s.onClose),onClick:Ie(e.onClick,s.onClose)})})});W4.displayName=F1;var ES="TooltipPortal",[KV,ZV]=dy(ES,{forceMount:void 0}),X4=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=jh(ES,t);return a.jsx(KV,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};X4.displayName=ES;var Xu="TooltipContent",Q4=h.forwardRef((e,t)=>{const n=ZV(Xu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,c=jh(Xu,e.__scopeTooltip);return a.jsx(Vr,{present:r||c.open,children:c.disableHoverableContent?a.jsx(J4,{side:s,...i,ref:t}):a.jsx(YV,{side:s,...i,ref:t})})}),YV=h.forwardRef((e,t)=>{const n=jh(Xu,e.__scopeTooltip),r=wS(Xu,e.__scopeTooltip),s=h.useRef(null),i=ht(t,s),[c,u]=h.useState(null),{trigger:f,onClose:m}=n,y=s.current,{onPointerInTransitChange:g}=r,x=h.useCallback(()=>{u(null),g(!1)},[g]),v=h.useCallback((C,S)=>{const w=C.currentTarget,R={x:C.clientX,y:C.clientY},j=JV(R,w.getBoundingClientRect()),_=eG(R,j),O=tG(S.getBoundingClientRect()),A=rG([..._,...O]);u(A),g(!0)},[g]);return h.useEffect(()=>()=>x(),[x]),h.useEffect(()=>{if(f&&y){const C=w=>v(w,y),S=w=>v(w,f);return f.addEventListener("pointerleave",C),y.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",C),y.removeEventListener("pointerleave",S)}}},[f,y,v,x]),h.useEffect(()=>{if(c){const C=S=>{const w=S.target,R={x:S.clientX,y:S.clientY},j=(f==null?void 0:f.contains(w))||(y==null?void 0:y.contains(w)),_=!nG(R,c);j?x():_&&(x(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[f,y,c,m,x]),a.jsx(J4,{...e,ref:i})}),[WV,XV]=dy(Qf,{isInside:!1}),QV=HV("TooltipContent"),J4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:c,...u}=e,f=jh(Xu,n),m=fy(n),{onClose:y}=f;return h.useEffect(()=>(document.addEventListener(z1,y),()=>document.removeEventListener(z1,y)),[y]),h.useEffect(()=>{if(f.trigger){const g=x=>{const v=x.target;v!=null&&v.contains(f.trigger)&&y()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,y]),a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:y,children:a.jsxs(Eh,{"data-state":f.stateAttribute,...m,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(QV,{children:r}),a.jsx(WV,{scope:n,isInside:!0,children:a.jsx(VV,{id:f.contentId,role:"tooltip",children:s||r})})]})})});Q4.displayName=Xu;var e3="TooltipArrow",t3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=fy(n);return XV(e3,n).isInside?null:a.jsx(Rh,{...s,...r,ref:t})});t3.displayName=e3;function JV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function eG(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 tG(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 nG(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],m=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-m)*(r-y)/(x-y)+m&&(s=!s)}return s}function rG(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),aG(t)}function aG(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 i=t[t.length-1],c=t[t.length-2];if((i.x-c.x)*(s.y-c.y)>=(i.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 i=n[n.length-1],c=n[n.length-2];if((i.x-c.x)*(s.y-c.y)>=(i.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 sG=Z4,oG=Y4,iG=W4,lG=X4,cG=Q4,uG=t3;function Ya({delayDuration:e=0,...t}){return a.jsx(sG,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Et({...e}){return a.jsx(Ya,{children:a.jsx(oG,{"data-slot":"tooltip",...e})})}function Rt({...e}){return a.jsx(iG,{"data-slot":"tooltip-trigger",...e})}function jt({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(lG,{children:a.jsxs(cG,{"data-slot":"tooltip-content",sideOffset:t,className:se("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,a.jsx(uG,{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 dG="sidebar_state",fG=3600*24*7,hG="16rem",mG="18rem",pG="3rem",gG="b",n3=h.createContext(null);function Th(){const e=h.useContext(n3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function yG({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...c}){const u=Gz(),[f,m]=h.useState(!1),[y,g]=h.useState(e),x=t??y,v=h.useCallback(R=>{const j=typeof R=="function"?R(x):R;n?n(j):g(j),document.cookie=`${dG}=${j}; path=/; max-age=${fG}`},[n,x]),C=h.useCallback(()=>u?m(R=>!R):v(R=>!R),[u,v,m]);h.useEffect(()=>{const R=j=>{j.key===gG&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),C())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[C]);const S=x?"expanded":"collapsed",w=h.useMemo(()=>({state:S,open:x,setOpen:v,isMobile:u,openMobile:f,setOpenMobile:m,toggleSidebar:C}),[S,x,v,u,f,m,C]);return a.jsx(n3.Provider,{value:w,children:a.jsx(Ya,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":hG,"--sidebar-width-icon":pG,...s},className:se("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:i})})})}function xG({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:m}=Th();return n==="none"?a.jsx("div",{"data-slot":"sidebar",className:se("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...i,children:s}):c?a.jsx(ci,{open:f,onOpenChange:m,...i,children:a.jsxs(ui,{"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":mG},side:e,children:[a.jsxs(di,{className:"sr-only",children:[a.jsx(fi,{children:"Sidebar"}),a.jsx(yl,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):a.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a.jsx("div",{"data-slot":"sidebar-gap",className:se("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)")}),a.jsx("div",{"data-slot":"sidebar-container",className:se("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),...i,children:a.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 vG({className:e,onClick:t,...n}){const{toggleSidebar:r}=Th();return a.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:a.jsxs(we,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:se("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[a.jsx(GU,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function bG({className:e,...t}){const{toggleSidebar:n}=Th();return a.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:se("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 SG({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:se("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 CG({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:se("flex flex-col gap-2 p-2",e),...t})}function wG({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:se("flex flex-col gap-2 p-2",e),...t})}function EG({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function MT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:se("relative flex w-full min-w-0 flex-col p-2",e),...t})}function kT({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:se("w-full text-sm",e),...t})}function RG({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:se("flex w-full min-w-0 flex-col gap-1",e),...t})}function jG({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:se("group/menu-item relative",e),...t})}const TG=Ec("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 _G({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...c}){const u=e?yh:"button",{isMobile:f,state:m}=Th(),y=a.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:se(TG({variant:n,size:r}),i),...c});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:y}),a.jsx(jt,{side:"right",align:"center",hidden:m!=="collapsed"||f,...s})]})):y}function H1(e){const t=NG(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(DG);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function NG(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=IG(s),u=OG(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var AG=Symbol("radix.slottable");function DG(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===AG}function OG(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function IG(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 MG(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=H1(u),m=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),O=ht(w,_.collectionRef);return a.jsx(f,{ref:O,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=H1(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,O=re.useRef(null),A=ht(w,O),D=i(y,R);return re.useEffect(()=>(D.itemMap.set(O,{ref:O,..._}),()=>void D.itemMap.delete(O))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,T)=>_.indexOf(D.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var kG=h.createContext(void 0);function _h(e){const t=h.useContext(kG);return e||t||"ltr"}function LT(e){const t=LG(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(UG);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function LG(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=FG(s),u=zG(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var PG=Symbol("radix.slottable");function UG(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===PG}function zG(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function FG(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 HG(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=LT(u),m=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),O=ht(w,_.collectionRef);return a.jsx(f,{ref:O,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=LT(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,O=re.useRef(null),A=ht(w,O),D=i(y,R);return re.useEffect(()=>(D.itemMap.set(O,{ref:O,..._}),()=>void D.itemMap.delete(O))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,T)=>_.indexOf(D.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var U0="rovingFocusGroup.onEntryFocus",$G={bubbles:!1,cancelable:!0},Nh="RovingFocusGroup",[$1,r3,VG]=HG(Nh),[GG,hy]=Sr(Nh,[VG]),[BG,qG]=GG(Nh),a3=h.forwardRef((e,t)=>a.jsx($1.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx($1.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(KG,{...e,ref:t})})}));a3.displayName=Nh;var KG=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...g}=e,x=h.useRef(null),v=ht(t,x),C=_h(i),[S,w]=ia({prop:c,defaultProp:u??null,onChange:f,caller:Nh}),[R,j]=h.useState(!1),_=Fs(m),O=r3(n),A=h.useRef(!1),[D,T]=h.useState(0);return h.useEffect(()=>{const I=x.current;if(I)return I.addEventListener(U0,_),()=>I.removeEventListener(U0,_)},[_]),a.jsx(BG,{scope:n,orientation:r,dir:C,loop:s,currentTabStopId:S,onItemFocus:h.useCallback(I=>w(I),[w]),onItemShiftTab:h.useCallback(()=>j(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(I=>I+1),[]),onFocusableItemRemove:h.useCallback(()=>T(I=>I-1),[]),children:a.jsx(Je.div,{tabIndex:R||D===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{A.current=!0}),onFocus:Ie(e.onFocus,I=>{const k=!A.current;if(I.target===I.currentTarget&&k&&!R){const F=new CustomEvent(U0,$G);if(I.currentTarget.dispatchEvent(F),!F.defaultPrevented){const G=O().filter(M=>M.focusable),Y=G.find(M=>M.active),B=G.find(M=>M.id===S),H=[Y,B,...G].filter(Boolean).map(M=>M.ref.current);i3(H,y)}}A.current=!1}),onBlur:Ie(e.onBlur,()=>j(!1))})})}),s3="RovingFocusGroupItem",o3=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:c,...u}=e,f=er(),m=i||f,y=qG(s3,n),g=y.currentTabStopId===m,x=r3(n),{onFocusableItemAdd:v,onFocusableItemRemove:C,currentTabStopId:S}=y;return h.useEffect(()=>{if(r)return v(),()=>C()},[r,v,C]),a.jsx($1.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:a.jsx(Je.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...u,ref:t,onMouseDown:Ie(e.onMouseDown,w=>{r?y.onItemFocus(m):w.preventDefault()}),onFocus:Ie(e.onFocus,()=>y.onItemFocus(m)),onKeyDown:Ie(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){y.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const R=WG(w,y.orientation,y.dir);if(R!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let _=x().filter(O=>O.focusable).map(O=>O.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const O=_.indexOf(w.currentTarget);_=y.loop?XG(_,O+1):_.slice(O+1)}setTimeout(()=>i3(_))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:S!=null}):c})})});o3.displayName=s3;var ZG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function YG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function WG(e,t,n){const r=YG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return ZG[r]}function i3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function XG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var l3=a3,c3=o3,V1=["Enter"," "],QG=["ArrowDown","PageUp","Home"],u3=["ArrowUp","PageDown","End"],JG=[...QG,...u3],eB={ltr:[...V1,"ArrowRight"],rtl:[...V1,"ArrowLeft"]},tB={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ah="Menu",[Jf,nB,rB]=MG(Ah),[Nc,d3]=Sr(Ah,[rB,wo,hy]),Dh=wo(),f3=hy(),[h3,xl]=Nc(Ah),[aB,Oh]=Nc(Ah),m3=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:c=!0}=e,u=Dh(t),[f,m]=h.useState(null),y=h.useRef(!1),g=Fs(i),x=_h(s);return h.useEffect(()=>{const v=()=>{y.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>y.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),a.jsx(dd,{...u,children:a.jsx(h3,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:m,children:a.jsx(aB,{scope:t,onClose:h.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:y,dir:x,modal:c,children:r})})})};m3.displayName=Ah;var sB="MenuAnchor",RS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Dh(n);return a.jsx(fd,{...s,...r,ref:t})});RS.displayName=sB;var jS="MenuPortal",[oB,p3]=Nc(jS,{forceMount:void 0}),g3=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=xl(jS,t);return a.jsx(oB,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};g3.displayName=jS;var gs="MenuContent",[iB,TS]=Nc(gs),y3=h.forwardRef((e,t)=>{const n=p3(gs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=xl(gs,e.__scopeMenu),c=Oh(gs,e.__scopeMenu);return a.jsx(Jf.Provider,{scope:e.__scopeMenu,children:a.jsx(Vr,{present:r||i.open,children:a.jsx(Jf.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(lB,{...s,ref:t}):a.jsx(cB,{...s,ref:t})})})})}),lB=h.forwardRef((e,t)=>{const n=xl(gs,e.__scopeMenu),r=h.useRef(null),s=ht(t,r);return h.useEffect(()=>{const i=r.current;if(i)return ey(i)},[]),a.jsx(_S,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),cB=h.forwardRef((e,t)=>{const n=xl(gs,e.__scopeMenu);return a.jsx(_S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),uB=H1("MenuContent.ScrollLock"),_S=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,disableOutsideScroll:C,...S}=e,w=xl(gs,n),R=Oh(gs,n),j=Dh(n),_=f3(n),O=nB(n),[A,D]=h.useState(null),T=h.useRef(null),I=ht(t,T,w.onContentChange),k=h.useRef(0),F=h.useRef(""),G=h.useRef(0),Y=h.useRef(null),B=h.useRef("right"),Z=h.useRef(0),H=C?Ch:h.Fragment,M=C?{as:uB,allowPinchZoom:!0}:void 0,V=oe=>{var J,le;const ge=F.current+oe,P=O().filter(ye=>!ye.disabled),U=document.activeElement,z=(J=P.find(ye=>ye.ref.current===U))==null?void 0:J.textValue,X=P.map(ye=>ye.textValue),W=CB(X,ge,z),ae=(le=P.find(ye=>ye.textValue===W))==null?void 0:le.ref.current;(function ye(Ce){F.current=Ce,window.clearTimeout(k.current),Ce!==""&&(k.current=window.setTimeout(()=>ye(""),1e3))})(ge),ae&&setTimeout(()=>ae.focus())};h.useEffect(()=>()=>window.clearTimeout(k.current),[]),Qg();const $=h.useCallback(oe=>{var P,U;return B.current===((P=Y.current)==null?void 0:P.side)&&EB(oe,(U=Y.current)==null?void 0:U.area)},[]);return a.jsx(iB,{scope:n,searchRef:F,onItemEnter:h.useCallback(oe=>{$(oe)&&oe.preventDefault()},[$]),onItemLeave:h.useCallback(oe=>{var ge;$(oe)||((ge=T.current)==null||ge.focus(),D(null))},[$]),onTriggerLeave:h.useCallback(oe=>{$(oe)&&oe.preventDefault()},[$]),pointerGraceTimerRef:G,onPointerGraceIntentChange:h.useCallback(oe=>{Y.current=oe},[]),children:a.jsx(H,{...M,children:a.jsx(Sh,{asChild:!0,trapped:s,onMountAutoFocus:Ie(i,oe=>{var ge;oe.preventDefault(),(ge=T.current)==null||ge.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:x,onDismiss:v,children:a.jsx(l3,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:D,onEntryFocus:Ie(f,oe=>{R.isUsingKeyboardRef.current||oe.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Eh,{role:"menu","aria-orientation":"vertical","data-state":M3(w.open),"data-radix-menu-content":"",dir:R.dir,...j,...S,ref:I,style:{outline:"none",...S.style},onKeyDown:Ie(S.onKeyDown,oe=>{const P=oe.target.closest("[data-radix-menu-content]")===oe.currentTarget,U=oe.ctrlKey||oe.altKey||oe.metaKey,z=oe.key.length===1;P&&(oe.key==="Tab"&&oe.preventDefault(),!U&&z&&V(oe.key));const X=T.current;if(oe.target!==X||!JG.includes(oe.key))return;oe.preventDefault();const ae=O().filter(J=>!J.disabled).map(J=>J.ref.current);u3.includes(oe.key)&&ae.reverse(),bB(ae)}),onBlur:Ie(e.onBlur,oe=>{oe.currentTarget.contains(oe.target)||(window.clearTimeout(k.current),F.current="")}),onPointerMove:Ie(e.onPointerMove,eh(oe=>{const ge=oe.target,P=Z.current!==oe.clientX;if(oe.currentTarget.contains(ge)&&P){const U=oe.clientX>Z.current?"right":"left";B.current=U,Z.current=oe.clientX}}))})})})})})})});y3.displayName=gs;var dB="MenuGroup",NS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{role:"group",...r,ref:t})});NS.displayName=dB;var fB="MenuLabel",x3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{...r,ref:t})});x3.displayName=fB;var ug="MenuItem",PT="menu.itemSelect",my=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=h.useRef(null),c=Oh(ug,e.__scopeMenu),u=TS(ug,e.__scopeMenu),f=ht(t,i),m=h.useRef(!1),y=()=>{const g=i.current;if(!n&&g){const x=new CustomEvent(PT,{bubbles:!0,cancelable:!0});g.addEventListener(PT,v=>r==null?void 0:r(v),{once:!0}),YA(g,x),x.defaultPrevented?m.current=!1:c.onClose()}};return a.jsx(v3,{...s,ref:f,disabled:n,onClick:Ie(e.onClick,y),onPointerDown:g=>{var x;(x=e.onPointerDown)==null||x.call(e,g),m.current=!0},onPointerUp:Ie(e.onPointerUp,g=>{var x;m.current||(x=g.currentTarget)==null||x.click()}),onKeyDown:Ie(e.onKeyDown,g=>{const x=u.searchRef.current!=="";n||x&&g.key===" "||V1.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});my.displayName=ug;var v3=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,c=TS(ug,n),u=f3(n),f=h.useRef(null),m=ht(t,f),[y,g]=h.useState(!1),[x,v]=h.useState("");return h.useEffect(()=>{const C=f.current;C&&v((C.textContent??"").trim())},[i.children]),a.jsx(Jf.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:a.jsx(c3,{asChild:!0,...u,focusable:!r,children:a.jsx(Je.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:m,onPointerMove:Ie(e.onPointerMove,eh(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,eh(C=>c.onItemLeave(C))),onFocus:Ie(e.onFocus,()=>g(!0)),onBlur:Ie(e.onBlur,()=>g(!1))})})})}),hB="MenuCheckboxItem",b3=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(R3,{scope:e.__scopeMenu,checked:n,children:a.jsx(my,{role:"menuitemcheckbox","aria-checked":dg(n)?"mixed":n,...s,ref:t,"data-state":OS(n),onSelect:Ie(s.onSelect,()=>r==null?void 0:r(dg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});b3.displayName=hB;var S3="MenuRadioGroup",[mB,pB]=Nc(S3,{value:void 0,onValueChange:()=>{}}),C3=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Fs(r);return a.jsx(mB,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(NS,{...s,ref:t})})});C3.displayName=S3;var w3="MenuRadioItem",E3=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=pB(w3,e.__scopeMenu),i=n===s.value;return a.jsx(R3,{scope:e.__scopeMenu,checked:i,children:a.jsx(my,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":OS(i),onSelect:Ie(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});E3.displayName=w3;var AS="MenuItemIndicator",[R3,gB]=Nc(AS,{checked:!1}),j3=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=gB(AS,n);return a.jsx(Vr,{present:r||dg(i.checked)||i.checked===!0,children:a.jsx(Je.span,{...s,ref:t,"data-state":OS(i.checked)})})});j3.displayName=AS;var yB="MenuSeparator",T3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(Je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});T3.displayName=yB;var xB="MenuArrow",_3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Dh(n);return a.jsx(Rh,{...s,...r,ref:t})});_3.displayName=xB;var DS="MenuSub",[vB,N3]=Nc(DS),A3=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,i=xl(DS,t),c=Dh(t),[u,f]=h.useState(null),[m,y]=h.useState(null),g=Fs(s);return h.useEffect(()=>(i.open===!1&&g(!1),()=>g(!1)),[i.open,g]),a.jsx(dd,{...c,children:a.jsx(h3,{scope:t,open:r,onOpenChange:g,content:m,onContentChange:y,children:a.jsx(vB,{scope:t,contentId:er(),triggerId:er(),trigger:u,onTriggerChange:f,children:n})})})};A3.displayName=DS;var Df="MenuSubTrigger",D3=h.forwardRef((e,t)=>{const n=xl(Df,e.__scopeMenu),r=Oh(Df,e.__scopeMenu),s=N3(Df,e.__scopeMenu),i=TS(Df,e.__scopeMenu),c=h.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,m={__scopeMenu:e.__scopeMenu},y=h.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return h.useEffect(()=>y,[y]),h.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),f(null)}},[u,f]),a.jsx(RS,{asChild:!0,...m,children:a.jsx(v3,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":M3(n.open),...e,ref:Xr(t,s.onTriggerChange),onClick:g=>{var x;(x=e.onClick)==null||x.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(e.onPointerMove,eh(g=>{i.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(i.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),y()},100))})),onPointerLeave:Ie(e.onPointerLeave,eh(g=>{var v,C;y();const x=(v=n.content)==null?void 0:v.getBoundingClientRect();if(x){const S=(C=n.content)==null?void 0:C.dataset.side,w=S==="right",R=w?-5:5,j=x[w?"left":"right"],_=x[w?"right":"left"];i.onPointerGraceIntentChange({area:[{x:g.clientX+R,y:g.clientY},{x:j,y:x.top},{x:_,y:x.top},{x:_,y:x.bottom},{x:j,y:x.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(g),g.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(e.onKeyDown,g=>{var v;const x=i.searchRef.current!=="";e.disabled||x&&g.key===" "||eB[r.dir].includes(g.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),g.preventDefault())})})})});D3.displayName=Df;var O3="MenuSubContent",I3=h.forwardRef((e,t)=>{const n=p3(gs,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=xl(gs,e.__scopeMenu),c=Oh(gs,e.__scopeMenu),u=N3(O3,e.__scopeMenu),f=h.useRef(null),m=ht(t,f);return a.jsx(Jf.Provider,{scope:e.__scopeMenu,children:a.jsx(Vr,{present:r||i.open,children:a.jsx(Jf.Slot,{scope:e.__scopeMenu,children:a.jsx(_S,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:y=>{var g;c.isUsingKeyboardRef.current&&((g=f.current)==null||g.focus()),y.preventDefault()},onCloseAutoFocus:y=>y.preventDefault(),onFocusOutside:Ie(e.onFocusOutside,y=>{y.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,y=>{c.onClose(),y.preventDefault()}),onKeyDown:Ie(e.onKeyDown,y=>{var v;const g=y.currentTarget.contains(y.target),x=tB[c.dir].includes(y.key);g&&x&&(i.onOpenChange(!1),(v=u.trigger)==null||v.focus(),y.preventDefault())})})})})})});I3.displayName=O3;function M3(e){return e?"open":"closed"}function dg(e){return e==="indeterminate"}function OS(e){return dg(e)?"indeterminate":e?"checked":"unchecked"}function bB(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function SB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function CB(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=SB(e,Math.max(i,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function wB(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,c=t.length-1;i<t.length;c=i++){const u=t[i],f=t[c],m=u.x,y=u.y,g=f.x,x=f.y;y>r!=x>r&&n<(g-m)*(r-y)/(x-y)+m&&(s=!s)}return s}function EB(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return wB(n,t)}function eh(e){return t=>t.pointerType==="mouse"?e(t):void 0}var RB=m3,jB=RS,TB=g3,_B=y3,NB=NS,AB=x3,DB=my,OB=b3,IB=C3,MB=E3,kB=j3,LB=T3,PB=_3,UB=A3,zB=D3,FB=I3,py="DropdownMenu",[HB]=Sr(py,[d3]),Qr=d3(),[$B,k3]=HB(py),L3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=Qr(t),m=h.useRef(null),[y,g]=ia({prop:s,defaultProp:i??!1,onChange:c,caller:py});return a.jsx($B,{scope:t,triggerId:er(),triggerRef:m,contentId:er(),open:y,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(x=>!x),[g]),modal:u,children:a.jsx(RB,{...f,open:y,onOpenChange:g,dir:r,modal:u,children:n})})};L3.displayName=py;var P3="DropdownMenuTrigger",U3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=k3(P3,n),c=Qr(n);return a.jsx(jB,{asChild:!0,...c,children:a.jsx(Je.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Xr(t,i.triggerRef),onPointerDown:Ie(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Ie(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});U3.displayName=P3;var VB="DropdownMenuPortal",z3=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Qr(t);return a.jsx(TB,{...r,...n})};z3.displayName=VB;var F3="DropdownMenuContent",H3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=k3(F3,n),i=Qr(n),c=h.useRef(!1);return a.jsx(_B,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,u=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:Ie(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,y=f.button===2||m;(!s.modal||y)&&(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)"}})});H3.displayName=F3;var GB="DropdownMenuGroup",BB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(NB,{...s,...r,ref:t})});BB.displayName=GB;var qB="DropdownMenuLabel",KB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(AB,{...s,...r,ref:t})});KB.displayName=qB;var ZB="DropdownMenuItem",$3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(DB,{...s,...r,ref:t})});$3.displayName=ZB;var YB="DropdownMenuCheckboxItem",WB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(OB,{...s,...r,ref:t})});WB.displayName=YB;var XB="DropdownMenuRadioGroup",QB=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(IB,{...s,...r,ref:t})});QB.displayName=XB;var JB="DropdownMenuRadioItem",eq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(MB,{...s,...r,ref:t})});eq.displayName=JB;var tq="DropdownMenuItemIndicator",nq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(kB,{...s,...r,ref:t})});nq.displayName=tq;var rq="DropdownMenuSeparator",V3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(LB,{...s,...r,ref:t})});V3.displayName=rq;var aq="DropdownMenuArrow",sq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(PB,{...s,...r,ref:t})});sq.displayName=aq;var oq=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:i}=e,c=Qr(t),[u,f]=ia({prop:r,defaultProp:i??!1,onChange:s,caller:"DropdownMenuSub"});return a.jsx(UB,{...c,open:u,onOpenChange:f,children:n})},iq="DropdownMenuSubTrigger",G3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(zB,{...s,...r,ref:t})});G3.displayName=iq;var lq="DropdownMenuSubContent",B3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Qr(n);return a.jsx(FB,{...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)"}})});B3.displayName=lq;var cq=L3,uq=U3,q3=z3,dq=H3,fq=$3,hq=V3,mq=oq,pq=G3,gq=B3;function Cr({...e}){return a.jsx(cq,{"data-slot":"dropdown-menu",...e})}function yq({...e}){return a.jsx(q3,{"data-slot":"dropdown-menu-portal",...e})}function wr({...e}){return a.jsx(uq,{"data-slot":"dropdown-menu-trigger",...e})}function Er({className:e,sideOffset:t=4,...n}){return a.jsx(q3,{children:a.jsx(dq,{"data-slot":"dropdown-menu-content",sideOffset:t,className:se("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 vt({className:e,inset:t,variant:n="default",...r}){return a.jsx(fq,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:se("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 la({className:e,...t}){return a.jsx(hq,{"data-slot":"dropdown-menu-separator",className:se("bg-border -mx-1 my-1 h-px",e),...t})}function gy({...e}){return a.jsx(mq,{"data-slot":"dropdown-menu-sub",...e})}function yy({className:e,inset:t,children:n,...r}){return a.jsxs(pq,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:se("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,a.jsx(_a,{className:"ml-auto size-4"})]})}function xy({className:e,...t}){return a.jsx(gq,{"data-slot":"dropdown-menu-sub-content",className:se("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 xq="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",vq=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:xq,alt:"OWOX Logo",width:e,height:t,className:n}),K3=h.createContext(null),Z3=h.createContext(()=>{});function Y3(){return h.useContext(Z3)}function th(e){const t=h.useContext(K3);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function W3(){return th(e=>e.project)}function hd(){const{data:e,callState:t,error:n}=th(r=>r.flags);return{flags:e,callState:t,error:n}}function bq({isOpen:e}){const{title:t}=W3();return a.jsx(wr,{asChild:!0,children:a.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:[a.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:a.jsx(vq,{width:24,height:24})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),a.jsx(Ss,{className:`ml-auto size-4 transition-transform duration-200 ${e?"-rotate-90":""}`})]})})}var Zr=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Zr||{});function X3(e,t){return function(){return e.apply(t,arguments)}}const{toString:Sq}=Object.prototype,{getPrototypeOf:IS}=Object,{iterator:vy,toStringTag:Q3}=Symbol,by=(e=>t=>{const n=Sq.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zs=e=>(e=e.toLowerCase(),t=>by(t)===e),Sy=e=>t=>typeof t===e,{isArray:md}=Array,Qu=Sy("undefined");function Ih(e){return e!==null&&!Qu(e)&&e.constructor!==null&&!Qu(e.constructor)&&Ra(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const J3=Zs("ArrayBuffer");function Cq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&J3(e.buffer),t}const wq=Sy("string"),Ra=Sy("function"),eD=Sy("number"),Mh=e=>e!==null&&typeof e=="object",Eq=e=>e===!0||e===!1,Bp=e=>{if(by(e)!=="object")return!1;const t=IS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Q3 in e)&&!(vy in e)},Rq=e=>{if(!Mh(e)||Ih(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},jq=Zs("Date"),Tq=Zs("File"),_q=Zs("Blob"),Nq=Zs("FileList"),Aq=e=>Mh(e)&&Ra(e.pipe),Dq=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ra(e.append)&&((t=by(e))==="formdata"||t==="object"&&Ra(e.toString)&&e.toString()==="[object FormData]"))},Oq=Zs("URLSearchParams"),[Iq,Mq,kq,Lq]=["ReadableStream","Request","Response","Headers"].map(Zs),Pq=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function kh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),md(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Ih(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),c=i.length;let u;for(r=0;r<c;r++)u=i[r],t.call(null,e[u],u,e)}}function tD(e,t){if(Ih(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 rc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nD=e=>!Qu(e)&&e!==rc;function G1(){const{caseless:e,skipUndefined:t}=nD(this)&&this||{},n={},r=(s,i)=>{const c=e&&tD(n,i)||i;Bp(n[c])&&Bp(s)?n[c]=G1(n[c],s):Bp(s)?n[c]=G1({},s):md(s)?n[c]=s.slice():(!t||!Qu(s))&&(n[c]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&kh(arguments[s],r);return n}const Uq=(e,t,n,{allOwnKeys:r}={})=>(kh(t,(s,i)=>{n&&Ra(s)?e[i]=X3(s,n):e[i]=s},{allOwnKeys:r}),e),zq=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Fq=(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)},Hq=(e,t,n,r)=>{let s,i,c;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)c=s[i],(!r||r(c,e,t))&&!u[c]&&(t[c]=e[c],u[c]=!0);e=n!==!1&&IS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},$q=(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},Vq=e=>{if(!e)return null;if(md(e))return e;let t=e.length;if(!eD(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Gq=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&IS(Uint8Array)),Bq=(e,t)=>{const r=(e&&e[vy]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},qq=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Kq=Zs("HTMLFormElement"),Zq=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),UT=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Yq=Zs("RegExp"),rD=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};kh(n,(s,i)=>{let c;(c=t(s,i,e))!==!1&&(r[i]=c||s)}),Object.defineProperties(e,r)},Wq=e=>{rD(e,(t,n)=>{if(Ra(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ra(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+"'")})}})},Xq=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return md(e)?r(e):r(String(e).split(t)),n},Qq=()=>{},Jq=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function eK(e){return!!(e&&Ra(e.append)&&e[Q3]==="FormData"&&e[vy])}const tK=e=>{const t=new Array(10),n=(r,s)=>{if(Mh(r)){if(t.indexOf(r)>=0)return;if(Ih(r))return r;if(!("toJSON"in r)){t[s]=r;const i=md(r)?[]:{};return kh(r,(c,u)=>{const f=n(c,s+1);!Qu(f)&&(i[u]=f)}),t[s]=void 0,i}}return r};return n(e,0)},nK=Zs("AsyncFunction"),rK=e=>e&&(Mh(e)||Ra(e))&&Ra(e.then)&&Ra(e.catch),aD=((e,t)=>e?setImmediate:t?((n,r)=>(rc.addEventListener("message",({source:s,data:i})=>{s===rc&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),rc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ra(rc.postMessage)),aK=typeof queueMicrotask<"u"?queueMicrotask.bind(rc):typeof process<"u"&&process.nextTick||aD,sK=e=>e!=null&&Ra(e[vy]),me={isArray:md,isArrayBuffer:J3,isBuffer:Ih,isFormData:Dq,isArrayBufferView:Cq,isString:wq,isNumber:eD,isBoolean:Eq,isObject:Mh,isPlainObject:Bp,isEmptyObject:Rq,isReadableStream:Iq,isRequest:Mq,isResponse:kq,isHeaders:Lq,isUndefined:Qu,isDate:jq,isFile:Tq,isBlob:_q,isRegExp:Yq,isFunction:Ra,isStream:Aq,isURLSearchParams:Oq,isTypedArray:Gq,isFileList:Nq,forEach:kh,merge:G1,extend:Uq,trim:Pq,stripBOM:zq,inherits:Fq,toFlatObject:Hq,kindOf:by,kindOfTest:Zs,endsWith:$q,toArray:Vq,forEachEntry:Bq,matchAll:qq,isHTMLForm:Kq,hasOwnProperty:UT,hasOwnProp:UT,reduceDescriptors:rD,freezeMethods:Wq,toObjectSet:Xq,toCamelCase:Zq,noop:Qq,toFiniteNumber:Jq,findKey:tD,global:rc,isContextDefined:nD,isSpecCompliantForm:eK,toJSONObject:tK,isAsyncFn:nK,isThenable:rK,setImmediate:aD,asap:aK,isIterable:sK};function Ct(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)}me.inherits(Ct,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:me.toJSONObject(this.config),code:this.code,status:this.status}}});const sD=Ct.prototype,oD={};["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=>{oD[e]={value:e}});Object.defineProperties(Ct,oD);Object.defineProperty(sD,"isAxiosError",{value:!0});Ct.from=(e,t,n,r,s,i)=>{const c=Object.create(sD);me.toFlatObject(e,c,function(y){return y!==Error.prototype},m=>m!=="isAxiosError");const u=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return Ct.call(c,u,f,n,r,s),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",i&&Object.assign(c,i),c};const oK=null;function B1(e){return me.isPlainObject(e)||me.isArray(e)}function iD(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function zT(e,t,n){return e?e.concat(t).map(function(s,i){return s=iD(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function iK(e){return me.isArray(e)&&!e.some(B1)}const lK=me.toFlatObject(me,{},null,function(t){return/^is[A-Z]/.test(t)});function Cy(e,t,n){if(!me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,w){return!me.isUndefined(w[S])});const r=n.metaTokens,s=n.visitor||y,i=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&me.isSpecCompliantForm(t);if(!me.isFunction(s))throw new TypeError("visitor must be a function");function m(C){if(C===null)return"";if(me.isDate(C))return C.toISOString();if(me.isBoolean(C))return C.toString();if(!f&&me.isBlob(C))throw new Ct("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(C)||me.isTypedArray(C)?f&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function y(C,S,w){let R=C;if(C&&!w&&typeof C=="object"){if(me.endsWith(S,"{}"))S=r?S:S.slice(0,-2),C=JSON.stringify(C);else if(me.isArray(C)&&iK(C)||(me.isFileList(C)||me.endsWith(S,"[]"))&&(R=me.toArray(C)))return S=iD(S),R.forEach(function(_,O){!(me.isUndefined(_)||_===null)&&t.append(c===!0?zT([S],O,i):c===null?S:S+"[]",m(_))}),!1}return B1(C)?!0:(t.append(zT(w,S,i),m(C)),!1)}const g=[],x=Object.assign(lK,{defaultVisitor:y,convertValue:m,isVisitable:B1});function v(C,S){if(!me.isUndefined(C)){if(g.indexOf(C)!==-1)throw Error("Circular reference detected in "+S.join("."));g.push(C),me.forEach(C,function(R,j){(!(me.isUndefined(R)||R===null)&&s.call(t,R,me.isString(j)?j.trim():j,S,x))===!0&&v(R,S?S.concat(j):[j])}),g.pop()}}if(!me.isObject(e))throw new TypeError("data must be an object");return v(e),t}function FT(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function MS(e,t){this._pairs=[],e&&Cy(e,this,t)}const lD=MS.prototype;lD.append=function(t,n){this._pairs.push([t,n])};lD.toString=function(t){const n=t?function(r){return t.call(this,r,FT)}:FT;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function cK(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function cD(e,t,n){if(!t)return e;const r=n&&n.encode||cK;me.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=me.isURLSearchParams(t)?t.toString():new MS(t,n).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class HT{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){me.forEach(this.handlers,function(r){r!==null&&t(r)})}}const uD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},uK=typeof URLSearchParams<"u"?URLSearchParams:MS,dK=typeof FormData<"u"?FormData:null,fK=typeof Blob<"u"?Blob:null,hK={isBrowser:!0,classes:{URLSearchParams:uK,FormData:dK,Blob:fK},protocols:["http","https","file","blob","url","data"]},kS=typeof window<"u"&&typeof document<"u",q1=typeof navigator=="object"&&navigator||void 0,mK=kS&&(!q1||["ReactNative","NativeScript","NS"].indexOf(q1.product)<0),pK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gK=kS&&window.location.href||"http://localhost",yK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:kS,hasStandardBrowserEnv:mK,hasStandardBrowserWebWorkerEnv:pK,navigator:q1,origin:gK},Symbol.toStringTag,{value:"Module"})),Kr={...yK,...hK};function xK(e,t){return Cy(e,new Kr.classes.URLSearchParams,{visitor:function(n,r,s,i){return Kr.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function vK(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function bK(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function dD(e){function t(n,r,s,i){let c=n[i++];if(c==="__proto__")return!0;const u=Number.isFinite(+c),f=i>=n.length;return c=!c&&me.isArray(s)?s.length:c,f?(me.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!u):((!s[c]||!me.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],i)&&me.isArray(s[c])&&(s[c]=bK(s[c])),!u)}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};return me.forEachEntry(e,(r,s)=>{t(vK(r),s,n,0)}),n}return null}function SK(e,t,n){if(me.isString(e))try{return(t||JSON.parse)(e),me.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Lh={transitional:uD,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=me.isObject(t);if(i&&me.isHTMLForm(t)&&(t=new FormData(t)),me.isFormData(t))return s?JSON.stringify(dD(t)):t;if(me.isArrayBuffer(t)||me.isBuffer(t)||me.isStream(t)||me.isFile(t)||me.isBlob(t)||me.isReadableStream(t))return t;if(me.isArrayBufferView(t))return t.buffer;if(me.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return xK(t,this.formSerializer).toString();if((u=me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Cy(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),SK(t)):t}],transformResponse:[function(t){const n=this.transitional||Lh.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(me.isResponse(t)||me.isReadableStream(t))return t;if(t&&me.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(u){if(c)throw u.name==="SyntaxError"?Ct.from(u,Ct.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Kr.classes.FormData,Blob:Kr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],e=>{Lh.headers[e]={}});const CK=me.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"]),wK=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
596
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&CK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},$T=Symbol("internals");function bf(e){return e&&String(e).trim().toLowerCase()}function qp(e){return e===!1||e==null?e:me.isArray(e)?e.map(qp):String(e)}function EK(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 RK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function z0(e,t,n,r,s){if(me.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!me.isString(t)){if(me.isString(r))return t.indexOf(r)!==-1;if(me.isRegExp(r))return r.test(t)}}function jK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function TK(e,t){const n=me.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,c){return this[r].call(this,t,s,i,c)},configurable:!0})})}let ja=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,f,m){const y=bf(f);if(!y)throw new Error("header name must be a non-empty string");const g=me.findKey(s,y);(!g||s[g]===void 0||m===!0||m===void 0&&s[g]!==!1)&&(s[g||f]=qp(u))}const c=(u,f)=>me.forEach(u,(m,y)=>i(m,y,f));if(me.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(me.isString(t)&&(t=t.trim())&&!RK(t))c(wK(t),n);else if(me.isObject(t)&&me.isIterable(t)){let u={},f,m;for(const y of t){if(!me.isArray(y))throw TypeError("Object iterator must return a key-value pair");u[m=y[0]]=(f=u[m])?me.isArray(f)?[...f,y[1]]:[f,y[1]]:y[1]}c(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=bf(t),t){const r=me.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return EK(s);if(me.isFunction(n))return n.call(this,s,r);if(me.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=bf(t),t){const r=me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||z0(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(c){if(c=bf(c),c){const u=me.findKey(r,c);u&&(!n||z0(r,r[u],u,n))&&(delete r[u],s=!0)}}return me.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||z0(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return me.forEach(this,(s,i)=>{const c=me.findKey(r,i);if(c){n[c]=qp(s),delete n[i];return}const u=t?jK(i):String(i).trim();u!==i&&delete n[i],n[u]=qp(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return me.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&me.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(`
|
|
597
|
-
`)}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[$T]=this[$T]={accessors:{}}).accessors,s=this.prototype;function i(c){const u=bf(c);r[u]||(TK(s,c),r[u]=!0)}return me.isArray(t)?t.forEach(i):i(t),this}};ja.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(ja.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});me.freezeMethods(ja);function F0(e,t){const n=this||Lh,r=t||n,s=ja.from(r.headers);let i=r.data;return me.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function fD(e){return!!(e&&e.__CANCEL__)}function pd(e,t,n){Ct.call(this,e??"canceled",Ct.ERR_CANCELED,t,n),this.name="CanceledError"}me.inherits(pd,Ct,{__CANCEL__:!0});function hD(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ct("Request failed with status code "+n.status,[Ct.ERR_BAD_REQUEST,Ct.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function _K(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function NK(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,c;return t=t!==void 0?t:1e3,function(f){const m=Date.now(),y=r[i];c||(c=m),n[s]=f,r[s]=m;let g=i,x=0;for(;g!==s;)x+=n[g++],g=g%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),m-c<t)return;const v=y&&m-y;return v?Math.round(x*1e3/v):void 0}}function AK(e,t){let n=0,r=1e3/t,s,i;const c=(m,y=Date.now())=>{n=y,s=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const y=Date.now(),g=y-n;g>=r?c(m,y):(s=m,i||(i=setTimeout(()=>{i=null,c(s)},r-g)))},()=>s&&c(s)]}const fg=(e,t,n=3)=>{let r=0;const s=NK(50,250);return AK(i=>{const c=i.loaded,u=i.lengthComputable?i.total:void 0,f=c-r,m=s(f),y=c<=u;r=c;const g={loaded:c,total:u,progress:u?c/u:void 0,bytes:f,rate:m||void 0,estimated:m&&u&&y?(u-c)/m:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},VT=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},GT=e=>(...t)=>me.asap(()=>e(...t)),DK=Kr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Kr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Kr.origin),Kr.navigator&&/(msie|trident)/i.test(Kr.navigator.userAgent)):()=>!0,OK=Kr.hasStandardBrowserEnv?{write(e,t,n,r,s,i,c){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];me.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),me.isString(r)&&u.push(`path=${r}`),me.isString(s)&&u.push(`domain=${s}`),i===!0&&u.push("secure"),me.isString(c)&&u.push(`SameSite=${c}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function IK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function MK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mD(e,t,n){let r=!IK(t);return e&&(r||n==!1)?MK(e,t):t}const BT=e=>e instanceof ja?{...e}:e;function hc(e,t){t=t||{};const n={};function r(m,y,g,x){return me.isPlainObject(m)&&me.isPlainObject(y)?me.merge.call({caseless:x},m,y):me.isPlainObject(y)?me.merge({},y):me.isArray(y)?y.slice():y}function s(m,y,g,x){if(me.isUndefined(y)){if(!me.isUndefined(m))return r(void 0,m,g,x)}else return r(m,y,g,x)}function i(m,y){if(!me.isUndefined(y))return r(void 0,y)}function c(m,y){if(me.isUndefined(y)){if(!me.isUndefined(m))return r(void 0,m)}else return r(void 0,y)}function u(m,y,g){if(g in t)return r(m,y);if(g in e)return r(void 0,m)}const f={url:i,method:i,data:i,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:u,headers:(m,y,g)=>s(BT(m),BT(y),g,!0)};return me.forEach(Object.keys({...e,...t}),function(y){const g=f[y]||s,x=g(e[y],t[y],y);me.isUndefined(x)&&g!==u||(n[y]=x)}),n}const pD=e=>{const t=hc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=t;if(t.headers=c=ja.from(c),t.url=cD(mD(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),me.isFormData(n)){if(Kr.hasStandardBrowserEnv||Kr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(me.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([y,g])=>{m.includes(y.toLowerCase())&&c.set(y,g)})}}if(Kr.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(t)),r||r!==!1&&DK(t.url))){const f=s&&i&&OK.read(i);f&&c.set(s,f)}return t},kK=typeof XMLHttpRequest<"u",LK=kK&&function(e){return new Promise(function(n,r){const s=pD(e);let i=s.data;const c=ja.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:m}=s,y,g,x,v,C;function S(){v&&v(),C&&C(),s.cancelToken&&s.cancelToken.unsubscribe(y),s.signal&&s.signal.removeEventListener("abort",y)}let w=new XMLHttpRequest;w.open(s.method.toUpperCase(),s.url,!0),w.timeout=s.timeout;function R(){if(!w)return;const _=ja.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),A={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:_,config:e,request:w};hD(function(T){n(T),S()},function(T){r(T),S()},A),w=null}"onloadend"in w?w.onloadend=R:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(R)},w.onabort=function(){w&&(r(new Ct("Request aborted",Ct.ECONNABORTED,e,w)),w=null)},w.onerror=function(O){const A=O&&O.message?O.message:"Network Error",D=new Ct(A,Ct.ERR_NETWORK,e,w);D.event=O||null,r(D),w=null},w.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||uD;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new Ct(O,A.clarifyTimeoutError?Ct.ETIMEDOUT:Ct.ECONNABORTED,e,w)),w=null},i===void 0&&c.setContentType(null),"setRequestHeader"in w&&me.forEach(c.toJSON(),function(O,A){w.setRequestHeader(A,O)}),me.isUndefined(s.withCredentials)||(w.withCredentials=!!s.withCredentials),u&&u!=="json"&&(w.responseType=s.responseType),m&&([x,C]=fg(m,!0),w.addEventListener("progress",x)),f&&w.upload&&([g,v]=fg(f),w.upload.addEventListener("progress",g),w.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(y=_=>{w&&(r(!_||_.type?new pd(null,e,w):_),w.abort(),w=null)},s.cancelToken&&s.cancelToken.subscribe(y),s.signal&&(s.signal.aborted?y():s.signal.addEventListener("abort",y)));const j=_K(s.url);if(j&&Kr.protocols.indexOf(j)===-1){r(new Ct("Unsupported protocol "+j+":",Ct.ERR_BAD_REQUEST,e));return}w.send(i||null)})},PK=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const i=function(m){if(!s){s=!0,u();const y=m instanceof Error?m:this.reason;r.abort(y instanceof Ct?y:new pd(y instanceof Error?y.message:y))}};let c=t&&setTimeout(()=>{c=null,i(new Ct(`timeout ${t} of ms exceeded`,Ct.ETIMEDOUT))},t);const u=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(i):m.removeEventListener("abort",i)}),e=null)};e.forEach(m=>m.addEventListener("abort",i));const{signal:f}=r;return f.unsubscribe=()=>me.asap(u),f}},UK=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},zK=async function*(e,t){for await(const n of FK(e))yield*UK(n,t)},FK=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()}},qT=(e,t,n,r)=>{const s=zK(e,t);let i=0,c,u=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:m,value:y}=await s.next();if(m){u(),f.close();return}let g=y.byteLength;if(n){let x=i+=g;n(x)}f.enqueue(new Uint8Array(y))}catch(m){throw u(m),m}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},KT=64*1024,{isFunction:vp}=me,HK=(({Request:e,Response:t})=>({Request:e,Response:t}))(me.global),{ReadableStream:ZT,TextEncoder:YT}=me.global,WT=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$K=e=>{e=me.merge.call({skipUndefined:!0},HK,e);const{fetch:t,Request:n,Response:r}=e,s=t?vp(t):typeof fetch=="function",i=vp(n),c=vp(r);if(!s)return!1;const u=s&&vp(ZT),f=s&&(typeof YT=="function"?(C=>S=>C.encode(S))(new YT):async C=>new Uint8Array(await new n(C).arrayBuffer())),m=i&&u&&WT(()=>{let C=!1;const S=new n(Kr.origin,{body:new ZT,method:"POST",get duplex(){return C=!0,"half"}}).headers.has("Content-Type");return C&&!S}),y=c&&u&&WT(()=>me.isReadableStream(new r("").body)),g={stream:y&&(C=>C.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(C=>{!g[C]&&(g[C]=(S,w)=>{let R=S&&S[C];if(R)return R.call(S);throw new Ct(`Response type '${C}' is not supported`,Ct.ERR_NOT_SUPPORT,w)})});const x=async C=>{if(C==null)return 0;if(me.isBlob(C))return C.size;if(me.isSpecCompliantForm(C))return(await new n(Kr.origin,{method:"POST",body:C}).arrayBuffer()).byteLength;if(me.isArrayBufferView(C)||me.isArrayBuffer(C))return C.byteLength;if(me.isURLSearchParams(C)&&(C=C+""),me.isString(C))return(await f(C)).byteLength},v=async(C,S)=>{const w=me.toFiniteNumber(C.getContentLength());return w??x(S)};return async C=>{let{url:S,method:w,data:R,signal:j,cancelToken:_,timeout:O,onDownloadProgress:A,onUploadProgress:D,responseType:T,headers:I,withCredentials:k="same-origin",fetchOptions:F}=pD(C),G=t||fetch;T=T?(T+"").toLowerCase():"text";let Y=PK([j,_&&_.toAbortSignal()],O),B=null;const Z=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let H;try{if(D&&m&&w!=="get"&&w!=="head"&&(H=await v(I,R))!==0){let P=new n(S,{method:"POST",body:R,duplex:"half"}),U;if(me.isFormData(R)&&(U=P.headers.get("content-type"))&&I.setContentType(U),P.body){const[z,X]=VT(H,fg(GT(D)));R=qT(P.body,KT,z,X)}}me.isString(k)||(k=k?"include":"omit");const M=i&&"credentials"in n.prototype,V={...F,signal:Y,method:w.toUpperCase(),headers:I.normalize().toJSON(),body:R,duplex:"half",credentials:M?k:void 0};B=i&&new n(S,V);let $=await(i?G(B,F):G(S,V));const oe=y&&(T==="stream"||T==="response");if(y&&(A||oe&&Z)){const P={};["status","statusText","headers"].forEach(W=>{P[W]=$[W]});const U=me.toFiniteNumber($.headers.get("content-length")),[z,X]=A&&VT(U,fg(GT(A),!0))||[];$=new r(qT($.body,KT,z,()=>{X&&X(),Z&&Z()}),P)}T=T||"text";let ge=await g[me.findKey(g,T)||"text"]($,C);return!oe&&Z&&Z(),await new Promise((P,U)=>{hD(P,U,{data:ge,headers:ja.from($.headers),status:$.status,statusText:$.statusText,config:C,request:B})})}catch(M){throw Z&&Z(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new Ct("Network Error",Ct.ERR_NETWORK,C,B),{cause:M.cause||M}):Ct.from(M,M&&M.code,C,B)}}},VK=new Map,gD=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,i=[r,s,n];let c=i.length,u=c,f,m,y=VK;for(;u--;)f=i[u],m=y.get(f),m===void 0&&y.set(f,m=u?new Map:$K(t)),y=m;return m};gD();const LS={http:oK,xhr:LK,fetch:{get:gD}};me.forEach(LS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const XT=e=>`- ${e}`,GK=e=>me.isFunction(e)||e===null||e===!1;function BK(e,t){e=me.isArray(e)?e:[e];const{length:n}=e;let r,s;const i={};for(let c=0;c<n;c++){r=e[c];let u;if(s=r,!GK(r)&&(s=LS[(u=String(r)).toLowerCase()],s===void 0))throw new Ct(`Unknown adapter '${u}'`);if(s&&(me.isFunction(s)||(s=s.get(t))))break;i[u||"#"+c]=s}if(!s){const c=Object.entries(i).map(([f,m])=>`adapter ${f} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=n?c.length>1?`since :
|
|
598
|
-
`+c.map(XT).join(`
|
|
599
|
-
`):" "+XT(c[0]):"as no adapter specified";throw new Ct("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}const yD={getAdapter:BK,adapters:LS};function H0(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new pd(null,e)}function QT(e){return H0(e),e.headers=ja.from(e.headers),e.data=F0.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),yD.getAdapter(e.adapter||Lh.adapter,e)(e).then(function(r){return H0(e),r.data=F0.call(e,e.transformResponse,r),r.headers=ja.from(r.headers),r},function(r){return fD(r)||(H0(e),r&&r.response&&(r.response.data=F0.call(e,e.transformResponse,r.response),r.response.headers=ja.from(r.response.headers))),Promise.reject(r)})}const xD="1.13.2",wy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const JT={};wy.transitional=function(t,n,r){function s(i,c){return"[Axios v"+xD+"] Transitional option '"+i+"'"+c+(r?". "+r:"")}return(i,c,u)=>{if(t===!1)throw new Ct(s(c," has been removed"+(n?" in "+n:"")),Ct.ERR_DEPRECATED);return n&&!JT[c]&&(JT[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,c,u):!0}};wy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function qK(e,t,n){if(typeof e!="object")throw new Ct("options must be an object",Ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],c=t[i];if(c){const u=e[i],f=u===void 0||c(u,i,e);if(f!==!0)throw new Ct("option "+i+" must be "+f,Ct.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ct("Unknown option "+i,Ct.ERR_BAD_OPTION)}}const Kp={assertOptions:qK,validators:wy},no=Kp.validators;let oc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new HT,response:new HT}}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 i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
600
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=hc(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Kp.assertOptions(r,{silentJSONParsing:no.transitional(no.boolean),forcedJSONParsing:no.transitional(no.boolean),clarifyTimeoutError:no.transitional(no.boolean)},!1),s!=null&&(me.isFunction(s)?n.paramsSerializer={serialize:s}:Kp.assertOptions(s,{encode:no.function,serialize:no.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kp.assertOptions(n,{baseUrl:no.spelling("baseURL"),withXsrfToken:no.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=i&&me.merge(i.common,i[n.method]);i&&me.forEach(["delete","get","head","post","put","patch","common"],C=>{delete i[C]}),n.headers=ja.concat(c,i);const u=[];let f=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(f=f&&S.synchronous,u.unshift(S.fulfilled,S.rejected))});const m=[];this.interceptors.response.forEach(function(S){m.push(S.fulfilled,S.rejected)});let y,g=0,x;if(!f){const C=[QT.bind(this),void 0];for(C.unshift(...u),C.push(...m),x=C.length,y=Promise.resolve(n);g<x;)y=y.then(C[g++],C[g++]);return y}x=u.length;let v=n;for(;g<x;){const C=u[g++],S=u[g++];try{v=C(v)}catch(w){S.call(this,w);break}}try{y=QT.call(this,v)}catch(C){return Promise.reject(C)}for(g=0,x=m.length;g<x;)y=y.then(m[g++],m[g++]);return y}getUri(t){t=hc(this.defaults,t);const n=mD(t.baseURL,t.url,t.allowAbsoluteUrls);return cD(n,t.params,t.paramsSerializer)}};me.forEach(["delete","get","head","options"],function(t){oc.prototype[t]=function(n,r){return this.request(hc(r||{},{method:t,url:n,data:(r||{}).data}))}});me.forEach(["post","put","patch"],function(t){function n(r){return function(i,c,u){return this.request(hc(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:c}))}}oc.prototype[t]=n(),oc.prototype[t+"Form"]=n(!0)});let KK=class vD{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const c=new Promise(u=>{r.subscribe(u),i=u}).then(s);return c.cancel=function(){r.unsubscribe(i)},c},t(function(i,c,u){r.reason||(r.reason=new pd(i,c,u),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 vD(function(s){t=s}),cancel:t}}};function ZK(e){return function(n){return e.apply(null,n)}}function YK(e){return me.isObject(e)&&e.isAxiosError===!0}const K1={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(K1).forEach(([e,t])=>{K1[t]=e});function bD(e){const t=new oc(e),n=X3(oc.prototype.request,t);return me.extend(n,oc.prototype,t,{allOwnKeys:!0}),me.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return bD(hc(e,s))},n}const tr=bD(Lh);tr.Axios=oc;tr.CanceledError=pd;tr.CancelToken=KK;tr.isCancel=fD;tr.VERSION=xD;tr.toFormData=Cy;tr.AxiosError=Ct;tr.Cancel=tr.CanceledError;tr.all=function(t){return Promise.all(t)};tr.spread=ZK;tr.isAxiosError=YK;tr.mergeConfig=hc;tr.AxiosHeaders=ja;tr.formToJSON=e=>dD(me.isHTMLForm(e)?new FormData(e):e);tr.getAdapter=yD.getAdapter;tr.HttpStatusCode=K1;tr.default=tr;const{Axios:Nme,AxiosError:e_,CanceledError:Ame,isCancel:Dme,CancelToken:Ome,VERSION:Ime,all:Mme,Cancel:kme,isAxiosError:Lme,spread:Pme,toFormData:Ume,AxiosHeaders:WK,HttpStatusCode:zme,formToJSON:Fme,getAdapter:Hme,mergeConfig:$me}=tr;function XK(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const Ju={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 QK(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 PS=tr.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function JK(){const e=window.location.pathname+window.location.search,t=new URL(Ju.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function eZ(){const e=new URL(Ju.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",Ju.SIGN_IN),window.location.href=e.toString()}async function tZ(){try{return(await PS.post(Ju.ACCESS_TOKEN,{})).data}catch(e){const t=QK(e);throw new Error(t.message)}}async function nZ(e){const t=await PS.get(Ju.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return XK(t.data)}async function rZ(e){return(await PS.get(Ju.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const SD=h.createContext(null);class aZ{constructor(t,n){to(this,"getToken");to(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let US=null;function sZ(e){US=e}function zS(){return US}function bp(){US=null}const oZ=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Le=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",CD(e)},iZ=e=>{Le({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},lZ=()=>{Le({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},CD=e=>{var t;if(typeof window<"u"){oZ();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function cZ(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Zr.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Zr.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Zr.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Zr.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const uZ={status:Zr.LOADING,session:null,user:null};function dZ({children:e}){var y;const[t,n]=h.useReducer(cZ,uZ);h.useEffect(()=>{var g;if((g=t.session)!=null&&g.accessToken){const x=new aZ(()=>{var v;return((v=t.session)==null?void 0:v.accessToken)??null},async()=>await s());sZ(x)}else bp()},[(y=t.session)==null?void 0:y.accessToken]);const r=h.useCallback(()=>{JK()},[]);async function s(){try{const x=(await tZ()).accessToken;if(!x)throw new Error("Invalid token received");const v={accessToken:x},C=await nZ(x);return n({type:"SET_USER",payload:{user:C}}),n({type:"SET_AUTHENTICATED",payload:{session:v}}),x}catch(g){throw bp(),n({type:"SET_UNAUTHENTICATED"}),g}}const i=h.useCallback(async()=>{await s()},[]),c=h.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await i()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(g){console.error("Failed to initialize auth:",g),bp(),n({type:"SET_UNAUTHENTICATED"})}},[i,r]),u=h.useCallback(()=>{try{lZ()}finally{eZ()}},[]),f=h.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t.user&&(CD({projectId:t.user.projectId}),iZ({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),h.useEffect(()=>{const g=()=>{u()};return window.addEventListener("auth:logout",g),()=>{window.removeEventListener("auth:logout",g),bp()}},[u]);const m={...t,signIn:r,signOut:u,refreshToken:i,clearError:f};return a.jsx(SD.Provider,{value:m,children:e})}function hi(){const e=h.useContext(SD);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function wD(){const{status:e,session:t,user:n,error:r}=hi();return{status:e,session:t,user:n,error:r,isLoading:e===Zr.LOADING,isAuthenticated:e===Zr.AUTHENTICATED,isUnauthenticated:e===Zr.UNAUTHENTICATED,hasError:e===Zr.ERROR}}function fZ(){const{user:e}=hi();return e}function Fu({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 a.jsx("div",{className:s,children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&a.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function t_({message:e}){return a.jsx(Fu,{fullScreen:!0,message:e})}function n_(){return a.jsx("div",{className:"flex h-screen items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),a.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),a.jsx(we,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function hZ({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:i}=wD();return r?a.jsx(t_,{}):s?a.jsx(a.Fragment,{children:e}):i?n?(window.location.href=n,a.jsx(t_,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(n_,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(n_,{})}const ED=h.createContext(null);function RD(){const e=h.useContext(ED);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const mZ="/ui",pZ=()=>mZ,hg=(e,t)=>{const n=pZ(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function gZ(){const{projects:e,loadProjects:t,error:n,isLoading:r}=RD(),{user:s}=hi();return a.jsxs(gy,{children:[a.jsx(la,{}),a.jsxs(yy,{className:"flex items-center gap-2",children:[a.jsx(yP,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(yq,{children:a.jsxs(xy,{children:[r&&a.jsx(vt,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Rc,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&a.jsxs(a.Fragment,{children:[a.jsx(vt,{disabled:!0,children:"Unable to load projects. Please try again."}),a.jsx(vt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(i=>{const c=i.id===(s==null?void 0:s.projectId);return a.jsx(vt,{asChild:!0,children:a.jsxs(gh,{to:hg(encodeURIComponent(i.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(oa,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),i.title]})},i.id)})]})})]})}function yZ(){return a.jsx(gZ,{})}const xZ=({className:e,size:t=24})=>a.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:a.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"})}),jD=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]}),TD=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),a.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),a.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),a.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),a.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),a.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),a.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),a.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),a.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),a.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),a.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),a.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),a.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),a.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),a.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"})]}),vZ=({className:e,size:t=24})=>a.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:[a.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"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),bZ=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"})]}),SZ=({className:e,size:t=24})=>a.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:[a.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"}),a.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),a.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),a.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),a.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),a.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),a.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),a.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),a.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),a.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),a.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"})]}),_D=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"}),a.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"})]}),CZ=({className:e,size:t=24})=>a.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:a.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"})}),wZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),a.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),a.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),a.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),a.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),a.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),a.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),EZ=({className:e,size:t=24})=>a.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:[a.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"}),a.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)"}),a.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"}),a.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)"}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),a.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),a.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),Ac=({className:e="",size:t=24,base64:n})=>a.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),RZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.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"}),a.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"}),a.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"})]}),jZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M5.14132 15.1175C5.14132 16.4971 4.02636 17.612 2.64683 17.612C1.2673 17.612 0.152344 16.4971 0.152344 15.1175C0.152344 13.738 1.2673 12.623 2.64683 12.623H5.14132V15.1175ZM6.38856 15.1175C6.38856 13.738 7.50352 12.623 8.88305 12.623C10.2626 12.623 11.3775 13.738 11.3775 15.1175V21.3538C11.3775 22.7333 10.2626 23.8482 8.88305 23.8482C7.50352 23.8482 6.38856 22.7333 6.38856 21.3538V15.1175Z",fill:"#E01E5A"}),a.jsx("path",{d:"M8.88242 5.10226C7.50289 5.10226 6.38793 3.9873 6.38793 2.60777C6.38793 1.22824 7.50289 0.113281 8.88242 0.113281C10.2619 0.113281 11.3769 1.22824 11.3769 2.60777V5.10226H8.88242ZM8.88242 6.3684C10.2619 6.3684 11.3769 7.48336 11.3769 8.86289C11.3769 10.2424 10.2619 11.3574 8.88242 11.3574H2.6273C1.24777 11.3574 0.132812 10.2424 0.132812 8.86289C0.132812 7.48336 1.24777 6.3684 2.6273 6.3684H8.88242Z",fill:"#36C5F0"}),a.jsx("path",{d:"M18.8768 8.86289C18.8768 7.48336 19.9918 6.3684 21.3713 6.3684C22.7509 6.3684 23.8658 7.48336 23.8658 8.86289C23.8658 10.2424 22.7509 11.3574 21.3713 11.3574H18.8768V8.86289ZM17.6296 8.86289C17.6296 10.2424 16.5146 11.3574 15.1351 11.3574C13.7556 11.3574 12.6406 10.2424 12.6406 8.86289V2.60777C12.6406 1.22824 13.7556 0.113281 15.1351 0.113281C16.5146 0.113281 17.6296 1.22824 17.6296 2.60777V8.86289Z",fill:"#2EB67D"}),a.jsx("path",{d:"M15.1351 18.8593C16.5146 18.8593 17.6296 19.9742 17.6296 21.3538C17.6296 22.7333 16.5146 23.8482 15.1351 23.8482C13.7556 23.8482 12.6406 22.7333 12.6406 21.3538V18.8593H15.1351ZM15.1351 17.612C13.7556 17.612 12.6406 16.4971 12.6406 15.1175C12.6406 13.738 13.7556 12.623 15.1351 12.623H21.3902C22.7698 12.623 23.8847 13.738 23.8847 15.1175C23.8847 16.4971 22.7698 17.612 21.3902 17.612H15.1351Z",fill:"#ECB22E"})]}),TZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),_Z=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.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"}),a.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),NZ=({className:e,size:t=24})=>a.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:[a.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"}),a.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"})]}),AZ=({className:e,size:t=24})=>a.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:[a.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),a.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"})]}),DZ=({className:e,size:t=24})=>a.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:[a.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"}),a.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"}),a.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"}),a.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"})]}),OZ=({className:e,size:t=24})=>a.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:[a.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),a.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),a.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),a.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]}),IZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsxs("g",{"clip-path":"url(#clip0_377_3451)",children:[a.jsx("path",{d:"M16.4954 9.25H22.6042C23.1814 9.25 23.6492 9.71786 23.6492 10.295V15.8593C23.6492 17.9805 21.9297 19.7 19.8086 19.7H19.7904C17.6693 19.7003 15.9495 17.981 15.9492 15.8599C15.9492 15.8597 15.9492 15.8595 15.9492 15.8593V9.79616C15.9492 9.49452 16.1937 9.25 16.4954 9.25Z",fill:"#5059C9"}),a.jsx("path",{d:"M20.6234 8.14922C21.9903 8.14922 23.0984 7.04112 23.0984 5.67422C23.0984 4.30731 21.9903 3.19922 20.6234 3.19922C19.2565 3.19922 18.1484 4.30731 18.1484 5.67422C18.1484 7.04112 19.2565 8.14922 20.6234 8.14922Z",fill:"#5059C9"}),a.jsx("path",{d:"M12.9266 8.15001C14.901 8.15001 16.5016 6.54942 16.5016 4.575C16.5016 2.60058 14.901 1 12.9266 1C10.9521 1 9.35156 2.60058 9.35156 4.575C9.35156 6.54942 10.9521 8.15001 12.9266 8.15001Z",fill:"#7B83EB"}),a.jsx("path",{d:"M17.6912 9.25H7.60751C7.03725 9.26411 6.58614 9.73737 6.59937 10.3077V16.6541C6.51973 20.0763 9.22724 22.9163 12.6494 23C16.0715 22.9163 18.779 20.0763 18.6994 16.6541V10.3077C18.7126 9.73737 18.2615 9.26411 17.6912 9.25Z",fill:"#7B83EB"}),a.jsx("path",{opacity:"0.1",d:"M13.2019 9.25V18.1435C13.1991 18.5513 12.952 18.9177 12.5749 19.073C12.4548 19.1238 12.3257 19.15 12.1954 19.15H7.08585C7.01436 18.9685 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H13.2019Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V18.6935C12.6518 18.8239 12.6257 18.9529 12.5749 19.073C12.4196 19.4501 12.0532 19.6973 11.6454 19.7H7.34436C7.25085 19.5185 7.16286 19.337 7.08585 19.15C7.00885 18.963 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V17.5935C12.6477 18.1476 12.1995 18.5958 11.6454 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1018 9.25V17.5935C12.0977 18.1476 11.6495 18.5958 11.0953 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.1018Z",fill:"black"}),a.jsx("path",{opacity:"0.1",d:"M13.2002 6.40688V8.13938C13.1067 8.14488 13.0187 8.15038 12.9252 8.15038C12.8317 8.15038 12.7437 8.14489 12.6502 8.13938C12.4646 8.12706 12.2805 8.09761 12.1002 8.05138C10.9865 7.78763 10.0663 7.00654 9.62522 5.95039C9.54932 5.77303 9.4904 5.58886 9.44922 5.40039H12.1937C12.7487 5.40249 13.1981 5.85188 13.2002 6.40688Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1 6.95572V8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.0935C11.6485 5.95133 12.0979 6.40072 12.1 6.95572Z",fill:"black"}),a.jsx("path",{d:"M1.00814 5.94922H11.0918C11.6486 5.94922 12.1 6.40059 12.1 6.95736V17.0411C12.1 17.5978 11.6486 18.0492 11.0918 18.0492H1.00814C0.451357 18.0492 0 17.5978 0 17.0411V6.95736C0 6.40059 0.451368 5.94922 1.00814 5.94922Z",fill:"url(#paint0_linear_377_3451)"}),a.jsx("path",{d:"M8.70484 9.78745H6.68908V15.2765H5.40484V9.78745H3.39844V8.72266H8.70484V9.78745Z",fill:"white"})]}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_377_3451",x1:"2.10202",y1:"5.16147",x2:"9.99799",y2:"18.837",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#5A62C3"}),a.jsx("stop",{offset:"0.5","stop-color":"#4D55BD"}),a.jsx("stop",{offset:"1","stop-color":"#3940AB"})]}),a.jsx("clipPath",{id:"clip0_377_3451",children:a.jsx("rect",{width:"23.65",height:"22",fill:"white",transform:"translate(0 1)"})})]})]}),MZ=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6.22775 0.0390625L6.2285 5.77431L0.5 5.77281V1.55856C0.5425 1.26056 0.63075 1.01031 0.76475 0.807812C1.09525 0.306812 1.57575 0.0545625 2.20625 0.0510625C3.53925 0.0440625 4.87975 0.0400625 6.22775 0.0390625Z",fill:"#0066DA"}),a.jsx("path",{d:"M6.22656 0.0390625L18.0331 0.0405625C18.0579 0.0405527 18.082 0.0481525 18.1021 0.0623125L18.1298 0.0825625C18.1218 0.0855625 18.1151 0.0888125 18.1096 0.0923125C18.1011 0.0968125 18.0968 0.103813 18.0968 0.113313L18.0953 5.77656C18.0943 5.77656 18.0931 5.77656 18.0916 5.77656H6.22956C6.22906 5.77606 6.22831 5.77531 6.22731 5.77431L6.22656 0.0390625Z",fill:"#FBBC04"}),a.jsx("path",{d:"M18.1322 0.0820312L23.7909 5.75803L18.0977 5.77603L18.0992 0.112781C18.0992 0.103281 18.1034 0.0962812 18.1119 0.0917812C18.1174 0.0882812 18.1242 0.0850312 18.1322 0.0820312Z",fill:"#EA4335"}),a.jsx("path",{d:"M0.5 5.77148L6.2285 5.77298C6.2295 5.77398 6.23025 5.77473 6.23075 5.77523L6.23225 13.7012L0.5 13.6997V5.77148Z",fill:"#2684FC"}),a.jsx("path",{d:"M23.788 5.75781L23.8232 5.78331V17.9258C23.6902 18.6523 23.3137 19.1216 22.6937 19.3336C22.4727 19.4096 22.147 19.4471 21.7165 19.4461C18.922 19.4416 16.099 19.4373 13.2475 19.4333C12.8335 19.4328 12.4135 19.4358 11.9875 19.4423C11.964 19.4428 11.944 19.4513 11.9275 19.4678C10.5325 20.8563 9.13247 22.2568 7.72747 23.6693C7.51222 23.8861 7.26847 24.0068 6.95947 23.9611C6.67147 23.9186 6.45922 23.7701 6.32272 23.5156C6.26522 23.4076 6.23597 23.2106 6.23497 22.9246C6.23147 21.7651 6.23022 20.6018 6.23122 19.4348L6.23047 16.5638L9.06397 13.7303C9.07632 13.718 9.09102 13.7081 9.10723 13.7015C9.12345 13.6948 9.14086 13.6913 9.15847 13.6913L18.031 13.6943C18.0475 13.6943 18.0633 13.6878 18.075 13.6761C18.0867 13.6644 18.0932 13.6486 18.0932 13.6321L18.091 5.77581C18.0925 5.77581 18.0937 5.77581 18.0947 5.77581L23.788 5.75781Z",fill:"#00AC47"}),a.jsx("path",{d:"M6.23225 13.7027V16.5647L6.233 19.4357C5.0345 19.4427 3.84625 19.4449 2.66825 19.4424C2.17725 19.4414 1.8235 19.4029 1.607 19.3269C1 19.1149 0.631 18.6449 0.5 17.9169V13.7012L6.23225 13.7027Z",fill:"#00832D"})]}),kZ=({className:e,size:t=24,strokeWidth:n=2,strokeColor:r="#1E88E5"})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:r,"stroke-width":n,"stroke-linecap":"round","stroke-linejoin":"round",children:[a.jsx("path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),a.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]});function Eo({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:se("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 ND({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:i=!1,showCopyButton:c=!1}){const u=(w,R)=>{if(!w||R.length===0)return!1;try{const j=JSON.parse(w),_=O=>typeof O!="object"||O===null?!1:Array.isArray(O)?O.some(A=>typeof A=="object"&&A!==null&&_(A)):Object.keys(O).some(A=>R.includes(A)||typeof O[A]=="object"&&O[A]!==null&&_(O[A]));return _(j)}catch{return!1}},f=i?!1:!e||n.length===0||!u(e,n),[m,y]=h.useState(f),[g,x]=h.useState(!1);h.useEffect(()=>{i?y(!1):(!e||n.length===0||!u(e,n))&&y(!0)},[e,n,i]),h.useEffect(()=>{if(g){const w=setTimeout(()=>{x(!1)},2e3);return()=>{clearTimeout(w)}}},[g]);const v=()=>{navigator.clipboard.writeText(e),x(!0)},C=w=>{if(!w)return"";try{const R=JSON.parse(w),j=A=>{if(typeof A!="object"||A===null)return A;const D=Array.isArray(A)?[...A]:{...A};return Array.isArray(D)?D.forEach((T,I)=>{typeof T=="object"&&T!==null&&(D[I]=j(T))}):Object.entries(D).forEach(([T,I])=>{if(n.includes(T))if(typeof I=="string"){const k=I.length;k>30?D[T]="*".repeat(Math.min(20,Math.ceil(k/3))):k>10?D[T]="*".repeat(Math.min(10,Math.ceil(k/2))):D[T]="*".repeat(k)}else D[T]="***";else typeof I=="object"&&I!==null&&(D[T]=j(I))}),D},O=j(typeof R=="object"?R:{});return JSON.stringify(O,null,2)}catch{return w}},S=e&&n.length>0&&u(e,n);return a.jsxs("div",{className:"relative",children:[!m&&S&&!i&&a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(FU,{className:"h-4 w-4 text-gray-500"})})}),a.jsx(jt,{children:a.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),i?a.jsx("div",{className:`p-2 font-mono ${r??""} ${s} cursor-not-allowed whitespace-pre-wrap opacity-70`,children:C(e)}):a.jsx(Eo,{value:m?e:C(e),onChange:w=>{(m||!S)&&t&&t(w.target.value)},onFocus:w=>{!m&&S&&w.target.blur()},readOnly:!!(!m&&S),className:`font-mono ${r??""} ${!m&&S?"cursor-not-allowed opacity-70":""} ${s}`,rows:8}),S&&!i&&a.jsx(we,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{y(!m)},children:m?a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(oU,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),a.jsx(jt,{children:a.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(jA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),a.jsx(jt,{children:a.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&a.jsx(we,{type:"button",variant:"ghost",className:`absolute ${S&&!i?"top-2 right-24":"top-2 right-2"}`,onClick:v,children:a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{className:"flex items-center gap-1",children:g?a.jsxs(a.Fragment,{children:[a.jsx(oa,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copied!"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Yu,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copy"})]})})}),a.jsx(jt,{children:a.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var nn;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const c of s)i[c]=c;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),c={};for(const u of i)c[u]=s[u];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&i.push(c);return i},e.find=(s,i)=>{for(const c of s)if(i(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,i=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(nn||(nn={}));var r_;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(r_||(r_={}));const Ge=nn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bi=e=>{switch(typeof e){case"undefined":return Ge.undefined;case"string":return Ge.string;case"number":return Number.isNaN(e)?Ge.nan:Ge.number;case"boolean":return Ge.boolean;case"function":return Ge.function;case"bigint":return Ge.bigint;case"symbol":return Ge.symbol;case"object":return Array.isArray(e)?Ge.array:e===null?Ge.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ge.promise:typeof Map<"u"&&e instanceof Map?Ge.map:typeof Set<"u"&&e instanceof Set?Ge.set:typeof Date<"u"&&e instanceof Date?Ge.date:Ge.object;default:return Ge.unknown}},Te=nn.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 ii 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(i){return i.message},r={_errors:[]},s=i=>{for(const c of i.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 u=r,f=0;for(;f<c.path.length;){const m=c.path[f];f===c.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(n(c))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return s(this),r}static assert(t){if(!(t instanceof ii))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,nn.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 i=s.path[0];n[i]=n[i]||[],n[i].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ii.create=e=>new ii(e);const Z1=(e,t)=>{let n;switch(e.code){case Te.invalid_type:e.received===Ge.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Te.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,nn.jsonStringifyReplacer)}`;break;case Te.unrecognized_keys:n=`Unrecognized key(s) in object: ${nn.joinValues(e.keys,", ")}`;break;case Te.invalid_union:n="Invalid input";break;case Te.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${nn.joinValues(e.options)}`;break;case Te.invalid_enum_value:n=`Invalid enum value. Expected ${nn.joinValues(e.options)}, received '${e.received}'`;break;case Te.invalid_arguments:n="Invalid function arguments";break;case Te.invalid_return_type:n="Invalid function return type";break;case Te.invalid_date:n="Invalid date";break;case Te.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}"`:nn.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Te.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 Te.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 Te.custom:n="Invalid input";break;case Te.invalid_intersection_types:n="Intersection results could not be merged";break;case Te.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Te.not_finite:n="Number must be finite";break;default:n=t.defaultError,nn.assertNever(e)}return{message:n}};let LZ=Z1;function PZ(){return LZ}const UZ=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],c={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let u="";const f=r.filter(m=>!!m).slice().reverse();for(const m of f)u=m(c,{data:t,defaultError:u}).message;return{...s,path:i,message:u}};function Ue(e,t){const n=PZ(),r=UZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Z1?void 0:Z1].filter(s=>!!s)});e.common.issues.push(r)}class ca{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 ut;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 i=await s.key,c=await s.value;r.push({key:i,value:c})}return ca.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:c}=s;if(i.status==="aborted"||c.status==="aborted")return ut;i.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[i.value]=c.value)}return{status:t.value,value:r}}}const ut=Object.freeze({status:"aborted"}),Of=e=>({status:"dirty",value:e}),Cs=e=>({status:"valid",value:e}),a_=e=>e.status==="aborted",s_=e=>e.status==="dirty",ed=e=>e.status==="valid",mg=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 bo{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 o_=(e,t)=>{if(ed(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 ii(e.common.issues);return this._error=n,this._error}}};function At(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,u)=>{const{message:f}=e;return c.code==="invalid_enum_value"?{message:f??u.defaultError}:typeof u.data>"u"?{message:f??r??u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:f??n??u.defaultError}},description:s}}class Vt{get description(){return this._def.description}_getType(t){return Bi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Bi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ca,ctx:{common:t.parent.common,data:t.data,parsedType:Bi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(mg(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:Bi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return o_(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:Bi(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return ed(i)?{value:i.value}:{issues:n.common.issues}}catch(i){(s=(r=i==null?void 0:i.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(i=>ed(i)?{value:i.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:Bi(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(mg(s)?s:Promise.resolve(s));return o_(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const c=t(s),u=()=>i.addIssue({code:Te.custom,...r(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(u(),!1)):c?!0:(u(),!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 gc({schema:this,typeName:dt.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 ei.create(this,this._def)}nullable(){return yc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ho.create(this)}promise(){return Cg.create(this,this._def)}or(t){return yg.create([this,t],this._def)}and(t){return xg.create(this,t,this._def)}transform(t){return new gc({...At(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new wg({...At(this._def),innerType:this,defaultValue:n,typeName:dt.ZodDefault})}brand(){return new ID({typeName:dt.ZodBranded,type:this,...At(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Eg({...At(this._def),innerType:this,catchValue:n,typeName:dt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return HS.create(this,t)}readonly(){return Rg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const zZ=/^c[^\s-]{8,}$/i,FZ=/^[0-9a-z]+$/,HZ=/^[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,VZ=/^[a-z0-9_-]{21}$/i,GZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,BZ=/^[-+]?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)?)??$/,qZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,KZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $0;const ZZ=/^(?:(?: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])$/,YZ=/^(?:(?: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])$/,WZ=/^(([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]))$/,XZ=/^(([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])$/,QZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,JZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,AD="((\\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])))",eY=new RegExp(`^${AD}$`);function DD(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 tY(e){return new RegExp(`^${DD(e)}$`)}function nY(e){let t=`${AD}T${DD(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 rY(e,t){return!!((t==="v4"||!t)&&ZZ.test(e)||(t==="v6"||!t)&&WZ.test(e))}function aY(e,t){if(!GZ.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 sY(e,t){return!!((t==="v4"||!t)&&YZ.test(e)||(t==="v6"||!t)&&XZ.test(e))}class Jo extends Vt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ge.string){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_type,expected:Ge.string,received:i.parsedType}),ut}const r=new ca;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const c=t.data.length>i.value,u=t.data.length<i.value;(c||u)&&(s=this._getOrReturnCtx(t,s),c?Ue(s,{code:Te.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&Ue(s,{code:Te.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")qZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"email",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")$0||($0=new RegExp(KZ,"u")),$0.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"emoji",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")$Z.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"uuid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")VZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"nanoid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")zZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")FZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid2",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")HZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ulid",code:Te.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),Ue(s,{validation:"url",code:Te.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"regex",code:Te.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?nY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?eY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?tY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?BZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"duration",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?rY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ip",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?aY(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"jwt",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?sY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cidr",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?QZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64",code:Te.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?JZ.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64url",code:Te.invalid_string,message:i.message}),r.dirty()):nn.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Te.invalid_string,...Qe.errToObj(r)})}_addCheck(t){return new Jo({...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 Jo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Jo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Jo({...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}}Jo.create=e=>new Jo({checks:[],typeName:dt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});function oY(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return i%c/10**s}class td extends Vt{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)!==Ge.number){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_type,expected:Ge.number,received:i.parsedType}),ut}let r;const s=new ca;for(const i of this._def.checks)i.kind==="int"?nn.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?oY(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.not_finite,message:i.message}),s.dirty()):nn.assertNever(i);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 td({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new td({...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"&&nn.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)}}td.create=e=>new td({checks:[],typeName:dt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class nh extends Vt{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)!==Ge.bigint)return this._getInvalidInput(t);let r;const s=new ca;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Te.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):nn.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Te.invalid_type,expected:Ge.bigint,received:n.parsedType}),ut}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 nh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Qe.toString(s)}]})}_addCheck(t){return new nh({...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}}nh.create=e=>new nh({checks:[],typeName:dt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...At(e)});class Y1 extends Vt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ge.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Ge.boolean,received:r.parsedType}),ut}return Cs(t.data)}}Y1.create=e=>new Y1({typeName:dt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...At(e)});class pg extends Vt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ge.date){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_type,expected:Ge.date,received:i.parsedType}),ut}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Ue(i,{code:Te.invalid_date}),ut}const r=new ca;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),Ue(s,{code:Te.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):nn.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new pg({...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}}pg.create=e=>new pg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:dt.ZodDate,...At(e)});class i_ extends Vt{_parse(t){if(this._getType(t)!==Ge.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Ge.symbol,received:r.parsedType}),ut}return Cs(t.data)}}i_.create=e=>new i_({typeName:dt.ZodSymbol,...At(e)});class W1 extends Vt{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Ge.undefined,received:r.parsedType}),ut}return Cs(t.data)}}W1.create=e=>new W1({typeName:dt.ZodUndefined,...At(e)});class gg extends Vt{_parse(t){if(this._getType(t)!==Ge.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Ge.null,received:r.parsedType}),ut}return Cs(t.data)}}gg.create=e=>new gg({typeName:dt.ZodNull,...At(e)});class l_ extends Vt{constructor(){super(...arguments),this._any=!0}_parse(t){return Cs(t.data)}}l_.create=e=>new l_({typeName:dt.ZodAny,...At(e)});class X1 extends Vt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Cs(t.data)}}X1.create=e=>new X1({typeName:dt.ZodUnknown,...At(e)});class hl extends Vt{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Te.invalid_type,expected:Ge.never,received:n.parsedType}),ut}}hl.create=e=>new hl({typeName:dt.ZodNever,...At(e)});class c_ extends Vt{_parse(t){if(this._getType(t)!==Ge.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Ge.void,received:r.parsedType}),ut}return Cs(t.data)}}c_.create=e=>new c_({typeName:dt.ZodVoid,...At(e)});class ho extends Vt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ge.array)return Ue(n,{code:Te.invalid_type,expected:Ge.array,received:n.parsedType}),ut;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,u=n.data.length<s.exactLength.value;(c||u)&&(Ue(n,{code:c?Te.too_big:Te.too_small,minimum:u?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&&(Ue(n,{code:Te.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&&(Ue(n,{code:Te.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,u)=>s.type._parseAsync(new bo(n,c,n.path,u)))).then(c=>ca.mergeArray(r,c));const i=[...n.data].map((c,u)=>s.type._parseSync(new bo(n,c,n.path,u)));return ca.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new ho({...this._def,minLength:{value:t,message:Qe.toString(n)}})}max(t,n){return new ho({...this._def,maxLength:{value:t,message:Qe.toString(n)}})}length(t,n){return new ho({...this._def,exactLength:{value:t,message:Qe.toString(n)}})}nonempty(t){return this.min(1,t)}}ho.create=(e,t)=>new ho({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...At(t)});function Tu(e){if(e instanceof fr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ei.create(Tu(r))}return new fr({...e._def,shape:()=>t})}else return e instanceof ho?new ho({...e._def,type:Tu(e.element)}):e instanceof ei?ei.create(Tu(e.unwrap())):e instanceof yc?yc.create(Tu(e.unwrap())):e instanceof mc?mc.create(e.items.map(t=>Tu(t))):e}class fr extends Vt{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=nn.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ge.object){const m=this._getOrReturnCtx(t);return Ue(m,{code:Te.invalid_type,expected:Ge.object,received:m.parsedType}),ut}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof hl&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||u.push(m);const f=[];for(const m of c){const y=i[m],g=s.data[m];f.push({key:{status:"valid",value:m},value:y._parse(new bo(s,g,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof hl){const m=this._def.unknownKeys;if(m==="passthrough")for(const y of u)f.push({key:{status:"valid",value:y},value:{status:"valid",value:s.data[y]}});else if(m==="strict")u.length>0&&(Ue(s,{code:Te.unrecognized_keys,keys:u}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const y of u){const g=s.data[y];f.push({key:{status:"valid",value:y},value:m._parse(new bo(s,g,s.path,y)),alwaysSet:y in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const y of f){const g=await y.key,x=await y.value;m.push({key:g,value:x,alwaysSet:y.alwaysSet})}return m}).then(m=>ca.mergeObjectSync(r,m)):ca.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Qe.errToObj,new fr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,c;const s=((c=(i=this._def).errorMap)==null?void 0:c.call(i,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Qe.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new fr({...this._def,unknownKeys:"strip"})}passthrough(){return new fr({...this._def,unknownKeys:"passthrough"})}extend(t){return new fr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new fr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:dt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new fr({...this._def,catchall:t})}pick(t){const n={};for(const r of nn.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new fr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of nn.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new fr({...this._def,shape:()=>n})}deepPartial(){return Tu(this)}partial(t){const n={};for(const r of nn.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new fr({...this._def,shape:()=>n})}required(t){const n={};for(const r of nn.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof ei;)i=i._def.innerType;n[r]=i}return new fr({...this._def,shape:()=>n})}keyof(){return OD(nn.objectKeys(this.shape))}}fr.create=(e,t)=>new fr({shape:()=>e,unknownKeys:"strip",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});fr.strictCreate=(e,t)=>new fr({shape:()=>e,unknownKeys:"strict",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});fr.lazycreate=(e,t)=>new fr({shape:e,unknownKeys:"strip",catchall:hl.create(),typeName:dt.ZodObject,...At(t)});class yg extends Vt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const u of i)if(u.result.status==="valid")return u.result;for(const u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;const c=i.map(u=>new ii(u.ctx.common.issues));return Ue(n,{code:Te.invalid_union,unionErrors:c}),ut}if(n.common.async)return Promise.all(r.map(async i=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let i;const c=[];for(const f of r){const m={...n,common:{...n.common,issues:[]},parent:null},y=f._parseSync({data:n.data,path:n.path,parent:m});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const u=c.map(f=>new ii(f));return Ue(n,{code:Te.invalid_union,unionErrors:u}),ut}}get options(){return this._def.options}}yg.create=(e,t)=>new yg({options:e,typeName:dt.ZodUnion,...At(t)});const Ko=e=>e instanceof J1?Ko(e.schema):e instanceof gc?Ko(e.innerType()):e instanceof bg?[e.value]:e instanceof pc?e.options:e instanceof Sg?nn.objectValues(e.enum):e instanceof wg?Ko(e._def.innerType):e instanceof W1?[void 0]:e instanceof gg?[null]:e instanceof ei?[void 0,...Ko(e.unwrap())]:e instanceof yc?[null,...Ko(e.unwrap())]:e instanceof ID||e instanceof Rg?Ko(e.unwrap()):e instanceof Eg?Ko(e._def.innerType):[];class FS extends Vt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.object)return Ue(n,{code:Te.invalid_type,expected:Ge.object,received:n.parsedType}),ut;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(Ue(n,{code:Te.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ut)}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 i of n){const c=Ko(i.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const u of c){if(s.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);s.set(u,i)}}return new FS({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...At(r)})}}function Q1(e,t){const n=Bi(e),r=Bi(t);if(e===t)return{valid:!0,data:e};if(n===Ge.object&&r===Ge.object){const s=nn.objectKeys(t),i=nn.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of i){const f=Q1(e[u],t[u]);if(!f.valid)return{valid:!1};c[u]=f.data}return{valid:!0,data:c}}else if(n===Ge.array&&r===Ge.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const c=e[i],u=t[i],f=Q1(c,u);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===Ge.date&&r===Ge.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class xg extends Vt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,c)=>{if(a_(i)||a_(c))return ut;const u=Q1(i.value,c.value);return u.valid?((s_(i)||s_(c))&&n.dirty(),{status:n.value,value:u.data}):(Ue(r,{code:Te.invalid_intersection_types}),ut)};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(([i,c])=>s(i,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}))}}xg.create=(e,t,n)=>new xg({left:e,right:t,typeName:dt.ZodIntersection,...At(n)});class mc extends Vt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.array)return Ue(r,{code:Te.invalid_type,expected:Ge.array,received:r.parsedType}),ut;if(r.data.length<this._def.items.length)return Ue(r,{code:Te.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ut;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:Te.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((c,u)=>{const f=this._def.items[u]||this._def.rest;return f?f._parse(new bo(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(i).then(c=>ca.mergeArray(n,c)):ca.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new mc({...this._def,rest:t})}}mc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new mc({items:e,typeName:dt.ZodTuple,rest:null,...At(t)})};class vg extends Vt{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!==Ge.object)return Ue(r,{code:Te.invalid_type,expected:Ge.object,received:r.parsedType}),ut;const s=[],i=this._def.keyType,c=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new bo(r,u,r.path,u)),value:c._parse(new bo(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?ca.mergeObjectAsync(n,s):ca.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Vt?new vg({keyType:t,valueType:n,typeName:dt.ZodRecord,...At(r)}):new vg({keyType:Jo.create(),valueType:t,typeName:dt.ZodRecord,...At(n)})}}class u_ extends Vt{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!==Ge.map)return Ue(r,{code:Te.invalid_type,expected:Ge.map,received:r.parsedType}),ut;const s=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map(([u,f],m)=>({key:s._parse(new bo(r,u,r.path,[m,"key"])),value:i._parse(new bo(r,f,r.path,[m,"value"]))}));if(r.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const f of c){const m=await f.key,y=await f.value;if(m.status==="aborted"||y.status==="aborted")return ut;(m.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(m.value,y.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const f of c){const m=f.key,y=f.value;if(m.status==="aborted"||y.status==="aborted")return ut;(m.status==="dirty"||y.status==="dirty")&&n.dirty(),u.set(m.value,y.value)}return{status:n.value,value:u}}}}u_.create=(e,t,n)=>new u_({valueType:t,keyType:e,typeName:dt.ZodMap,...At(n)});class rh extends Vt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ge.set)return Ue(r,{code:Te.invalid_type,expected:Ge.set,received:r.parsedType}),ut;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ue(r,{code:Te.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&&(Ue(r,{code:Te.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function c(f){const m=new Set;for(const y of f){if(y.status==="aborted")return ut;y.status==="dirty"&&n.dirty(),m.add(y.value)}return{status:n.value,value:m}}const u=[...r.data.values()].map((f,m)=>i._parse(new bo(r,f,r.path,m)));return r.common.async?Promise.all(u).then(f=>c(f)):c(u)}min(t,n){return new rh({...this._def,minSize:{value:t,message:Qe.toString(n)}})}max(t,n){return new rh({...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)}}rh.create=(e,t)=>new rh({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...At(t)});class J1 extends Vt{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})}}J1.create=(e,t)=>new J1({getter:e,typeName:dt.ZodLazy,...At(t)});class bg extends Vt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:Te.invalid_literal,expected:this._def.value}),ut}return{status:"valid",value:t.data}}get value(){return this._def.value}}bg.create=(e,t)=>new bg({value:e,typeName:dt.ZodLiteral,...At(t)});function OD(e,t){return new pc({values:e,typeName:dt.ZodEnum,...At(t)})}class pc extends Vt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:nn.joinValues(r),received:n.parsedType,code:Te.invalid_type}),ut}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 Ue(n,{received:n.data,code:Te.invalid_enum_value,options:r}),ut}return Cs(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 pc.create(t,{...this._def,...n})}exclude(t,n=this._def){return pc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}pc.create=OD;class Sg extends Vt{_parse(t){const n=nn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ge.string&&r.parsedType!==Ge.number){const s=nn.objectValues(n);return Ue(r,{expected:nn.joinValues(s),received:r.parsedType,code:Te.invalid_type}),ut}if(this._cache||(this._cache=new Set(nn.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=nn.objectValues(n);return Ue(r,{received:r.data,code:Te.invalid_enum_value,options:s}),ut}return Cs(t.data)}get enum(){return this._def.values}}Sg.create=(e,t)=>new Sg({values:e,typeName:dt.ZodNativeEnum,...At(t)});class Cg extends Vt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ge.promise&&n.common.async===!1)return Ue(n,{code:Te.invalid_type,expected:Ge.promise,received:n.parsedType}),ut;const r=n.parsedType===Ge.promise?n.data:Promise.resolve(n.data);return Cs(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cg.create=(e,t)=>new Cg({type:e,typeName:dt.ZodPromise,...At(t)});class gc extends Vt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:c=>{Ue(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const c=s.transform(r.data,i);if(r.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return ut;const f=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return f.status==="aborted"?ut:f.status==="dirty"||n.value==="dirty"?Of(f.value):f});{if(n.value==="aborted")return ut;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?ut:u.status==="dirty"||n.value==="dirty"?Of(u.value):u}}if(s.type==="refinement"){const c=u=>{const f=s.refinement(u,i);if(r.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){const u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?ut:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?ut:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.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(!ed(c))return ut;const u=s.transform(c.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>ed(c)?Promise.resolve(s.transform(c.value,i)).then(u=>({status:n.value,value:u})):ut);nn.assertNever(s)}}gc.create=(e,t,n)=>new gc({schema:e,typeName:dt.ZodEffects,effect:t,...At(n)});gc.createWithPreprocess=(e,t,n)=>new gc({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...At(n)});class ei extends Vt{_parse(t){return this._getType(t)===Ge.undefined?Cs(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ei.create=(e,t)=>new ei({innerType:e,typeName:dt.ZodOptional,...At(t)});class yc extends Vt{_parse(t){return this._getType(t)===Ge.null?Cs(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}yc.create=(e,t)=>new yc({innerType:e,typeName:dt.ZodNullable,...At(t)});class wg extends Vt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ge.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}wg.create=(e,t)=>new wg({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...At(t)});class Eg extends Vt{_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 mg(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ii(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ii(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Eg.create=(e,t)=>new Eg({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...At(t)});class d_ extends Vt{_parse(t){if(this._getType(t)!==Ge.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:Te.invalid_type,expected:Ge.nan,received:r.parsedType}),ut}return{status:"valid",value:t.data}}}d_.create=e=>new d_({typeName:dt.ZodNaN,...At(e)});class ID extends Vt{_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 HS extends Vt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?ut:i.status==="dirty"?(n.dirty(),Of(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ut: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 HS({in:t,out:n,typeName:dt.ZodPipeline})}}class Rg extends Vt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(ed(s)&&(s.value=Object.freeze(s.value)),s);return mg(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Rg.create=(e,t)=>new Rg({innerType:e,typeName:dt.ZodReadonly,...At(t)});var dt;(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"})(dt||(dt={}));const Dt=Jo.create,iY=td.create,lY=Y1.create,cY=gg.create,uY=X1.create;hl.create;const eb=ho.create,rn=fr.create,dY=yg.create,$S=FS.create;xg.create;mc.create;const fY=vg.create,Gr=bg.create;pc.create;const Ey=Sg.create;Cg.create;ei.create;const hY=yc.create,V0=ut,MD=rn({serviceAccount:Dt().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Te.custom,message:"Service Account must be a valid JSON object"}),V0):n.client_email?e:(t.addIssue({code:Te.custom,message:"Service Account must contain a client_email field"}),V0)}catch(n){return console.error(n),t.addIssue({code:Te.custom,message:"Service Account must be a valid JSON string"}),V0}})}),mY=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:xZ,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:rT,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:OA,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:rT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:AP,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:aT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:aT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:KU,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:wP,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:xz,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:RZ,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function tb(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function pY(){const{flags:e}=hd(),{loadProjects:t,projects:n}=RD(),{id:r}=W3(),s=tb("IDP_PROVIDER","owox",e);h.useEffect(()=>{s&&t()},[t,s]);const i=n.length>1;return{visibleMenuItems:h.useMemo(()=>{const f=mY.filter(x=>typeof x.visible=="boolean"?x.visible:tb(x.visible.flagKey,x.visible.expectedValue,e)).map(x=>{if(x.group==="project"&&x.href&&r)try{const v=x.href.replace("/p/none/",`/p/${r}/`);return{...x,href:v}}catch{return x}return x}),m=new Map;f.forEach(x=>{const v=x.group||"default";m.has(v)||m.set(v,[]);const C=m.get(v);C&&C.push(x)});const y=[],g=Array.from(m.entries()).filter(([,x])=>x.length>0);return g.forEach(([,x],v)=>{y.push(...x),v<g.length-1&&y.push({type:"separator",visible:!0})}),y},[e,r]),canSwitchProject:i}}function gY(){const{visibleMenuItems:e,canSwitchProject:t}=pY();return a.jsxs(Er,{align:"start",side:"right",className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(la,{},`separator-${String(r)}`);const s=n.icon;return a.jsx(vt,{asChild:!0,children:a.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[a.jsx(s,{className:"size-4"}),n.title]})},n.href)}),t&&a.jsx(yZ,{},"switch-project")]})}var St=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(St||{});let yY={data:""},xY=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||yY},vY=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,bY=/\/\*[^]*?\*\/| +/g,f_=/\n+/g,Yi=(e,t)=>{let n="",r="",s="";for(let i in e){let c=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+c+";":r+=i[1]=="f"?Yi(c,i):i+"{"+Yi(c,i[1]=="k"?"":t)+"}":typeof c=="object"?r+=Yi(c,t?t.replace(/([^,])+/g,u=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,u):u?u+" "+f:f)):i):c!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Yi.p?Yi.p(i,c):i+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Go={},kD=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+kD(e[n]);return t}return e},SY=(e,t,n,r,s)=>{let i=kD(e),c=Go[i]||(Go[i]=(f=>{let m=0,y=11;for(;m<f.length;)y=101*y+f.charCodeAt(m++)>>>0;return"go"+y})(i));if(!Go[c]){let f=i!==e?e:(m=>{let y,g,x=[{}];for(;y=vY.exec(m.replace(bY,""));)y[4]?x.shift():y[3]?(g=y[3].replace(f_," ").trim(),x.unshift(x[0][g]=x[0][g]||{})):x[0][y[1]]=y[2].replace(f_," ").trim();return x[0]})(e);Go[c]=Yi(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let u=n&&Go.g?Go.g:null;return n&&(Go.g=Go[c]),((f,m,y,g)=>{g?m.data=m.data.replace(g,f):m.data.indexOf(f)===-1&&(m.data=y?f+m.data:m.data+f)})(Go[c],t,r,u),c},CY=(e,t,n)=>e.reduce((r,s,i)=>{let c=t[i];if(c&&c.call){let u=c(n),f=u&&u.props&&u.props.className||/^go/.test(u)&&u;c=f?"."+f:u&&typeof u=="object"?u.props?"":Yi(u,""):u===!1?"":u}return r+s+(c??"")},"");function Ry(e){let t=this||{},n=e.call?e(t.p):e;return SY(n.unshift?n.raw?CY(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,xY(t.target),t.g,t.o,t.k)}let LD,nb,rb;Ry.bind({g:1});let li=Ry.bind({k:1});function wY(e,t,n,r){Yi.p=t,LD=e,nb=n,rb=r}function vl(e,t){let n=this||{};return function(){let r=arguments;function s(i,c){let u=Object.assign({},i),f=u.className||s.className;n.p=Object.assign({theme:nb&&nb()},u),n.o=/ *go\d+/.test(f),u.className=Ry.apply(n,r)+(f?" "+f:"");let m=e;return e[0]&&(m=u.as||e,delete u.as),rb&&m[0]&&rb(u),LD(m,u)}return s}}var EY=e=>typeof e=="function",jg=(e,t)=>EY(e)?e(t):e,RY=(()=>{let e=0;return()=>(++e).toString()})(),PD=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),jY=20,VS="default",UD=(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 UD(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 i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(c=>({...c,pauseDuration:c.pauseDuration+i}))}}},Zp=[],zD={toasts:[],pausedAt:void 0,settings:{toastLimit:jY}},co={},FD=(e,t=VS)=>{co[t]=UD(co[t]||zD,e),Zp.forEach(([n,r])=>{n===t&&r(co[t])})},HD=e=>Object.keys(co).forEach(t=>FD(e,t)),TY=e=>Object.keys(co).find(t=>co[t].toasts.some(n=>n.id===e)),jy=(e=VS)=>t=>{FD(t,e)},_Y={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},NY=(e={},t=VS)=>{let[n,r]=h.useState(co[t]||zD),s=h.useRef(co[t]);h.useEffect(()=>(s.current!==co[t]&&r(co[t]),Zp.push([t,r]),()=>{let c=Zp.findIndex(([u])=>u===t);c>-1&&Zp.splice(c,1)}),[t]);let i=n.toasts.map(c=>{var u,f,m;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((u=e[c.type])==null?void 0:u.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((f=e[c.type])==null?void 0:f.duration)||(e==null?void 0:e.duration)||_Y[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:i}},AY=(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)||RY()}),Ph=e=>(t,n)=>{let r=AY(t,e,n);return jy(r.toasterId||TY(r.id))({type:2,toast:r}),r.id},Dn=(e,t)=>Ph("blank")(e,t);Dn.error=Ph("error");Dn.success=Ph("success");Dn.loading=Ph("loading");Dn.custom=Ph("custom");Dn.dismiss=(e,t)=>{let n={type:3,toastId:e};t?jy(t)(n):HD(n)};Dn.dismissAll=e=>Dn.dismiss(void 0,e);Dn.remove=(e,t)=>{let n={type:4,toastId:e};t?jy(t)(n):HD(n)};Dn.removeAll=e=>Dn.remove(void 0,e);Dn.promise=(e,t,n)=>{let r=Dn.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?jg(t.success,s):void 0;return i?Dn.success(i,{id:r,...n,...n==null?void 0:n.success}):Dn.dismiss(r),s}).catch(s=>{let i=t.error?jg(t.error,s):void 0;i?Dn.error(i,{id:r,...n,...n==null?void 0:n.error}):Dn.dismiss(r)}),e};var DY=1e3,OY=(e,t="default")=>{let{toasts:n,pausedAt:r}=NY(e,t),s=h.useRef(new Map).current,i=h.useCallback((g,x=DY)=>{if(s.has(g))return;let v=setTimeout(()=>{s.delete(g),c({type:4,toastId:g})},x);s.set(g,v)},[]);h.useEffect(()=>{if(r)return;let g=Date.now(),x=n.map(v=>{if(v.duration===1/0)return;let C=(v.duration||0)+v.pauseDuration-(g-v.createdAt);if(C<0){v.visible&&Dn.dismiss(v.id);return}return setTimeout(()=>Dn.dismiss(v.id,t),C)});return()=>{x.forEach(v=>v&&clearTimeout(v))}},[n,r,t]);let c=h.useCallback(jy(t),[t]),u=h.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=h.useCallback((g,x)=>{c({type:1,toast:{id:g,height:x}})},[c]),m=h.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),y=h.useCallback((g,x)=>{let{reverseOrder:v=!1,gutter:C=8,defaultPosition:S}=x||{},w=n.filter(_=>(_.position||S)===(g.position||S)&&_.height),R=w.findIndex(_=>_.id===g.id),j=w.filter((_,O)=>O<R&&_.visible).length;return w.filter(_=>_.visible).slice(...v?[j+1]:[0,j]).reduce((_,O)=>_+(O.height||0)+C,0)},[n]);return h.useEffect(()=>{n.forEach(g=>{if(g.dismissed)i(g.id,g.removeDelay);else{let x=s.get(g.id);x&&(clearTimeout(x),s.delete(g.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:f,startPause:u,endPause:m,calculateOffset:y}}},IY=li`
|
|
601
|
-
from {
|
|
602
|
-
transform: scale(0) rotate(45deg);
|
|
603
|
-
opacity: 0;
|
|
604
|
-
}
|
|
605
|
-
to {
|
|
606
|
-
transform: scale(1) rotate(45deg);
|
|
607
|
-
opacity: 1;
|
|
608
|
-
}`,MY=li`
|
|
609
|
-
from {
|
|
610
|
-
transform: scale(0);
|
|
611
|
-
opacity: 0;
|
|
612
|
-
}
|
|
613
|
-
to {
|
|
614
|
-
transform: scale(1);
|
|
615
|
-
opacity: 1;
|
|
616
|
-
}`,kY=li`
|
|
617
|
-
from {
|
|
618
|
-
transform: scale(0) rotate(90deg);
|
|
619
|
-
opacity: 0;
|
|
620
|
-
}
|
|
621
|
-
to {
|
|
622
|
-
transform: scale(1) rotate(90deg);
|
|
623
|
-
opacity: 1;
|
|
624
|
-
}`,LY=vl("div")`
|
|
625
|
-
width: 20px;
|
|
626
|
-
opacity: 0;
|
|
627
|
-
height: 20px;
|
|
628
|
-
border-radius: 10px;
|
|
629
|
-
background: ${e=>e.primary||"#ff4b4b"};
|
|
630
|
-
position: relative;
|
|
631
|
-
transform: rotate(45deg);
|
|
632
|
-
|
|
633
|
-
animation: ${IY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
634
|
-
forwards;
|
|
635
|
-
animation-delay: 100ms;
|
|
636
|
-
|
|
637
|
-
&:after,
|
|
638
|
-
&:before {
|
|
639
|
-
content: '';
|
|
640
|
-
animation: ${MY} 0.15s ease-out forwards;
|
|
641
|
-
animation-delay: 150ms;
|
|
642
|
-
position: absolute;
|
|
643
|
-
border-radius: 3px;
|
|
644
|
-
opacity: 0;
|
|
645
|
-
background: ${e=>e.secondary||"#fff"};
|
|
646
|
-
bottom: 9px;
|
|
647
|
-
left: 4px;
|
|
648
|
-
height: 2px;
|
|
649
|
-
width: 12px;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
&:before {
|
|
653
|
-
animation: ${kY} 0.15s ease-out forwards;
|
|
654
|
-
animation-delay: 180ms;
|
|
655
|
-
transform: rotate(90deg);
|
|
656
|
-
}
|
|
657
|
-
`,PY=li`
|
|
658
|
-
from {
|
|
659
|
-
transform: rotate(0deg);
|
|
660
|
-
}
|
|
661
|
-
to {
|
|
662
|
-
transform: rotate(360deg);
|
|
663
|
-
}
|
|
664
|
-
`,UY=vl("div")`
|
|
665
|
-
width: 12px;
|
|
666
|
-
height: 12px;
|
|
667
|
-
box-sizing: border-box;
|
|
668
|
-
border: 2px solid;
|
|
669
|
-
border-radius: 100%;
|
|
670
|
-
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
671
|
-
border-right-color: ${e=>e.primary||"#616161"};
|
|
672
|
-
animation: ${PY} 1s linear infinite;
|
|
673
|
-
`,zY=li`
|
|
674
|
-
from {
|
|
675
|
-
transform: scale(0) rotate(45deg);
|
|
676
|
-
opacity: 0;
|
|
677
|
-
}
|
|
678
|
-
to {
|
|
679
|
-
transform: scale(1) rotate(45deg);
|
|
680
|
-
opacity: 1;
|
|
681
|
-
}`,FY=li`
|
|
682
|
-
0% {
|
|
683
|
-
height: 0;
|
|
684
|
-
width: 0;
|
|
685
|
-
opacity: 0;
|
|
686
|
-
}
|
|
687
|
-
40% {
|
|
688
|
-
height: 0;
|
|
689
|
-
width: 6px;
|
|
690
|
-
opacity: 1;
|
|
691
|
-
}
|
|
692
|
-
100% {
|
|
693
|
-
opacity: 1;
|
|
694
|
-
height: 10px;
|
|
695
|
-
}`,HY=vl("div")`
|
|
696
|
-
width: 20px;
|
|
697
|
-
opacity: 0;
|
|
698
|
-
height: 20px;
|
|
699
|
-
border-radius: 10px;
|
|
700
|
-
background: ${e=>e.primary||"#61d345"};
|
|
701
|
-
position: relative;
|
|
702
|
-
transform: rotate(45deg);
|
|
703
|
-
|
|
704
|
-
animation: ${zY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
705
|
-
forwards;
|
|
706
|
-
animation-delay: 100ms;
|
|
707
|
-
&:after {
|
|
708
|
-
content: '';
|
|
709
|
-
box-sizing: border-box;
|
|
710
|
-
animation: ${FY} 0.2s ease-out forwards;
|
|
711
|
-
opacity: 0;
|
|
712
|
-
animation-delay: 200ms;
|
|
713
|
-
position: absolute;
|
|
714
|
-
border-right: 2px solid;
|
|
715
|
-
border-bottom: 2px solid;
|
|
716
|
-
border-color: ${e=>e.secondary||"#fff"};
|
|
717
|
-
bottom: 6px;
|
|
718
|
-
left: 6px;
|
|
719
|
-
height: 10px;
|
|
720
|
-
width: 6px;
|
|
721
|
-
}
|
|
722
|
-
`,$Y=vl("div")`
|
|
723
|
-
position: absolute;
|
|
724
|
-
`,VY=vl("div")`
|
|
725
|
-
position: relative;
|
|
726
|
-
display: flex;
|
|
727
|
-
justify-content: center;
|
|
728
|
-
align-items: center;
|
|
729
|
-
min-width: 20px;
|
|
730
|
-
min-height: 20px;
|
|
731
|
-
`,GY=li`
|
|
732
|
-
from {
|
|
733
|
-
transform: scale(0.6);
|
|
734
|
-
opacity: 0.4;
|
|
735
|
-
}
|
|
736
|
-
to {
|
|
737
|
-
transform: scale(1);
|
|
738
|
-
opacity: 1;
|
|
739
|
-
}`,BY=vl("div")`
|
|
740
|
-
position: relative;
|
|
741
|
-
transform: scale(0.6);
|
|
742
|
-
opacity: 0.4;
|
|
743
|
-
min-width: 20px;
|
|
744
|
-
animation: ${GY} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
745
|
-
forwards;
|
|
746
|
-
`,qY=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?h.createElement(BY,null,t):t:n==="blank"?null:h.createElement(VY,null,h.createElement(UY,{...r}),n!=="loading"&&h.createElement($Y,null,n==="error"?h.createElement(LY,{...r}):h.createElement(HY,{...r})))},KY=e=>`
|
|
747
|
-
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
748
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
749
|
-
`,ZY=e=>`
|
|
750
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
751
|
-
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
752
|
-
`,YY="0%{opacity:0;} 100%{opacity:1;}",WY="0%{opacity:1;} 100%{opacity:0;}",XY=vl("div")`
|
|
753
|
-
display: flex;
|
|
754
|
-
align-items: center;
|
|
755
|
-
background: #fff;
|
|
756
|
-
color: #363636;
|
|
757
|
-
line-height: 1.3;
|
|
758
|
-
will-change: transform;
|
|
759
|
-
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
760
|
-
max-width: 350px;
|
|
761
|
-
pointer-events: auto;
|
|
762
|
-
padding: 8px 10px;
|
|
763
|
-
border-radius: 8px;
|
|
764
|
-
`,QY=vl("div")`
|
|
765
|
-
display: flex;
|
|
766
|
-
justify-content: center;
|
|
767
|
-
margin: 4px 10px;
|
|
768
|
-
color: inherit;
|
|
769
|
-
flex: 1 1 auto;
|
|
770
|
-
white-space: pre-line;
|
|
771
|
-
`,JY=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=PD()?[YY,WY]:[KY(n),ZY(n)];return{animation:t?`${li(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${li(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},eW=h.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?JY(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(qY,{toast:e}),c=h.createElement(QY,{...e.ariaProps},jg(e.message,e));return h.createElement(XY,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:c}):h.createElement(h.Fragment,null,i,c))});wY(h.createElement);var tW=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let i=h.useCallback(c=>{if(c){let u=()=>{let f=c.getBoundingClientRect().height;r(e,f)};u(),new MutationObserver(u).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return h.createElement("div",{ref:i,className:t,style:n},s)},nW=(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:PD()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},rW=Ry`
|
|
772
|
-
z-index: 9999;
|
|
773
|
-
> * {
|
|
774
|
-
pointer-events: auto;
|
|
775
|
-
}
|
|
776
|
-
`,Sp=16,aW=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:c,containerClassName:u})=>{let{toasts:f,handlers:m}=OY(n,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Sp,left:Sp,right:Sp,bottom:Sp,pointerEvents:"none",...c},className:u,onMouseEnter:m.startPause,onMouseLeave:m.endPause},f.map(y=>{let g=y.position||t,x=m.calculateOffset(y,{reverseOrder:e,gutter:r,defaultPosition:t}),v=nW(g,x);return h.createElement(tW,{id:y.id,key:y.id,onHeightUpdate:m.updateHeight,className:y.visible?rW:"",style:v},y.type==="custom"?jg(y.message,y):s?s(y):h.createElement(eW,{toast:y,position:g}))}))},_t=Dn;const un=e=>{var n;return(n=e.response)==null?void 0:n.data};function h_(e,t="Something went wrong"){var s,i;const n=un(e);let r=n.message.trim()||t;(i=(s=n.errorDetails)==null?void 0:s.error)!=null&&i.trim()&&(r=`${r}. ${n.errorDetails.error}`),_t.error(r)}function $D(e,t){var n,r,s,i;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():((i=(s=c[0])==null?void 0:s[0])==null?void 0:i.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"}class sW{constructor(){to(this,"isRefreshingToken",!1);to(this,"refreshTokenPromise",null);to(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 oW={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},Ea=tr.create(oW),ab=new sW;Ea.interceptors.request.use(e=>{if(e.skipAuthHeader||new WK(e.headers).has("X-OWOX-Authorization"))return e;const n=zS(),r=(n==null?void 0:n.getAccessToken())??ab.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));Ea.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 i=zS();if(!i)throw new Error("No token provider available");const c=await ab.refreshToken(()=>i.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await Ea(t)}catch{return ab.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&&h_(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&h_(e,"Bad request"),Promise.reject(e)});const VD={projects:[],callState:St.IDLE,error:null};function iW(e,t){switch(t.type){case"LOADING":return{...e,callState:St.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:St.LOADED,error:null};case"ERROR":return{...e,callState:St.ERROR,error:t.payload};case"RESET":return{...VD};default:return e}}function lW({children:e}){const[t,n]=h.useReducer(iW,VD),r=h.useCallback(async()=>{n({type:"LOADING"});try{const u=zS();if(!u){n({type:"ERROR",payload:un(new e_("No token provider"))});return}const f=u.getAccessToken();if(!f){n({type:"ERROR",payload:un(new e_("Unable to obtain access token"))});return}const m=await rZ(f);n({type:"SUCCESS",payload:m})}catch(u){n({type:"ERROR",payload:un(u)})}},[]),s=h.useCallback(()=>{n({type:"RESET"})},[]),i=t.callState===St.LOADING,c={...t,loadProjects:r,reset:s,isLoading:i};return a.jsx(ED.Provider,{value:c,children:e})}function cW(){const[e,t]=h.useState(!1);return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Cr,{open:e,onOpenChange:t,children:[a.jsx(bq,{isOpen:e}),a.jsx(lW,{children:a.jsx(gY,{})})]})})})})}var uW=(e,t,n,r,s,i,c,u)=>{let f=document.documentElement,m=["light","dark"];function y(v){(Array.isArray(e)?e:[e]).forEach(C=>{let S=C==="class",w=S&&i?s.map(R=>i[R]||R):s;S?(f.classList.remove(...w),f.classList.add(i&&i[v]?i[v]:v)):f.setAttribute(C,v)}),g(v)}function g(v){u&&m.includes(v)&&(f.style.colorScheme=v)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)y(r);else try{let v=localStorage.getItem(t)||n,C=c&&v==="system"?x():v;y(C)}catch{}},m_=["light","dark"],GD="(prefers-color-scheme: dark)",dW=typeof window>"u",GS=h.createContext(void 0),fW={setTheme:e=>{},themes:[]},gd=()=>{var e;return(e=h.useContext(GS))!=null?e:fW},hW=e=>h.useContext(GS)?h.createElement(h.Fragment,null,e.children):h.createElement(pW,{...e}),mW=["light","dark"],pW=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=mW,defaultTheme:c=n?"system":"light",attribute:u="data-theme",value:f,children:m,nonce:y,scriptProps:g})=>{let[x,v]=h.useState(()=>yW(s,c)),[C,S]=h.useState(()=>x==="system"?G0():x),w=f?Object.values(f):i,R=h.useCallback(A=>{let D=A;if(!D)return;A==="system"&&n&&(D=G0());let T=f?f[D]:D,I=t?xW(y):null,k=document.documentElement,F=G=>{G==="class"?(k.classList.remove(...w),T&&k.classList.add(T)):G.startsWith("data-")&&(T?k.setAttribute(G,T):k.removeAttribute(G))};if(Array.isArray(u)?u.forEach(F):F(u),r){let G=m_.includes(c)?c:null,Y=m_.includes(D)?D:G;k.style.colorScheme=Y}I==null||I()},[y]),j=h.useCallback(A=>{let D=typeof A=="function"?A(x):A;v(D);try{localStorage.setItem(s,D)}catch{}},[x]),_=h.useCallback(A=>{let D=G0(A);S(D),x==="system"&&n&&!e&&R("system")},[x,e]);h.useEffect(()=>{let A=window.matchMedia(GD);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),h.useEffect(()=>{let A=D=>{D.key===s&&(D.newValue?v(D.newValue):j(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[j]),h.useEffect(()=>{R(e??x)},[e,x]);let O=h.useMemo(()=>({theme:x,setTheme:j,forcedTheme:e,resolvedTheme:x==="system"?C:x,themes:n?[...i,"system"]:i,systemTheme:n?C:void 0}),[x,j,e,C,n,i]);return h.createElement(GS.Provider,{value:O},h.createElement(gW,{forcedTheme:e,storageKey:s,attribute:u,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:i,nonce:y,scriptProps:g}),m)},gW=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:f,scriptProps:m})=>{let y=JSON.stringify([n,t,i,e,u,c,r,s]).slice(1,-1);return h.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${uW.toString()})(${y})`}})}),yW=(e,t)=>{if(dW)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},xW=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)}},G0=e=>(e||(e=window.matchMedia(GD)),e.matches?"dark":"light");const vW=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:bW(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:NA},{value:"light",label:"Light",icon:MA},{value:"dark",label:"Dark",icon:AA}]}},{type:"separator"},{type:"item",title:"Sign out",icon:$U,onClick:n,className:"text-red-600 focus:text-red-600"}];function bW(e){switch(e){case"light":return MA;case"dark":return AA;case"system":default:return NA}}var Hu=(e=>(e.LARGE="LARGE",e.NORMAL="NORMAL",e.SMALL="SMALL",e))(Hu||{});function sb({avatar:e,initials:t,displayName:n,size:r=Hu.NORMAL}){let s,i,c;switch(r){case Hu.SMALL:s="w-6 h-6",i="w-5 h-5",c="text-[10px]";break;case Hu.LARGE:s="w-16 h-16",i="w-15 h-15",c="text-2xl";break;default:s="size-8",i="size-full",c="text-sm"}return a.jsx("div",{className:`${s} flex aspect-square items-center justify-center rounded-full border bg-white dark:bg-white/10`,children:e?a.jsx("img",{src:e,alt:n,className:`${i} rounded-full object-cover`}):a.jsx("span",{className:`${c} text-muted-foreground font-medium`,children:t})})}function SW({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return a.jsx(wr,{asChild:!0,children:a.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:[a.jsx(sb,{avatar:r,initials:s,displayName:t}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[a.jsx("span",{className:"truncate font-medium",children:t}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),a.jsx(Ss,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function CW({items:e}){return a.jsx(Er,{align:"end",side:"right",className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return a.jsx(la,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(gy,{children:[a.jsxs(yy,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(xy,{children:r.options.map(s=>a.jsxs(vt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&a.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&a.jsx(oa,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return a.jsxs(vt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[a.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function wW(){const{user:e,signOut:t}=hi(),{setTheme:n,theme:r}=gd(),[s,i]=h.useState(!1);if(!e)return null;const{fullName:c,email:u,avatar:f}=e,m=c??u??"Unknown User",y=$D(c,u);return a.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Cr,{open:s,onOpenChange:i,children:[a.jsx(SW,{isOpen:s,displayName:m,email:u,avatar:f,initials:y}),a.jsx(CW,{items:vW({theme:r,setTheme:n,signOut:t})})]})})}function EW(){const{user:e,status:t}=hi();return t===Zr.LOADING||t===Zr.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function mi(){const e=wc(),t=EW(),n=h.useCallback((i,c)=>{if(!t){e("/",{replace:!0});return}const u=hg(t,i);e(u,c)},[e,t]),r=h.useCallback(i=>t?hg(t,i):i,[t]);return h.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function RW(e,t=500){const[n,r]=h.useState(!1),s=h.useRef(!1),i=h.useRef(null),c=h.useCallback(async(...u)=>{if(s.current)return Promise.reject(new Error("Action is locked"));s.current=!0,r(!0);try{return await e(...u)}finally{i.current=setTimeout(()=>{s.current=!1,r(!1)},t)}},[e,t]);return h.useEffect(()=>()=>{i.current&&clearTimeout(i.current),s.current=!1},[]),{trigger:c,isLocked:n}}function jW(){const{scope:e}=mi();return a.jsxs(gh,{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:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:a.jsx(ma,{className:"size-4 shrink-0"})}),a.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:a.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const TW=[{title:"Data Marts",url:"/data-marts",icon:ng},{title:"Storages",url:"/data-storages",icon:cc},{title:"Destinations",url:"/data-destinations",icon:tS}];function _W(){const{scope:e}=mi();return a.jsx(RG,{children:TW.map(t=>{const n=t.icon;return a.jsx(jG,{children:a.jsx(gh,{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})=>a.jsxs(Et,{delayDuration:500,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs(_G,{className:`${r?"hover:bg-transparent":""}`,children:[a.jsx(n,{className:"size-4 shrink-0 transition-all"}),a.jsx("span",{children:t.title}),t.badge&&a.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),a.jsx(jt,{side:"right",children:t.title})]})})},t.title)})})}const BD=20,qD=20;function KD({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 NW(e){try{if(!window.Intercom)return;window.Intercom("update",{hide_default_launcher:!e})}catch(t){console.warn("Failed to toggle Intercom launcher visibility",t)}}function AW(e=30,t=0){KD({vertical:qD+e,horizontal:BD+t})}function ob(){if(KD({vertical:qD,horizontal:BD}),NW(!1),window.__intercom_open_on_ready&&window.Intercom){try{window.Intercom("show")}catch(e){console.warn("Failed to show Intercom after boot",e)}window.__intercom_open_on_ready=!1}}function DW(){if(window.Intercom)try{window.Intercom("show")}catch(e){console.warn("Intercom show failed",e)}else window.__intercom_open_on_ready=!0}function OW(e){return[{type:"menu-item",title:"What´s new",icon:mz,href:"https://docs.owox.com/docs/changelog/?utm_source=community_edition&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=whats_new",visible:!0},{type:"separator"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=documentation",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"}},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=support_menu_dropdown&utm_content=documentation",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"}},{type:"submenu",title:"Video tutorials",icon:KP,visible:!0,submenu:{options:[{label:"SQL to Google Sheets in Minutes",icon:Jj,onClick:()=>{e("video-1-google-sheets")}},{label:"Looker Studio Setup",icon:Jj,onClick:()=>{e("video-2-looker")}}]}},{type:"separator"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:TZ,visible:!0},{type:"menu-item",title:"Online Chat",icon:YU,onClick:()=>{DW()},visible:!0}]}function IW({isOpen:e}){return a.jsx(wr,{asChild:!0,children:a.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:[a.jsx("div",{className:"text-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:a.jsx(_A,{className:"text-muted-foreground",size:18,strokeWidth:1.5})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[a.jsx("span",{className:"truncate font-medium",children:"Help"}),a.jsx("span",{className:"text-muted-foreground hidden truncate text-xs",children:"Chat, Docs, Videos"})]}),a.jsx(Ss,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function MW({items:e,onClose:t}){return a.jsx(Er,{align:"end",side:"right",className:"w-56",children:e.map((n,r)=>{if(n.type==="separator")return a.jsx(la,{},`sep-${String(r)}`);const s=n.icon;if(n.type==="submenu"){const{submenu:i}=n;return a.jsxs(gy,{children:[a.jsxs(yy,{className:"flex items-center gap-2",children:[a.jsx(s,{className:"text-muted-foreground size-4"}),n.title]}),a.jsx(xy,{children:i.options.map((c,u)=>a.jsxs(vt,{onClick:()=>{var f;(f=c.onClick)==null||f.call(c),t==null||t()},children:[c.icon&&a.jsx(c.icon,{className:"size-4"}),c.label]},`submenu-${n.title}-opt-${String(u)}`))})]},`submenu-${n.title}-${String(r)}`)}return a.jsx(vt,{onClick:()=>{var i;(i=n.onClick)==null||i.call(n),t==null||t()},asChild:!!n.href,children:n.href?a.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(s,{className:"size-4"}),n.title]}):a.jsxs(a.Fragment,{children:[a.jsx(s,{className:"size-4"}),n.title]})},`item-${n.title}-${String(r)}`)})})}function kW(e){const{flags:t}=hd();return{visibleItems:h.useMemo(()=>e.filter(r=>r.type==="separator"||r.type==="submenu"?!0:typeof r.visible=="boolean"?r.visible:tb(r.visible.flagKey,r.visible.expectedValue,t)),[e,t])}}const ZD={activePopoverId:null,isOpen:!1},YD="contentPopovers/OPEN_POPOVER",WD="contentPopovers/CLOSE_POPOVER",XD="contentPopovers/TOGGLE_POPOVER";function LW(e){return{type:YD,payload:e}}function PW(e){return{type:WD,payload:e}}function UW(e){return{type:XD,payload:e}}function zW(e=ZD,t){switch(t.type){case YD:return{activePopoverId:t.payload,isOpen:!0};case WD:{const n=t.payload;return e.activePopoverId!==n?e:{activePopoverId:null,isOpen:!1}}case XD:{const n=t.payload;return e.activePopoverId!==n?{activePopoverId:n,isOpen:!0}:{activePopoverId:n,isOpen:!e.isOpen}}default:return e}}function BS(){const e=Y3(),t=th(n=>n.contentPopovers);return{activePopoverId:t.activePopoverId,isOpen:t.isOpen,open:n=>{e(LW(n))},close:()=>{t.activePopoverId&&e(PW(t.activePopoverId))},toggle:n=>{e(UW(n))}}}function FW(){const[e,t]=h.useState(!1),{open:n}=BS(),r=OW(n),{visibleItems:s}=kW(r);return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(Cr,{open:e,onOpenChange:t,children:[a.jsx(IW,{isOpen:e}),a.jsx(MW,{items:s,onClose:()=>{t(!1)}})]})})})})}function HW({variant:e="inset",collapsible:t="icon"}){return a.jsxs(xG,{variant:e,collapsible:t,children:[a.jsx(CG,{children:a.jsx(cW,{})}),a.jsxs(EG,{children:[a.jsx(MT,{children:a.jsx(kT,{children:a.jsx(jW,{})})}),a.jsx(MT,{children:a.jsx(kT,{children:a.jsx(_W,{})})})]}),a.jsxs(wG,{children:[a.jsx(FW,{}),a.jsx(lS,{}),a.jsx(wW,{})]}),a.jsx(bG,{})]})}function $W({children:e,...t}){return a.jsx(hW,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class bl{constructor(t){to(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await Ea.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await Ea.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await Ea.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await Ea.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await Ea.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class VW{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 ps=new VW;class GW{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),i=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),u=this.getDisplayName(r,i);return{identifier:r,displayName:u,offsetMinutes:s,offsetString:i,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}),i=new Date(r.format(n)),c=new Date(s.format(n));return Math.round((c.getTime()-i.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),i=r%60;return`${n}${s.toString().padStart(2,"0")}:${i.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),i=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),u=this.getTimezoneOffset(t,n),f=Math.min(i,c);return u>f}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),i=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:i}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const BW=new GW;function qW({isLoading:e,className:t}){const[n,r]=h.useState(0),[s,i]=h.useState(!1);return h.useEffect(()=>{let c,u;return e?(i(!0),r(0),c=setInterval(()=>{r(f=>f<90?f+(90-f)/10:f)},200)):(r(100),u=setTimeout(()=>{i(!1)},300)),()=>{clearInterval(c),clearTimeout(u)}},[e]),a.jsx("div",{className:se("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:a.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const QD=h.createContext({isLoading:!1});function KW({children:e}){const[t,n]=h.useState(0),r=t>0;return h.useEffect(()=>{const s=Ea.interceptors.request.use(c=>(c.skipLoadingIndicator||n(u=>u+1),c),c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),Promise.reject(c))),i=Ea.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),c),c=>(c.config.skipLoadingIndicator||n(u=>Math.max(0,u-1)),Promise.reject(c)));return()=>{Ea.interceptors.request.eject(s),Ea.interceptors.response.eject(i)}},[]),a.jsx(QD.Provider,{value:{isLoading:r},children:e})}function ZW(){return h.useContext(QD)}function YW(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const WW=e=>{switch(e){case"success":return JW;case"info":return tX;case"warning":return eX;case"error":return nX;default:return null}},XW=Array(12).fill(0),QW=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},XW.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),JW=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),eX=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),tX=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),nX=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),rX=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aX=()=>{const[e,t]=re.useState(document.hidden);return re.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let ib=1;class sX{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:ib++,c=this.toasts.find(f=>f.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),c?this.toasts=this.toasts.map(f=>f.id===i?(this.publish({...f,...t,id:i,title:r}),{...f,...t,id:i,dismissible:u,title:r}):f):this.addToast({title:r,...s,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=r!==void 0,c;const u=s.then(async m=>{if(c=["resolve",m],re.isValidElement(m))i=!1,this.create({id:r,type:"default",message:m});else if(iX(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,x=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:x,...C})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,x=typeof n.description=="function"?await n.description(m):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:x,...C})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(m):n.success,x=typeof n.description=="function"?await n.description(m):n.description,C=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:x,...C})}}).catch(async m=>{if(c=["reject",m],n.error!==void 0){i=!1;const y=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,v=typeof y=="object"&&!re.isValidElement(y)?y:{message:y};this.create({id:r,type:"error",description:g,...v})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((m,y)=>u.then(()=>c[0]==="reject"?y(c[1]):m(c[1])).catch(y));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||ib++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ca=new sX,oX=(e,t)=>{const n=(t==null?void 0:t.id)||ib++;return Ca.addToast({title:e,...t,id:n}),n},iX=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",lX=oX,cX=()=>Ca.toasts,uX=()=>Ca.getActiveToasts(),p_=Object.assign(lX,{success:Ca.success,info:Ca.info,warning:Ca.warning,error:Ca.error,custom:Ca.custom,message:Ca.message,promise:Ca.promise,dismiss:Ca.dismiss,loading:Ca.loading},{getHistory:cX,getToasts:uX});YW("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Cp(e){return e.label!==void 0}const dX=3,fX="24px",hX="16px",g_=4e3,mX=356,pX=14,gX=45,yX=200;function ro(...e){return e.filter(Boolean).join(" ")}function xX(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const vX=e=>{var t,n,r,s,i,c,u,f,m;const{invert:y,toast:g,unstyled:x,interacting:v,setHeights:C,visibleToasts:S,heights:w,index:R,toasts:j,expanded:_,removeToast:O,defaultRichColors:A,closeButton:D,style:T,cancelButtonStyle:I,actionButtonStyle:k,className:F="",descriptionClassName:G="",duration:Y,position:B,gap:Z,expandByDefault:H,classNames:M,icons:V,closeButtonAriaLabel:$="Close toast"}=e,[oe,ge]=re.useState(null),[P,U]=re.useState(null),[z,X]=re.useState(!1),[W,ae]=re.useState(!1),[J,le]=re.useState(!1),[ye,Ce]=re.useState(!1),[Ve,De]=re.useState(!1),[et,rt]=re.useState(0),[dn,zt]=re.useState(0),On=re.useRef(g.duration||Y||g_),yn=re.useRef(null),Me=re.useRef(null),q=R===0,ne=R+1<=S,ce=g.type,Oe=g.dismissible!==!1,Ee=g.className||"",je=g.descriptionClassName||"",He=re.useMemo(()=>w.findIndex(Ye=>Ye.toastId===g.id)||0,[w,g.id]),mt=re.useMemo(()=>{var Ye;return(Ye=g.closeButton)!=null?Ye:D},[g.closeButton,D]),st=re.useMemo(()=>g.duration||Y||g_,[g.duration,Y]),Wt=re.useRef(0),sr=re.useRef(0),$n=re.useRef(0),Dr=re.useRef(null),[Jr,fn]=B.split("-"),or=re.useMemo(()=>w.reduce((Ye,Gt,Xt)=>Xt>=He?Ye:Ye+Gt.height,0),[w,He]),kn=aX(),Ws=g.invert||y,Aa=ce==="loading";sr.current=re.useMemo(()=>He*Z+or,[He,or]),re.useEffect(()=>{On.current=st},[st]),re.useEffect(()=>{X(!0)},[]),re.useEffect(()=>{const Ye=Me.current;if(Ye){const Gt=Ye.getBoundingClientRect().height;return zt(Gt),C(Xt=>[{toastId:g.id,height:Gt,position:g.position},...Xt]),()=>C(Xt=>Xt.filter(Bt=>Bt.toastId!==g.id))}},[C,g.id]),re.useLayoutEffect(()=>{if(!z)return;const Ye=Me.current,Gt=Ye.style.height;Ye.style.height="auto";const Xt=Ye.getBoundingClientRect().height;Ye.style.height=Gt,zt(Xt),C(Bt=>Bt.find(Jt=>Jt.toastId===g.id)?Bt.map(Jt=>Jt.toastId===g.id?{...Jt,height:Xt}:Jt):[{toastId:g.id,height:Xt,position:g.position},...Bt])},[z,g.title,g.description,C,g.id,g.jsx,g.action,g.cancel]);const ea=re.useCallback(()=>{ae(!0),rt(sr.current),C(Ye=>Ye.filter(Gt=>Gt.toastId!==g.id)),setTimeout(()=>{O(g)},yX)},[g,O,C,sr]);re.useEffect(()=>{if(g.promise&&ce==="loading"||g.duration===1/0||g.type==="loading")return;let Ye;return _||v||kn?(()=>{if($n.current<Wt.current){const Bt=new Date().getTime()-Wt.current;On.current=On.current-Bt}$n.current=new Date().getTime()})():(()=>{On.current!==1/0&&(Wt.current=new Date().getTime(),Ye=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),ea()},On.current))})(),()=>clearTimeout(Ye)},[_,v,g,ce,kn,ea]),re.useEffect(()=>{g.delete&&(ea(),g.onDismiss==null||g.onDismiss.call(g,g))},[ea,g.delete]);function Da(){var Ye;if(V!=null&&V.loading){var Gt;return re.createElement("div",{className:ro(M==null?void 0:M.loader,g==null||(Gt=g.classNames)==null?void 0:Gt.loader,"sonner-loader"),"data-visible":ce==="loading"},V.loading)}return re.createElement(QW,{className:ro(M==null?void 0:M.loader,g==null||(Ye=g.classNames)==null?void 0:Ye.loader),visible:ce==="loading"})}const Es=g.icon||(V==null?void 0:V[ce])||WW(ce);var wn,In;return re.createElement("li",{tabIndex:0,ref:Me,className:ro(F,Ee,M==null?void 0:M.toast,g==null||(t=g.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[ce],g==null||(n=g.classNames)==null?void 0:n[ce]),"data-sonner-toast":"","data-rich-colors":(wn=g.richColors)!=null?wn:A,"data-styled":!(g.jsx||g.unstyled||x),"data-mounted":z,"data-promise":!!g.promise,"data-swiped":Ve,"data-removed":W,"data-visible":ne,"data-y-position":Jr,"data-x-position":fn,"data-index":R,"data-front":q,"data-swiping":J,"data-dismissible":Oe,"data-type":ce,"data-invert":Ws,"data-swipe-out":ye,"data-swipe-direction":P,"data-expanded":!!(_||H&&z),"data-testid":g.testId,style:{"--index":R,"--toasts-before":R,"--z-index":j.length-R,"--offset":`${W?et:sr.current}px`,"--initial-height":H?"auto":`${dn}px`,...T,...g.style},onDragEnd:()=>{le(!1),ge(null),Dr.current=null},onPointerDown:Ye=>{Ye.button!==2&&(Aa||!Oe||(yn.current=new Date,rt(sr.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(le(!0),Dr.current={x:Ye.clientX,y:Ye.clientY})))},onPointerUp:()=>{var Ye,Gt,Xt;if(ye||!Oe)return;Dr.current=null;const Bt=Number(((Ye=Me.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Vn=Number(((Gt=Me.current)==null?void 0:Gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jt=new Date().getTime()-((Xt=yn.current)==null?void 0:Xt.getTime()),Qt=oe==="x"?Bt:Vn,Rr=Math.abs(Qt)/Jt;if(Math.abs(Qt)>=gX||Rr>.11){rt(sr.current),g.onDismiss==null||g.onDismiss.call(g,g),U(oe==="x"?Bt>0?"right":"left":Vn>0?"down":"up"),ea(),Ce(!0);return}else{var K,ee;(K=Me.current)==null||K.style.setProperty("--swipe-amount-x","0px"),(ee=Me.current)==null||ee.style.setProperty("--swipe-amount-y","0px")}De(!1),le(!1),ge(null)},onPointerMove:Ye=>{var Gt,Xt,Bt;if(!Dr.current||!Oe||((Gt=window.getSelection())==null?void 0:Gt.toString().length)>0)return;const Jt=Ye.clientY-Dr.current.y,Qt=Ye.clientX-Dr.current.x;var Rr;const K=(Rr=e.swipeDirections)!=null?Rr:xX(B);!oe&&(Math.abs(Qt)>1||Math.abs(Jt)>1)&&ge(Math.abs(Qt)>Math.abs(Jt)?"x":"y");let ee={x:0,y:0};const fe=Se=>1/(1.5+Math.abs(Se)/20);if(oe==="y"){if(K.includes("top")||K.includes("bottom"))if(K.includes("top")&&Jt<0||K.includes("bottom")&&Jt>0)ee.y=Jt;else{const Se=Jt*fe(Jt);ee.y=Math.abs(Se)<Math.abs(Jt)?Se:Jt}}else if(oe==="x"&&(K.includes("left")||K.includes("right")))if(K.includes("left")&&Qt<0||K.includes("right")&&Qt>0)ee.x=Qt;else{const Se=Qt*fe(Qt);ee.x=Math.abs(Se)<Math.abs(Qt)?Se:Qt}(Math.abs(ee.x)>0||Math.abs(ee.y)>0)&&De(!0),(Xt=Me.current)==null||Xt.style.setProperty("--swipe-amount-x",`${ee.x}px`),(Bt=Me.current)==null||Bt.style.setProperty("--swipe-amount-y",`${ee.y}px`)}},mt&&!g.jsx&&ce!=="loading"?re.createElement("button",{"aria-label":$,"data-disabled":Aa,"data-close-button":!0,onClick:Aa||!Oe?()=>{}:()=>{ea(),g.onDismiss==null||g.onDismiss.call(g,g)},className:ro(M==null?void 0:M.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(In=V==null?void 0:V.close)!=null?In:rX):null,(ce||g.icon||g.promise)&&g.icon!==null&&((V==null?void 0:V[ce])!==null||g.icon)?re.createElement("div",{"data-icon":"",className:ro(M==null?void 0:M.icon,g==null||(s=g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Da():null,g.type!=="loading"?Es:null):null,re.createElement("div",{"data-content":"",className:ro(M==null?void 0:M.content,g==null||(i=g.classNames)==null?void 0:i.content)},re.createElement("div",{"data-title":"",className:ro(M==null?void 0:M.title,g==null||(c=g.classNames)==null?void 0:c.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?re.createElement("div",{"data-description":"",className:ro(G,je,M==null?void 0:M.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),re.isValidElement(g.cancel)?g.cancel:g.cancel&&Cp(g.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||I,onClick:Ye=>{Cp(g.cancel)&&Oe&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Ye),ea())},className:ro(M==null?void 0:M.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,re.isValidElement(g.action)?g.action:g.action&&Cp(g.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||k,onClick:Ye=>{Cp(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Ye),!Ye.defaultPrevented&&ea())},className:ro(M==null?void 0:M.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function y_(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function bX(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,c=i?"--mobile-offset":"--offset",u=i?hX:fX;function f(m){["top","right","bottom","left"].forEach(y=>{n[`${c}-${y}`]=typeof m=="number"?`${m}px`:m})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(m=>{r[m]===void 0?n[`${c}-${m}`]=u:n[`${c}-${m}`]=typeof r[m]=="number"?`${r[m]}px`:r[m]}):f(u)}),n}const SX=re.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:m,offset:y,mobileOffset:g,theme:x="light",richColors:v,duration:C,style:S,visibleToasts:w=dX,toastOptions:R,dir:j=y_(),gap:_=pX,icons:O,containerAriaLabel:A="Notifications"}=t,[D,T]=re.useState([]),I=re.useMemo(()=>r?D.filter(z=>z.toasterId===r):D.filter(z=>!z.toasterId),[D,r]),k=re.useMemo(()=>Array.from(new Set([i].concat(I.filter(z=>z.position).map(z=>z.position)))),[I,i]),[F,G]=re.useState([]),[Y,B]=re.useState(!1),[Z,H]=re.useState(!1),[M,V]=re.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=re.useRef(null),oe=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),ge=re.useRef(null),P=re.useRef(!1),U=re.useCallback(z=>{T(X=>{var W;return(W=X.find(ae=>ae.id===z.id))!=null&&W.delete||Ca.dismiss(z.id),X.filter(({id:ae})=>ae!==z.id)})},[]);return re.useEffect(()=>Ca.subscribe(z=>{if(z.dismiss){requestAnimationFrame(()=>{T(X=>X.map(W=>W.id===z.id?{...W,delete:!0}:W))});return}setTimeout(()=>{vA.flushSync(()=>{T(X=>{const W=X.findIndex(ae=>ae.id===z.id);return W!==-1?[...X.slice(0,W),{...X[W],...z},...X.slice(W+1)]:[z,...X]})})})}),[D]),re.useEffect(()=>{if(x!=="system"){V(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;const z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:X})=>{V(X?"dark":"light")})}catch{z.addListener(({matches:W})=>{try{V(W?"dark":"light")}catch(ae){console.error(ae)}})}},[x]),re.useEffect(()=>{D.length<=1&&B(!1)},[D]),re.useEffect(()=>{const z=X=>{var W;if(c.every(le=>X[le]||X.code===le)){var J;B(!0),(J=$.current)==null||J.focus()}X.code==="Escape"&&(document.activeElement===$.current||(W=$.current)!=null&&W.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[c]),re.useEffect(()=>{if($.current)return()=>{ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null,P.current=!1)}},[$.current]),re.createElement("section",{ref:n,"aria-label":`${A} ${oe}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((z,X)=>{var W;const[ae,J]=z.split("-");return I.length?re.createElement("ol",{key:z,dir:j==="auto"?y_():j,tabIndex:-1,ref:$,className:m,"data-sonner-toaster":!0,"data-sonner-theme":M,"data-y-position":ae,"data-x-position":J,style:{"--front-toast-height":`${((W=F[0])==null?void 0:W.height)||0}px`,"--width":`${mX}px`,"--gap":`${_}px`,...S,...bX(y,g)},onBlur:le=>{P.current&&!le.currentTarget.contains(le.relatedTarget)&&(P.current=!1,ge.current&&(ge.current.focus({preventScroll:!0}),ge.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||P.current||(P.current=!0,ge.current=le.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{Z||B(!1)},onDragEnd:()=>B(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||H(!0)},onPointerUp:()=>H(!1)},I.filter(le=>!le.position&&X===0||le.position===z).map((le,ye)=>{var Ce,Ve;return re.createElement(vX,{key:le.id,icons:O,index:ye,toast:le,defaultRichColors:v,duration:(Ce=R==null?void 0:R.duration)!=null?Ce:C,className:R==null?void 0:R.className,descriptionClassName:R==null?void 0:R.descriptionClassName,invert:s,visibleToasts:w,closeButton:(Ve=R==null?void 0:R.closeButton)!=null?Ve:f,interacting:Z,position:z,style:R==null?void 0:R.style,unstyled:R==null?void 0:R.unstyled,classNames:R==null?void 0:R.classNames,cancelButtonStyle:R==null?void 0:R.cancelButtonStyle,actionButtonStyle:R==null?void 0:R.actionButtonStyle,closeButtonAriaLabel:R==null?void 0:R.closeButtonAriaLabel,removeToast:U,toasts:I.filter(De=>De.position==le.position),heights:F.filter(De=>De.position==le.position),setHeights:G,expandByDefault:u,gap:_,expanded:Y,swipeDirections:t.swipeDirections})})):null}))}),CX=({...e})=>{const{theme:t="system"}=gd();return a.jsx(SX,{theme:t,className:"toaster group",icons:{success:a.jsx(vh,{className:"size-4"}),info:a.jsx(Fr,{className:"size-4"}),warning:a.jsx(bh,{className:"size-4"}),error:a.jsx(DA,{className:"size-4"}),loading:a.jsx(Rc,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...e})};function wX(){return a.jsx(aW,{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 EX({children:e}){const{isLoading:t}=wD(),n=fZ(),r=Yg(),s=Bs();return h.useEffect(()=>{if(t)return;const i=r.projectId,c=n==null?void 0:n.projectId;if(i&&!s.pathname.startsWith("/auth")&&n&&c&&c!==i){const u=new URLSearchParams({projectId:i}).toString();window.location.href=`/auth/sign-in?${u}`}},[t,n,r.projectId,s.pathname]),a.jsx(a.Fragment,{children:e})}const x_="sidebar_state";function RX(){const{state:e,isMobile:t}=Th(),r=t||e==="collapsed",{isLoading:s}=ZW();return a.jsxs(a.Fragment,{children:[a.jsx(CX,{position:"bottom-right",closeButton:!0}),a.jsx(wX,{}),a.jsx(qW,{isLoading:s}),a.jsxs(hZ,{redirectTo:"/auth/sign-in",children:[a.jsx(HW,{variant:"inset",collapsible:"icon"}),a.jsxs(SG,{children:[r&&a.jsx(vG,{}),a.jsx(EX,{children:a.jsx(Xb,{})})]})]})]})}function jX(){const[e,t]=h.useState(()=>ps.get(x_,"boolean")??!0),n=r=>{t(r),ps.set(x_,r)};return a.jsx($W,{children:a.jsx(KW,{children:a.jsx(yG,{open:e,onOpenChange:n,children:a.jsx(RX,{})})})})}function TX(){return a.jsxs("div",{className:"app-container",children:[a.jsx("h1",{children:"About OWOX"}),a.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function v_(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx(Uz,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),a.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",a.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",a.jsx("i",{children:"yesterday"}),".",a.jsx("br",{}),"Escape while you can!"]}),a.jsx(we,{variant:"default",asChild:!0,children:a.jsxs(Wr,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(_a,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const _X={items:[],loading:!1,error:null};function NX(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 JD=h.createContext(void 0);function AX({children:e}){const[t,n]=h.useReducer(NX,_X);return a.jsx(JD.Provider,{value:{state:t,dispatch:n},children:e})}function DX(){const e=h.useContext(JD);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class OX 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)}async getDataMartRunById(t,n,r){return this.get(`/${t}/runs/${n}`,void 0,r)}async getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const Tn=new OX;var zr=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(zr||{}),$e=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))($e||{}),Yp=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Yp||{});const IX={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"};var e5=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(e5||{}),Pr=(e=>(e.CONNECTOR="CONNECTOR",e.GOOGLE_SHEETS_EXPORT="GOOGLE_SHEETS_EXPORT",e.LOOKER_STUDIO="LOOKER_STUDIO",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e.INSIGHT="INSIGHT",e))(Pr||{}),qn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(qn||{});const t5={statuses:{[zr.DRAFT]:{code:zr.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[zr.PUBLISHED]:{code:zr.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},n5=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,r5=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,MX=e=>e?n5(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",kX=e=>e?r5(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",a5=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)},s5=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)},LX=e=>e?a5(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",PX=e=>e?s5(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";var Ps=(e=>(e.PASSWORD="PASSWORD",e.KEY_PAIR="KEY_PAIR",e))(Ps||{});const UX=[{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 zX(e){return"projectId"in e}function FX(e){return"outputBucket"in e}var Re=(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))(Re||{}),Xo=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(Xo||{});const HX=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return a.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[a.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?a.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):a.jsx("span",{className:"text-sm",children:s||r===void 0?a.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},$X=({type:e,config:t})=>{const n={[Re.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Re.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Re.SNOWFLAKE]:[],[Re.DATABRICKS]:[],[Re.AWS_REDSHIFT]:[],[Re.AZURE_SYNAPSE]:[]},r=t&&(e===Re.GOOGLE_BIGQUERY&&zX(t)||e===Re.AWS_ATHENA&&FX(t));return a.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:i})=>{let c;return r&&(c=(e===Re.GOOGLE_BIGQUERY,t[i])),a.jsx(HX,{label:s,value:c},i)})})},VX=({type:e,config:t})=>a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),a.jsx($X,{type:e,config:t})]})}),GX=Ec("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 Nr({className:e,variant:t,asChild:n=!1,...r}){const s=n?yh:"span";return a.jsx(s,{"data-slot":"badge",className:se(GX({variant:t}),e),...r})}function o5(e){return e.type===Re.GOOGLE_BIGQUERY}function i5(e){return e.type===Re.AWS_ATHENA}function l5(e){return e.type===Re.SNOWFLAKE}const Sl={types:{[Re.GOOGLE_BIGQUERY]:{type:Re.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:jD,status:Xo.ACTIVE},[Re.AWS_ATHENA]:{type:Re.AWS_ATHENA,displayName:"AWS Athena",icon:TD,status:Xo.ACTIVE},[Re.SNOWFLAKE]:{type:Re.SNOWFLAKE,displayName:"Snowflake",icon:_D,status:Xo.ACTIVE},[Re.DATABRICKS]:{type:Re.DATABRICKS,displayName:"Databricks",icon:CZ,status:Xo.COMING_SOON},[Re.AWS_REDSHIFT]:{type:Re.AWS_REDSHIFT,displayName:"AWS Redshift",icon:wZ,status:Xo.COMING_SOON},[Re.AZURE_SYNAPSE]:{type:Re.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:EZ,status:Xo.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function BX({dataStorage:e,isLoading:t=!1}){if(t)return a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,u)=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ur,{className:"h-5 w-24"}),a.jsx(Ur,{className:"h-6 w-40"})]},u))})});if(!e)return a.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:i}=e;return a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{children:e.title}),a.jsx(Nr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:u}=Sl.getInfo(n);return a.jsxs(a.Fragment,{children:[a.jsx(u,{}),c]})})()})]}),a.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:a.jsx(VX,{type:n,config:r})}),a.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[a.jsxs("div",{children:[a.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))]}),a.jsxs("div",{children:[a.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(i))]})]})]})})}function qX(e){const t=e.split(".");return t.length===2?{dataset:t[0],table:t[1]}:t.length===3?{dataset:t[0],schema:t[1],table:t[2]}:(console.error("Invalid fully qualified name format:",e),null)}function KX(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),i=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${i}`}function ZX(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function YX(e){return`https://${e}.snowflakecomputing.com/`}function WX(e,t){const n=qX(t);if(!n)return null;const{dataset:r,table:s}=n;return o5(e)?KX(e.config.projectId,r,s):i5(e)?ZX(e.config.region):l5(e)?YX(e.config.account):null}function XX(e,t){const n=WX(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function QX(e){return o5(e)?"Open table in Google BigQuery":i5(e)?"Open region in AWS Athena":l5(e)?"Open console in Snowflake":"Open data in storage"}function c5(e){switch(e.type){case Re.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Re.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);case Re.SNOWFLAKE:return!!(e.config.account&&e.config.warehouse);default:return!1}}const JX=rn({accessKeyId:Dt().min(1,"Access Key ID is required"),secretAccessKey:Dt().min(1,"Secret Access Key is required")}),eQ=rn({authMethod:Gr(Ps.PASSWORD),username:Dt().min(1,"Username is required"),password:Dt().min(1,"Password is required")}),tQ=rn({authMethod:Gr(Ps.KEY_PAIR),username:Dt().min(1,"Username is required"),privateKey:Dt().min(1,"Private Key is required"),privateKeyPassphrase:Dt().optional()}),nQ=$S("authMethod",[eQ,tQ]),rQ=rn({projectId:Dt().min(1,"Project ID is required"),location:Dt().min(1,"Location is required")}),aQ=rn({region:Dt().min(1,"Region is required"),outputBucket:Dt().min(1,"Output Bucket is required")}),sQ=rn({account:Dt().min(1,"Account is required"),warehouse:Dt().min(1,"Warehouse is required")}),qS=rn({title:Dt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),oQ=qS.extend({type:Gr(Re.GOOGLE_BIGQUERY),credentials:MD,config:rQ}),iQ=qS.extend({type:Gr(Re.AWS_ATHENA),credentials:JX,config:aQ}),lQ=qS.extend({type:Gr(Re.SNOWFLAKE),credentials:nQ,config:sQ}),cQ=$S("type",[oQ,iQ,lQ]),u5=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${t}$`).test(e)},d5=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")',n='(?:[a-zA-Z0-9_$*]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${n}$`).test(e)},uQ=e=>e?u5(e)?"":"Invalid format. Expected: database.schema.object":"Fully qualified name is required",dQ=e=>e?d5(e)?"":"Invalid format. Expected: database.schema.table_* (with wildcards)":"Table pattern is required",fQ=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return n5(e);case Re.AWS_ATHENA:return a5(e);case Re.SNOWFLAKE:return u5(e);default:return!1}},hQ=(e,t)=>{if(!e)return!1;switch(t){case Re.GOOGLE_BIGQUERY:return r5(e);case Re.AWS_ATHENA:return s5(e);case Re.SNOWFLAKE:return d5(e);default:return!1}},mQ=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Re.GOOGLE_BIGQUERY:return MX(e);case Re.AWS_ATHENA:return LX(e);case Re.SNOWFLAKE:return uQ(e);default:return"Unsupported storage type"}},pQ=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Re.GOOGLE_BIGQUERY:return kX(e);case Re.AWS_ATHENA:return PX(e);case Re.SNOWFLAKE:return dQ(e);default:return"Unsupported storage type"}},f5=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"project.dataset.table";case Re.AWS_ATHENA:return"database.table or catalog.database.table";case Re.SNOWFLAKE:return"database.schema.table";default:return""}},gQ=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Re.AWS_ATHENA:return"database.table_* or catalog.database.table_*";case Re.SNOWFLAKE:return"database.schema.table_*";default:return""}},h5=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Re.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";case Re.SNOWFLAKE:return"Enter the fully qualified name of the table (e.g., database.schema.table)";default:return""}},yQ=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Re.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';case Re.SNOWFLAKE:return'Enter a pattern to match multiple tables (e.g., database.schema.table_* will match all tables starting with "table_")';default:return""}};var Jn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Jn||{});const xQ={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:""},vQ=e=>xQ[e],bQ={[Jn.SUCCESS]:{icon:vh,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"}},[Jn.ERROR]:{icon:DA,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"}},[Jn.WARNING]:{icon:bh,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"}},[Jn.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"}},[Jn.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 Uh({type:e=Jn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:i,colors:c}=bQ[e],u=f=>{const m="inline-flex items-center gap-1 text-sm",y=vQ(f),g=c[f];return se(m,y,g,s)};return a.jsxs("span",{className:u(t),children:[n&&a.jsx(i,{className:"h-4 w-4","data-testid":"icon"}),r]})}const m5=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,SQ=/[#&]gid=([0-9]+)/;function p5(e){return m5.test(e)}function CQ(e){const t=m5.exec(e);return t?t[2]:""}function wQ(e){const t=SQ.exec(e);return t?t[1]:"0"}function EQ(e){return{spreadsheetId:CQ(e),sheetId:parseInt(wQ(e),10)}}function KS(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function RQ(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 B0(e){return RQ(e,"client_email")}const g5=h.createContext(void 0);var it=(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))(it||{}),Ar=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(Ar||{}),Mn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(Mn||{}),_n=(e=>(e.EDIT="edit",e.CREATE="create",e))(_n||{});const jQ={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function TQ(e,t){switch(t.type){case it.FETCH_REPORTS_START:case it.FETCH_REPORT_START:case it.CREATE_REPORT_START:case it.UPDATE_REPORT_START:case it.DELETE_REPORT_START:return{...e,loading:!0,error:null};case it.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case it.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case it.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case it.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case it.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 it.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case it.FETCH_REPORTS_ERROR:case it.FETCH_REPORT_ERROR:case it.FETCH_DESTINATIONS_ERROR:case it.CREATE_REPORT_ERROR:case it.UPDATE_REPORT_ERROR:case it.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case it.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case it.CLEAR_ERROR:return{...e,error:null};case it.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case it.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case it.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case it.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==Mn.RUNNING||(n==null?void 0:n.lastRunStatus)!==Mn.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 ZS({children:e}){const[t,n]=h.useReducer(TQ,jQ);return a.jsx(g5.Provider,{value:{state:t,dispatch:n},children:e})}function _Q(){const e=h.useContext(g5);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class NQ 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 NQ,AQ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class DQ{constructor(){to(this,"pollingTimers",new Map);to(this,"pollCounters",new Map);to(this,"config",AQ)}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 i=await Yo.getReportById(t);if(n(i),i.lastRunStatus!==Mn.RUNNING){this.stopPolling(t);return}const u=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,f=setTimeout(()=>{r()},u);this.pollingTimers.set(t,f)}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 wp=new DQ;var Ae=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e))(Ae||{}),As=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(As||{}),mo=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(mo||{});class OQ 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 Jl=new OQ,aa={types:{[Ae.GOOGLE_SHEETS]:{type:Ae.GOOGLE_SHEETS,displayName:"Google Sheets",icon:vZ,status:As.ACTIVE},[Ae.LOOKER_STUDIO]:{type:Ae.LOOKER_STUDIO,displayName:"Looker Studio",icon:bZ,status:As.ACTIVE},[Ae.EMAIL]:{type:Ae.EMAIL,displayName:"Email",icon:kZ,status:As.CLOUD_ONLY},[Ae.SLACK]:{type:Ae.SLACK,displayName:"Slack",icon:jZ,status:As.CLOUD_ONLY},[Ae.MS_TEAMS]:{type:Ae.MS_TEAMS,displayName:"Microsoft Teams",icon:IZ,status:As.CLOUD_ONLY},[Ae.GOOGLE_CHAT]:{type:Ae.GOOGLE_CHAT,displayName:"Google Chat",icon:MZ,status:As.CLOUD_ONLY},[Ae.ODATA]:{type:Ae.ODATA,displayName:"OData",icon:SZ,status:As.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},IQ=rn({deploymentUrl:Dt().optional(),destinationId:Dt().optional(),destinationSecretKey:Dt().optional()}),MQ=rn({to:eb(Dt().email()).min(1)}),YS=rn({title:Dt().min(1,"Title is required"),type:Ey(Ae)}),kQ=YS.extend({type:Gr(Ae.GOOGLE_SHEETS),credentials:MD}),LQ=YS.extend({type:Gr(Ae.LOOKER_STUDIO),credentials:IQ.optional()}),Ty=YS.extend({credentials:MQ.optional()}),PQ=Ty.extend({type:Gr(Ae.EMAIL)}),UQ=Ty.extend({type:Gr(Ae.SLACK)}),zQ=Ty.extend({type:Gr(Ae.MS_TEAMS)}),FQ=Ty.extend({type:Gr(Ae.GOOGLE_CHAT)}),HQ=$S("type",[kQ,LQ,PQ,UQ,zQ,FQ]),y5=h.createContext(void 0);var en=(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))(en||{});const $Q={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function VQ(e,t){switch(t.type){case en.FETCH_DESTINATIONS_START:case en.FETCH_DESTINATION_START:case en.CREATE_DESTINATION_START:case en.UPDATE_DESTINATION_START:case en.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case en.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case en.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case en.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case en.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 en.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case en.FETCH_DESTINATIONS_ERROR:case en.FETCH_DESTINATION_ERROR:case en.CREATE_DESTINATION_ERROR:case en.UPDATE_DESTINATION_ERROR:case en.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case en.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case en.CLEAR_ERROR:return{...e,error:null};default:return e}}function zh({children:e}){const[t,n]=h.useReducer(VQ,$Q);return a.jsx(y5.Provider,{value:{state:t,dispatch:n},children:e})}function GQ(){const e=h.useContext(y5);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Ep{constructor(t){this.type=t}mapFromDto(t){const n=this.extractCredentials(t.credentials);return{id:t.id,title:t.title,type:this.type,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};if(n.credentials!==void 0){const s=n.credentials.to;r.credentials={type:mo.EMAIL_CREDENTIALS,to:s}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:mo.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===mo.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class BQ{mapFromDto(t){let n="";try{t.credentials.type===mo.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:Ae.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:mo.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Ae.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:mo.GOOGLE_SHEETS_CREDENTIALS}}}}class qQ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Ae.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:mo.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Ae.LOOKER_STUDIO,credentials:{type:mo.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===mo.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const x5={getMapper(e){switch(e){case Ae.GOOGLE_SHEETS:return new BQ;case Ae.LOOKER_STUDIO:return new qQ;case Ae.EMAIL:return new Ep(Ae.EMAIL);case Ae.SLACK:return new Ep(Ae.SLACK);case Ae.MS_TEAMS:return new Ep(Ae.MS_TEAMS);case Ae.GOOGLE_CHAT:return new Ep(Ae.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function _u(e){return x5.getMapper(e.type).mapFromDto(e)}function Fh(){const{state:e,dispatch:t}=GQ(),n=h.useCallback(async()=>{t({type:en.FETCH_DESTINATIONS_START});try{const y=(await Jl.getDataDestinations()).map(_u);t({type:en.FETCH_DESTINATIONS_SUCCESS,payload:y})}catch(m){const y=m instanceof Error?m.message:"Failed to load destinations";t({type:en.FETCH_DESTINATIONS_ERROR,payload:y}),Le({event:"data_destination_error",category:"DataDestination",action:"ListError",label:y})}},[t]),r=h.useCallback(async m=>{try{const y=await Jl.getDataDestinationById(m),g=_u(y);t({type:en.FETCH_DESTINATION_SUCCESS,payload:g})}catch(y){const g=y instanceof Error?y.message:"Failed to load destination";t({type:en.FETCH_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"GetError",label:g})}},[t]),s=h.useCallback(async m=>{t({type:en.CREATE_DESTINATION_START});try{const y=await Jl.createDataDestination(m),g=_u(y);return t({type:en.CREATE_DESTINATION_SUCCESS,payload:g}),Le({event:"data_destination_created",category:"DataDestination",action:"Create",label:g.type}),_t.success("Destination created"),g}catch(y){const g=y instanceof Error?y.message:"Failed to create destination";return t({type:en.CREATE_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type}),null}},[t]),i=h.useCallback(async(m,y)=>{t({type:en.UPDATE_DESTINATION_START});try{const g=await Jl.updateDataDestination(m,y),x=_u(g);return t({type:en.UPDATE_DESTINATION_SUCCESS,payload:x}),Le({event:"data_destination_updated",category:"DataDestination",action:"Update",label:x.type}),_t.success("Destination updated"),x}catch(g){const x=g instanceof Error?g.message:"Failed to update destination";return t({type:en.UPDATE_DESTINATION_ERROR,payload:x}),Le({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:x}),null}},[t]),c=h.useCallback(async m=>{t({type:en.DELETE_DESTINATION_START});try{await Jl.deleteDataDestination(m),t({type:en.DELETE_DESTINATION_SUCCESS,payload:m}),Le({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),_t.success("Destination deleted")}catch(y){const g=y instanceof Error?y.message:"Failed to delete destination";throw t({type:en.DELETE_DESTINATION_ERROR,payload:g}),Le({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:g}),y}},[t]),u=h.useCallback(()=>{t({type:en.CLEAR_CURRENT_DESTINATION})},[t]),f=h.useCallback(async m=>{try{const y=await Jl.rotateSecretKey(m),g=_u(y);return Le({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:g.type}),g}catch(y){const g=y instanceof Error?y.message:"Failed to rotate secret key";throw Le({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",label:g}),console.error("Failed to rotate secret key:",y),y}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:i,deleteDataDestination:c,clearCurrentDataDestination:u,rotateSecretKey:f}}function KQ(e){const t=aa.getInfo(e.type),n=t.status!==As.COMING_SOON;return{destinationInfo:t,isVisible:n}}function ZQ(){const{dataMart:e}=bs(),{fetchReportsByDataMartId:t}=ts(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Fh(),[i,c]=h.useState(!0);return h.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:i||s}}function WS(e){return JSON.stringify(e,null,2)}class YQ{mapFromDto(t){if(t.type!==Ar.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:Ar.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class WQ{mapFromDto(t){if(t.type!==Ar.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:Ar.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class XQ{mapFromDto(t){if(t.type!==Ar.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:Ar.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const QQ={getMapper(e){switch(e){case Ar.GOOGLE_SHEETS_CONFIG:return new WQ;case Ar.LOOKER_STUDIO_CONFIG:return new XQ;case Ar.EMAIL_CONFIG:return new YQ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function JQ(e){return QQ.getMapper(e.type).mapFromDto(e)}function ec(e){const t=JQ(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:_u(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)}}const v5=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"—";return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(t)},_y=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(g=>[g.type,g.value])),i=s.get("year")??"",c=s.get("month")??"",u=s.get("day")??"",f=s.get("hour")??"",m=s.get("minute")??"",y=s.get("second")??"";return`${i}-${c}-${u} ${f}:${m}:${y}`},Su=e=>_y(b5(e).toISOString()),b5=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},eJ=(e,t)=>{const n=t.getTime()-e.getTime(),r=Math.floor(n/1e3),s=Math.floor(r/60),i=Math.floor(s/60),c=s%60,u=r%60,f=[];return i>0&&f.push(`${String(i)} h`),c>0&&f.push(`${String(c)} min`),f.push(`${String(u)} sec`),f.join(" ")};function S5(e){return JSON.parse(JSON.stringify(e))}function tJ(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]}`}const C5=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}};function nJ(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function rJ(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}const aJ=e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[];function ts(){const{state:e,dispatch:t}=_Q(),n=h.useCallback(async()=>{t({type:it.FETCH_DESTINATIONS_START});try{const w=await Jl.getDataDestinations();t({type:it.FETCH_DESTINATIONS_SUCCESS,payload:w})}catch(w){const R=w instanceof Error?w.message:"Failed to fetch destinations";t({type:it.FETCH_DESTINATIONS_ERROR,payload:R}),Le({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=h.useCallback(async()=>{t({type:it.FETCH_REPORTS_START});try{const R=(await Yo.getReportsByProject()).map(ec);t({type:it.FETCH_REPORTS_SUCCESS,payload:R})}catch(w){const R=w instanceof Error?w.message:"Failed to fetch reports";t({type:it.FETCH_REPORTS_ERROR,payload:R}),Le({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),s=h.useCallback(async(w,R)=>{R!=null&&R.silent||t({type:it.FETCH_REPORTS_START});try{const _=(await Yo.getReportsByDataMartId(w,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(ec);t({type:it.FETCH_REPORTS_SUCCESS,payload:_})}catch(j){const _=j instanceof Error?j.message:"Failed to fetch reports";t({type:it.FETCH_REPORTS_ERROR,payload:_}),Le({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),i=h.useCallback(async w=>{t({type:it.FETCH_REPORT_START});try{const R=await Yo.getReportById(w),j=ec(R);t({type:it.FETCH_REPORT_SUCCESS,payload:j})}catch(R){const j=R instanceof Error?R.message:"Failed to fetch report";t({type:it.FETCH_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"GetError",label:j})}},[t]),c=h.useCallback(async w=>{t({type:it.CREATE_REPORT_START});try{const R=await Yo.createReport(w),j=ec(R);return t({type:it.CREATE_REPORT_SUCCESS,payload:j}),Le({event:"report_created",category:"Report",action:"Create",label:j.dataDestination.type}),_t.success("Report created"),j}catch(R){const j=R instanceof Error?R.message:"Failed to create report";return t({type:it.CREATE_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"CreateError",label:w.destinationConfig.type}),null}},[t]),u=h.useCallback(async(w,R)=>{t({type:it.UPDATE_REPORT_START});try{const j=await Yo.updateReport(w,R),_=ec(j);return t({type:it.UPDATE_REPORT_SUCCESS,payload:_}),Le({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type}),_t.success("Report updated"),_}catch(j){const _=j instanceof Error?j.message:"Failed to update report";return t({type:it.UPDATE_REPORT_ERROR,payload:_}),Le({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=h.useCallback(async w=>{t({type:it.DELETE_REPORT_START});try{await Yo.deleteReport(w),t({type:it.DELETE_REPORT_SUCCESS,payload:w}),Le({event:"report_deleted",category:"Report",action:"Delete"}),_t.success("Report deleted")}catch(R){const j=R instanceof Error?R.message:"Failed to delete report";t({type:it.DELETE_REPORT_ERROR,payload:j}),Le({event:"report_error",category:"Report",action:"DeleteError",label:j})}},[t]),m=h.useCallback(()=>{t({type:it.CLEAR_CURRENT_REPORT})},[t]),y=h.useCallback(()=>{t({type:it.CLEAR_ERROR})},[t]),g=h.useCallback(w=>{wp.stopPolling(w),t({type:it.STOP_POLLING_REPORT,payload:w})},[t]),x=h.useCallback(w=>{e.polledReportIds.includes(w)&&g(w),t({type:it.START_POLLING_REPORT,payload:w}),wp.startPolling(w,R=>{const j=ec(R);t({type:it.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,g]),v=h.useCallback(()=>{wp.stopAllPolling(),t({type:it.STOP_ALL_POLLING})},[t]),C=h.useCallback(w=>{wp.setConfig(w)},[]),S=h.useCallback(async w=>{try{g(w),await Yo.runReport(w),await i(w),x(w),Le({event:"report_run_started",category:"Report",action:"Run",label:w}),_t.success("Report run started")}catch(R){const j=R instanceof Error?R.message:"Failed to run report";Le({event:"report_error",category:"Report",action:"RunError",label:j}),console.error("Failed to run report:",R)}},[i,x,g]);return h.useEffect(()=>()=>{v()},[v]),{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:i,createReport:c,updateReport:u,deleteReport:f,runReport:S,startPollingReport:x,stopPollingReport:g,stopAllPolling:v,setPollingConfig:C,clearCurrentReport:m,clearError:y}}Mn.SUCCESS+"",Mn.SUCCESS,Mn.RUNNING+"",Mn.RUNNING,Mn.ERROR+"",Mn.ERROR,Mn.CANCELLED+"",Mn.CANCELLED;var q0,Ny="HoverCard",[w5]=Sr(Ny,[wo]),Ay=wo(),[sJ,Dy]=w5(Ny),E5=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:c=700,closeDelay:u=300}=e,f=Ay(t),m=h.useRef(0),y=h.useRef(0),g=h.useRef(!1),x=h.useRef(!1),[v,C]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:Ny}),S=h.useCallback(()=>{clearTimeout(y.current),m.current=window.setTimeout(()=>C(!0),c)},[c,C]),w=h.useCallback(()=>{clearTimeout(m.current),!g.current&&!x.current&&(y.current=window.setTimeout(()=>C(!1),u))},[u,C]),R=h.useCallback(()=>C(!1),[C]);return h.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(y.current)},[]),a.jsx(sJ,{scope:t,open:v,onOpenChange:C,onOpen:S,onClose:w,onDismiss:R,hasSelectionRef:g,isPointerDownOnContentRef:x,children:a.jsx(dd,{...f,children:n})})};E5.displayName=Ny;var R5="HoverCardTrigger",j5=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Dy(R5,n),i=Ay(n);return a.jsx(fd,{asChild:!0,...i,children:a.jsx(Je.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Ie(e.onPointerEnter,_g(s.onOpen)),onPointerLeave:Ie(e.onPointerLeave,_g(s.onClose)),onFocus:Ie(e.onFocus,s.onOpen),onBlur:Ie(e.onBlur,s.onClose),onTouchStart:Ie(e.onTouchStart,c=>c.preventDefault())})})});j5.displayName=R5;var XS="HoverCardPortal",[oJ,iJ]=w5(XS,{forceMount:void 0}),T5=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=Dy(XS,t);return a.jsx(oJ,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};T5.displayName=XS;var Tg="HoverCardContent",_5=h.forwardRef((e,t)=>{const n=iJ(Tg,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=Dy(Tg,e.__scopeHoverCard);return a.jsx(Vr,{present:r||i.open,children:a.jsx(lJ,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Ie(e.onPointerEnter,_g(i.onOpen)),onPointerLeave:Ie(e.onPointerLeave,_g(i.onClose)),ref:t})})});_5.displayName=Tg;var lJ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,...u}=e,f=Dy(Tg,n),m=Ay(n),y=h.useRef(null),g=ht(t,y),[x,v]=h.useState(!1);return h.useEffect(()=>{if(x){const C=document.body;return q0=C.style.userSelect||C.style.webkitUserSelect,C.style.userSelect="none",C.style.webkitUserSelect="none",()=>{C.style.userSelect=q0,C.style.webkitUserSelect=q0}}},[x]),h.useEffect(()=>{if(y.current){const C=()=>{v(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var w;((w=document.getSelection())==null?void 0:w.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",C),()=>{document.removeEventListener("pointerup",C),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),h.useEffect(()=>{y.current&&dJ(y.current).forEach(S=>S.setAttribute("tabindex","-1"))}),a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Ie(i,C=>{C.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(Eh,{...m,...u,onPointerDown:Ie(u.onPointerDown,C=>{C.currentTarget.contains(C.target)&&v(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:g,style:{...u.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)"}})})}),cJ="HoverCardArrow",uJ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Ay(n);return a.jsx(Rh,{...s,...r,ref:t})});uJ.displayName=cJ;function _g(e){return t=>t.pointerType==="touch"?void 0:e()}function dJ(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 fJ=E5,hJ=j5,mJ=T5,pJ=_5;const Oy=({...e})=>a.jsx(fJ,{"data-slot":"hover-card",...e});Oy.displayName="HoverCard";const Iy=h.forwardRef(({...e},t)=>a.jsx(hJ,{"data-slot":"hover-card-trigger",ref:t,...e}));Iy.displayName="HoverCardTrigger";const My=h.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},i)=>{const c=u=>{u.stopPropagation(),r&&r(u)};return a.jsx(mJ,{children:a.jsx(pJ,{ref:i,align:t,sideOffset:n,className:se("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})})});My.displayName="HoverCardContent";const QS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("border-border flex gap-4 border-b pb-4",e),...t}));QS.displayName="HoverCardHeader";const JS=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));JS.displayName="HoverCardHeaderIcon";const e2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col space-y-1",e),...t}));e2.displayName="HoverCardHeaderText";const t2=h.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:se("text-md pt-1 leading-snug font-semibold",e),...t}));t2.displayName="HoverCardHeaderTitle";const n2=h.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));n2.displayName="HoverCardHeaderDescription";const r2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col",e),...t}));r2.displayName="HoverCardBody";const el=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("border-border flex items-center justify-between border-b py-4",e),...t}));el.displayName="HoverCardItem";const tl=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));tl.displayName="HoverCardItemLabel";const nl=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-sm",e),...t}));nl.displayName="HoverCardItemValue";const a2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("pt-4 pb-2",e),...t}));a2.displayName="HoverCardFooter";function ky(e){return e.type===Ar.GOOGLE_SHEETS_CONFIG}function N5(e){return e.type===Ar.LOOKER_STUDIO_CONFIG}function K0(e){return e.type===Ar.EMAIL_CONFIG}function Vs({date:e,className:t=""}){const n=h.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),i=Math.abs(s),c=s<0,u=Math.floor(i/(1e3*60)),f=Math.floor(i/(1e3*60*60)),m=Math.floor(i/(1e3*60*60*24)),y=Math.floor(m/7),g=Math.floor(m/30),x=Math.floor(m/365),v=S=>S.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),C=S=>S.toLocaleDateString("en-US",{weekday:"long"});if(u<1)return c?"Just now":"In a moment";if(u<60)return c?u===1?"1 minute ago":`${u} minutes ago`:u===1?"In 1 minute":`In ${u} minutes`;if(f<24)return c?f===1?"1 hour ago":`${f} hours ago`:f===1?"In 1 hour":`In ${f} hours`;if(m===1){const S=v(e);return c?`Yesterday at ${S}`:`Tomorrow at ${S}`}if(m<7){const S=C(e),w=v(e);return c?`Last ${S} at ${w}`:`This ${S} at ${w}`}if(m<14){const S=C(e),w=v(e);return c?`Last ${S} at ${w}`:`Next ${S} at ${w}`}return y<4?c?y===2?"2 weeks ago":"3 weeks ago":y===2?"In 2 weeks":"In 3 weeks":g<12?c?g===1?"1 month ago":`${g} months ago`:g===1?"In 1 month":`In ${g} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return a.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const gJ=()=>{const e=h.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=h.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},yJ=re.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=gJ(),i=h.useMemo(()=>t.lastRunStatus?{statusType:bJ(t.lastRunStatus),statusText:CJ(t.lastRunStatus)}:null,[t.lastRunStatus]),c=h.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),u=h.useMemo(()=>aa.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=h.useMemo(()=>ky(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),m=h.useCallback(()=>{if(!f.isGoogleSheets||!f.spreadsheetId||!f.sheetId)return;const y=KS(f.spreadsheetId,f.sheetId);window.open(y,"_blank","noopener,noreferrer")},[f]);return a.jsxs(Oy,{children:[a.jsx(Iy,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(My,{children:[a.jsxs(QS,{children:[a.jsx(JS,{children:a.jsx(u,{size:20})}),a.jsxs(e2,{children:[a.jsx(t2,{children:t.title||"Unnamed Report"}),a.jsxs(n2,{children:["Last modified ",a.jsx(Vs,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(r2,{children:[a.jsxs(el,{children:[a.jsx(tl,{children:"Last run status:"}),a.jsx(nl,{children:i?a.jsx(Uh,{type:i.statusType,variant:"ghost",children:i.statusText}):"Not run yet"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Last run date:"}),a.jsx(nl,{children:t.lastRunDate?a.jsx(Vs,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(el,{children:[a.jsx(tl,{children:"Error message:"}),a.jsx(nl,{children:t.lastRunError})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Total runs:"}),a.jsxs(nl,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(a2,{children:a.jsxs(we,{className:"w-full",variant:"default",onClick:m,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",a.jsx(ai,{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));var Xa=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Xa||{});const xJ=e=>{switch(e){case zr.DRAFT:return Jn.NEUTRAL;case zr.PUBLISHED:return Jn.SUCCESS;default:return Jn.NEUTRAL}},vJ=e=>{switch(e){case qn.SUCCESS:return Jn.SUCCESS;case qn.RUNNING:return Jn.INFO;case qn.FAILED:case qn.CANCELLED:case qn.INTERRUPTED:return Jn.ERROR;default:return Jn.NEUTRAL}},bJ=e=>{switch(e){case Mn.SUCCESS:return Jn.SUCCESS;case Mn.RUNNING:return Jn.INFO;case Mn.ERROR:return Jn.ERROR;default:return Jn.NEUTRAL}},SJ=e=>{switch(e){case qn.SUCCESS:return"Success";case qn.RUNNING:return"Running";case qn.FAILED:return"Failed";case qn.CANCELLED:return"Cancelled";case qn.INTERRUPTED:return"Interrupted";case qn.PENDING:return"Pending";default:return"Unknown"}},CJ=e=>{switch(e){case Mn.SUCCESS:return"Success";case Mn.RUNNING:return"Running";case Mn.ERROR:return"Failed";default:return"Unknown"}},wJ=e=>e?[qn.SUCCESS,qn.FAILED,qn.CANCELLED,qn.INTERRUPTED].includes(e):!0,EJ=e=>e?[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED].includes(e):!0,A5=e=>rn({fullyQualifiedName:Dt().min(1,"Fully qualified name is required").refine(t=>fQ(t,e),t=>({message:mQ(t,e)}))}),RJ=e=>rn({pattern:Dt().min(1,"Table pattern is required").refine(t=>hQ(t,e),t=>({message:pQ(t,e)}))}),jJ=e=>{const t=[];return e.status.code===zr.PUBLISHED&&t.push(Yp.ALREADY_PUBLISHED),c5(e.storage)||t.push(Yp.INVALID_STORAGE),e.definition||t.push(Yp.MISSING_DEFINITION),t},TJ=e=>e.map(t=>IX[t]);function _J(e){return e.map(t=>({id:t.id,title:t.title,status:t5.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdByUser:t.createdByUser,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function D5(){const{state:e,dispatch:t}=DX(),n=h.useCallback(async()=>{t({type:"SET_LOADING"});try{const i=await Tn.getDataMarts(),c=_J(i);t({type:"SET_ITEMS",payload:c})}catch(i){t({type:"SET_ERROR",payload:i instanceof Error?i.message:"Failed to load data marts"})}},[t]),r=h.useCallback(async i=>{t({type:"SET_LOADING"});try{await Tn.deleteDataMart(i),Le({event:"data_mart_deleted",category:"DataMart",action:"Delete"})}catch(c){const u=c instanceof Error?c.message:"Failed to delete data mart";throw t({type:"SET_ERROR",payload:u}),Le({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:u}),c}},[t]),s=h.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,deleteDataMart:r}}/**
|
|
777
|
-
* table-core
|
|
778
|
-
*
|
|
779
|
-
* Copyright (c) TanStack
|
|
780
|
-
*
|
|
781
|
-
* This source code is licensed under the MIT license found in the
|
|
782
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
783
|
-
*
|
|
784
|
-
* @license MIT
|
|
785
|
-
*/function rl(e,t){return typeof e=="function"?e(t):e}function Ja(e,t){return n=>{t.setState(r=>({...r,[e]:rl(n,r[e])}))}}function Ly(e){return e instanceof Function}function NJ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function AJ(e,t){const n=[],r=s=>{s.forEach(i=>{n.push(i);const c=t(i);c!=null&&c.length&&r(c)})};return r(e),n}function lt(e,t,n){let r=[],s;return i=>{let c;n.key&&n.debug&&(c=Date.now());const u=e(i);if(!(u.length!==r.length||u.some((y,g)=>r[g]!==y)))return s;r=u;let m;if(n.key&&n.debug&&(m=Date.now()),s=t(...u),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const y=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-m)*100)/100,x=g/16,v=(C,S)=>{for(C=String(C);C.length<S;)C=" "+C;return C};console.info(`%c⏱ ${v(g,5)} /${v(y,5)} ms`,`
|
|
786
|
-
font-size: .6rem;
|
|
787
|
-
font-weight: bold;
|
|
788
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function ct(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 DJ(e,t,n,r){const s=()=>{var c;return(c=i.getValue())!=null?c:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:lt(()=>[e,n,t,i],(c,u,f,m)=>({table:c,column:u,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),ct(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(i,n,t,e)},{}),i}function OJ(e,t,n,r){var s,i;const u={...e._getDefaultColumnDef(),...t},f=u.accessorKey;let m=(s=(i=u.id)!=null?i:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?s:typeof u.header=="string"?u.header:void 0,y;if(u.accessorFn?y=u.accessorFn:f&&(f.includes(".")?y=x=>{let v=x;for(const S of f.split(".")){var C;v=(C=v)==null?void 0:C[S]}return v}:y=x=>x[u.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:y,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:lt(()=>[!0],()=>{var x;return[g,...(x=g.columns)==null?void 0:x.flatMap(v=>v.getFlatColumns())]},ct(e.options,"debugColumns")),getLeafColumns:lt(()=>[e._getOrderColumnsFn()],x=>{var v;if((v=g.columns)!=null&&v.length){let C=g.columns.flatMap(S=>S.getLeafColumns());return x(C)}return[g]},ct(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(g,e);return g}const qr="debugHeaders";function b_(e,t,n){var r;let i={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=[],u=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(u),c.push(f)};return u(i),c},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(i,e)}),i}const IJ={createTable:e=>{e.getHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var i,c;const u=(i=r==null?void 0:r.map(g=>n.find(x=>x.id===g)).filter(Boolean))!=null?i:[],f=(c=s==null?void 0:s.map(g=>n.find(x=>x.id===g)).filter(Boolean))!=null?c:[],m=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(s!=null&&s.includes(g.id)));return Rp(t,[...u,...m,...f],e)},ct(e.options,qr)),e.getCenterHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(s!=null&&s.includes(i.id))),Rp(t,n,e,"center")),ct(e.options,qr)),e.getLeftHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(c=>n.find(u=>u.id===c)).filter(Boolean))!=null?s:[];return Rp(t,i,e,"left")},ct(e.options,qr)),e.getRightHeaderGroups=lt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const i=(s=r==null?void 0:r.map(c=>n.find(u=>u.id===c)).filter(Boolean))!=null?s:[];return Rp(t,i,e,"right")},ct(e.options,qr)),e.getFooterGroups=lt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getLeftFooterGroups=lt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getCenterFooterGroups=lt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getRightFooterGroups=lt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ct(e.options,qr)),e.getFlatHeaders=lt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getLeftFlatHeaders=lt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getCenterFlatHeaders=lt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getRightFlatHeaders=lt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,qr)),e.getCenterLeafHeaders=lt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getLeftLeafHeaders=lt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getRightLeafHeaders=lt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,qr)),e.getLeafHeaders=lt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,i,c,u,f,m;return[...(s=(i=t[0])==null?void 0:i.headers)!=null?s:[],...(c=(u=n[0])==null?void 0:u.headers)!=null?c:[],...(f=(m=r[0])==null?void 0:m.headers)!=null?f:[]].map(y=>y.getLeafHeaders()).flat()},ct(e.options,qr))}};function Rp(e,t,n,r){var s,i;let c=0;const u=function(x,v){v===void 0&&(v=1),c=Math.max(c,v),x.filter(C=>C.getIsVisible()).forEach(C=>{var S;(S=C.columns)!=null&&S.length&&u(C.columns,v+1)},0)};u(e);let f=[];const m=(x,v)=>{const C={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},S=[];x.forEach(w=>{const R=[...S].reverse()[0],j=w.column.depth===C.depth;let _,O=!1;if(j&&w.column.parent?_=w.column.parent:(_=w.column,O=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(w);else{const A=b_(n,_,{id:[r,v,_.id,w==null?void 0:w.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${S.filter(D=>D.column===_).length}`:void 0,depth:v,index:S.length});A.subHeaders.push(w),S.push(A)}C.headers.push(w),w.headerGroup=C}),f.push(C),v>0&&m(S,v-1)},y=t.map((x,v)=>b_(n,x,{depth:c,index:v}));m(y,c-1),f.reverse();const g=x=>x.filter(C=>C.column.getIsVisible()).map(C=>{let S=0,w=0,R=[0];C.subHeaders&&C.subHeaders.length?(R=[],g(C.subHeaders).forEach(_=>{let{colSpan:O,rowSpan:A}=_;S+=O,R.push(A)})):S=1;const j=Math.min(...R);return w=w+j,C.colSpan=S,C.rowSpan=w,{colSpan:S,rowSpan:w}});return g((s=(i=f[0])==null?void 0:i.headers)!=null?s:[]),f}const s2=(e,t,n,r,s,i,c)=>{let u={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(u._valuesCache.hasOwnProperty(f))return u._valuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return u._valuesCache[f]=m.accessorFn(u.original,r),u._valuesCache[f]},getUniqueValues:f=>{if(u._uniqueValuesCache.hasOwnProperty(f))return u._uniqueValuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(u._uniqueValuesCache[f]=m.columnDef.getUniqueValues(u.original,r),u._uniqueValuesCache[f]):(u._uniqueValuesCache[f]=[u.getValue(f)],u._uniqueValuesCache[f])},renderValue:f=>{var m;return(m=u.getValue(f))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>AJ(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],m=u;for(;;){const y=m.getParentRow();if(!y)break;f.push(y),m=y}return f.reverse()},getAllCells:lt(()=>[e.getAllLeafColumns()],f=>f.map(m=>DJ(e,u,m,m.id)),ct(e.options,"debugRows")),_getAllCellsByColumnId:lt(()=>[u.getAllCells()],f=>f.reduce((m,y)=>(m[y.column.id]=y,m),{}),ct(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const m=e._features[f];m==null||m.createRow==null||m.createRow(u,e)}return u},MJ={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()}}},O5=(e,t,n)=>{var r,s;const i=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(i))};O5.autoRemove=e=>Us(e);const I5=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};I5.autoRemove=e=>Us(e);const M5=(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())};M5.autoRemove=e=>Us(e);const k5=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};k5.autoRemove=e=>Us(e);const L5=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});L5.autoRemove=e=>Us(e)||!(e!=null&&e.length);const P5=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});P5.autoRemove=e=>Us(e)||!(e!=null&&e.length);const U5=(e,t,n)=>e.getValue(t)===n;U5.autoRemove=e=>Us(e);const z5=(e,t,n)=>e.getValue(t)==n;z5.autoRemove=e=>Us(e);const o2=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};o2.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(i>c){const u=i;i=c,c=u}return[i,c]};o2.autoRemove=e=>Us(e)||Us(e[0])&&Us(e[1]);const Wo={includesString:O5,includesStringSensitive:I5,equalsString:M5,arrIncludes:k5,arrIncludesAll:L5,arrIncludesSome:P5,equals:U5,weakEquals:z5,inNumberRange:o2};function Us(e){return e==null||e===""}const kJ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ja("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"?Wo.includesString:typeof r=="number"?Wo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wo.equals:Array.isArray(r)?Wo.arrIncludes:Wo.weakEquals},e.getFilterFn=()=>{var n,r;return Ly(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:Wo[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(),i=r==null?void 0:r.find(y=>y.id===e.id),c=rl(n,i?i.value:void 0);if(S_(s,c,e)){var u;return(u=r==null?void 0:r.filter(y=>y.id!==e.id))!=null?u:[]}const f={id:e.id,value:c};if(i){var m;return(m=r==null?void 0:r.map(y=>y.id===e.id?f:y))!=null?m:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var i;return(i=rl(t,s))==null?void 0:i.filter(c=>{const u=n.find(f=>f.id===c.id);if(u){const f=u.getFilterFn();if(S_(f,c.value,u))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 S_(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const LJ=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),PJ=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},UJ=(e,t,n)=>{let r;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},zJ=(e,t,n)=>{let r,s;return n.forEach(i=>{const c=i.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},FJ=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let i=s.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},HJ=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!NJ(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((i,c)=>i-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},$J=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),VJ=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,GJ=(e,t)=>t.length,Z0={sum:LJ,min:PJ,max:UJ,extent:zJ,mean:FJ,median:HJ,unique:$J,uniqueCount:VJ,count:GJ},BJ={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:Ja("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 Z0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Z0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ly(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:Z0[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 qJ(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(c=>c.id===i)).filter(Boolean),...r]}const KJ={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ja("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=lt(n=>[Uf(t,n)],n=>n.findIndex(r=>r.id===e.id),ct(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Uf(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Uf(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=lt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let i=[];if(!(t!=null&&t.length))i=s;else{const c=[...t],u=[...s];for(;u.length&&c.length;){const f=c.shift(),m=u.findIndex(y=>y.id===f);m>-1&&i.push(u.splice(m,1)[0])}i=[...i,...u]}return qJ(i,n,r)},ct(e.options,"debugTable"))}},Y0=()=>({left:[],right:[]}),ZJ={getInitialState:e=>({columnPinning:Y0(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ja("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var i,c;if(n==="right"){var u,f;return{left:((u=s==null?void 0:s.left)!=null?u:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((f=s==null?void 0:s.right)!=null?f:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var m,y;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((y=s==null?void 0:s.right)!=null?y:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((i=s==null?void 0:s.left)!=null?i:[]).filter(g=>!(r!=null&&r.includes(g))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,i,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((i=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(u=>u.id),{left:r,right:s}=t.getState().columnPinning,i=n.some(u=>r==null?void 0:r.includes(u)),c=n.some(u=>s==null?void 0:s.includes(u));return i?"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=lt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const i=[...r??[],...s??[]];return n.filter(c=>!i.includes(c.column.id))},ct(t.options,"debugRows")),e.getLeftVisibleCells=lt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(c=>c.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ct(t.options,"debugRows")),e.getRightVisibleCells=lt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(c=>c.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ct(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?Y0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Y0())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,i;return!!((s=r.left)!=null&&s.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ct(e.options,"debugColumns")),e.getRightLeafColumns=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),ct(e.options,"debugColumns")),e.getCenterLeafColumns=lt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(i=>!s.includes(i.id))},ct(e.options,"debugColumns"))}};function YJ(e){return e||(typeof document<"u"?document:null)}const jp={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},W0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),WJ={getDefaultColumnDef:()=>jp,getInitialState:e=>({columnSizing:{},columnSizingInfo:W0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ja("columnSizing",e),onColumnSizingInfoChange:Ja("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:jp.minSize,(r=i??e.columnDef.size)!=null?r:jp.size),(s=e.columnDef.maxSize)!=null?s:jp.maxSize)},e.getStart=lt(n=>[n,Uf(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,i)=>s+i.getSize(),0),ct(t.options,"debugColumns")),e.getAfter=lt(n=>[n,Uf(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,i)=>s+i.getSize(),0),ct(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 i;n+=(i=s.column.getSize())!=null?i: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 i=>{if(!r||!s||(i.persist==null||i.persist(),X0(i)&&i.touches&&i.touches.length>1))return;const c=e.getSize(),u=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],f=X0(i)?Math.round(i.touches[0].clientX):i.clientX,m={},y=(R,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(_=>{var O,A;const D=t.options.columnResizeDirection==="rtl"?-1:1,T=(j-((O=_==null?void 0:_.startOffset)!=null?O:0))*D,I=Math.max(T/((A=_==null?void 0:_.startSize)!=null?A:0),-.999999);return _.columnSizingStart.forEach(k=>{let[F,G]=k;m[F]=Math.round(Math.max(G+G*I,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:I}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...m})))},g=R=>y("move",R),x=R=>{y("end",R),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=YJ(n),C={moveHandler:R=>g(R.clientX),upHandler:R=>{v==null||v.removeEventListener("mousemove",C.moveHandler),v==null||v.removeEventListener("mouseup",C.upHandler),x(R.clientX)}},S={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),g(R.touches[0].clientX),!1),upHandler:R=>{var j;v==null||v.removeEventListener("touchmove",S.moveHandler),v==null||v.removeEventListener("touchend",S.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((j=R.touches[0])==null?void 0:j.clientX)}},w=XJ()?{passive:!1}:!1;X0(i)?(v==null||v.addEventListener("touchmove",S.moveHandler,w),v==null||v.addEventListener("touchend",S.upHandler,w)):(v==null||v.addEventListener("mousemove",C.moveHandler,w),v==null||v.addEventListener("mouseup",C.upHandler,w)),t.setColumnSizingInfo(R=>({...R,startOffset:f,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,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?W0():(n=e.initialState.columnSizingInfo)!=null?n:W0())},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 Tp=null;function XJ(){if(typeof Tp=="boolean")return Tp;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 Tp=e,Tp}function X0(e){return e.type==="touchstart"}const QJ={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ja("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(i=>i.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=lt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ct(t.options,"debugRows")),e.getVisibleCells=lt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],ct(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>lt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ct(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,i)=>({...s,[i.id]:n||!(i.getCanHide!=null&&i.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 Uf(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const JJ={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()}}},eee={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ja("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,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ly(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wo[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},tee={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ja("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,i;e.setExpanded(r?{}:(s=(i=e.initialState)==null?void 0:i.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(i=>{const c=i.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 i=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(u=>{c[u]=!0}):c=r,n=(s=n)!=null?s:!i,!i&&n)return{...c,[e.id]:!0};if(i&&!n){const{[e.id]:u,...f}=c;return f}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=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()}}}},lb=0,cb=10,Q0=()=>({pageIndex:lb,pageSize:cb}),nee={getInitialState:e=>({...e,pagination:{...Q0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ja("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=i=>rl(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?Q0():(s=e.initialState.pagination)!=null?s:Q0())},e.setPageIndex=r=>{e.setPagination(s=>{let i=rl(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,c)),{...s,pageIndex:i}})},e.resetPageIndex=r=>{var s,i;e.setPageIndex(r?lb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:lb)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?cb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:cb)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,rl(r,s.pageSize)),c=s.pageSize*s.pageIndex,u=Math.floor(c/i);return{...s,pageIndex:u,pageSize:i}})},e.setPageCount=r=>e.setPagination(s=>{var i;let c=rl(r,(i=e.options.pageCount)!=null?i:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=lt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((i,c)=>c)),s},ct(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}}},J0=()=>({top:[],bottom:[]}),ree={getInitialState:e=>({rowPinning:J0(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ja("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const i=r?e.getLeafRows().map(f=>{let{id:m}=f;return m}):[],c=s?e.getParentRows().map(f=>{let{id:m}=f;return m}):[],u=new Set([...c,e.id,...i]);t.setRowPinning(f=>{var m,y;if(n==="bottom"){var g,x;return{top:((g=f==null?void 0:f.top)!=null?g:[]).filter(S=>!(u!=null&&u.has(S))),bottom:[...((x=f==null?void 0:f.bottom)!=null?x:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)]}}if(n==="top"){var v,C;return{top:[...((v=f==null?void 0:f.top)!=null?v:[]).filter(S=>!(u!=null&&u.has(S))),...Array.from(u)],bottom:((C=f==null?void 0:f.bottom)!=null?C:[]).filter(S=>!(u!=null&&u.has(S)))}}return{top:((m=f==null?void 0:f.top)!=null?m:[]).filter(S=>!(u!=null&&u.has(S))),bottom:((y=f==null?void 0:f.bottom)!=null?y:[]).filter(S=>!(u!=null&&u.has(S)))}})},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,i=n.some(u=>r==null?void 0:r.includes(u)),c=n.some(u=>s==null?void 0:s.includes(u));return i?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const i=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:u}=c;return u});return(r=i==null?void 0:i.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?J0():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:J0())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,i;return!!((s=r.top)!=null&&s.length||(i=r.bottom)!=null&&i.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 u=e.getRow(c,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(c=>t.find(u=>u.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ct(e.options,"debugRows")),e.getBottomRows=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ct(e.options,"debugRows")),e.getCenterRows=lt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(i=>!s.has(i.id))},ct(e.options,"debugRows"))}},aee={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ja("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(i=>{i.getCanSelect()&&(r[i.id]=!0)}):s.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(i=>{ub(s,i.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?e1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getFilteredSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?e1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getGroupedSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?e1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(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(i=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return i;const u={...i};return ub(u,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return i2(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return db(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return db(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)}}}},ub=(e,t,n,r,s)=>{var i;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=c.subRows)!=null&&i.length&&c.getCanSelectSubRows()&&c.subRows.forEach(u=>ub(e,u.id,n,r,s))};function e1(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(c,u){return c.map(f=>{var m;const y=i2(f,n);if(y&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:i(f.subRows)}),y)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function i2(e,t){var n;return(n=t[e.id])!=null?n:!1}function db(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,i=!1;return e.subRows.forEach(c=>{if(!(i&&!s)&&(c.getCanSelect()&&(i2(c,t)?i=!0:s=!1),c.subRows&&c.subRows.length)){const u=db(c,t);u==="all"?i=!0:(u==="some"&&(i=!0),s=!1)}}),s?"all":i?"some":!1}const fb=/([0-9]+)/gm,see=(e,t,n)=>F5(ml(e.getValue(n)).toLowerCase(),ml(t.getValue(n)).toLowerCase()),oee=(e,t,n)=>F5(ml(e.getValue(n)),ml(t.getValue(n))),iee=(e,t,n)=>l2(ml(e.getValue(n)).toLowerCase(),ml(t.getValue(n)).toLowerCase()),lee=(e,t,n)=>l2(ml(e.getValue(n)),ml(t.getValue(n))),cee=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},uee=(e,t,n)=>l2(e.getValue(n),t.getValue(n));function l2(e,t){return e===t?0:e>t?1:-1}function ml(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function F5(e,t){const n=e.split(fb).filter(Boolean),r=t.split(fb).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),i=r.shift(),c=parseInt(s,10),u=parseInt(i,10),f=[c,u].sort();if(isNaN(f[0])){if(s>i)return 1;if(i>s)return-1;continue}if(isNaN(f[1]))return isNaN(c)?-1:1;if(c>u)return 1;if(u>c)return-1}return n.length-r.length}const Sf={alphanumeric:see,alphanumericCaseSensitive:oee,text:iee,textCaseSensitive:lee,datetime:cee,basic:uee},dee={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ja("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 i=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Sf.datetime;if(typeof i=="string"&&(r=!0,i.split(fb).length>1))return Sf.alphanumeric}return r?Sf.text:Sf.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 Ly(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:Sf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(c=>{const u=c==null?void 0:c.find(v=>v.id===e.id),f=c==null?void 0:c.findIndex(v=>v.id===e.id);let m=[],y,g=i?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?u?y="toggle":y="add":c!=null&&c.length&&f!==c.length-1?y="replace":u?y="toggle":y="replace",y==="toggle"&&(i||s||(y="remove")),y==="add"){var x;m=[...c,{id:e.id,desc:g}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else y==="toggle"?m=c.map(v=>v.id===e.id?{...v,desc:g}:v):y==="remove"?m=c.filter(v=>v.id!==e.id):m=[{id:e.id,desc:g}];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 i=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":i},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())}},fee=[IJ,QJ,KJ,ZJ,MJ,kJ,JJ,eee,dee,BJ,tee,nee,ree,aee,WJ];function hee(e){var t,n;const r=[...fee,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((x,v)=>Object.assign(x,v.getDefaultOptions==null?void 0:v.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(i,x):{...i,...x};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var v;f=(v=x.getInitialState==null?void 0:x.getInitialState(f))!=null?v:f});const m=[];let y=!1;const g={_features:r,options:{...i,...e},initialState:f,_queue:x=>{m.push(x),y||(y=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();y=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const v=rl(x,s.options);s.options=c(v)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,v,C)=>{var S;return(S=s.options.getRowId==null?void 0:s.options.getRowId(x,v,C))!=null?S:`${C?[C.id,v].join("."):v}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,v)=>{let C=(v?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!C&&(C=s.getCoreRowModel().rowsById[x],!C))throw new Error;return C},_getDefaultColumnDef:lt(()=>[s.options.defaultColumn],x=>{var v;return x=(v=x)!=null?v:{},{header:C=>{const S=C.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:C=>{var S,w;return(S=(w=C.renderValue())==null||w.toString==null?void 0:w.toString())!=null?S:null},...s._features.reduce((C,S)=>Object.assign(C,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...x}},ct(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:lt(()=>[s._getColumnDefs()],x=>{const v=function(C,S,w){return w===void 0&&(w=0),C.map(R=>{const j=OJ(s,R,w,S),_=R;return j.columns=_.columns?v(_.columns,j,w+1):[],j})};return v(x)},ct(e,"debugColumns")),getAllFlatColumns:lt(()=>[s.getAllColumns()],x=>x.flatMap(v=>v.getFlatColumns()),ct(e,"debugColumns")),_getAllFlatColumnsById:lt(()=>[s.getAllFlatColumns()],x=>x.reduce((v,C)=>(v[C.id]=C,v),{}),ct(e,"debugColumns")),getAllLeafColumns:lt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,v)=>{let C=x.flatMap(S=>S.getLeafColumns());return v(C)},ct(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,g);for(let x=0;x<s._features.length;x++){const v=s._features[x];v==null||v.createTable==null||v.createTable(s)}return s}function Cl(){return e=>lt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,i,c){i===void 0&&(i=0);const u=[];for(let m=0;m<s.length;m++){const y=s2(e,e._getRowId(s[m],m,c),s[m],m,i,void 0,c==null?void 0:c.id);if(n.flatRows.push(y),n.rowsById[y.id]=y,u.push(y),e.options.getSubRows){var f;y.originalSubRows=e.options.getSubRows(s[m],m),(f=y.originalSubRows)!=null&&f.length&&(y.subRows=r(y.originalSubRows,i+1,y))}}return u};return n.rows=r(t),n},ct(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function mee(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 pee(e,t,n){return n.options.filterFromLeafRows?gee(e,t,n):yee(e,t,n)}function gee(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,m){m===void 0&&(m=0);const y=[];for(let x=0;x<f.length;x++){var g;let v=f[x];const C=s2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(C.columnFilters=v.columnFilters,(g=v.subRows)!=null&&g.length&&m<c){if(C.subRows=u(v.subRows,m+1),v=C,t(v)&&!C.subRows.length){y.push(v),i[v.id]=v,s.push(v);continue}if(t(v)||C.subRows.length){y.push(v),i[v.id]=v,s.push(v);continue}}else v=C,t(v)&&(y.push(v),i[v.id]=v,s.push(v))}return y};return{rows:u(e),flatRows:s,rowsById:i}}function yee(e,t,n){var r;const s=[],i={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,u=function(f,m){m===void 0&&(m=0);const y=[];for(let x=0;x<f.length;x++){let v=f[x];if(t(v)){var g;if((g=v.subRows)!=null&&g.length&&m<c){const S=s2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);S.subRows=u(v.subRows,m+1),v=S}y.push(v),s.push(v),i[v.id]=v}}return y};return{rows:u(e),flatRows:s,rowsById:i}}function yd(){return e=>lt(()=>[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=[],i=[];(n??[]).forEach(x=>{var v;const C=e.getColumn(x.id);if(!C)return;const S=C.getFilterFn();S&&s.push({id:x.id,filterFn:S,resolvedValue:(v=S.resolveFilterValue==null?void 0:S.resolveFilterValue(x.value))!=null?v:x.value})});const c=(n??[]).map(x=>x.id),u=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&u&&f.length&&(c.push("__global__"),f.forEach(x=>{var v;i.push({id:x.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?v:r})}));let m,y;for(let x=0;x<t.flatRows.length;x++){const v=t.flatRows[x];if(v.columnFilters={},s.length)for(let C=0;C<s.length;C++){m=s[C];const S=m.id;v.columnFilters[S]=m.filterFn(v,S,m.resolvedValue,w=>{v.columnFiltersMeta[S]=w})}if(i.length){for(let C=0;C<i.length;C++){y=i[C];const S=y.id;if(y.filterFn(v,S,y.resolvedValue,w=>{v.columnFiltersMeta[S]=w})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const g=x=>{for(let v=0;v<c.length;v++)if(x.columnFilters[c[v]]===!1)return!1;return!0};return pee(t.rows,g,e)},ct(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Hh(e){return t=>lt(()=>[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:i}=n;let{rows:c,flatRows:u,rowsById:f}=r;const m=s*i,y=m+s;c=c.slice(m,y);let g;t.options.paginateExpandedRows?g={rows:c,flatRows:u,rowsById:f}:g=mee({rows:c,flatRows:u,rowsById:f}),g.flatRows=[];const x=v=>{g.flatRows.push(v),v.subRows.length&&v.subRows.forEach(x)};return g.rows.forEach(x),g},ct(t.options,"debugTable"))}function Dc(){return e=>lt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],i=r.filter(f=>{var m;return(m=e.getColumn(f.id))==null?void 0:m.getCanSort()}),c={};i.forEach(f=>{const m=e.getColumn(f.id);m&&(c[f.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const u=f=>{const m=f.map(y=>({...y}));return m.sort((y,g)=>{for(let v=0;v<i.length;v+=1){var x;const C=i[v],S=c[C.id],w=S.sortUndefined,R=(x=C==null?void 0:C.desc)!=null?x:!1;let j=0;if(w){const _=y.getValue(C.id),O=g.getValue(C.id),A=_===void 0,D=O===void 0;if(A||D){if(w==="first")return A?-1:1;if(w==="last")return A?1:-1;j=A&&D?0:A?w:-w}}if(j===0&&(j=S.sortingFn(y,g,C.id)),j!==0)return R&&(j*=-1),S.invertSorting&&(j*=-1),j}return y.index-g.index}),m.forEach(y=>{var g;s.push(y),(g=y.subRows)!=null&&g.length&&(y.subRows=u(y.subRows))}),m};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},ct(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
789
|
-
* react-table
|
|
790
|
-
*
|
|
791
|
-
* Copyright (c) TanStack
|
|
792
|
-
*
|
|
793
|
-
* This source code is licensed under the MIT license found in the
|
|
794
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
795
|
-
*
|
|
796
|
-
* @license MIT
|
|
797
|
-
*/function nd(e,t){return e?xee(e)?h.createElement(e,t):e:null}function xee(e){return vee(e)||typeof e=="function"||bee(e)}function vee(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function bee(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function wl(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:hee(t)})),[r,s]=h.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function El({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a.jsx("table",{"data-slot":"table",className:se("w-full caption-bottom text-sm",e),...t})})}function Rl({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:se("[&_tr]:border-b",e),...t})}function jl({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:se("[&_tr:last-child]:border-0",e),...t})}function Hn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:se("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Tl({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:se("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 $r({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:se("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var See=Symbol("radix.slottable");function Cee(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=See,t}var H5="AlertDialog",[wee]=Sr(H5,[l4]),pi=l4(),$5=e=>{const{__scopeAlertDialog:t,...n}=e,r=pi(t);return a.jsx(ny,{...r,...n,modal:!0})};$5.displayName=H5;var Eee="AlertDialogTrigger",Ree=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(v$,{...s,...r,ref:t})});Ree.displayName=Eee;var jee="AlertDialogPortal",V5=e=>{const{__scopeAlertDialog:t,...n}=e,r=pi(t);return a.jsx(ry,{...r,...n})};V5.displayName=jee;var Tee="AlertDialogOverlay",G5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(ay,{...s,...r,ref:t})});G5.displayName=Tee;var $u="AlertDialogContent",[_ee,Nee]=wee($u),Aee=Cee("AlertDialogContent"),B5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=pi(n),c=h.useRef(null),u=ht(t,c),f=h.useRef(null);return a.jsx(p$,{contentName:$u,titleName:q5,docsSlug:"alert-dialog",children:a.jsx(_ee,{scope:n,cancelRef:f,children:a.jsxs(sy,{role:"alertdialog",...i,...s,ref:u,onOpenAutoFocus:Ie(s.onOpenAutoFocus,m=>{var y;m.preventDefault(),(y=f.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[a.jsx(Aee,{children:r}),a.jsx(Oee,{contentRef:c})]})})})});B5.displayName=$u;var q5="AlertDialogTitle",K5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(fS,{...s,...r,ref:t})});K5.displayName=q5;var Z5="AlertDialogDescription",Y5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(hS,{...s,...r,ref:t})});Y5.displayName=Z5;var Dee="AlertDialogAction",W5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=pi(n);return a.jsx(oy,{...s,...r,ref:t})});W5.displayName=Dee;var X5="AlertDialogCancel",Q5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Nee(X5,n),i=pi(n),c=ht(t,s);return a.jsx(oy,{...i,...r,ref:c})});Q5.displayName=X5;var Oee=({contentRef:e})=>{const t=`\`${$u}\` requires a description for the component to be accessible for screen reader users.
|
|
798
|
-
|
|
799
|
-
You can add a description to the \`${$u}\` by passing a \`${Z5}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
800
|
-
|
|
801
|
-
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 \`${$u}\`. 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.
|
|
802
|
-
|
|
803
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Iee=$5,Mee=V5,kee=G5,Lee=B5,Pee=W5,Uee=Q5,zee=K5,Fee=Y5;function J5({...e}){return a.jsx(Iee,{"data-slot":"alert-dialog",...e})}function Hee({...e}){return a.jsx(Mee,{"data-slot":"alert-dialog-portal",...e})}function $ee({className:e,...t}){return a.jsx(kee,{"data-slot":"alert-dialog-overlay",className:se("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 eO({className:e,...t}){return a.jsxs(Hee,{children:[a.jsx($ee,{}),a.jsx(Lee,{"data-slot":"alert-dialog-content",className:se("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 tO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function nO({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function rO({className:e,...t}){return a.jsx(zee,{"data-slot":"alert-dialog-title",className:se("text-lg font-semibold",e),...t})}function aO({className:e,...t}){return a.jsx(Fee,{"data-slot":"alert-dialog-description",className:se("text-muted-foreground text-sm",e),...t})}function sO({className:e,...t}){return a.jsx(Pee,{className:se(iS(),e),...t})}function oO({className:e,...t}){return a.jsx(Uee,{className:se(iS({variant:"outline"}),e),...t})}const iO=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],lO={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:$e.CONNECTOR,icon:NZ},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:$e.CONNECTOR,icon:AZ},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:$e.CONNECTOR,icon:DZ},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:$e.CONNECTOR,icon:OZ},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:$e.CONNECTOR,icon:sS},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:$e.SQL,icon:aS},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:ng}},C_=iO.map(e=>({key:e,...lO[e]}));function Vee(e){if(!e||!iO.includes(e))return;const t=e;return{key:t,...lO[t]}}function Gee({children:e,className:t="",...n}){return a.jsx("div",{className:"dm-card",children:a.jsx("div",{className:se("-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 Bee({children:e,className:t="",...n}){return a.jsx("div",{className:se("pb-2",t),...n,children:e})}function qee({children:e,className:t="",...n}){return a.jsx("h2",{className:se("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function Kee({children:e,className:t="",...n}){return a.jsx("p",{className:se("text-muted-foreground text-lg",t),...n,children:e})}function Zee({children:e,rings:t=7,className:n="",...r}){return a.jsxs("div",{className:se("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(s,i)=>{const c=`${(16*(i+1)+24).toString()}vmin`;return a.jsx("div",{className:"animate-ring-pulse",style:{height:c,width:c,animationDelay:`${(i*.3).toString()}s`,animationDuration:"4s",opacity:.2+i*.1,filter:i===0?"blur(1px)":"none"}},i)})}),a.jsx("div",{className:"animate-glow-burst"}),a.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function Yee({children:e,className:t="",...n}){return a.jsx("div",{className:se("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function t1({separator:e=!0,children:t,className:n="",...r}){return a.jsx("section",{className:se("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 w_({children:e,className:t="",...n}){return a.jsx("h3",{className:se("mb-4 text-xl font-medium",t),...n,children:e})}function n1({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-wrap items-center gap-4",t),...n,children:e})}function _p({href:e,icon:t,title:n,variant:r="outline",size:s,className:i="",target:c,...u}){const f=r==="outline"?"lg":"sm",m=a.jsxs("span",{className:se("flex items-center gap-2"),children:[t,n]});return e?a.jsx(we,{asChild:!0,variant:r,size:s??f,className:se(r==="ghost"?"text-muted-foreground":"",i),...u,children:a.jsx(Wr,{to:e,target:c,children:m})}):a.jsx(we,{variant:r,size:s??f,className:i,...u,children:m})}function Wee(){const{scope:e}=mi(),t=C_.filter(r=>r.definitionType===$e.CONNECTOR),n=C_.filter(r=>r.definitionType!==$e.CONNECTOR);return a.jsxs(Gee,{children:[a.jsx(Zee,{children:a.jsx(_Z,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(Yee,{children:[a.jsxs(Bee,{children:[a.jsx(qee,{children:"Let’s Build Your First Data Mart"}),a.jsx(Kee,{children:"A Data Mart is the key element of self-service analytics — it provides both control for data analyst and freedom for business users. To get started, connect the source you need or query the data you already have in storage"})]}),a.jsxs(t1,{children:[a.jsx(w_,{children:"Connect a data source"}),a.jsx(n1,{children:t.map(r=>a.jsx(_p,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),a.jsxs(t1,{children:[a.jsx(w_,{children:"Use existing SQL or start from scratch"}),a.jsx(n1,{children:n.map((r,s)=>a.jsxs(a.Fragment,{children:[a.jsx(_p,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),s<n.length-1&&a.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),a.jsx(t1,{separator:!1,children:a.jsxs(n1,{children:[a.jsx(_p,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(IA,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(_p,{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:a.jsx(CU,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function Xee(){return a.jsx(Ur,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Cu={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},Qee={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 Oc({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Cu.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=Cu.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:i=Cu.DEFAULT_EXCLUDED_COLUMNS}){const c=h.useMemo(()=>({SORTING:`${t}${Cu.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Cu.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),u=h.useMemo(()=>Qee.extractColumnIds(e),[e]),f=h.useMemo(()=>u.filter(S=>!s.includes(S)),[u,s]),m=h.useCallback(()=>{const S=ps.get(c.SORTING,"json");return S&&Array.isArray(S)&&S.length>0?S:[{id:f.includes(n)?n:f[0]??Cu.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),y=h.useCallback(()=>{const S=ps.get(c.COLUMN_VISIBILITY,"json");if(S&&typeof S=="object"&&!Array.isArray(S)){const w={};for(const R of u)i.includes(R)||(w[R]=S[R]);return w}return r},[c.COLUMN_VISIBILITY,u,i,r]),[g,x]=h.useState(m),[v,C]=h.useState(y);return h.useEffect(()=>{g.length>0&&f.includes(g[0].id)&&ps.set(c.SORTING,g)},[g,f,c.SORTING]),h.useEffect(()=>{const S={};for(const w of u){if(i.includes(w))continue;const R=v[w];typeof R=="boolean"&&(S[w]=R)}ps.set(c.COLUMN_VISIBILITY,S)},[v,u,i,c.COLUMN_VISIBILITY]),{sorting:g,setSorting:x,columnVisibility:v,setColumnVisibility:C}}function Jee({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var I;const{navigate:i,scope:c}=mi(),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:y}=Oc({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1,createdByUser:!1}}),[g,x]=h.useState([]),[v,C]=h.useState({}),[S,w]=h.useState(!1),[R,j]=h.useState(!1),_="data-mart-empty-state-onboarding-video-shown",{open:O}=BS();h.useEffect(()=>{!s&&t.length===0&&(ps.get(_,"boolean")||(O("video-1-google-sheets"),ps.set(_,!0)))},[s,t.length,O]);const A=async()=>{try{j(!0);const F=T.getSelectedRowModel().rows.map(G=>G.original.id);for(const G of F)await n(G);Dn.success(`Successfully deleted ${String(F.length)} data mart${F.length!==1?"s":""}`),C({}),await r()}catch(k){console.error("Error deleting data marts:",k),Dn.error("Failed to delete some data marts. Please try again.")}finally{j(!1),w(!1)}},D=Object.keys(v).length>0,T=wl({data:t,columns:[{id:"select",size:40,header:({table:k})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":k.getIsAllRowsSelected(),"data-state":k.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:k.getToggleAllRowsSelectedHandler(),children:k.getIsAllRowsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),cell:({row:k})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":k.getIsSelected(),"data-state":k.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:k.getToggleSelectedHandler(),children:k.getIsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:f,getSortedRowModel:Dc(),onColumnFiltersChange:x,getFilteredRowModel:yd(),onColumnVisibilityChange:y,onRowSelectionChange:C,state:{sorting:u,columnFilters:g,columnVisibility:m,rowSelection:v},enableRowSelection:!0});return s?a.jsx("div",{children:a.jsx(Xee,{})}):t.length?a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsxs("div",{className:"dm-card-toolbar-left",children:[D&&a.jsx(we,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{w(!0)},disabled:R,children:a.jsx(es,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(I=T.getColumn("title"))==null?void 0:I.getFilterValue(),onChange:k=>{var F;return(F=T.getColumn("title"))==null?void 0:F.setFilterValue(k.target.value)},className:"dm-card-toolbar-search-input"})]})]}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsx(Wr,{to:c("/data-marts/create"),children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(ma,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:T.getHeaderGroups().map(k=>a.jsx(Hn,{className:"dm-card-table-header-row",children:k.headers.map(F=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:F.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:F.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(F.getSize())}%`},children:F.isPlaceholder?null:nd(F.column.columnDef.header,F.getContext())},F.id))},k.id))}),a.jsx(jl,{className:"dm-card-table-body",children:T.getRowModel().rows.length?T.getRowModel().rows.map(k=>a.jsx(Hn,{"data-state":k.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:F=>{if(F.target instanceof HTMLElement&&(F.target.closest('[role="checkbox"]')||F.target.closest(".actions-cell")||F.target.closest('[role="menuitem"]')||F.target.closest('[data-state="open"]')))return;const G=k.original.id;i(`/data-marts/${G}/data-setup`)},children:k.getVisibleCells().map(F=>a.jsx($r,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${F.column.id==="actions"?"actions-cell":""} ${F.column.id==="createdAt"?"whitespace-nowrap":""}`,style:F.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:F.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(F.column.getSize())}%`},children:nd(F.column.columnDef.cell,F.getContext())},F.id))},k.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{T.previousPage()},disabled:!T.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{T.nextPage()},disabled:!T.getCanNextPage(),children:"Next"})]}),a.jsx(J5,{open:S,onOpenChange:w,children:a.jsxs(eO,{children:[a.jsxs(tO,{children:[a.jsx(rO,{children:"Are you sure?"}),a.jsxs(aO,{children:["You're about to delete ",Object.keys(v).length," selected data mart",Object.keys(v).length!==1?"s":"",". This action cannot be undone."]})]}),a.jsxs(nO,{children:[a.jsx(oO,{disabled:R,children:"Cancel"}),a.jsx(sO,{onClick:()=>{A()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):a.jsx(Wee,{})}function cO({userProjection:e}){const{fullName:t,email:n,avatar:r}=e,s=t??n??"Unknown User",i=$D(t,n);return a.jsxs(Oy,{children:[a.jsx(Iy,{asChild:!0,children:a.jsxs("div",{className:"mx-1 inline-flex min-w-max items-center gap-1 rounded-full bg-neutral-100 py-1 pr-3 pl-1 dark:bg-neutral-900",children:[a.jsx(sb,{avatar:r,initials:i,displayName:s,size:Hu.SMALL}),a.jsx("span",{className:"text-muted-foreground inline text-sm leading-tight","aria-label":s,children:s})]})}),a.jsx(My,{side:"top",align:"start",className:"w-max p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(sb,{avatar:r,initials:i,displayName:s,size:Hu.LARGE}),a.jsxs("div",{className:"grid text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:t??n??"Unknown User"}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]})]})})]})}function c2({...e}){return a.jsx(ny,{"data-slot":"dialog",...e})}function ete({...e}){return a.jsx(ry,{"data-slot":"dialog-portal",...e})}function tte({className:e,...t}){return a.jsx(ay,{"data-slot":"dialog-overlay",className:se("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 u2({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(ete,{"data-slot":"dialog-portal",children:[a.jsx(tte,{}),a.jsxs(sy,{"data-slot":"dialog-content",className:se("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&&a.jsxs(oy,{"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:[a.jsx(uc,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function d2({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function nte({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function f2({className:e,...t}){return a.jsx(fS,{"data-slot":"dialog-title",className:se("text-lg leading-none font-semibold",e),...t})}function h2({className:e,...t}){return a.jsx(hS,{"data-slot":"dialog-description",className:se("text-muted-foreground text-sm",e),...t})}const rte=Ec("",{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 Vu({className:e,variant:t,...n}){return t==="brand"?a.jsx(we,{variant:"default",className:se(rte({variant:t}),e),...n}):a.jsx(we,{variant:t,className:e,...n})}const br=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:i,onConfirm:c,onCancel:u,variant:f="destructive",children:m})=>{const y=()=>{t(!1),u==null||u()};return a.jsx(c2,{open:e,onOpenChange:t,children:a.jsxs(u2,{children:[a.jsxs(d2,{children:[a.jsx(f2,{children:n}),a.jsx(h2,{children:r})]}),m,a.jsxs(nte,{children:[i&&a.jsx(Vu,{variant:"secondary",onClick:y,children:i}),a.jsx(Vu,{variant:f,onClick:c,children:s})]})]})})},ate=({row:e,onDeleteSuccess:t})=>{const{scope:n}=mi(),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{deleteDataMart:u,refreshList:f}=D5(),m=async()=>{try{await u(e.original.id),s(!1),await f(),t==null||t()}catch(y){console.error("Failed to delete data mart:",y)}};return a.jsxs("div",{className:"text-right",children:[a.jsxs(Cr,{open:i,onOpenChange:c,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsx(vt,{children:a.jsxs(Wr,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[a.jsx(od,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]})}),a.jsx(la,{}),a.jsxs(vt,{onClick:()=>{s(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(br,{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"})]})},E_={types:{[$e.SQL]:{type:$e.SQL,displayName:"SQL",icon:aS},[$e.TABLE]:{type:$e.TABLE,displayName:"Table",icon:kA},[$e.VIEW]:{type:$e.VIEW,displayName:"View",icon:TU},[$e.TABLE_PATTERN]:{type:$e.TABLE_PATTERN,displayName:"Pattern",icon:SP},[$e.CONNECTOR]:{type:$e.CONNECTOR,displayName:"Connector",icon:sS}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}};var zn=(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.CREATED_BY_USER="createdByUser",e))(zn||{});const $i={[zn.TITLE]:"Title",[zn.DEFINITION_TYPE]:"Input Source",[zn.STORAGE_TYPE]:"Storage",[zn.STATUS]:"Status",[zn.TRIGGERS_COUNT]:"Triggers",[zn.REPORTS_COUNT]:"Reports",[zn.CREATED_AT]:"Created at",[zn.CREATED_BY_USER]:"Created by"};function xr({column:e,children:t,label:n}){const r=e.getIsSorted(),s=h.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),i=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",u=n??(typeof t=="string"?t:"Column");return a.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${u} - ${i()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(Zu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Ss,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(Zu,{className:"text-muted-foreground h-4 w-4"})})]})]})}function xd({table:e,getColumnLabel:t}){return a.jsx("div",{className:"text-right",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:e.getAllColumns().filter(n=>n.getCanHide()&&n.id!=="actions").map(n=>{var s;const r=(t==null?void 0:t(n.id,n))??((s=n.columnDef.meta)==null?void 0:s.title)??n.id;return a.jsx(vt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":n.getIsVisible(),"data-state":n.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${r}`,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:()=>{n.toggleVisibility(!n.getIsVisible())},children:n.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:r})]})},n.id)})})]})})}const ste=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:zn.TITLE,size:40,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.TITLE]}),cell:({row:n})=>a.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===$e.CONNECTOR){const s=n.definition,i=t.find(c=>c.name===s.connector.source.name);return(i==null?void 0:i.displayName)??(i==null?void 0:i.name)??"Unknown"}else{const{displayName:s}=E_.getInfo(r);return s}},id:zn.DEFINITION_TYPE,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case $e.CONNECTOR:{const s=n.original.definition,i=t.find(c=>c.name===s.connector.source.name);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(i==null?void 0:i.logoBase64)&&a.jsx(Ac,{base64:i.logoBase64,size:18}),(i==null?void 0:i.displayName)??"Unknown"]})}default:{const{displayName:s,icon:i}=E_.getInfo(r);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(i,{className:"h-4 w-4"}),s]})}}}},{accessorKey:zn.STORAGE_TYPE,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:i,icon:c}=Sl.getInfo(r),u=s??i;return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),u]})}},{accessorKey:zn.CREATED_AT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.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 a.jsx("div",{className:"text-muted-foreground",children:s})}},{id:zn.CREATED_BY_USER,size:15,accessorFn:n=>{const r=n.createdByUser;return(r==null?void 0:r.fullName)??(r==null?void 0:r.email)},header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.CREATED_BY_USER]}),cell:({row:n})=>{const r=n.original.createdByUser;return r?a.jsx(cO,{userProjection:r}):a.jsx("div",{className:"text-muted-foreground",children:"—"})}},{accessorKey:zn.STATUS,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(Uh,{type:xJ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:zn.TRIGGERS_COUNT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:zn.REPORTS_COUNT,size:15,header:({column:n})=>a.jsx(xr,{column:n,children:$i[zn.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>a.jsx(xd,{table:n}),cell:({row:n})=>a.jsx(ate,{row:n,onDeleteSuccess:e})}];var yr=(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))(yr||{});const ote={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function ite(e,t){switch(t.type){case yr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case yr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case yr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case yr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case yr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case yr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case yr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case yr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case yr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const uO=h.createContext(void 0);function rd({children:e}){const[t,n]=h.useReducer(ite,ote);return a.jsx(uO.Provider,{value:{state:t,dispatch:n},children:e})}function lte(){const e=h.useContext(uO);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var Os=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(Os||{});class zf 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`)}async exchangeCredentials(t,n){return this.post(`/${t}/oauth/exchange`,n)}async checkOAuthStatus(t,n){return this.get(`/${t}/oauth/status/${n}`)}async getOAuthSettings(t,n){return this.get(`/${t}/oauth/settings?path=${encodeURIComponent(n)}`)}}function dO(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 Ic(){const{state:e,dispatch:t}=lte(),n=h.useMemo(()=>dO(e.connectors),[e.connectors]),r=h.useCallback(async()=>{t({type:yr.FETCH_CONNECTORS_START});try{const u=await new zf().getAvailableConnectors();t({type:yr.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(c){const u=c instanceof Error?c.message:"Unknown error";t({type:yr.FETCH_CONNECTORS_ERROR,payload:u}),Le({event:"connector_error",category:"Connector",action:"ListError",label:u})}},[t]),s=h.useCallback(async c=>{t({type:yr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new zf().getConnectorSpecification(c);t({type:yr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:yr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Le({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),i=h.useCallback(async c=>{t({type:yr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new zf().getConnectorFields(c);t({type:yr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:yr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),Le({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:i}}const cte=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=D5(),{connectors:i,fetchAvailableConnectors:c}=Ic();return h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t()},[t]),a.jsx(Jee,{columns:ste({connectors:i}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function R_(){return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(AX,{children:a.jsx(rd,{children:a.jsx(cte,{})})})})]})}const fO=h.createContext(void 0),Cf=e=>{const t=jJ(e);return{...e,canPublish:t.length===0,validationErrors:t}};var Qa=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(Qa||{}),ah=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(ah||{}),ar=(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))(ar||{}),m2=(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))(m2||{}),p2=(e=>(e.NUMBER="NUMBER",e.DECIMAL="DECIMAL",e.NUMERIC="NUMERIC",e.INT="INT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.SMALLINT="SMALLINT",e.TINYINT="TINYINT",e.BYTEINT="BYTEINT",e.FLOAT="FLOAT",e.FLOAT4="FLOAT4",e.FLOAT8="FLOAT8",e.DOUBLE="DOUBLE",e.DOUBLE_PRECISION="DOUBLE PRECISION",e.REAL="REAL",e.VARCHAR="VARCHAR",e.CHAR="CHAR",e.CHARACTER="CHARACTER",e.STRING="STRING",e.TEXT="TEXT",e.BINARY="BINARY",e.VARBINARY="VARBINARY",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.TIME="TIME",e.TIMESTAMP="TIMESTAMP",e.TIMESTAMP_LTZ="TIMESTAMP_LTZ",e.TIMESTAMP_NTZ="TIMESTAMP_NTZ",e.TIMESTAMP_TZ="TIMESTAMP_TZ",e.VARIANT="VARIANT",e.OBJECT="OBJECT",e.ARRAY="ARRAY",e.GEOGRAPHY="GEOGRAPHY",e.GEOMETRY="GEOMETRY",e))(p2||{});const ute=(e,t)=>e!==$e.CONNECTOR||t===null?!0:t.fields.some(r=>r.status===Qa.CONNECTED),hO={dataMart:null,isLoading:!1,error:null,runs:[]};function dte(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:Cf(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Cf({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Cf({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Cf({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Cf({...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 hO;default:return e}}function ws(){const e=h.useContext(fO);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class fte{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:Re.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 hte{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Re.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}}class mte{mapFromDto(t){const n=t.config,r=t.credentials,s=r?r.authMethod==="KEY_PAIR"?{authMethod:Ps.KEY_PAIR,username:r.username??"",privateKey:r.privateKey??"",privateKeyPassphrase:r.privateKeyPassphrase}:{authMethod:Ps.PASSWORD,username:r.username??"",password:r.password??""}:void 0;return{id:t.id,title:t.title,type:Re.SNOWFLAKE,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:s??{authMethod:Ps.PASSWORD,username:"",password:""},config:n?{account:n.account,warehouse:n.warehouse}:{account:"",warehouse:""}}}mapToUpdateRequest(t){const n={config:{account:t.config.account,warehouse:t.config.warehouse}};if(t.credentials){const r=t.credentials;n.credentials={authMethod:r.authMethod,username:r.username,...r.authMethod===Ps.PASSWORD?{password:r.password}:{privateKey:r.privateKey,privateKeyPassphrase:r.privateKeyPassphrase}}}return n}}const mO={getMapper(e){switch(e){case Re.GOOGLE_BIGQUERY:return new fte;case Re.AWS_ATHENA:return new hte;case Re.SNOWFLAKE:return new mte;default:throw new Error(`Unknown storage type: ${e}`)}}};function Wp(e){return mO.getMapper(e.type).mapFromDto(e)}function pte(e){const t=mO.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function gte(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function yte(e){return{type:e}}let Np=null;async function xte(){if(Np)return Np;const e=await vte();return Np=dO(e),Np}async function vte(){return await new zf().getAvailableConnectors()}async function bte(e){const t=await xte();return t.length===0?null:t.find(r=>r.name===e)??null}function Ste(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function Cte(e){return{sqlQuery:e.sqlQuery}}function wte(e){return{sqlQuery:e.sqlQuery}}function Ete(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Rte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function jte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Tte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function _te(e){return{pattern:e.pattern}}function Nte(e){return{pattern:e.pattern}}function Ate(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 Dte(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}}}}async function Ote(e,t){if(!e||!t)return null;switch(e){case $e.SQL:return wte(t);case $e.TABLE:return Rte(t);case $e.VIEW:return Tte(t);case $e.TABLE_PATTERN:return Nte(t);case $e.CONNECTOR:{const n=Dte(t);return n.connector.info=await bte(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function wu(e){const t={id:e.id,title:e.title,description:e.description,status:t5.getInfo(e.status),storage:Wp(e.storage),definitionType:e.definitionType,definition:await Ote(e.definitionType,e.definition),schema:e.schema,connectorState:e.connectorState??null,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,canActualizeSchema:!1,validationErrors:[]};return t.canActualizeSchema=ute(t.definitionType,t.schema),t}function Ite(e){return{id:e.id,title:e.title}}const Mte=e=>({id:e.id,status:e.status,createdAt:new Date(e.createdAt),logs:e.logs??[],errors:e.errors??[],definitionRun:e.definitionRun,type:e.type,triggerType:e.runType,startedAt:e.startedAt?new Date(e.startedAt):null,finishedAt:e.finishedAt?new Date(e.finishedAt):null,reportDefinition:e.reportDefinition?e.reportDefinition:null,reportId:e.reportId,insightDefinition:e.insightDefinition??null,insightId:e.insightId,createdByUser:e.createdByUser}),j_=e=>e.runs.map(Mte);function pO({children:e}){const[t,n]=h.useReducer(dte,hO),r=h.useCallback(async D=>{try{n({type:"FETCH_DATA_MART_START"});const T=await Tn.getDataMartById(D),I=await wu(T);n({type:"FETCH_DATA_MART_SUCCESS",payload:I})}catch(T){n({type:"FETCH_DATA_MART_ERROR",payload:un(T)})}},[]),s=h.useCallback(async D=>{try{n({type:"CREATE_DATA_MART_START"});const T=await Tn.createDataMart(D),I=Ite(T);return n({type:"CREATE_DATA_MART_SUCCESS",payload:I}),Le({event:"data_mart_created",category:"DataMart",action:"Create",label:I.id}),_t.success("Data Mart created"),I}catch(T){const I=un(T);throw n({type:"CREATE_DATA_MART_ERROR",payload:I}),Le({event:"data_mart_error",category:"DataMart",action:"CreateError",label:I.message}),T}},[]),i=h.useCallback(async(D,T)=>{try{n({type:"UPDATE_DATA_MART_START"});const I=await Tn.updateDataMart(D,T),k=await wu(I);n({type:"UPDATE_DATA_MART_SUCCESS",payload:k}),Le({event:"data_mart_updated",category:"DataMart",action:"Update",label:k.id})}catch(I){const k=un(I);n({type:"UPDATE_DATA_MART_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:k.message})}},[]),c=h.useCallback(async D=>{try{n({type:"DELETE_DATA_MART_START"}),await Tn.deleteDataMart(D),n({type:"DELETE_DATA_MART_SUCCESS"}),Le({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:D}),_t.success("Data Mart deleted")}catch(T){const I=un(T);n({type:"DELETE_DATA_MART_ERROR",payload:I}),Le({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:I.message})}},[]),u=h.useCallback(async(D,T)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await Tn.updateDataMartTitle(D,T),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:T}),Le({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:T}),_t.success("Title updated")}catch(I){const k=un(I);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:k.message})}},[]),f=h.useCallback(async(D,T)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await Tn.updateDataMartDescription(D,T),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:T??""}),Le({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),_t.success("Description updated")}catch(I){const k=un(I);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:k.message})}},[]),m=h.useCallback(D=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:D})},[]),y=h.useCallback(async(D,T,I)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let k;switch(T){case $e.SQL:k={definitionType:T,definition:Cte(I)};break;case $e.TABLE:k={definitionType:T,definition:Ete(I)};break;case $e.VIEW:k={definitionType:T,definition:jte(I)};break;case $e.TABLE_PATTERN:k={definitionType:T,definition:_te(I)};break;case $e.CONNECTOR:{const Y=I;let B;for(const Z of Y.connector.source.configuration){const H=Z;if(H._copiedFrom){B=H._copiedFrom.dataMartId;break}}k={definitionType:$e.CONNECTOR,definition:Ate(Y),sourceDataMartId:B};break}default:throw new Error(`Unsupported definition type: ${String(T)}`)}const F=await Tn.updateDataMartDefinition(D,k),G=await wu(F);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:T,definition:I}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:G}),Le({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:T})}catch(k){const F=un(k);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:F}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:F.message})}},[]),g=h.useCallback(async D=>{try{n({type:"PUBLISH_DATA_MART_START"});const T=await Tn.publishDataMart(D),I=await wu(T);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:I}),_t.success("Data Mart published")}catch(T){const I=un(T);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:I}),Le({event:"data_mart_error",category:"DataMart",action:"PublishError",label:I.message}),T}},[]),x=h.useCallback(async(D,T=5,I=0,k)=>{try{k!=null&&k.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const F=await Tn.getDataMartRuns(D,T,I,k!=null&&k.silent?{skipLoadingIndicator:!0}:void 0),G=j_(F);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:G}),G}catch(F){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:un(F)}),F}},[]),v=h.useCallback(async(D,T,I=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const k=await Tn.getDataMartRuns(D,I,T),F=j_(k);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:F}),F}catch(k){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:un(k)}),k}},[]),C=h.useCallback(async D=>{const T=_t.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await Tn.runDataMart(D.id,D.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(I){_t.dismiss(T);const k=un(I);n({type:"RUN_DATA_MART_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"RunError",label:k.message})}},[]),S=h.useCallback(async(D,T)=>{try{await Tn.cancelDataMartRun(D,T),await x(D),_t.success("Data Mart run canceled")}catch(I){const k=un(I);n({type:"RUN_DATA_MART_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:k.message})}},[x]),w=h.useCallback(async(D,T)=>{try{return await Tn.getDataMartRunById(D,T)}catch(I){const k=un(I);throw Le({event:"data_mart_error",category:"DataMart",action:"FetchRunDetailsError",label:k.message}),I}},[]),R=h.useCallback(async D=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const T=await Tn.actualizeDataMartSchema(D),I=await wu(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:I}),_t.success("Output schema actualized")}catch(T){const I=un(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:I}),Le({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:I.message})}},[]),j=h.useCallback(async(D,T)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const I=await Tn.updateDataMartSchema(D,{schema:T}),k=await wu(I);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:k}),_t.success("Output schema updated")}catch(I){const k=un(I);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:k}),Le({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:k.message})}},[]),_=h.useCallback(()=>{n({type:"RESET"})},[]),O=h.useCallback(()=>t.error?t.error.message:null,[t.error]),A={...t,getDataMart:r,createDataMart:s,updateDataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartStorage:m,updateDataMartDefinition:y,publishDataMart:g,runDataMart:C,cancelDataMartRun:S,actualizeDataMartSchema:R,updateDataMartSchema:j,getDataMartRuns:x,getDataMartRunById:w,loadMoreDataMartRuns:v,getErrorMessage:O,reset:_};return a.jsx(fO.Provider,{value:A,children:e})}var $h=e=>e.type==="checkbox",ac=e=>e instanceof Date,wa=e=>e==null;const gO=e=>typeof e=="object";var hr=e=>!wa(e)&&!Array.isArray(e)&&gO(e)&&!ac(e),yO=e=>hr(e)&&e.target?$h(e.target)?e.target.checked:e.target.value:e,kte=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,xO=(e,t)=>e.has(kte(t)),Lte=e=>{const t=e.constructor&&e.constructor.prototype;return hr(t)&&t.hasOwnProperty("isPrototypeOf")},g2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function gr(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(!(g2&&(e instanceof Blob||r))&&(n||hr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Lte(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=gr(e[s]));else return e;return t}var Py=e=>/^\w*$/.test(e),Xn=e=>e===void 0,y2=e=>Array.isArray(e)?e.filter(Boolean):[],x2=e=>y2(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!hr(e))return n;const r=(Py(t)?[t]:x2(t)).reduce((s,i)=>wa(s)?s:s[i],e);return Xn(r)||r===e?Xn(e[t])?n:e[t]:r},Ga=e=>typeof e=="boolean",Sn=(e,t,n)=>{let r=-1;const s=Py(t)?[t]:x2(t),i=s.length,c=i-1;for(;++r<i;){const u=s[r];let f=n;if(r!==c){const m=e[u];f=hr(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Ng={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Is={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Bo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},v2=re.createContext(null);v2.displayName="HookFormContext";const vd=()=>re.useContext(v2),vO=e=>{const{children:t,...n}=e;return re.createElement(v2.Provider,{value:n},t)};var bO=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(s,i,{get:()=>{const c=i;return t._proxyFormState[c]!==Is.all&&(t._proxyFormState[c]=!r||Is.all),n&&(n[c]=!0),e[c]}});return s};const b2=typeof window<"u"?re.useLayoutEffect:re.useEffect;function SO(e){const t=vd(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[c,u]=re.useState(n._formState),f=re.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return b2(()=>n._subscribe({name:s,formState:f.current,exact:i,callback:m=>{!r&&u({...n._formState,...m})}}),[s,r,i]),re.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),re.useMemo(()=>bO(c,n,f.current,!1),[c,n])}var Za=e=>typeof e=="string",hb=(e,t,n,r,s)=>Za(e)?(r&&t.watch.add(e),Pe(n,e,s)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),Pe(n,i))):(r&&(t.watchAll=!0),n),mb=e=>wa(e)||!gO(e);function Ms(e,t,n=new WeakSet){if(mb(e)||mb(t))return Object.is(e,t);if(ac(e)&&ac(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 i of r){const c=e[i];if(!s.includes(i))return!1;if(i!=="ref"){const u=t[i];if(ac(c)&&ac(u)||hr(c)&&hr(u)||Array.isArray(c)&&Array.isArray(u)?!Ms(c,u,n):!Object.is(c,u))return!1}}return!0}function Pte(e){const t=vd(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:c,compute:u}=e||{},f=re.useRef(s),m=re.useRef(u),y=re.useRef(void 0),g=re.useRef(n),x=re.useRef(r);m.current=u;const[v,C]=re.useState(()=>{const O=n._getWatch(r,f.current);return m.current?m.current(O):O}),S=re.useCallback(O=>{const A=hb(r,n._names,O||n._formValues,!1,f.current);return m.current?m.current(A):A},[n._formValues,n._names,r]),w=re.useCallback(O=>{if(!i){const A=hb(r,n._names,O||n._formValues,!1,f.current);if(m.current){const D=m.current(A);Ms(D,y.current)||(C(D),y.current=D)}else C(A)}},[n._formValues,n._names,i,r]);b2(()=>((g.current!==n||!Ms(x.current,r))&&(g.current=n,x.current=r,w()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:O=>{w(O.values)}})),[n,c,r,w]),re.useEffect(()=>n._removeUnmounted());const R=g.current!==n,j=x.current,_=re.useMemo(()=>{if(i)return null;const O=!R&&!Ms(j,r);return R||O?S():null},[i,R,r,j,S]);return _!==null?_:v}function Ute(e){const t=vd(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i,defaultValue:c,exact:u=!0}=e,f=xO(s._names.array,n),m=re.useMemo(()=>Pe(s._formValues,n,Pe(s._defaultValues,n,c)),[s,n,c]),y=Pte({control:s,name:n,defaultValue:m,exact:u}),g=SO({control:s,name:n,exact:u}),x=re.useRef(e),v=re.useRef(void 0),C=re.useRef(s.register(n,{...e.rules,value:y,...Ga(e.disabled)?{disabled:e.disabled}:{}}));x.current=e;const S=re.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Pe(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Pe(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Pe(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Pe(g.validatingFields,n)},error:{enumerable:!0,get:()=>Pe(g.errors,n)}}),[g,n]),w=re.useCallback(O=>C.current.onChange({target:{value:yO(O),name:n},type:Ng.CHANGE}),[n]),R=re.useCallback(()=>C.current.onBlur({target:{value:Pe(s._formValues,n),name:n},type:Ng.BLUR}),[n,s._formValues]),j=re.useCallback(O=>{const A=Pe(s._fields,n);A&&O&&(A._f.ref={focus:()=>O.focus&&O.focus(),select:()=>O.select&&O.select(),setCustomValidity:D=>O.setCustomValidity(D),reportValidity:()=>O.reportValidity()})},[s._fields,n]),_=re.useMemo(()=>({name:n,value:y,...Ga(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:w,onBlur:R,ref:j}),[n,r,g.disabled,w,R,j,y]);return re.useEffect(()=>{const O=s._options.shouldUnregister||i,A=v.current;A&&A!==n&&!f&&s.unregister(A),s.register(n,{...x.current.rules,...Ga(x.current.disabled)?{disabled:x.current.disabled}:{}});const D=(T,I)=>{const k=Pe(s._fields,T);k&&k._f&&(k._f.mount=I)};if(D(n,!0),O){const T=gr(Pe(s._options.defaultValues,n,x.current.defaultValue));Sn(s._defaultValues,n,T),Xn(Pe(s._formValues,n))&&Sn(s._formValues,n,T)}return!f&&s.register(n),v.current=n,()=>{(f?O&&!s._state.action:O)?s.unregister(n):D(n,!1)}},[n,s,f,i]),re.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),re.useMemo(()=>({field:_,formState:g,fieldState:S}),[_,g,S])}const zte=e=>e.render(Ute(e));var S2=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Ff=e=>Array.isArray(e)?e:[e],T_=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function CO(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],i=t[r];if(s&&hr(s)&&i){const c=CO(s,i);hr(c)&&(n[r]=c)}else e[r]&&(n[r]=i)}return n}var na=e=>hr(e)&&!Object.keys(e).length,C2=e=>e.type==="file",ks=e=>typeof e=="function",Ag=e=>{if(!g2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},wO=e=>e.type==="select-multiple",w2=e=>e.type==="radio",Fte=e=>w2(e)||$h(e),r1=e=>Ag(e)&&e.isConnected;function Hte(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Xn(e)?r++:e[t[r++]];return e}function $te(e){for(const t in e)if(e.hasOwnProperty(t)&&!Xn(e[t]))return!1;return!0}function dr(e,t){const n=Array.isArray(t)?t:Py(t)?[t]:x2(t),r=n.length===1?e:Hte(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(hr(r)&&na(r)||Array.isArray(r)&&$te(r))&&dr(e,n.slice(0,-1)),e}var Vte=e=>{for(const t in e)if(ks(e[t]))return!0;return!1};function EO(e){return Array.isArray(e)||hr(e)&&!Vte(e)}function pb(e,t={}){for(const n in e){const r=e[n];EO(r)?(t[n]=Array.isArray(r)?[]:{},pb(r,t[n])):Xn(r)||(t[n]=!0)}return t}function Nu(e,t,n){n||(n=pb(t));for(const r in e){const s=e[r];if(EO(s))Xn(t)||mb(n[r])?n[r]=pb(s,Array.isArray(s)?[]:{}):Nu(s,wa(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!Ms(s,i)}}return n}const __={value:!1,isValid:!1},N_={value:!0,isValid:!0};var RO=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&&!Xn(e[0].attributes.value)?Xn(e[0].value)||e[0].value===""?N_:{value:e[0].value,isValid:!0}:N_:__}return __},jO=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Xn(e)?e:t?e===""?NaN:e&&+e:n&&Za(e)?new Date(e):r?r(e):e;const A_={isValid:!1,value:null};var TO=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,A_):A_;function D_(e){const t=e.ref;return C2(t)?t.files:w2(t)?TO(e.refs).value:wO(t)?[...t.selectedOptions].map(({value:n})=>n):$h(t)?RO(e.refs).value:jO(Xn(t.value)?e.ref.value:t.value,e)}var Gte=(e,t,n,r)=>{const s={};for(const i of e){const c=Pe(t,i);c&&Sn(s,i,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Dg=e=>e instanceof RegExp,wf=e=>Xn(e)?e:Dg(e)?e.source:hr(e)?Dg(e.value)?e.value.source:e.value:e,O_=e=>({isOnSubmit:!e||e===Is.onSubmit,isOnBlur:e===Is.onBlur,isOnChange:e===Is.onChange,isOnAll:e===Is.all,isOnTouch:e===Is.onTouched});const I_="AsyncFunction";var Bte=e=>!!e&&!!e.validate&&!!(ks(e.validate)&&e.validate.constructor.name===I_||hr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===I_)),qte=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),M_=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Hf=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const i=Pe(e,s);if(i){const{_f:c,...u}=i;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(Hf(u,t))break}else if(hr(u)&&Hf(u,t))break}}};function k_(e,t,n){const r=Pe(e,n);if(r||Py(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),c=Pe(t,i),u=Pe(e,i);if(c&&!Array.isArray(c)&&n!==i)return{name:n};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};s.pop()}return{name:n}}var Kte=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return na(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(c=>t[c]===(!r||Is.all))},Zte=(e,t,n)=>!e||!t||e===t||Ff(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Yte=(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,Wte=(e,t)=>!y2(Pe(e,t)).length&&dr(e,t),Xte=(e,t,n)=>{const r=Ff(Pe(e,n));return Sn(r,"root",t[n]),Sn(e,n,r),e};function L_(e,t,n="validate"){if(Za(e)||Array.isArray(e)&&e.every(Za)||Ga(e)&&!e)return{type:n,message:Za(e)?e:"",ref:t}}var Eu=e=>hr(e)&&!Dg(e)?e:{value:e,message:""},P_=async(e,t,n,r,s,i)=>{const{ref:c,refs:u,required:f,maxLength:m,minLength:y,min:g,max:x,pattern:v,validate:C,name:S,valueAsNumber:w,mount:R}=e._f,j=Pe(n,S);if(!R||t.has(S))return{};const _=u?u[0]:c,O=Y=>{s&&_.reportValidity&&(_.setCustomValidity(Ga(Y)?"":Y||""),_.reportValidity())},A={},D=w2(c),T=$h(c),I=D||T,k=(w||C2(c))&&Xn(c.value)&&Xn(j)||Ag(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,F=S2.bind(null,S,r,A),G=(Y,B,Z,H=Bo.maxLength,M=Bo.minLength)=>{const V=Y?B:Z;A[S]={type:Y?H:M,message:V,ref:c,...F(Y?H:M,V)}};if(i?!Array.isArray(j)||!j.length:f&&(!I&&(k||wa(j))||Ga(j)&&!j||T&&!RO(u).isValid||D&&!TO(u).isValid)){const{value:Y,message:B}=Za(f)?{value:!!f,message:f}:Eu(f);if(Y&&(A[S]={type:Bo.required,message:B,ref:_,...F(Bo.required,B)},!r))return O(B),A}if(!k&&(!wa(g)||!wa(x))){let Y,B;const Z=Eu(x),H=Eu(g);if(!wa(j)&&!isNaN(j)){const M=c.valueAsNumber||j&&+j;wa(Z.value)||(Y=M>Z.value),wa(H.value)||(B=M<H.value)}else{const M=c.valueAsDate||new Date(j),V=ge=>new Date(new Date().toDateString()+" "+ge),$=c.type=="time",oe=c.type=="week";Za(Z.value)&&j&&(Y=$?V(j)>V(Z.value):oe?j>Z.value:M>new Date(Z.value)),Za(H.value)&&j&&(B=$?V(j)<V(H.value):oe?j<H.value:M<new Date(H.value))}if((Y||B)&&(G(!!Y,Z.message,H.message,Bo.max,Bo.min),!r))return O(A[S].message),A}if((m||y)&&!k&&(Za(j)||i&&Array.isArray(j))){const Y=Eu(m),B=Eu(y),Z=!wa(Y.value)&&j.length>+Y.value,H=!wa(B.value)&&j.length<+B.value;if((Z||H)&&(G(Z,Y.message,B.message),!r))return O(A[S].message),A}if(v&&!k&&Za(j)){const{value:Y,message:B}=Eu(v);if(Dg(Y)&&!j.match(Y)&&(A[S]={type:Bo.pattern,message:B,ref:c,...F(Bo.pattern,B)},!r))return O(B),A}if(C){if(ks(C)){const Y=await C(j,n),B=L_(Y,_);if(B&&(A[S]={...B,...F(Bo.validate,B.message)},!r))return O(B.message),A}else if(hr(C)){let Y={};for(const B in C){if(!na(Y)&&!r)break;const Z=L_(await C[B](j,n),_,B);Z&&(Y={...Z,...F(B,Z.message)},O(Z.message),r&&(A[S]=Y))}if(!na(Y)&&(A[S]={ref:_,...Y},!r))return A}}return O(!0),A};const Qte={mode:Is.onSubmit,reValidateMode:Is.onChange,shouldFocusError:!0};function Jte(e={}){let t={...Qte,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:ks(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=hr(t.defaultValues)||hr(t.values)?gr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:gr(s),c={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const y={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...y};const x={array:T_(),state:T_()},v=t.criteriaMode===Is.all,C=q=>ne=>{clearTimeout(m),m=setTimeout(q,ne)},S=async q=>{if(!t.disabled&&(y.isValid||g.isValid||q)){const ne=t.resolver?na((await T()).errors):await k(r,!0);ne!==n.isValid&&x.state.next({isValid:ne})}},w=(q,ne)=>{!t.disabled&&(y.isValidating||y.validatingFields||g.isValidating||g.validatingFields)&&((q||Array.from(u.mount)).forEach(ce=>{ce&&(ne?Sn(n.validatingFields,ce,ne):dr(n.validatingFields,ce))}),x.state.next({validatingFields:n.validatingFields,isValidating:!na(n.validatingFields)}))},R=(q,ne=[],ce,Oe,Ee=!0,je=!0)=>{if(Oe&&ce&&!t.disabled){if(c.action=!0,je&&Array.isArray(Pe(r,q))){const He=ce(Pe(r,q),Oe.argA,Oe.argB);Ee&&Sn(r,q,He)}if(je&&Array.isArray(Pe(n.errors,q))){const He=ce(Pe(n.errors,q),Oe.argA,Oe.argB);Ee&&Sn(n.errors,q,He),Wte(n.errors,q)}if((y.touchedFields||g.touchedFields)&&je&&Array.isArray(Pe(n.touchedFields,q))){const He=ce(Pe(n.touchedFields,q),Oe.argA,Oe.argB);Ee&&Sn(n.touchedFields,q,He)}(y.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Nu(s,i)),x.state.next({name:q,isDirty:G(q,ne),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Sn(i,q,ne)},j=(q,ne)=>{Sn(n.errors,q,ne),x.state.next({errors:n.errors})},_=q=>{n.errors=q,x.state.next({errors:n.errors,isValid:!1})},O=(q,ne,ce,Oe)=>{const Ee=Pe(r,q);if(Ee){const je=Pe(i,q,Xn(ce)?Pe(s,q):ce);Xn(je)||Oe&&Oe.defaultChecked||ne?Sn(i,q,ne?je:D_(Ee._f)):Z(q,je),c.mount&&!c.action&&S()}},A=(q,ne,ce,Oe,Ee)=>{let je=!1,He=!1;const mt={name:q};if(!t.disabled){if(!ce||Oe){(y.isDirty||g.isDirty)&&(He=n.isDirty,n.isDirty=mt.isDirty=G(),je=He!==mt.isDirty);const st=Ms(Pe(s,q),ne);He=!!Pe(n.dirtyFields,q),st?dr(n.dirtyFields,q):Sn(n.dirtyFields,q,!0),mt.dirtyFields=n.dirtyFields,je=je||(y.dirtyFields||g.dirtyFields)&&He!==!st}if(ce){const st=Pe(n.touchedFields,q);st||(Sn(n.touchedFields,q,ce),mt.touchedFields=n.touchedFields,je=je||(y.touchedFields||g.touchedFields)&&st!==ce)}je&&Ee&&x.state.next(mt)}return je?mt:{}},D=(q,ne,ce,Oe)=>{const Ee=Pe(n.errors,q),je=(y.isValid||g.isValid)&&Ga(ne)&&n.isValid!==ne;if(t.delayError&&ce?(f=C(()=>j(q,ce)),f(t.delayError)):(clearTimeout(m),f=null,ce?Sn(n.errors,q,ce):dr(n.errors,q)),(ce?!Ms(Ee,ce):Ee)||!na(Oe)||je){const He={...Oe,...je&&Ga(ne)?{isValid:ne}:{},errors:n.errors,name:q};n={...n,...He},x.state.next(He)}},T=async q=>{w(q,!0);const ne=await t.resolver(i,t.context,Gte(q||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return w(q),ne},I=async q=>{const{errors:ne}=await T(q);if(q)for(const ce of q){const Oe=Pe(ne,ce);Oe?Sn(n.errors,ce,Oe):dr(n.errors,ce)}else n.errors=ne;return ne},k=async(q,ne,ce={valid:!0})=>{for(const Oe in q){const Ee=q[Oe];if(Ee){const{_f:je,...He}=Ee;if(je){const mt=u.array.has(je.name),st=Ee._f&&Bte(Ee._f);st&&y.validatingFields&&w([je.name],!0);const Wt=await P_(Ee,u.disabled,i,v,t.shouldUseNativeValidation&&!ne,mt);if(st&&y.validatingFields&&w([je.name]),Wt[je.name]&&(ce.valid=!1,ne))break;!ne&&(Pe(Wt,je.name)?mt?Xte(n.errors,Wt,je.name):Sn(n.errors,je.name,Wt[je.name]):dr(n.errors,je.name))}!na(He)&&await k(He,ne,ce)}}return ce.valid},F=()=>{for(const q of u.unMount){const ne=Pe(r,q);ne&&(ne._f.refs?ne._f.refs.every(ce=>!r1(ce)):!r1(ne._f.ref))&&J(q)}u.unMount=new Set},G=(q,ne)=>!t.disabled&&(q&&ne&&Sn(i,q,ne),!Ms(ge(),s)),Y=(q,ne,ce)=>hb(q,u,{...c.mount?i:Xn(ne)?s:Za(q)?{[q]:ne}:ne},ce,ne),B=q=>y2(Pe(c.mount?i:s,q,t.shouldUnregister?Pe(s,q,[]):[])),Z=(q,ne,ce={})=>{const Oe=Pe(r,q);let Ee=ne;if(Oe){const je=Oe._f;je&&(!je.disabled&&Sn(i,q,jO(ne,je)),Ee=Ag(je.ref)&&wa(ne)?"":ne,wO(je.ref)?[...je.ref.options].forEach(He=>He.selected=Ee.includes(He.value)):je.refs?$h(je.ref)?je.refs.forEach(He=>{(!He.defaultChecked||!He.disabled)&&(Array.isArray(Ee)?He.checked=!!Ee.find(mt=>mt===He.value):He.checked=Ee===He.value||!!Ee)}):je.refs.forEach(He=>He.checked=He.value===Ee):C2(je.ref)?je.ref.value="":(je.ref.value=Ee,je.ref.type||x.state.next({name:q,values:gr(i)})))}(ce.shouldDirty||ce.shouldTouch)&&A(q,Ee,ce.shouldTouch,ce.shouldDirty,!0),ce.shouldValidate&&oe(q)},H=(q,ne,ce)=>{for(const Oe in ne){if(!ne.hasOwnProperty(Oe))return;const Ee=ne[Oe],je=q+"."+Oe,He=Pe(r,je);(u.array.has(q)||hr(Ee)||He&&!He._f)&&!ac(Ee)?H(je,Ee,ce):Z(je,Ee,ce)}},M=(q,ne,ce={})=>{const Oe=Pe(r,q),Ee=u.array.has(q),je=gr(ne);Sn(i,q,je),Ee?(x.array.next({name:q,values:gr(i)}),(y.isDirty||y.dirtyFields||g.isDirty||g.dirtyFields)&&ce.shouldDirty&&x.state.next({name:q,dirtyFields:Nu(s,i),isDirty:G(q,je)})):Oe&&!Oe._f&&!wa(je)?H(q,je,ce):Z(q,je,ce),M_(q,u)&&x.state.next({...n,name:q}),x.state.next({name:c.mount?q:void 0,values:gr(i)})},V=async q=>{c.mount=!0;const ne=q.target;let ce=ne.name,Oe=!0;const Ee=Pe(r,ce),je=st=>{Oe=Number.isNaN(st)||ac(st)&&isNaN(st.getTime())||Ms(st,Pe(i,ce,st))},He=O_(t.mode),mt=O_(t.reValidateMode);if(Ee){let st,Wt;const sr=ne.type?D_(Ee._f):yO(q),$n=q.type===Ng.BLUR||q.type===Ng.FOCUS_OUT,Dr=!qte(Ee._f)&&!t.resolver&&!Pe(n.errors,ce)&&!Ee._f.deps||Yte($n,Pe(n.touchedFields,ce),n.isSubmitted,mt,He),Jr=M_(ce,u,$n);Sn(i,ce,sr),$n?(!ne||!ne.readOnly)&&(Ee._f.onBlur&&Ee._f.onBlur(q),f&&f(0)):Ee._f.onChange&&Ee._f.onChange(q);const fn=A(ce,sr,$n),or=!na(fn)||Jr;if(!$n&&x.state.next({name:ce,type:q.type,values:gr(i)}),Dr)return(y.isValid||g.isValid)&&(t.mode==="onBlur"?$n&&S():$n||S()),or&&x.state.next({name:ce,...Jr?{}:fn});if(!$n&&Jr&&x.state.next({...n}),t.resolver){const{errors:kn}=await T([ce]);if(je(sr),Oe){const Ws=k_(n.errors,r,ce),Aa=k_(kn,r,Ws.name||ce);st=Aa.error,ce=Aa.name,Wt=na(kn)}}else w([ce],!0),st=(await P_(Ee,u.disabled,i,v,t.shouldUseNativeValidation))[ce],w([ce]),je(sr),Oe&&(st?Wt=!1:(y.isValid||g.isValid)&&(Wt=await k(r,!0)));Oe&&(Ee._f.deps&&(!Array.isArray(Ee._f.deps)||Ee._f.deps.length>0)&&oe(Ee._f.deps),D(ce,Wt,st,fn))}},$=(q,ne)=>{if(Pe(n.errors,ne)&&q.focus)return q.focus(),1},oe=async(q,ne={})=>{let ce,Oe;const Ee=Ff(q);if(t.resolver){const je=await I(Xn(q)?q:Ee);ce=na(je),Oe=q?!Ee.some(He=>Pe(je,He)):ce}else q?(Oe=(await Promise.all(Ee.map(async je=>{const He=Pe(r,je);return await k(He&&He._f?{[je]:He}:He)}))).every(Boolean),!(!Oe&&!n.isValid)&&S()):Oe=ce=await k(r);return x.state.next({...!Za(q)||(y.isValid||g.isValid)&&ce!==n.isValid?{}:{name:q},...t.resolver||!q?{isValid:ce}:{},errors:n.errors}),ne.shouldFocus&&!Oe&&Hf(r,$,q?Ee:u.mount),Oe},ge=(q,ne)=>{let ce={...c.mount?i:s};return ne&&(ce=CO(ne.dirtyFields?n.dirtyFields:n.touchedFields,ce)),Xn(q)?ce:Za(q)?Pe(ce,q):q.map(Oe=>Pe(ce,Oe))},P=(q,ne)=>({invalid:!!Pe((ne||n).errors,q),isDirty:!!Pe((ne||n).dirtyFields,q),error:Pe((ne||n).errors,q),isValidating:!!Pe(n.validatingFields,q),isTouched:!!Pe((ne||n).touchedFields,q)}),U=q=>{q&&Ff(q).forEach(ne=>dr(n.errors,ne)),x.state.next({errors:q?n.errors:{}})},z=(q,ne,ce)=>{const Oe=(Pe(r,q,{_f:{}})._f||{}).ref,Ee=Pe(n.errors,q)||{},{ref:je,message:He,type:mt,...st}=Ee;Sn(n.errors,q,{...st,...ne,ref:Oe}),x.state.next({name:q,errors:n.errors,isValid:!1}),ce&&ce.shouldFocus&&Oe&&Oe.focus&&Oe.focus()},X=(q,ne)=>ks(q)?x.state.subscribe({next:ce=>"values"in ce&&q(Y(void 0,ne),ce)}):Y(q,ne,!0),W=q=>x.state.subscribe({next:ne=>{Zte(q.name,ne.name,q.exact)&&Kte(ne,q.formState||y,On,q.reRenderRoot)&&q.callback({values:{...i},...n,...ne,defaultValues:s})}}).unsubscribe,ae=q=>(c.mount=!0,g={...g,...q.formState},W({...q,formState:g})),J=(q,ne={})=>{for(const ce of q?Ff(q):u.mount)u.mount.delete(ce),u.array.delete(ce),ne.keepValue||(dr(r,ce),dr(i,ce)),!ne.keepError&&dr(n.errors,ce),!ne.keepDirty&&dr(n.dirtyFields,ce),!ne.keepTouched&&dr(n.touchedFields,ce),!ne.keepIsValidating&&dr(n.validatingFields,ce),!t.shouldUnregister&&!ne.keepDefaultValue&&dr(s,ce);x.state.next({values:gr(i)}),x.state.next({...n,...ne.keepDirty?{isDirty:G()}:{}}),!ne.keepIsValid&&S()},le=({disabled:q,name:ne})=>{(Ga(q)&&c.mount||q||u.disabled.has(ne))&&(q?u.disabled.add(ne):u.disabled.delete(ne))},ye=(q,ne={})=>{let ce=Pe(r,q);const Oe=Ga(ne.disabled)||Ga(t.disabled);return Sn(r,q,{...ce||{},_f:{...ce&&ce._f?ce._f:{ref:{name:q}},name:q,mount:!0,...ne}}),u.mount.add(q),ce?le({disabled:Ga(ne.disabled)?ne.disabled:t.disabled,name:q}):O(q,!0,ne.value),{...Oe?{disabled:ne.disabled||t.disabled}:{},...t.progressive?{required:!!ne.required,min:wf(ne.min),max:wf(ne.max),minLength:wf(ne.minLength),maxLength:wf(ne.maxLength),pattern:wf(ne.pattern)}:{},name:q,onChange:V,onBlur:V,ref:Ee=>{if(Ee){ye(q,ne),ce=Pe(r,q);const je=Xn(Ee.value)&&Ee.querySelectorAll&&Ee.querySelectorAll("input,select,textarea")[0]||Ee,He=Fte(je),mt=ce._f.refs||[];if(He?mt.find(st=>st===je):je===ce._f.ref)return;Sn(r,q,{_f:{...ce._f,...He?{refs:[...mt.filter(r1),je,...Array.isArray(Pe(s,q))?[{}]:[]],ref:{type:je.type,name:q}}:{ref:je}}}),O(q,!1,void 0,je)}else ce=Pe(r,q,{}),ce._f&&(ce._f.mount=!1),(t.shouldUnregister||ne.shouldUnregister)&&!(xO(u.array,q)&&c.action)&&u.unMount.add(q)}}},Ce=()=>t.shouldFocusError&&Hf(r,$,u.mount),Ve=q=>{Ga(q)&&(x.state.next({disabled:q}),Hf(r,(ne,ce)=>{const Oe=Pe(r,ce);Oe&&(ne.disabled=Oe._f.disabled||q,Array.isArray(Oe._f.refs)&&Oe._f.refs.forEach(Ee=>{Ee.disabled=Oe._f.disabled||q}))},0,!1))},De=(q,ne)=>async ce=>{let Oe;ce&&(ce.preventDefault&&ce.preventDefault(),ce.persist&&ce.persist());let Ee=gr(i);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:je,values:He}=await T();n.errors=je,Ee=gr(He)}else await k(r);if(u.disabled.size)for(const je of u.disabled)dr(Ee,je);if(dr(n.errors,"root"),na(n.errors)){x.state.next({errors:{}});try{await q(Ee,ce)}catch(je){Oe=je}}else ne&&await ne({...n.errors},ce),Ce(),setTimeout(Ce);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:na(n.errors)&&!Oe,submitCount:n.submitCount+1,errors:n.errors}),Oe)throw Oe},et=(q,ne={})=>{Pe(r,q)&&(Xn(ne.defaultValue)?M(q,gr(Pe(s,q))):(M(q,ne.defaultValue),Sn(s,q,gr(ne.defaultValue))),ne.keepTouched||dr(n.touchedFields,q),ne.keepDirty||(dr(n.dirtyFields,q),n.isDirty=ne.defaultValue?G(q,gr(Pe(s,q))):G()),ne.keepError||(dr(n.errors,q),y.isValid&&S()),x.state.next({...n}))},rt=(q,ne={})=>{const ce=q?gr(q):s,Oe=gr(ce),Ee=na(q),je=Ee?s:Oe;if(ne.keepDefaultValues||(s=ce),!ne.keepValues){if(ne.keepDirtyValues){const He=new Set([...u.mount,...Object.keys(Nu(s,i))]);for(const mt of Array.from(He))Pe(n.dirtyFields,mt)?Sn(je,mt,Pe(i,mt)):M(mt,Pe(je,mt))}else{if(g2&&Xn(q))for(const He of u.mount){const mt=Pe(r,He);if(mt&&mt._f){const st=Array.isArray(mt._f.refs)?mt._f.refs[0]:mt._f.ref;if(Ag(st)){const Wt=st.closest("form");if(Wt){Wt.reset();break}}}}if(ne.keepFieldsRef)for(const He of u.mount)M(He,Pe(je,He));else r={}}i=t.shouldUnregister?ne.keepDefaultValues?gr(s):{}:gr(je),x.array.next({values:{...je}}),x.state.next({values:{...je}})}u={mount:ne.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!y.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!t.shouldUnregister&&!na(je),c.watch=!!t.shouldUnregister,c.action=!1,ne.keepErrors||(n.errors={}),x.state.next({submitCount:ne.keepSubmitCount?n.submitCount:0,isDirty:Ee?!1:ne.keepDirty?n.isDirty:!!(ne.keepDefaultValues&&!Ms(q,s)),isSubmitted:ne.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ee?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?Nu(s,i):n.dirtyFields:ne.keepDefaultValues&&q?Nu(s,q):ne.keepDirty?n.dirtyFields:{},touchedFields:ne.keepTouched?n.touchedFields:{},errors:ne.keepErrors?n.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},dn=(q,ne)=>rt(ks(q)?q(i):q,ne),zt=(q,ne={})=>{const ce=Pe(r,q),Oe=ce&&ce._f;if(Oe){const Ee=Oe.refs?Oe.refs[0]:Oe.ref;Ee.focus&&(Ee.focus(),ne.shouldSelect&&ks(Ee.select)&&Ee.select())}},On=q=>{n={...n,...q}},Me={control:{register:ye,unregister:J,getFieldState:P,handleSubmit:De,setError:z,_subscribe:W,_runSchema:T,_focusError:Ce,_getWatch:Y,_getDirty:G,_setValid:S,_setFieldArray:R,_setDisabledField:le,_setErrors:_,_getFieldArray:B,_reset:rt,_resetDefaultValues:()=>ks(t.defaultValues)&&t.defaultValues().then(q=>{dn(q,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:Ve,_subjects:x,_proxyFormState:y,get _fields(){return r},get _formValues(){return i},get _state(){return c},set _state(q){c=q},get _defaultValues(){return s},get _names(){return u},set _names(q){u=q},get _formState(){return n},get _options(){return t},set _options(q){t={...t,...q}}},subscribe:ae,trigger:oe,register:ye,handleSubmit:De,watch:X,setValue:M,getValues:ge,reset:dn,resetField:et,clearErrors:U,unregister:J,setError:z,setFocus:zt,getFieldState:P};return{...Me,formControl:Me}}function Ro(e={}){const t=re.useRef(void 0),n=re.useRef(void 0),[r,s]=re.useState({isDirty:!1,isValidating:!1,isLoading:ks(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:ks(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!ks(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...u}=Jte(e);t.current={...u,formState:r}}const i=t.current.control;return i._options=e,b2(()=>{const c=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(u=>({...u,isReady:!0})),i._formState.isReady=!0,c},[i]),re.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),re.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),re.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),re.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),re.useEffect(()=>{if(i._proxyFormState.isDirty){const c=i._getDirty();c!==r.isDirty&&i._subjects.state.next({isDirty:c})}},[i,r.isDirty]),re.useEffect(()=>{var c;e.values&&!Ms(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((c=i._options.resetOptions)===null||c===void 0)&&c.keepIsValid||i._setValid(),n.current=e.values,s(u=>({...u}))):i._resetDefaultValues()},[i,e.values]),re.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=bO(r,i),t.current}var ene=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tne=ene.reduce((e,t)=>{const n=eS(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:c,...u}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...u,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),nne="Label",_O=h.forwardRef((e,t)=>a.jsx(tne.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())}}));_O.displayName=nne;var rne=_O;function Ta({className:e,...t}){return a.jsx(rne,{"data-slot":"label",className:se("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 _l=vO,NO=h.createContext({}),Nt=({...e})=>a.jsx(NO.Provider,{value:{name:e.name},children:a.jsx(zte,{...e})}),Vh=()=>{const e=h.useContext(NO),t=h.useContext(AO),{getFieldState:n}=vd(),r=SO({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},AO=h.createContext({});function xt({className:e="",...t}){const n=h.useId();return a.jsx(AO.Provider,{value:{id:n},children:a.jsx("div",{"data-slot":"form-item",className:se("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 yt({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:i,formItemId:c}=Vh();return a.jsxs(Ta,{"data-slot":"form-label","data-error":!!i,className:se("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[a.jsx("span",{children:r}),t&&a.jsxs(Et,{...n,children:[a.jsx(Rt,{asChild:!0,children:a.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:a.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(jt,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function wt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=Vh();return a.jsx(yh,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function xn({className:e,...t}){const{formDescriptionId:n}=Vh();return a.jsx("div",{"data-slot":"form-description",id:n,className:se("text-muted-foreground text-sm",e),...t})}function Mt({className:e,...t}){const{error:n,formMessageId:r}=Vh(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?a.jsx("p",{"data-slot":"form-message",id:r,className:se("text-destructive text-sm",e),...t,children:s}):null}function Nl({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 a.jsx("div",{className:r,children:a.jsx("div",{className:se("flex min-h-full flex-col gap-4",t),children:e})})}function Mc({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 a.jsx("div",{className:se(r,e),children:t})}function Yr({title:e,children:t}){return a.jsxs("section",{className:"mb-4",children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function ane({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:i="vertical",className:c=""}){const{formItemId:u}=Vh();return a.jsxs("label",{htmlFor:`${u}-${e}`,className:se("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",i==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[a.jsx("input",{type:"radio",id:`${u}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:se("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")}),a.jsx("span",{className:se("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function sne({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return a.jsx("div",{tabIndex:-1,className:se(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(i=>a.jsx(ane,{value:i.value,label:i.label,checked:t===i.value,onChange:c=>n(c.target.value),disabled:i.disabled,orientation:r},i.value))})}const gi=h.forwardRef(({children:e,className:t="",...n},r)=>a.jsx("form",{ref:r,className:se("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));gi.displayName="AppForm";function U_(e,[t,n]){return Math.min(n,Math.max(t,e))}function gb(e){const t=one(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(lne);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function one(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=une(s),u=cne(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ine=Symbol("radix.slottable");function lne(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ine}function cne(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function une(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 dne(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=gb(u),m=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),O=ht(w,_.collectionRef);return a.jsx(f,{ref:O,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=gb(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,O=re.useRef(null),A=ht(w,O),D=i(y,R);return re.useEffect(()=>(D.itemMap.set(O,{ref:O,..._}),()=>void D.itemMap.delete(O))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,T)=>_.indexOf(D.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}function E2(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var fne=[" ","Enter","ArrowUp","ArrowDown"],hne=[" ","Enter"],xc="Select",[Uy,zy,mne]=dne(xc),[bd]=Sr(xc,[mne,wo]),Fy=wo(),[pne,Al]=bd(xc),[gne,yne]=bd(xc),DO=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:m,name:y,autoComplete:g,disabled:x,required:v,form:C}=e,S=Fy(t),[w,R]=h.useState(null),[j,_]=h.useState(null),[O,A]=h.useState(!1),D=_h(m),[T,I]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:xc}),[k,F]=ia({prop:c,defaultProp:u,onChange:f,caller:xc}),G=h.useRef(null),Y=w?C||!!w.closest("form"):!0,[B,Z]=h.useState(new Set),H=Array.from(B).map(M=>M.props.value).join(";");return a.jsx(dd,{...S,children:a.jsxs(pne,{required:v,scope:t,trigger:w,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:er(),value:k,onValueChange:F,open:T,onOpenChange:I,dir:D,triggerPointerDownPosRef:G,disabled:x,children:[a.jsx(Uy.Provider,{scope:t,children:a.jsx(gne,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(M=>{Z(V=>new Set(V).add(M))},[]),onNativeOptionRemove:h.useCallback(M=>{Z(V=>{const $=new Set(V);return $.delete(M),$})},[]),children:n})}),Y?a.jsxs(t6,{"aria-hidden":!0,required:v,tabIndex:-1,name:y,autoComplete:g,value:k,onChange:M=>F(M.target.value),disabled:x,form:C,children:[k===void 0?a.jsx("option",{value:""}):null,Array.from(B)]},H):null]})})};DO.displayName=xc;var OO="SelectTrigger",IO=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Fy(n),c=Al(OO,n),u=c.disabled||r,f=ht(t,c.onTriggerChange),m=zy(n),y=h.useRef("touch"),[g,x,v]=r6(S=>{const w=m().filter(_=>!_.disabled),R=w.find(_=>_.value===c.value),j=a6(w,S,R);j!==void 0&&c.onValueChange(j.value)}),C=S=>{u||(c.onOpenChange(!0),v()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return a.jsx(fd,{asChild:!0,...i,children:a.jsx(Je.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":n6(c.value)?"":void 0,...s,ref:f,onClick:Ie(s.onClick,S=>{S.currentTarget.focus(),y.current!=="mouse"&&C(S)}),onPointerDown:Ie(s.onPointerDown,S=>{y.current=S.pointerType;const w=S.target;w.hasPointerCapture(S.pointerId)&&w.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:Ie(s.onKeyDown,S=>{const w=g.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&x(S.key),!(w&&S.key===" ")&&fne.includes(S.key)&&(C(),S.preventDefault())})})})});IO.displayName=OO;var MO="SelectValue",kO=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:c="",...u}=e,f=Al(MO,n),{onValueNodeHasChildrenChange:m}=f,y=i!==void 0,g=ht(t,f.onValueNodeChange);return Hr(()=>{m(y)},[m,y]),a.jsx(Je.span,{...u,ref:g,style:{pointerEvents:"none"},children:n6(f.value)?a.jsx(a.Fragment,{children:c}):i})});kO.displayName=MO;var xne="SelectIcon",LO=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(Je.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});LO.displayName=xne;var vne="SelectPortal",PO=e=>a.jsx(_c,{asChild:!0,...e});PO.displayName=vne;var vc="SelectContent",UO=h.forwardRef((e,t)=>{const n=Al(vc,e.__scopeSelect),[r,s]=h.useState();if(Hr(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Ls.createPortal(a.jsx(zO,{scope:e.__scopeSelect,children:a.jsx(Uy.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(FO,{...e,ref:t})});UO.displayName=vc;var Ns=10,[zO,Dl]=bd(vc),bne="SelectContentImpl",Sne=gb("SelectContent.RemoveScroll"),FO=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:u,sideOffset:f,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:w,...R}=e,j=Al(vc,n),[_,O]=h.useState(null),[A,D]=h.useState(null),T=ht(t,J=>O(J)),[I,k]=h.useState(null),[F,G]=h.useState(null),Y=zy(n),[B,Z]=h.useState(!1),H=h.useRef(!1);h.useEffect(()=>{if(_)return ey(_)},[_]),Qg();const M=h.useCallback(J=>{const[le,...ye]=Y().map(De=>De.ref.current),[Ce]=ye.slice(-1),Ve=document.activeElement;for(const De of J)if(De===Ve||(De==null||De.scrollIntoView({block:"nearest"}),De===le&&A&&(A.scrollTop=0),De===Ce&&A&&(A.scrollTop=A.scrollHeight),De==null||De.focus(),document.activeElement!==Ve))return},[Y,A]),V=h.useCallback(()=>M([I,_]),[M,I,_]);h.useEffect(()=>{B&&V()},[B,V]);const{onOpenChange:$,triggerPointerDownPosRef:oe}=j;h.useEffect(()=>{if(_){let J={x:0,y:0};const le=Ce=>{var Ve,De;J={x:Math.abs(Math.round(Ce.pageX)-(((Ve=oe.current)==null?void 0:Ve.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((De=oe.current)==null?void 0:De.y)??0))}},ye=Ce=>{J.x<=10&&J.y<=10?Ce.preventDefault():_.contains(Ce.target)||$(!1),document.removeEventListener("pointermove",le),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",ye,{capture:!0})}}},[_,$,oe]),h.useEffect(()=>{const J=()=>$(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[$]);const[ge,P]=r6(J=>{const le=Y().filter(Ve=>!Ve.disabled),ye=le.find(Ve=>Ve.ref.current===document.activeElement),Ce=a6(le,J,ye);Ce&&setTimeout(()=>Ce.ref.current.focus())}),U=h.useCallback((J,le,ye)=>{const Ce=!H.current&&!ye;(j.value!==void 0&&j.value===le||Ce)&&(k(J),Ce&&(H.current=!0))},[j.value]),z=h.useCallback(()=>_==null?void 0:_.focus(),[_]),X=h.useCallback((J,le,ye)=>{const Ce=!H.current&&!ye;(j.value!==void 0&&j.value===le||Ce)&&G(J)},[j.value]),W=r==="popper"?yb:HO,ae=W===yb?{side:u,sideOffset:f,align:m,alignOffset:y,arrowPadding:g,collisionBoundary:x,collisionPadding:v,sticky:C,hideWhenDetached:S,avoidCollisions:w}:{};return a.jsx(zO,{scope:n,content:_,viewport:A,onViewportChange:D,itemRefCallback:U,selectedItem:I,onItemLeave:z,itemTextRefCallback:X,focusSelectedItem:V,selectedItemText:F,position:r,isPositioned:B,searchRef:ge,children:a.jsx(Ch,{as:Sne,allowPinchZoom:!0,children:a.jsx(Sh,{asChild:!0,trapped:j.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Ie(s,J=>{var le;(le=j.trigger)==null||le.focus({preventScroll:!0}),J.preventDefault()}),children:a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:a.jsx(W,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:J=>J.preventDefault(),...R,...ae,onPlaced:()=>Z(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Ie(R.onKeyDown,J=>{const le=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!le&&J.key.length===1&&P(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ce=Y().filter(Ve=>!Ve.disabled).map(Ve=>Ve.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const Ve=J.target,De=Ce.indexOf(Ve);Ce=Ce.slice(De+1)}setTimeout(()=>M(Ce)),J.preventDefault()}})})})})})})});FO.displayName=bne;var Cne="SelectItemAlignedPosition",HO=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Al(vc,n),c=Dl(vc,n),[u,f]=h.useState(null),[m,y]=h.useState(null),g=ht(t,T=>y(T)),x=zy(n),v=h.useRef(!1),C=h.useRef(!0),{viewport:S,selectedItem:w,selectedItemText:R,focusSelectedItem:j}=c,_=h.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&S&&w&&R){const T=i.trigger.getBoundingClientRect(),I=m.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),F=R.getBoundingClientRect();if(i.dir!=="rtl"){const Ve=F.left-I.left,De=k.left-Ve,et=T.left-De,rt=T.width+et,dn=Math.max(rt,I.width),zt=window.innerWidth-Ns,On=U_(De,[Ns,Math.max(Ns,zt-dn)]);u.style.minWidth=rt+"px",u.style.left=On+"px"}else{const Ve=I.right-F.right,De=window.innerWidth-k.right-Ve,et=window.innerWidth-T.right-De,rt=T.width+et,dn=Math.max(rt,I.width),zt=window.innerWidth-Ns,On=U_(De,[Ns,Math.max(Ns,zt-dn)]);u.style.minWidth=rt+"px",u.style.right=On+"px"}const G=x(),Y=window.innerHeight-Ns*2,B=S.scrollHeight,Z=window.getComputedStyle(m),H=parseInt(Z.borderTopWidth,10),M=parseInt(Z.paddingTop,10),V=parseInt(Z.borderBottomWidth,10),$=parseInt(Z.paddingBottom,10),oe=H+M+B+$+V,ge=Math.min(w.offsetHeight*5,oe),P=window.getComputedStyle(S),U=parseInt(P.paddingTop,10),z=parseInt(P.paddingBottom,10),X=T.top+T.height/2-Ns,W=Y-X,ae=w.offsetHeight/2,J=w.offsetTop+ae,le=H+M+J,ye=oe-le;if(le<=X){const Ve=G.length>0&&w===G[G.length-1].ref.current;u.style.bottom="0px";const De=m.clientHeight-S.offsetTop-S.offsetHeight,et=Math.max(W,ae+(Ve?z:0)+De+V),rt=le+et;u.style.height=rt+"px"}else{const Ve=G.length>0&&w===G[0].ref.current;u.style.top="0px";const et=Math.max(X,H+S.offsetTop+(Ve?U:0)+ae)+ye;u.style.height=et+"px",S.scrollTop=le-X+S.offsetTop}u.style.margin=`${Ns}px 0`,u.style.minHeight=ge+"px",u.style.maxHeight=Y+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[x,i.trigger,i.valueNode,u,m,S,w,R,i.dir,r]);Hr(()=>_(),[_]);const[O,A]=h.useState();Hr(()=>{m&&A(window.getComputedStyle(m).zIndex)},[m]);const D=h.useCallback(T=>{T&&C.current===!0&&(_(),j==null||j(),C.current=!1)},[_,j]);return a.jsx(Ene,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:D,children:a.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:a.jsx(Je.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});HO.displayName=Cne;var wne="SelectPopperPosition",yb=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ns,...i}=e,c=Fy(n);return a.jsx(Eh,{...c,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});yb.displayName=wne;var[Ene,R2]=bd(vc,{}),xb="SelectViewport",$O=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Dl(xb,n),c=R2(xb,n),u=ht(t,i.onViewportChange),f=h.useRef(0);return a.jsxs(a.Fragment,{children:[a.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}),a.jsx(Uy.Slot,{scope:n,children:a.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ie(s.onScroll,m=>{const y=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&g){const v=Math.abs(f.current-y.scrollTop);if(v>0){const C=window.innerHeight-Ns*2,S=parseFloat(g.style.minHeight),w=parseFloat(g.style.height),R=Math.max(S,w);if(R<C){const j=R+v,_=Math.min(C,j),O=j-_;g.style.height=_+"px",g.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,g.style.justifyContent="flex-end")}}}f.current=y.scrollTop})})})]})});$O.displayName=xb;var VO="SelectGroup",[Rne,jne]=bd(VO),GO=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=er();return a.jsx(Rne,{scope:n,id:s,children:a.jsx(Je.div,{role:"group","aria-labelledby":s,...r,ref:t})})});GO.displayName=VO;var BO="SelectLabel",Tne=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=jne(BO,n);return a.jsx(Je.div,{id:s.id,...r,ref:t})});Tne.displayName=BO;var Og="SelectItem",[_ne,qO]=bd(Og),KO=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...c}=e,u=Al(Og,n),f=Dl(Og,n),m=u.value===r,[y,g]=h.useState(i??""),[x,v]=h.useState(!1),C=ht(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,s)}),S=er(),w=h.useRef("touch"),R=()=>{s||(u.onValueChange(r),u.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 a.jsx(_ne,{scope:n,value:r,disabled:s,textId:S,isSelected:m,onItemTextChange:h.useCallback(j=>{g(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:a.jsx(Uy.ItemSlot,{scope:n,value:r,disabled:s,textValue:y,children:a.jsx(Je.div,{role:"option","aria-labelledby":S,"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:C,onFocus:Ie(c.onFocus,()=>v(!0)),onBlur:Ie(c.onBlur,()=>v(!1)),onClick:Ie(c.onClick,()=>{w.current!=="mouse"&&R()}),onPointerUp:Ie(c.onPointerUp,()=>{w.current==="mouse"&&R()}),onPointerDown:Ie(c.onPointerDown,j=>{w.current=j.pointerType}),onPointerMove:Ie(c.onPointerMove,j=>{var _;w.current=j.pointerType,s?(_=f.onItemLeave)==null||_.call(f):w.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Ie(c.onKeyDown,j=>{var O;((O=f.searchRef)==null?void 0:O.current)!==""&&j.key===" "||(hne.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});KO.displayName=Og;var If="SelectItemText",ZO=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,c=Al(If,n),u=Dl(If,n),f=qO(If,n),m=yne(If,n),[y,g]=h.useState(null),x=ht(t,R=>g(R),f.onItemTextChange,R=>{var j;return(j=u.itemTextRefCallback)==null?void 0:j.call(u,R,f.value,f.disabled)}),v=y==null?void 0:y.textContent,C=h.useMemo(()=>a.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:S,onNativeOptionRemove:w}=m;return Hr(()=>(S(C),()=>w(C)),[S,w,C]),a.jsxs(a.Fragment,{children:[a.jsx(Je.span,{id:f.textId,...i,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Ls.createPortal(i.children,c.valueNode):null]})});ZO.displayName=If;var YO="SelectItemIndicator",WO=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return qO(YO,n).isSelected?a.jsx(Je.span,{"aria-hidden":!0,...r,ref:t}):null});WO.displayName=YO;var vb="SelectScrollUpButton",XO=h.forwardRef((e,t)=>{const n=Dl(vb,e.__scopeSelect),r=R2(vb,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Hr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollTop>0;i(m)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(JO,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});XO.displayName=vb;var bb="SelectScrollDownButton",QO=h.forwardRef((e,t)=>{const n=Dl(bb,e.__scopeSelect),r=R2(bb,e.__scopeSelect),[s,i]=h.useState(!1),c=ht(t,r.onScrollButtonChange);return Hr(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,y=Math.ceil(f.scrollTop)<m;i(y)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(JO,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});QO.displayName=bb;var JO=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Dl("SelectScrollButton",n),c=h.useRef(null),u=zy(n),f=h.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return h.useEffect(()=>()=>f(),[f]),Hr(()=>{var y;const m=u().find(g=>g.ref.current===document.activeElement);(y=m==null?void 0:m.ref.current)==null||y.scrollIntoView({block:"nearest"})},[u]),a.jsx(Je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Ie(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Ie(s.onPointerMove,()=>{var m;(m=i.onItemLeave)==null||m.call(i),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Ie(s.onPointerLeave,()=>{f()})})}),Nne="SelectSeparator",e6=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(Je.div,{"aria-hidden":!0,...r,ref:t})});e6.displayName=Nne;var Sb="SelectArrow",Ane=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Fy(n),i=Al(Sb,n),c=Dl(Sb,n);return i.open&&c.position==="popper"?a.jsx(Rh,{...s,...r,ref:t}):null});Ane.displayName=Sb;var Dne="SelectBubbleInput",t6=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=ht(r,s),c=E2(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLSelectElement.prototype,y=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&y){const g=new Event("change",{bubbles:!0});y.call(u,t),u.dispatchEvent(g)}},[c,t]),a.jsx(Je.select,{...n,style:{...B4,...n.style},ref:i,defaultValue:t})});t6.displayName=Dne;function n6(e){return e===""||e===void 0}function r6(e){const t=Fs(e),n=h.useRef(""),r=h.useRef(0),s=h.useCallback(c=>{const u=n.current+c;t(u),(function f(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function a6(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let c=One(e,Math.max(i,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function One(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ine=DO,Mne=IO,kne=kO,Lne=LO,Pne=PO,Une=UO,zne=$O,Fne=GO,Hne=KO,$ne=ZO,Vne=WO,Gne=XO,Bne=QO,qne=e6;function ua({...e}){return a.jsx(Ine,{"data-slot":"select",...e})}function Hy({...e}){return a.jsx(Fne,{"data-slot":"select-group",...e})}function da({...e}){return a.jsx(kne,{"data-slot":"select-value",...e})}function fa({className:e,size:t="default",children:n,...r}){return a.jsxs(Mne,{"data-slot":"select-trigger","data-size":t,className:se("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,a.jsx(Lne,{asChild:!0,children:a.jsx(Ss,{className:"size-4 opacity-50"})})]})}function ha({className:e,children:t,position:n="popper",...r}){return a.jsx(Pne,{children:a.jsxs(Une,{"data-slot":"select-content",className:se("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:[a.jsx(Kne,{}),a.jsx(zne,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),a.jsx(Zne,{})]})})}function Bn({className:e,children:t,...n}){return a.jsxs(Hne,{"data-slot":"select-item",className:se("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:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(Vne,{children:a.jsx(oa,{className:"size-4"})})}),a.jsx($ne,{children:t})]})}function s6({className:e,...t}){return a.jsx(qne,{"data-slot":"select-separator",className:se("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function Kne({className:e,...t}){return a.jsx(Gne,{"data-slot":"select-scroll-up-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Zu,{className:"size-4"})})}function Zne({className:e,...t}){return a.jsx(Bne,{"data-slot":"select-scroll-down-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Ss,{className:"size-4"})})}const Yne=rn({title:Dt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:Dt().min(1,"Storage is required")});function Wne(){const{createDataMart:e,isLoading:t,error:n}=ws();return{handleCreate:h.useCallback(async s=>{try{return await e(s)}catch(i){return console.error(i),null}},[e]),isSubmitting:t,serverError:n}}function Xne(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,reset:v,dataMart:C,isLoading:S,error:w,getErrorMessage:R,runs:j}=ws();return h.useEffect(()=>(e?t(e):v(),()=>{v()}),[e,t,v]),{dataMart:C,isLoading:S,error:w,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:y,getDataMartRuns:g,loadMoreDataMartRuns:x,runs:j,getDataMart:t}}const z_=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Pe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Cb=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?z_(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>z_(s,n,e))}},F_=(e,t)=>{t.shouldUseNativeValidation&&Cb(e,t);const n={};for(const r in e){const s=Pe(t.fields,r),i=Object.assign(e[r]||{},{ref:s&&s.ref});if(Qne(t.names||Object.keys(e),r)){const c=Object.assign({},Pe(n,r));Sn(c,"root",i),Sn(n,r,c)}else Sn(n,r,i)}return n},Qne=(e,t)=>{const n=H_(t);return e.some(r=>H_(r).match(`^${n}\\.\\d+`))};function H_(e){return e.replace(/\]|\[/g,"")}function o6(e,t,n){function r(u,f){var m;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(m=u._zod).traits??(m.traits=new Set),u._zod.traits.add(e),t(u,f);for(const y in c.prototype)y in u||Object.defineProperty(u,y,{value:c.prototype[y].bind(u)});u._zod.constr=c,u._zod.def=f}const s=(n==null?void 0:n.Parent)??Object;class i extends s{}Object.defineProperty(i,"name",{value:e});function c(u){var f;const m=n!=null&&n.Parent?new i:this;r(m,u),(f=m._zod).deferred??(f.deferred=[]);for(const y of m._zod.deferred)y();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:u=>{var f,m;return n!=null&&n.Parent&&u instanceof n.Parent?!0:(m=(f=u==null?void 0:u._zod)==null?void 0:f.traits)==null?void 0:m.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class Jne extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const ere={};function i6(e){return ere}function tre(e,t){return typeof t=="bigint"?t.toString():t}const l6=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ap(e){return typeof e=="string"?e:e==null?void 0:e.message}function c6(e,t,n){var s,i,c,u,f,m;const r={...e,path:e.path??[]};if(!e.message){const y=Ap((c=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??Ap((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??Ap((f=n.customError)==null?void 0:f.call(n,e))??Ap((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=y}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const u6=(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,tre,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},nre=o6("$ZodError",u6),d6=o6("$ZodError",u6,{Parent:Error}),rre=e=>(t,n,r,s)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise)throw new Jne;if(c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>c6(f,i,i6())));throw l6(u,s==null?void 0:s.callee),u}return c.value},are=rre(d6),sre=e=>async(t,n,r,s)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},i);if(c instanceof Promise&&(c=await c),c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>c6(f,i,i6())));throw l6(u,s==null?void 0:s.callee),u}return c.value},ore=sre(d6);function $_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function ire(e,t){for(var n={};e.length;){var r=e[0],s=r.code,i=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var u=r.unionErrors[0].errors[0];n[c]={message:u.message,type:u.code}}else n[c]={message:i,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(y){return y.errors.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=S2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function lre(e,t){for(var n={};e.length;){var r=e[0],s=r.code,i=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var u=r.errors[0][0];n[c]={message:u.message,type:u.code}}else n[c]={message:i,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(y){return y.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=S2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function yi(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,i){try{return Promise.resolve($_(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&Cb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return Array.isArray(u==null?void 0:u.issues)})(c))return{values:{},errors:F_(ire(c.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,i){try{return Promise.resolve($_(function(){return Promise.resolve((n.mode==="sync"?are:ore)(e,r,t)).then(function(c){return i.shouldUseNativeValidation&&Cb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return u instanceof nre})(c))return{values:{},errors:F_(lre(c.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const f6=h.createContext(void 0);function cre(){const e=h.useContext(f6);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var tn=(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))(tn||{});const ure={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function dre(e,t){switch(t.type){case tn.FETCH_STORAGES_START:case tn.FETCH_STORAGE_START:case tn.CREATE_STORAGE_START:case tn.UPDATE_STORAGE_START:return{...e,error:null};case tn.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case tn.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case tn.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case tn.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case tn.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 tn.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case tn.FETCH_STORAGES_ERROR:case tn.FETCH_STORAGE_ERROR:case tn.CREATE_STORAGE_ERROR:case tn.UPDATE_STORAGE_ERROR:case tn.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case tn.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case tn.CLEAR_ERROR:return{...e,error:null};default:return e}}function j2({children:e}){const[t,n]=h.useReducer(dre,ure);return a.jsx(f6.Provider,{value:{state:t,dispatch:n},children:e})}class fre 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 Ef=new fre;function $y(){const{state:e,dispatch:t}=cre(),n=h.useCallback(async()=>{t({type:tn.FETCH_STORAGES_START});try{const f=await Ef.getDataStorages();t({type:tn.FETCH_STORAGES_SUCCESS,payload:f.map(gte)})}catch(f){throw t({type:tn.FETCH_STORAGES_ERROR,payload:un(f)}),f}},[t]),r=h.useCallback(async f=>{try{const m=await Ef.getDataStorageById(f),y=Wp(m);t({type:tn.FETCH_STORAGE_SUCCESS,payload:y})}catch(m){throw t({type:tn.FETCH_STORAGE_ERROR,payload:un(m)}),m}},[t]),s=h.useCallback(async f=>{t({type:tn.CREATE_STORAGE_START});try{const m=yte(f),y=await Ef.createDataStorage(m),g=Wp(y);return t({type:tn.CREATE_STORAGE_SUCCESS,payload:g}),Le({event:"data_storage_created",category:"DataStorage",action:"Create",label:g.type}),_t.success("Storage created"),g}catch(m){return t({type:tn.CREATE_STORAGE_ERROR,payload:un(m)}),null}},[t]),i=h.useCallback(async(f,m)=>{t({type:tn.UPDATE_STORAGE_START});try{const y=pte(m),g=await Ef.updateDataStorage(f,y),x=Wp(g);return t({type:tn.UPDATE_STORAGE_SUCCESS,payload:x}),Le({event:"data_storage_updated",category:"DataStorage",action:"Update",label:x.type}),_t.success("Storage updated"),x}catch(y){return t({type:tn.UPDATE_STORAGE_ERROR,payload:un(y)}),null}},[t]),c=h.useCallback(async f=>{t({type:tn.DELETE_STORAGE_START});try{await Ef.deleteDataStorage(f),t({type:tn.DELETE_STORAGE_SUCCESS,payload:f}),Le({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),_t.success("Storage deleted")}catch(m){throw t({type:tn.DELETE_STORAGE_ERROR,payload:un(m)}),m}},[t]),u=h.useCallback(()=>{t({type:tn.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:i,deleteDataStorage:c,clearCurrentDataStorage:u}}const h6=({isOpen:e,onClose:t,onSelect:n,isCreatingDataStorage:r})=>{const{trigger:s,isLocked:i}=RW(n,1e3);return a.jsx(c2,{open:e,onOpenChange:t,children:a.jsxs(u2,{className:"sm:max-w-sm",children:[a.jsxs(d2,{children:[a.jsx(f2,{children:"New Storage"}),a.jsx(h2,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:Sl.getAllTypes().map(c=>{const u=c.icon,f=c.status===Xo.ACTIVE;return a.jsxs(we,{variant:"outline",className:"flex px-4 py-6 select-none",onClick:()=>{s(c.type)},disabled:!f||r||i,onDoubleClick:m=>{m.preventDefault()},children:[a.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[a.jsx(u,{size:24}),a.jsx("span",{className:"font-medium",children:c.displayName})]}),!f&&a.jsx(Nr,{variant:"secondary",children:"Coming soon"})]},c.type)})})]})})};function hre({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=Wne(),{dataStorages:i,loading:c,fetchDataStorages:u,createDataStorage:f,getDataStorageById:m}=$y(),[y,g]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{u()},[u]);const C=Ro({resolver:yi(Yne),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),S=async j=>{const _=await n(j);_&&t&&t(_)},w=()=>{g(!0)},R=async j=>{v(!0);try{const _=await f(j);_!=null&&_.id&&(await m(_.id),C.setValue("storageId",_.id))}catch(_){console.error("Failed to create storage:",_)}g(!1),v(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(_l,{...C,children:a.jsxs(gi,{onSubmit:j=>{C.handleSubmit(S)(j)},children:[a.jsxs(Nl,{variant:"light",children:[s&&a.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),a.jsx(Nt,{control:C.control,name:"title",render:({field:j})=>a.jsxs(xt,{children:[a.jsx(yt,{children:"Title"}),a.jsx(wt,{children:a.jsx(It,{id:"title",placeholder:"Enter title",...j,disabled:r})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:C.control,name:"storageId",render:({field:j})=>a.jsxs(xt,{children:[a.jsx(yt,{children:"Storage"}),a.jsx(wt,{children:a.jsxs(ua,{onValueChange:_=>{_==="create_new"?w():j.onChange(_)},value:j.value,disabled:r||c,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a storage"})}),a.jsx(ha,{children:a.jsxs(Hy,{children:[c&&a.jsx(Bn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&i.map(_=>{const O=Sl.getInfo(_.type).icon;return a.jsx(Bn,{value:_.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(O,{size:20}),a.jsx("span",{children:_.title})]})},_.id)}),!c&&i.length>0&&a.jsx(s6,{}),a.jsx(Bn,{value:"create_new",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:a.jsx(ma,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(Mt,{})]})})]}),a.jsxs(Mc,{variant:"light",children:[a.jsx(we,{type:"submit",children:"Create Data Mart"}),a.jsx(we,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),a.jsx(h6,{isOpen:y,onClose:()=>{g(!1)},onSelect:j=>R(j),isCreatingDataStorage:x})]})}function m6({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[i,c]=h.useState(e),[u,f]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{c(e)},[e]),h.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[i]);const y=async()=>{if(i.trim()===""){c(e);return}if(i.trim()!==e)try{f(!0),await t(i.trim())}catch(x){c(e),console.error(x)}finally{f(!1)}},g=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),i.trim()===""){_t.error(r),c(e);return}y()}else x.key==="Escape"&&c(e)};return a.jsx("h2",{className:se("m-0 cursor-pointer p-0 hover:opacity-80",n),children:a.jsx(Eo,{ref:m,value:i,onChange:x=>{c(x.target.value);const v=x.target;v.style.height="auto",v.style.height=`${String(v.scrollHeight)}px`},onBlur:()=>void y(),onKeyDown:g,className:se("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":u}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:u})})}var tc=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(tc||{}),p6=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(p6||{}),Vy="Tabs",[mre]=Sr(Vy,[hy]),g6=hy(),[pre,T2]=mre(Vy),y6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,y=_h(u),[g,x]=ia({prop:r,onChange:s,defaultProp:i??"",caller:Vy});return a.jsx(pre,{scope:n,baseId:er(),value:g,onValueChange:x,orientation:c,dir:y,activationMode:f,children:a.jsx(Je.div,{dir:y,"data-orientation":c,...m,ref:t})})});y6.displayName=Vy;var x6="TabsList",v6=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=T2(x6,n),c=g6(n);return a.jsx(l3,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(Je.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});v6.displayName=x6;var b6="TabsTrigger",S6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,c=T2(b6,n),u=g6(n),f=E6(c.baseId,r),m=R6(c.baseId,r),y=r===c.value;return a.jsx(c3,{asChild:!0,...u,focusable:!s,active:y,children:a.jsx(Je.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":m,"data-state":y?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:Ie(e.onMouseDown,g=>{!s&&g.button===0&&g.ctrlKey===!1?c.onValueChange(r):g.preventDefault()}),onKeyDown:Ie(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(r)}),onFocus:Ie(e.onFocus,()=>{const g=c.activationMode!=="manual";!y&&!s&&g&&c.onValueChange(r)})})})});S6.displayName=b6;var C6="TabsContent",w6=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...c}=e,u=T2(C6,n),f=E6(u.baseId,r),m=R6(u.baseId,r),y=r===u.value,g=h.useRef(y);return h.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),a.jsx(Vr,{present:s||y,children:({present:x})=>a.jsx(Je.div,{"data-state":y?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:x&&i})})});w6.displayName=C6;function E6(e,t){return`${e}-trigger-${t}`}function R6(e,t){return`${e}-content-${t}`}var gre=y6,yre=v6,xre=S6,vre=w6;function _2({className:e,...t}){return a.jsx(gre,{"data-slot":"tabs",className:se("flex flex-col gap-2",e),...t})}function N2({className:e,...t}){return a.jsx(yre,{"data-slot":"tabs-list",className:se("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function sh({className:e,...t}){return a.jsx(xre,{"data-slot":"tabs-trigger",className:se("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 bre({className:e,...t}){return a.jsx(vre,{"data-slot":"tabs-content",className:se("flex-1 outline-none",e),...t})}var Gy="Collapsible",[Sre,j6]=Sr(Gy),[Cre,A2]=Sre(Gy),T6=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:c,...u}=e,[f,m]=ia({prop:r,defaultProp:s??!1,onChange:c,caller:Gy});return a.jsx(Cre,{scope:n,disabled:i,contentId:er(),open:f,onOpenToggle:h.useCallback(()=>m(y=>!y),[m]),children:a.jsx(Je.div,{"data-state":M2(f),"data-disabled":i?"":void 0,...u,ref:t})})});T6.displayName=Gy;var _6="CollapsibleTrigger",D2=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=A2(_6,n);return a.jsx(Je.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":M2(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Ie(e.onClick,s.onOpenToggle)})});D2.displayName=_6;var O2="CollapsibleContent",I2=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=A2(O2,e.__scopeCollapsible);return a.jsx(Vr,{present:n||s.open,children:({present:i})=>a.jsx(wre,{...r,ref:t,present:i})})});I2.displayName=O2;var wre=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,c=A2(O2,n),[u,f]=h.useState(r),m=h.useRef(null),y=ht(t,m),g=h.useRef(0),x=g.current,v=h.useRef(0),C=v.current,S=c.open||u,w=h.useRef(S),R=h.useRef(void 0);return h.useEffect(()=>{const j=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(j)},[]),Hr(()=>{const j=m.current;if(j){R.current=R.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const _=j.getBoundingClientRect();g.current=_.height,v.current=_.width,w.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),a.jsx(Je.div,{"data-state":M2(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!S,...i,ref:y,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:S&&s})});function M2(e){return e?"open":"closed"}var N6=T6,Ere=D2,Rre=I2;const jre=N6,Tre=D2,_re=I2;function Nre({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function Are({children:e,className:t="",...n}){return a.jsx("div",{className:se("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:a.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function Dre({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 a.jsx("div",{className:se(s,t),...r,children:e})}function Gi({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step-item",className:se("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 Ore({label:e,children:t,className:n="",options:r,value:s,onValueChange:i,required:c=!1,tooltip:u,...f}){return a.jsx("div",{"data-slot":"wizard-step-item-one-of",className:se("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),...f,children:a.jsxs(_2,{value:s,onValueChange:i,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ba,{required:c,tooltip:u,className:"w-full",children:e}),r.length>1&&a.jsx(N2,{children:r.map(m=>a.jsx(sh,{value:m.value,children:m.label},m.value))})]}),t]})})}function A6({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,i]=h.useState(n);return a.jsxs(jre,{open:s,onOpenChange:i,"data-slot":"wizard-collapsible",className:se("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(Tre,{asChild:!0,children:a.jsxs("button",{type:"button",className:se("flex cursor-pointer items-center gap-1"),children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx(_a,{className:se("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),a.jsx(_re,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:a.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function Ba({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...i}){return a.jsxs(Ta,{"data-slot":"wizard-step-label",className:se("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...i,children:[t?a.jsxs(Et,{...r,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("span",{className:"flex items-center gap-1",children:[e,a.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),a.jsx(jt,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):a.jsx("span",{children:e}),n&&a.jsxs(Et,{...r,children:[a.jsx(Rt,{asChild:!0,children:a.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:a.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(jt,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function al({title:e,children:t,className:n="",...r}){return a.jsxs("section",{"data-slot":"wizard-step-section",className:se("mb-8",n),...r,children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function ti({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:i,...c}){return s==="compact"?a.jsxs("div",{"data-slot":"wizard-step-hero",className:se("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",i),...c,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsx("div",{children:e}),a.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ai,{className:"h-4 w-4"})]})})]}):a.jsxs("div",{"data-slot":"wizard-step-hero",className:se("mb-6 flex flex-col items-center justify-center text-center",i),...c,children:[e&&a.jsx("div",{className:"mt-6 mb-3",children:e}),a.jsx("h2",{className:"text-xl font-medium",children:t}),n&&a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&a.jsx(we,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:a.jsxs(Wr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ai,{className:"h-4 w-4"})]})})]})}function ni({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:se("space-y-4",t),...n,children:e})}function Ire({children:e,className:t="",...n}){return a.jsx("div",{className:se("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function Mre({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:i,className:c="",...u}){return a.jsxs("div",{className:se("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:i,...u,children:[e&&a.jsx("span",{className:"shrink-0",children:e}),r?a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),a.jsx(jt,{side:"top",align:"center",children:"Coming soon"})]}):a.jsx("span",{className:"text-sm font-medium",children:t})]})}function D6({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-col gap-0.5 rounded-md border-b bg-white p-2 transition-shadow duration-200 select-none hover:shadow-sm dark:bg-white/4",t),...n,children:e})}function O6({type:e,id:t,name:n,value:r,label:s,checked:i,selected:c=!1,disabled:u=!1,tooltip:f,rightIcon:m,onChange:y,className:g="",...x}){const v=S=>{y&&y(e==="checkbox"?S.target.checked:S.target.value)},C=h.useRef(null);return a.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:S=>{if(u)return;const w=S.target;w.tagName==="INPUT"||w.tagName==="LABEL"||w.closest("label")||C.current&&C.current.click()},className:se("group flex items-center gap-2 rounded-sm px-4 py-3 transition-shadow duration-200 select-none",u?"cursor-not-allowed":"hover:bg-accent cursor-pointer dark:hover:bg-white/4",c?"bg-primary/8 hover:bg-primary/8 dark:bg-white/8 dark:hover:bg-white/8":"",g),children:[a.jsx("input",{ref:C,id:t,type:e,name:n,value:r,checked:i,disabled:u,onChange:v,className:se("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"accent-primary dark:accent-primary h-4 w-4":"h-8 w-full rounded-md border px-2"),...x}),s&&a.jsx(Ba,{htmlFor:t,className:se("cursor-pointer",u&&"cursor-not-allowed"),children:s}),(f||m)&&a.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.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})}),a.jsx(jt,{side:"top",align:"center",children:f})]}),m&&a.jsx("div",{className:"flex items-center",children:m})]})]})}function k2({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 a.jsx("div",{"data-slot":"wizard-step-loading",className:se(s,n),children:Array.from({length:r}).map((i,c)=>a.jsx(Ur,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function V_(e){const t=kre(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Pre);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function kre(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=zre(s),u=Ure(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Lre=Symbol("radix.slottable");function Pre(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Lre}function Ure(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function zre(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 Fre(e){const t=e+"CollectionProvider",[n,r]=Sr(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:w,children:R}=S,j=re.useRef(null),_=re.useRef(new Map).current;return a.jsx(s,{scope:w,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=V_(u),m=re.forwardRef((S,w)=>{const{scope:R,children:j}=S,_=i(u,R),O=ht(w,_.collectionRef);return a.jsx(f,{ref:O,children:j})});m.displayName=u;const y=e+"CollectionItemSlot",g="data-radix-collection-item",x=V_(y),v=re.forwardRef((S,w)=>{const{scope:R,children:j,..._}=S,O=re.useRef(null),A=ht(w,O),D=i(y,R);return re.useEffect(()=>(D.itemMap.set(O,{ref:O,..._}),()=>void D.itemMap.delete(O))),a.jsx(x,{[g]:"",ref:A,children:j})});v.displayName=y;function C(S){const w=i(e+"CollectionConsumer",S);return re.useCallback(()=>{const j=w.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((D,T)=>_.indexOf(D.ref.current)-_.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},C,r]}var Ys="Accordion",Hre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[L2,$re,Vre]=Fre(Ys),[By]=Sr(Ys,[Vre,j6]),P2=j6(),I6=re.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return a.jsx(L2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(Kre,{...i,ref:t}):a.jsx(qre,{...s,ref:t})})});I6.displayName=Ys;var[M6,Gre]=By(Ys),[k6,Bre]=By(Ys,{collapsible:!1}),qre=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...c}=e,[u,f]=ia({prop:n,defaultProp:r??"",onChange:s,caller:Ys});return a.jsx(M6,{scope:e.__scopeAccordion,value:re.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:re.useCallback(()=>i&&f(""),[i,f]),children:a.jsx(k6,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(L6,{...c,ref:t})})})}),Kre=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[c,u]=ia({prop:n,defaultProp:r??[],onChange:s,caller:Ys}),f=re.useCallback(y=>u((g=[])=>[...g,y]),[u]),m=re.useCallback(y=>u((g=[])=>g.filter(x=>x!==y)),[u]);return a.jsx(M6,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:m,children:a.jsx(k6,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(L6,{...i,ref:t})})})}),[Zre,qy]=By(Ys),L6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...c}=e,u=re.useRef(null),f=ht(u,t),m=$re(n),g=_h(s)==="ltr",x=Ie(e.onKeyDown,v=>{var I;if(!Hre.includes(v.key))return;const C=v.target,S=m().filter(k=>{var F;return!((F=k.ref.current)!=null&&F.disabled)}),w=S.findIndex(k=>k.ref.current===C),R=S.length;if(w===-1)return;v.preventDefault();let j=w;const _=0,O=R-1,A=()=>{j=w+1,j>O&&(j=_)},D=()=>{j=w-1,j<_&&(j=O)};switch(v.key){case"Home":j=_;break;case"End":j=O;break;case"ArrowRight":i==="horizontal"&&(g?A():D());break;case"ArrowDown":i==="vertical"&&A();break;case"ArrowLeft":i==="horizontal"&&(g?D():A());break;case"ArrowUp":i==="vertical"&&D();break}const T=j%R;(I=S[T].ref.current)==null||I.focus()});return a.jsx(Zre,{scope:n,disabled:r,direction:s,orientation:i,children:a.jsx(L2.Slot,{scope:n,children:a.jsx(Je.div,{...c,"data-orientation":i,ref:f,onKeyDown:r?void 0:x})})})}),Ig="AccordionItem",[Yre,U2]=By(Ig),P6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=qy(Ig,n),c=Gre(Ig,n),u=P2(n),f=er(),m=r&&c.value.includes(r)||!1,y=i.disabled||e.disabled;return a.jsx(Yre,{scope:n,open:m,disabled:y,triggerId:f,children:a.jsx(N6,{"data-orientation":i.orientation,"data-state":V6(m),...u,...s,ref:t,disabled:y,open:m,onOpenChange:g=>{g?c.onItemOpen(r):c.onItemClose(r)}})})});P6.displayName=Ig;var U6="AccordionHeader",z6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=qy(Ys,n),i=U2(U6,n);return a.jsx(Je.h3,{"data-orientation":s.orientation,"data-state":V6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});z6.displayName=U6;var wb="AccordionTrigger",F6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=qy(Ys,n),i=U2(wb,n),c=Bre(wb,n),u=P2(n);return a.jsx(L2.ItemSlot,{scope:n,children:a.jsx(Ere,{"aria-disabled":i.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:t})})});F6.displayName=wb;var H6="AccordionContent",$6=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=qy(Ys,n),i=U2(H6,n),c=P2(n);return a.jsx(Rre,{role:"region","aria-labelledby":i.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}})});$6.displayName=H6;function V6(e){return e?"open":"closed"}var Wre=I6,Xre=P6,Qre=z6,Jre=F6,eae=$6;const z2={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:a.jsx(_A,{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}},G6=h.createContext("default");function Cn({variant:e="default",...t}){return a.jsx(G6.Provider,{value:e,children:a.jsx(Wre,{"data-slot":"accordion",...t})})}function F2(e){const t=h.useContext(G6);return e??t??"default"}function Kt({className:e,variant:t,...n}){const r=F2(t),{itemClass:s}=z2[r];return a.jsx(Xre,{"data-slot":"accordion-item",className:se(s,e),...n})}function Zt({className:e,children:t,variant:n,...r}){const s=F2(n),{triggerClass:i,icon:c,chevronClass:u,headerClass:f}=z2[s];return a.jsx(Qre,{className:f,children:a.jsxs(Jre,{"data-slot":"accordion-trigger",className:se(i,e),...r,children:[c,t,a.jsx(Ss,{className:u,"aria-hidden":"true"})]})})}function Yt({className:e,children:t,variant:n,...r}){const s=F2(n),{contentClass:i,contentInnerClass:c}=z2[s];return a.jsx(eae,{"data-slot":"accordion-content",className:se(i,e),...r,children:a.jsx("div",{className:c,children:t})})}function gn({href:e,children:t,className:n,...r}){return a.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:se("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,a.jsx(ai,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function G_(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"connector-state-details",children:[a.jsx(Zt,{children:"What’s connector state?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"The connector state stores internal data between runs and updates automatically with each execution. It’s used to track progress and ensure consistent data processing across runs."}),a.jsx("p",{className:"mb-2",children:"Connector state is available only for connectors that support incremental runs, helping add only new or updated records since the last run without reloading existing data."}),a.jsxs("p",{className:"mb-2",children:["For more details, see the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/?utm_source=owox_data_marts&utm_medium=manual_run_sheet&utm_campaign=tooltip_connector_state",children:"OWOX documentation"}),"."]})]})]})})}function tae({configuration:e,connectorState:t}){const r=((e==null?void 0:e.connector.source.configuration)??[]).map((u,f)=>{const m=u;return typeof m._id=="string"?{id:m._id,index:f}:void 0}).filter(u=>!!u),s=(t==null?void 0:t.states)??[],i=new Map(s.map(u=>[u._id,u])),c=r.map(({id:u,index:f})=>{const m=i.get(u);return m?{state:m,index:f}:void 0}).filter(u=>!!u);return a.jsx(A6,{title:"State Info",children:c.length===0?a.jsxs(xt,{children:[a.jsx(yt,{children:"Connector state"}),a.jsx(wt,{children:a.jsx("div",{className:"bg-muted min-h-[70px] cursor-not-allowed overflow-auto rounded-md px-3 py-2 font-mono text-sm whitespace-pre-wrap opacity-70",children:"No state available"})}),a.jsx(xn,{children:a.jsx(G_,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:u,index:f})=>{const m=u.at||"",y=m?_y(b5(m).toISOString()):"—",g=u.state,x=(()=>{try{return JSON.stringify(g,null,2)}catch{return typeof g=="string"?g:'"—"'}})();return a.jsxs(xt,{children:[a.jsx(yt,{tooltip:`Created at ${y}`,children:`Connector state of configuration #${String(f+1)}`}),a.jsx(wt,{children:a.jsx(ND,{value:x,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(xn,{children:a.jsx(G_,{})})]},u._id)})})})}function nae({configuration:e,onClose:t,onSubmit:n}){const[r,s]=h.useState(new Set),i=h.useId(),c=Ro({defaultValues:{runType:tc.INCREMENTAL}}),{loading:u,loadingSpecification:f,connectorSpecification:m,fetchConnectorSpecification:y}=Ic(),{dataMart:g}=ws(),x=h.useCallback(async w=>{!r.has(w)&&!f&&(s(R=>new Set(R).add(w)),await y(w))},[r,f,y]);h.useEffect(()=>{e!=null&&e.connector.source.name&&x(e.connector.source.name)},[e,u,x]);const v=w=>{n&&n(w)},C=()=>{t&&t()},S=w=>{if(!w)return"text";switch(w){case Os.DATE:return"date";case Os.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):m?a.jsx(_l,{...c,children:a.jsxs(gi,{id:i,noValidate:!0,onSubmit:w=>void c.handleSubmit(v)(w),children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:c.control,name:"runType",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),a.jsx(wt,{children:a.jsxs(a.Fragment,{children:[a.jsx(sne,{options:[{value:tc.INCREMENTAL,label:"Incremental load"},{value:tc.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:w.value,onChange:w.onChange,orientation:"horizontal"}),a.jsx(xn,{children:c.watch("runType")===tc.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")===tc.INCREMENTAL&&a.jsx(tae,{configuration:e,connectorState:(g==null?void 0:g.connectorState)??null})]}),c.watch("runType")===tc.MANUAL_BACKFILL&&a.jsx(Yr,{title:"Run configuration",children:m.filter(w=>{var R;return(R=w.attributes)==null?void 0:R.includes(p6.MANUAL_BACKFILL)}).map(w=>a.jsx(Nt,{control:c.control,name:`data.${w.name}`,render:()=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:w.description,children:w.title??w.name}),a.jsx(wt,{children:a.jsx(It,{id:w.name,placeholder:w.description,type:S(w.requiredType),defaultValue:typeof w.default=="string"||typeof w.default=="number"?w.default.toString():void 0,...c.register(`data.${w.name}`,{required:!0})})}),a.jsx(Mt,{})]},w.name)}))})]}),a.jsxs(Mc,{children:[a.jsx(we,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(we,{type:"button",variant:"outline",onClick:C,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function Ol(e,t){h.useEffect(()=>(e?AW(0,600):ob(),()=>{ob()}),[e,0,600])}function rae({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return Ol(e),a.jsx(ci,{open:e,onOpenChange:t,children:a.jsxs(ui,{children:[a.jsx(di,{children:a.jsx(fi,{children:"Manual Run"})}),a.jsx(nae,{configuration:n,onClose:t,onSubmit:r})]})})}function B6({children:e,configuration:t,onManualRun:n,open:r}){const[s,i]=h.useState(r??!1),c=()=>{i(!0)},u=m=>{n(m),i(!1)},f=()=>e?a.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return a.jsxs(a.Fragment,{children:[f(),s&&a.jsx(rd,{children:a.jsx(rae,{isOpen:s,onClose:()=>{i(!1)},configuration:t,onSubmit:u})})]})}const aae=1e3;function sae(e,t){const[n,r]=h.useState(!1),[s,i]=h.useState(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(!0),m=h.useRef(t);m.current=t;const y=h.useCallback(w=>{f.current&&r(w)},[]),g=h.useCallback(w=>{f.current&&i(w)},[]),x=h.useCallback((w,R)=>{const j=w instanceof Error?w.message:"Schema actualization failed";_t.dismiss(R),g(j),y(!1),c.current=null,u.current=null,_t.error(j,{duration:void 0,id:R})},[g,y]),v=h.useCallback(async()=>{var R;const w=c.current;if((R=u.current)==null||R.abort(),w){_t.dismiss(w);try{await Tn.abortSchemaActualizeTrigger(e,w)}catch{}}c.current=null,u.current=null,y(!1)},[e,y]),C=h.useCallback(async(w,R)=>{var _;const j=O=>O===Xa.SUCCESS||O===Xa.ERROR||O===Xa.CANCELLED;for(;!R.aborted&&c.current===w;)try{const O=await Tn.getSchemaActualizeTriggerStatus(e,w);if(j(O)){try{const A=await Tn.getSchemaActualizeTriggerResponse(e,w);if(_t.dismiss(w),A.success)(_=m.current)==null||_.call(m),_t.success("Output schema actualized",{duration:void 0,id:w});else{const D=A.error??"Schema actualization failed";g(D),_t.error(D,{duration:void 0,id:w})}}catch(A){const D=A instanceof Error?A.message:"Schema actualization failed";_t.dismiss(w),g(D),_t.error(D,{duration:void 0,id:w})}y(!1),c.current=null,u.current=null;return}await new Promise(A=>setTimeout(A,aae))}catch(O){x(O,w)}},[e,g,y,x]),S=h.useCallback(async()=>{c.current&&await v(),g(null),y(!0);try{const{triggerId:w}=await Tn.createSchemaActualizeTrigger(e);_t.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:w}),c.current=w;const R=new AbortController;u.current=R;try{await C(w,R.signal)}catch(j){x(j,w)}}catch(w){y(!1),g(w instanceof Error?w.message:"Failed to start schema actualization")}},[e,v,C,g,y,x]);return h.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const w=c.current;(R=u.current)==null||R.abort(),w&&(_t.dismiss(w),Tn.abortSchemaActualizeTrigger(e,w).catch(()=>{})),c.current=null,u.current=null}),[e]),{run:S,isLoading:n,cancel:v,error:s}}function oae({id:e}){const{navigate:t}=mi(),{user:n}=hi(),{flags:r}=hd(),{dataMart:s,deleteDataMart:i,updateDataMartTitle:c,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:y,publishDataMart:g,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:S,isLoading:w,error:R,getErrorMessage:j,runs:_,getDataMart:O}=Xne(e),[A,D]=h.useState(!1),[T,I]=h.useState(!1),{id:k="",canPublish:F=!1,canActualizeSchema:G=!1,status:Y={code:null,displayName:"",description:""},title:B="",definition:Z=null,definitionType:H=null,validationErrors:M=[]}=s??{},V=h.useCallback(()=>{k&&O(k)},[k,O]),{run:$,isLoading:oe}=sae(k,V),ge=h.useCallback(async()=>{G&&await $()},[G,$]),P=r==null?void 0:r.INSIGHTS_ENABLED_PROJECT_IDS,U=(n==null?void 0:n.projectId)??"",z=U.length>0&&aJ(P??"").includes(U),X=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},...z?[{name:"Insights",path:"insights"}]:[],{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],W=h.useCallback(async le=>{k&&await c(k,le)},[k,c]),ae=h.useCallback(async()=>{if(k){I(!0);try{await g(k),ge()}catch(le){console.log(le instanceof Error?le.message:"Failed to publish Data Mart")}finally{I(!1)}}},[k,g,ge]),J=h.useCallback(async le=>{if(k){if(Y.code!==zr.PUBLISHED){Dn.error("Manual run is only available for published Data Marts");return}await x({id:k,payload:le})}},[k,Y,x]);return s?a.jsxs("div",{className:"px-12 py-6",children:[a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[a.jsx(Vu,{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:a.jsx(pP,{className:"h-5 w-5"})}),a.jsx(m6,{title:B,onUpdate:W,className:"text-2xl font-medium"})]}),a.jsxs("div",{className:"flex items-center gap-2"+(T?" opacity-50":""),style:{minWidth:"120px"},children:[a.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Uh,{type:Y.code===zr.PUBLISHED?Jn.SUCCESS:Jn.NEUTRAL,variant:"subtle",children:Y.displayName})})}),a.jsx(jt,{children:Y.code===zr.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),Y.code===zr.DRAFT&&a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{children:a.jsxs(Vu,{variant:"default",onClick:()=>{ae()},disabled:T||!F,className:"ml-2 flex items-center gap-1",children:[a.jsx(vh,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!F&&a.jsxs(jt,{children:[a.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),M.length>0&&a.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:TJ(M).map((le,ye)=>a.jsx("li",{children:le},ye))})]})]})]}),a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(Vu,{variant:"ghost",children:a.jsx(RA,{className:"h-5 w-5"})})}),a.jsxs(Er,{align:"end",children:[H===$e.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(B6,{configuration:Z??null,onManualRun:le=>{J({runType:le.runType,data:le.data})},children:a.jsxs(vt,{onClick:le=>{le.preventDefault()},children:[a.jsx(Xg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(la,{})]}),a.jsxs(vt,{onClick:()=>{D(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),a.jsx("div",{children:a.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:X.map(le=>a.jsx(gh,{to:le.path,className:({isActive:ye})=>se("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",ye?"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:le.name},le.name))})}),a.jsx("div",{className:"pt-4",children:a.jsx(Xb,{context:{dataMart:s,isLoading:w,error:R,getErrorMessage:j,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:y,runDataMart:x,cancelDataMartRun:v,getDataMartRuns:C,loadMoreDataMartRuns:S,runs:_,getDataMart:O,runSchemaActualization:ge,isSchemaActualizationLoading:oe}})}),a.jsx(br,{open:A,onOpenChange:D,title:"Delete Data Mart",description:a.jsxs(a.Fragment,{children:["Are you sure you want to delete ",a.jsxs("strong",{children:['"',B,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await i(k),D(!1),t("/data-marts")}catch(le){console.error("Failed to delete Data Mart:",le)}})()}})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx(Ur,{className:"h-16 w-full"},0),Array.from({length:3}).map((le,ye)=>a.jsx(Ur,{className:"h-48 w-full"},ye+1))]})}function iae({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:i="100px"}){const[c,u]=h.useState(e??""),[f,m]=h.useState(!1),[y,g]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{u(e??"")},[e]),h.useEffect(()=>{if(x.current&&f){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),v(x.current)}},[f]);const v=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},C=R=>{u(R.target.value),v(R.target)},S=async()=>{const R=c.trim();if(R===(e??"")){m(!1);return}try{g(!0),await t(R===""?null:R),m(!1)}catch(_){console.error("Failed to update description:",_),u(e??"")}finally{g(!1)}},w=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),S()):R.key==="Escape"&&(R.preventDefault(),u(e??""),m(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(Eo,{ref:x,value:c,onChange:C,onBlur:()=>void S(),onKeyDown:w,placeholder:r,className:se("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":y}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:i,minWidth:s},disabled:y}),a.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[a.jsxs("span",{children:["Press"," ",a.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 •"," "]}),a.jsxs("span",{children:[a.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 •"," "]}),a.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):a.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:a.jsx("div",{onClick:()=>{m(!0)},className:se("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 lae(){const{dataMart:e,updateDataMartDescription:t}=bs(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx(iae,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function B_(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 cae(e){if(Array.isArray(e))return e}function uae(e,t,n){return(t=yae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dae(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,c,u=[],f=!0,m=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(f=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(y){m=!0,s=y}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return u}}function fae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
804
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q_(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 K_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q_(Object(n),!0).forEach(function(r){uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hae(e,t){if(e==null)return{};var n,r,s=mae(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function mae(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 pae(e,t){return cae(e)||dae(e,t)||xae(e,t)||fae()}function gae(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 yae(e){var t=gae(e,"string");return typeof t=="symbol"?t:t+""}function xae(e,t){if(e){if(typeof e=="string")return B_(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)?B_(e,t):void 0}}function vae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z_(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 Y_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z_(Object(n),!0).forEach(function(r){vae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bae(){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,i){return i(s)},r)}}function Mf(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return t.apply(n,[].concat(s,u))}}}function Mg(e){return{}.toString.call(e).includes("Object")}function Sae(e){return!Object.keys(e).length}function oh(e){return typeof e=="function"}function Cae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wae(e,t){return Mg(t)||ll("changeType"),Object.keys(t).some(function(n){return!Cae(e,n)})&&ll("changeField"),t}function Eae(e){oh(e)||ll("selectorType")}function Rae(e){oh(e)||Mg(e)||ll("handlerType"),Mg(e)&&Object.values(e).some(function(t){return!oh(t)})&&ll("handlersType")}function jae(e){e||ll("initialIsRequired"),Mg(e)||ll("initialType"),Sae(e)&&ll("initialContent")}function Tae(e,t){throw new Error(e[t]||e.default)}var _ae={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"},ll=Mf(Tae)(_ae),Dp={changes:wae,selector:Eae,handler:Rae,initial:jae};function Nae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Dp.initial(e),Dp.handler(t);var n={current:e},r=Mf(Oae)(n,t),s=Mf(Dae)(n),i=Mf(Dp.changes)(e),c=Mf(Aae)(n);function u(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return Dp.selector(m),m(n.current)}function f(m){bae(r,s,i,c)(m)}return[u,f]}function Aae(e,t){return oh(t)?t(e.current):t}function Dae(e,t){return e.current=Y_(Y_({},e.current),t),t}function Oae(e,t,n){return oh(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 Iae={create:Nae},Mae={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function kae(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return t.apply(n,[].concat(s,u))}}}function Lae(e){return{}.toString.call(e).includes("Object")}function Pae(e){return e||W_("configIsRequired"),Lae(e)||W_("configType"),e.urls?(Uae(),{paths:{vs:e.urls.monacoBase}}):e}function Uae(){console.warn(q6.deprecation)}function zae(e,t){throw new Error(e[t]||e.default)}var q6={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!
|
|
805
|
-
You are using deprecated way of configuration.
|
|
806
|
-
|
|
807
|
-
Instead of using
|
|
808
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
809
|
-
use
|
|
810
|
-
monaco.config({ paths: { vs: '...' } })
|
|
811
|
-
|
|
812
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
813
|
-
`},W_=kae(zae)(q6),Fae={config:Pae},Hae=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(i,c){return c(i)},s)}};function K6(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],K6(e[n],t[n]))}),K_(K_({},e),t)}var $ae={type:"cancelation",msg:"operation is manually canceled"};function a1(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s($ae):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var Vae=["monaco"],Gae=Iae.create({config:Mae,isInitialized:!1,resolve:null,reject:null,monaco:null}),Z6=pae(Gae,2),Gh=Z6[0],Ky=Z6[1];function Bae(e){var t=Fae.config(e),n=t.monaco,r=hae(t,Vae);Ky(function(s){return{config:K6(s.config,r),monaco:n}})}function qae(){var e=Gh(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Ky({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),a1(s1);if(window.monaco&&window.monaco.editor)return Y6(window.monaco),e.resolve(window.monaco),a1(s1);Hae(Kae,Yae)(Wae)}return a1(s1)}function Kae(e){return document.body.appendChild(e)}function Zae(e){var t=document.createElement("script");return e&&(t.src=e),t}function Yae(e){var t=Gh(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=Zae("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Wae(){var e=Gh(function(n){var r=n.config,s=n.resolve,i=n.reject;return{config:r,resolve:s,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m||n;Y6(r),e.resolve(r)},function(n){e.reject(n)})}function Y6(e){Gh().monaco||Ky({monaco:e})}function Xae(){return Gh(function(e){var t=e.monaco;return t})}var s1=new Promise(function(e,t){return Ky({resolve:e,reject:t})}),W6={config:Bae,init:qae,__getMonacoInstance:Xae},Qae={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},o1=Qae,Jae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},ese=Jae;function tse({children:e}){return re.createElement("div",{style:ese.container},e)}var nse=tse,rse=nse;function ase({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:c}){return re.createElement("section",{style:{...o1.wrapper,width:e,height:t},...c},!n&&re.createElement(rse,null,r),re.createElement("div",{ref:s,style:{...o1.fullWidth,...!n&&o1.hide},className:i}))}var sse=ase,X6=h.memo(sse);function ose(e){h.useEffect(e,[])}var Q6=ose;function ise(e,t,n=!0){let r=h.useRef(!0);h.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var qa=ise;function $f(){}function ku(e,t,n,r){return lse(e,r)||cse(e,t,n,r)}function lse(e,t){return e.editor.getModel(J6(e,t))}function cse(e,t,n,r){return e.editor.createModel(t,n,r?J6(e,r):void 0)}function J6(e,t){return e.Uri.parse(t)}function use({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:y="Loading...",options:g={},height:x="100%",width:v="100%",className:C,wrapperProps:S={},beforeMount:w=$f,onMount:R=$f}){let[j,_]=h.useState(!1),[O,A]=h.useState(!0),D=h.useRef(null),T=h.useRef(null),I=h.useRef(null),k=h.useRef(R),F=h.useRef(w),G=h.useRef(!1);Q6(()=>{let H=W6.init();return H.then(M=>(T.current=M)&&A(!1)).catch(M=>(M==null?void 0:M.type)!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>D.current?Z():H.cancel()}),qa(()=>{if(D.current&&T.current){let H=D.current.getOriginalEditor(),M=ku(T.current,e||"",r||n||"text",i||"");M!==H.getModel()&&H.setModel(M)}},[i],j),qa(()=>{if(D.current&&T.current){let H=D.current.getModifiedEditor(),M=ku(T.current,t||"",s||n||"text",c||"");M!==H.getModel()&&H.setModel(M)}},[c],j),qa(()=>{let H=D.current.getModifiedEditor();H.getOption(T.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],j),qa(()=>{var H,M;(M=(H=D.current)==null?void 0:H.getModel())==null||M.original.setValue(e||"")},[e],j),qa(()=>{let{original:H,modified:M}=D.current.getModel();T.current.editor.setModelLanguage(H,r||n||"text"),T.current.editor.setModelLanguage(M,s||n||"text")},[n,r,s],j),qa(()=>{var H;(H=T.current)==null||H.editor.setTheme(m)},[m],j),qa(()=>{var H;(H=D.current)==null||H.updateOptions(g)},[g],j);let Y=h.useCallback(()=>{var V;if(!T.current)return;F.current(T.current);let H=ku(T.current,e||"",r||n||"text",i||""),M=ku(T.current,t||"",s||n||"text",c||"");(V=D.current)==null||V.setModel({original:H,modified:M})},[n,t,s,e,r,i,c]),B=h.useCallback(()=>{var H;!G.current&&I.current&&(D.current=T.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...g}),Y(),(H=T.current)==null||H.editor.setTheme(m),_(!0),G.current=!0)},[g,m,Y]);h.useEffect(()=>{j&&k.current(D.current,T.current)},[j]),h.useEffect(()=>{!O&&!j&&B()},[O,j,B]);function Z(){var M,V,$,oe;let H=(M=D.current)==null?void 0:M.getModel();u||((V=H==null?void 0:H.original)==null||V.dispose()),f||(($=H==null?void 0:H.modified)==null||$.dispose()),(oe=D.current)==null||oe.dispose()}return re.createElement(X6,{width:v,height:x,isEditorReady:j,loading:y,_ref:I,className:C,wrapperProps:S})}var dse=use;h.memo(dse);function fse(e){let t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}var hse=fse,Op=new Map;function mse({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:c="light",line:u,loading:f="Loading...",options:m={},overrideServices:y={},saveViewState:g=!0,keepCurrentModel:x=!1,width:v="100%",height:C="100%",className:S,wrapperProps:w={},beforeMount:R=$f,onMount:j=$f,onChange:_,onValidate:O=$f}){let[A,D]=h.useState(!1),[T,I]=h.useState(!0),k=h.useRef(null),F=h.useRef(null),G=h.useRef(null),Y=h.useRef(j),B=h.useRef(R),Z=h.useRef(),H=h.useRef(r),M=hse(i),V=h.useRef(!1),$=h.useRef(!1);Q6(()=>{let P=W6.init();return P.then(U=>(k.current=U)&&I(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>F.current?ge():P.cancel()}),qa(()=>{var U,z,X,W;let P=ku(k.current,e||r||"",t||s||"",i||n||"");P!==((U=F.current)==null?void 0:U.getModel())&&(g&&Op.set(M,(z=F.current)==null?void 0:z.saveViewState()),(X=F.current)==null||X.setModel(P),g&&((W=F.current)==null||W.restoreViewState(Op.get(i))))},[i],A),qa(()=>{var P;(P=F.current)==null||P.updateOptions(m)},[m],A),qa(()=>{!F.current||r===void 0||(F.current.getOption(k.current.editor.EditorOption.readOnly)?F.current.setValue(r):r!==F.current.getValue()&&($.current=!0,F.current.executeEdits("",[{range:F.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),F.current.pushUndoStop(),$.current=!1))},[r],A),qa(()=>{var U,z;let P=(U=F.current)==null?void 0:U.getModel();P&&s&&((z=k.current)==null||z.editor.setModelLanguage(P,s))},[s],A),qa(()=>{var P;u!==void 0&&((P=F.current)==null||P.revealLine(u))},[u],A),qa(()=>{var P;(P=k.current)==null||P.editor.setTheme(c)},[c],A);let oe=h.useCallback(()=>{var P;if(!(!G.current||!k.current)&&!V.current){B.current(k.current);let U=i||n,z=ku(k.current,r||e||"",t||s||"",U||"");F.current=(P=k.current)==null?void 0:P.editor.create(G.current,{model:z,automaticLayout:!0,...m},y),g&&F.current.restoreViewState(Op.get(U)),k.current.editor.setTheme(c),u!==void 0&&F.current.revealLine(u),D(!0),V.current=!0}},[e,t,n,r,s,i,m,y,g,c,u]);h.useEffect(()=>{A&&Y.current(F.current,k.current)},[A]),h.useEffect(()=>{!T&&!A&&oe()},[T,A,oe]),H.current=r,h.useEffect(()=>{var P,U;A&&_&&((P=Z.current)==null||P.dispose(),Z.current=(U=F.current)==null?void 0:U.onDidChangeModelContent(z=>{$.current||_(F.current.getValue(),z)}))},[A,_]),h.useEffect(()=>{if(A){let P=k.current.editor.onDidChangeMarkers(U=>{var X;let z=(X=F.current.getModel())==null?void 0:X.uri;if(z&&U.find(W=>W.path===z.path)){let W=k.current.editor.getModelMarkers({resource:z});O==null||O(W)}});return()=>{P==null||P.dispose()}}return()=>{}},[A,O]);function ge(){var P,U;(P=Z.current)==null||P.dispose(),x?g&&Op.set(i,F.current.saveViewState()):(U=F.current.getModel())==null||U.dispose(),F.current.dispose()}return re.createElement(X6,{width:v,height:C,isEditorReady:A,loading:f,_ref:G,className:S,wrapperProps:w})}var pse=mse,H2=h.memo(pse);function gse({initialValue:e,onChange:t}){const[n,r]=h.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=gd();h.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function i(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return a.jsx("div",{className:"shadow-xs",children:a.jsx(H2,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:i,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function Eb({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:i}){const c=e;return a.jsxs("div",{className:se("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",i),onClick:s,children:[a.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(c,{className:"h-6 w-6"})}),a.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[a.jsx("div",{className:"text-md font-medium",children:t}),n&&a.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&a.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:a.jsx(_a,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var X_=1,yse=.9,xse=.8,vse=.17,i1=.1,l1=.999,bse=.9999,Sse=.99,Cse=/[\\\/_+.#"@\[\(\{&]/,wse=/[\\\/_+.#"@\[\(\{&]/g,Ese=/[\s-]/,eI=/[\s-]/g;function Rb(e,t,n,r,s,i,c){if(i===t.length)return s===e.length?X_:Sse;var u=`${s},${i}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(i),m=n.indexOf(f,s),y=0,g,x,v,C;m>=0;)g=Rb(e,t,n,r,m+1,i+1,c),g>y&&(m===s?g*=X_:Cse.test(e.charAt(m-1))?(g*=xse,v=e.slice(s,m-1).match(wse),v&&s>0&&(g*=Math.pow(l1,v.length))):Ese.test(e.charAt(m-1))?(g*=yse,C=e.slice(s,m-1).match(eI),C&&s>0&&(g*=Math.pow(l1,C.length))):(g*=vse,s>0&&(g*=Math.pow(l1,m-s))),e.charAt(m)!==t.charAt(i)&&(g*=bse)),(g<i1&&n.charAt(m-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(m-1)!==r.charAt(i))&&(x=Rb(e,t,n,r,m+1,i+2,c),x*i1>g&&(g=x*i1)),g>y&&(y=g),m=n.indexOf(f,m+1);return c[u]=y,y}function Q_(e){return e.toLowerCase().replace(eI," ")}function Rse(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Rb(e,t,Q_(e),Q_(t),0,0,{})}var Rf='[cmdk-group=""]',c1='[cmdk-group-items=""]',jse='[cmdk-group-heading=""]',tI='[cmdk-item=""]',J_=`${tI}:not([aria-disabled="true"])`,jb="cmdk-item-select",Au="data-value",Tse=(e,t,n)=>Rse(e,t,n),nI=h.createContext(void 0),Bh=()=>h.useContext(nI),rI=h.createContext(void 0),$2=()=>h.useContext(rI),aI=h.createContext(void 0),sI=h.forwardRef((e,t)=>{let n=Du(()=>{var U,z;return{search:"",value:(z=(U=e.value)!=null?U:e.defaultValue)!=null?z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Du(()=>new Set),s=Du(()=>new Map),i=Du(()=>new Map),c=Du(()=>new Set),u=oI(e),{label:f,children:m,value:y,onValueChange:g,filter:x,shouldFilter:v,loop:C,disablePointerSelection:S=!1,vimBindings:w=!0,...R}=e,j=er(),_=er(),O=er(),A=h.useRef(null),D=Use();bc(()=>{if(y!==void 0){let U=y.trim();n.current.value=U,T.emit()}},[y]),bc(()=>{D(6,B)},[]);let T=h.useMemo(()=>({subscribe:U=>(c.current.add(U),()=>c.current.delete(U)),snapshot:()=>n.current,setState:(U,z,X)=>{var W,ae,J,le;if(!Object.is(n.current[U],z)){if(n.current[U]=z,U==="search")Y(),F(),D(1,G);else if(U==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(O);ye?ye.focus():(W=document.getElementById(j))==null||W.focus()}if(D(7,()=>{var ye;n.current.selectedItemId=(ye=Z())==null?void 0:ye.id,T.emit()}),X||D(5,B),((ae=u.current)==null?void 0:ae.value)!==void 0){let ye=z??"";(le=(J=u.current).onValueChange)==null||le.call(J,ye);return}}T.emit()}},emit:()=>{c.current.forEach(U=>U())}}),[]),I=h.useMemo(()=>({value:(U,z,X)=>{var W;z!==((W=i.current.get(U))==null?void 0:W.value)&&(i.current.set(U,{value:z,keywords:X}),n.current.filtered.items.set(U,k(z,X)),D(2,()=>{F(),T.emit()}))},item:(U,z)=>(r.current.add(U),z&&(s.current.has(z)?s.current.get(z).add(U):s.current.set(z,new Set([U]))),D(3,()=>{Y(),F(),n.current.value||G(),T.emit()}),()=>{i.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let X=Z();D(4,()=>{Y(),(X==null?void 0:X.getAttribute("id"))===U&&G(),T.emit()})}),group:U=>(s.current.has(U)||s.current.set(U,new Set),()=>{i.current.delete(U),s.current.delete(U)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:j,inputId:O,labelId:_,listInnerRef:A}),[]);function k(U,z){var X,W;let ae=(W=(X=u.current)==null?void 0:X.filter)!=null?W:Tse;return U?ae(U,n.current.search,z):0}function F(){if(!n.current.search||u.current.shouldFilter===!1)return;let U=n.current.filtered.items,z=[];n.current.filtered.groups.forEach(W=>{let ae=s.current.get(W),J=0;ae.forEach(le=>{let ye=U.get(le);J=Math.max(ye,J)}),z.push([W,J])});let X=A.current;H().sort((W,ae)=>{var J,le;let ye=W.getAttribute("id"),Ce=ae.getAttribute("id");return((J=U.get(Ce))!=null?J:0)-((le=U.get(ye))!=null?le:0)}).forEach(W=>{let ae=W.closest(c1);ae?ae.appendChild(W.parentElement===ae?W:W.closest(`${c1} > *`)):X.appendChild(W.parentElement===X?W:W.closest(`${c1} > *`))}),z.sort((W,ae)=>ae[1]-W[1]).forEach(W=>{var ae;let J=(ae=A.current)==null?void 0:ae.querySelector(`${Rf}[${Au}="${encodeURIComponent(W[0])}"]`);J==null||J.parentElement.appendChild(J)})}function G(){let U=H().find(X=>X.getAttribute("aria-disabled")!=="true"),z=U==null?void 0:U.getAttribute(Au);T.setState("value",z||void 0)}function Y(){var U,z,X,W;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ae=0;for(let J of r.current){let le=(z=(U=i.current.get(J))==null?void 0:U.value)!=null?z:"",ye=(W=(X=i.current.get(J))==null?void 0:X.keywords)!=null?W:[],Ce=k(le,ye);n.current.filtered.items.set(J,Ce),Ce>0&&ae++}for(let[J,le]of s.current)for(let ye of le)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=ae}function B(){var U,z,X;let W=Z();W&&(((U=W.parentElement)==null?void 0:U.firstChild)===W&&((X=(z=W.closest(Rf))==null?void 0:z.querySelector(jse))==null||X.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function Z(){var U;return(U=A.current)==null?void 0:U.querySelector(`${tI}[aria-selected="true"]`)}function H(){var U;return Array.from(((U=A.current)==null?void 0:U.querySelectorAll(J_))||[])}function M(U){let z=H()[U];z&&T.setState("value",z.getAttribute(Au))}function V(U){var z;let X=Z(),W=H(),ae=W.findIndex(le=>le===X),J=W[ae+U];(z=u.current)!=null&&z.loop&&(J=ae+U<0?W[W.length-1]:ae+U===W.length?W[0]:W[ae+U]),J&&T.setState("value",J.getAttribute(Au))}function $(U){let z=Z(),X=z==null?void 0:z.closest(Rf),W;for(;X&&!W;)X=U>0?Lse(X,Rf):Pse(X,Rf),W=X==null?void 0:X.querySelector(J_);W?T.setState("value",W.getAttribute(Au)):V(U)}let oe=()=>M(H().length-1),ge=U=>{U.preventDefault(),U.metaKey?oe():U.altKey?$(1):V(1)},P=U=>{U.preventDefault(),U.metaKey?M(0):U.altKey?$(-1):V(-1)};return h.createElement(Je.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:U=>{var z;(z=R.onKeyDown)==null||z.call(R,U);let X=U.nativeEvent.isComposing||U.keyCode===229;if(!(U.defaultPrevented||X))switch(U.key){case"n":case"j":{w&&U.ctrlKey&&ge(U);break}case"ArrowDown":{ge(U);break}case"p":case"k":{w&&U.ctrlKey&&P(U);break}case"ArrowUp":{P(U);break}case"Home":{U.preventDefault(),M(0);break}case"End":{U.preventDefault(),oe();break}case"Enter":{U.preventDefault();let W=Z();if(W){let ae=new Event(jb);W.dispatchEvent(ae)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:Fse},f),Zy(e,U=>h.createElement(rI.Provider,{value:T},h.createElement(nI.Provider,{value:I},U))))}),_se=h.forwardRef((e,t)=>{var n,r;let s=er(),i=h.useRef(null),c=h.useContext(aI),u=Bh(),f=oI(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;bc(()=>{if(!m)return u.item(s,c==null?void 0:c.id)},[m]);let y=iI(s,i,[e.value,e.children,i],e.keywords),g=$2(),x=pl(D=>D.value&&D.value===y.current),v=pl(D=>m||u.filter()===!1?!0:D.search?D.filtered.items.get(s)>0:!0);h.useEffect(()=>{let D=i.current;if(!(!D||e.disabled))return D.addEventListener(jb,C),()=>D.removeEventListener(jb,C)},[v,e.onSelect,e.disabled]);function C(){var D,T;S(),(T=(D=f.current).onSelect)==null||T.call(D,y.current)}function S(){g.setState("value",y.current,!0)}if(!v)return null;let{disabled:w,value:R,onSelect:j,forceMount:_,keywords:O,...A}=e;return h.createElement(Je.div,{ref:Xr(i,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!x,"data-disabled":!!w,"data-selected":!!x,onPointerMove:w||u.getDisablePointerSelection()?void 0:S,onClick:w?void 0:C},e.children)}),Nse=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...i}=e,c=er(),u=h.useRef(null),f=h.useRef(null),m=er(),y=Bh(),g=pl(v=>s||y.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);bc(()=>y.group(c),[]),iI(c,u,[e.value,e.heading,f]);let x=h.useMemo(()=>({id:c,forceMount:s}),[s]);return h.createElement(Je.div,{ref:Xr(u,t),...i,"cmdk-group":"",role:"presentation",hidden:g?void 0:!0},n&&h.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Zy(e,v=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},h.createElement(aI.Provider,{value:x},v))))}),Ase=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),i=pl(c=>!c.search);return!n&&!i?null:h.createElement(Je.div,{ref:Xr(s,t),...r,"cmdk-separator":"",role:"separator"})}),Dse=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=$2(),c=pl(m=>m.search),u=pl(m=>m.selectedItemId),f=Bh();return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(Je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":u,id:f.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||i.setState("search",m.target.value),n==null||n(m.target.value)}})}),Ose=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=h.useRef(null),c=h.useRef(null),u=pl(m=>m.selectedItemId),f=Bh();return h.useEffect(()=>{if(c.current&&i.current){let m=c.current,y=i.current,g,x=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let v=m.offsetHeight;y.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(g),x.unobserve(m)}}},[]),h.createElement(Je.div,{ref:Xr(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},Zy(e,m=>h.createElement("div",{ref:Xr(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),Ise=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:c,...u}=e;return h.createElement(ny,{open:n,onOpenChange:r},h.createElement(ry,{container:c},h.createElement(ay,{"cmdk-overlay":"",className:s}),h.createElement(sy,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(sI,{ref:t,...u}))))}),Mse=h.forwardRef((e,t)=>pl(n=>n.filtered.count===0)?h.createElement(Je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),kse=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return h.createElement(Je.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Zy(e,c=>h.createElement("div",{"aria-hidden":!0},c)))}),Sd=Object.assign(sI,{List:Ose,Item:_se,Input:Dse,Group:Nse,Separator:Ase,Dialog:Ise,Empty:Mse,Loading:kse});function Lse(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Pse(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function oI(e){let t=h.useRef(e);return bc(()=>{t.current=e}),t}var bc=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Du(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function pl(e){let t=$2(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function iI(e,t,n,r=[]){let s=h.useRef(),i=Bh();return bc(()=>{var c;let u=(()=>{var m;for(let y of n){if(typeof y=="string")return y.trim();if(typeof y=="object"&&"current"in y)return y.current?(m=y.current.textContent)==null?void 0:m.trim():s.current}})(),f=r.map(m=>m.trim());i.value(e,u,f),(c=t.current)==null||c.setAttribute(Au,u),s.current=u}),s}var Use=()=>{let[e,t]=h.useState(),n=Du(()=>new Map);return bc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function zse(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Zy({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(zse(t),{ref:t.ref},n(t.props.children)):n(t)}var Fse={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function lI({className:e,...t}){return a.jsx(Sd,{"data-slot":"command",className:se("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function cI({className:e,...t}){return a.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[a.jsx(jc,{className:"size-4 shrink-0 opacity-50"}),a.jsx(Sd.Input,{"data-slot":"command-input",className:se("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 Hse({className:e,...t}){return a.jsx(Sd.List,{"data-slot":"command-list",className:se("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function uI({...e}){return a.jsx(Sd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function dI({className:e,...t}){return a.jsx(Sd.Group,{"data-slot":"command-group",className:se("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 fI({className:e,...t}){return a.jsx(Sd.Item,{"data-slot":"command-item",className:se("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})}function $se(e){const t=Vse(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Bse);if(f){const m=f.props.children,y=u.map(g=>g===f?h.Children.count(m)>1?h.Children.only(null):h.isValidElement(m)?m.props.children:null:g);return a.jsx(t,{...c,ref:s,children:h.isValidElement(m)?h.cloneElement(m,void 0,y):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Vse(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Kse(s),u=qse(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Xr(r,c):c),h.cloneElement(s,u)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gse=Symbol("radix.slottable");function Bse(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gse}function qse(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...u)=>{const f=i(...u);return s(...u),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Kse(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 Yy="Popover",[hI]=Sr(Yy,[wo]),qh=wo(),[Zse,Il]=hI(Yy),mI=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!1}=e,u=qh(t),f=h.useRef(null),[m,y]=h.useState(!1),[g,x]=ia({prop:r,defaultProp:s??!1,onChange:i,caller:Yy});return a.jsx(dd,{...u,children:a.jsx(Zse,{scope:t,contentId:er(),triggerRef:f,open:g,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(v=>!v),[x]),hasCustomAnchor:m,onCustomAnchorAdd:h.useCallback(()=>y(!0),[]),onCustomAnchorRemove:h.useCallback(()=>y(!1),[]),modal:c,children:n})})};mI.displayName=Yy;var pI="PopoverAnchor",Yse=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(pI,n),i=qh(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=s;return h.useEffect(()=>(c(),()=>u()),[c,u]),a.jsx(fd,{...i,...r,ref:t})});Yse.displayName=pI;var gI="PopoverTrigger",yI=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(gI,n),i=qh(n),c=ht(t,s.triggerRef),u=a.jsx(Je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":CI(s.open),...r,ref:c,onClick:Ie(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(fd,{asChild:!0,...i,children:u})});yI.displayName=gI;var V2="PopoverPortal",[Wse,Xse]=hI(V2,{forceMount:void 0}),xI=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Il(V2,t);return a.jsx(Wse,{scope:t,forceMount:n,children:a.jsx(Vr,{present:n||i.open,children:a.jsx(_c,{asChild:!0,container:s,children:r})})})};xI.displayName=V2;var ad="PopoverContent",vI=h.forwardRef((e,t)=>{const n=Xse(ad,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Il(ad,e.__scopePopover);return a.jsx(Vr,{present:r||i.open,children:i.modal?a.jsx(Jse,{...s,ref:t}):a.jsx(eoe,{...s,ref:t})})});vI.displayName=ad;var Qse=$se("PopoverContent.RemoveScroll"),Jse=h.forwardRef((e,t)=>{const n=Il(ad,e.__scopePopover),r=h.useRef(null),s=ht(t,r),i=h.useRef(!1);return h.useEffect(()=>{const c=r.current;if(c)return ey(c)},[]),a.jsx(Ch,{as:Qse,allowPinchZoom:!0,children:a.jsx(bI,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;i.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),eoe=h.forwardRef((e,t)=>{const n=Il(ad,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(bI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,i),i.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),bI=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:y,...g}=e,x=Il(ad,n),v=qh(n);return Qg(),a.jsx(Sh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Tc,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:y,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:a.jsx(Eh,{"data-state":CI(x.open),role:"dialog",id:x.contentId,...v,...g,ref:t,style:{...g.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)"}})})})}),SI="PopoverClose",toe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Il(SI,n);return a.jsx(Je.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>s.onOpenChange(!1))})});toe.displayName=SI;var noe="PopoverArrow",roe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=qh(n);return a.jsx(Rh,{...s,...r,ref:t})});roe.displayName=noe;function CI(e){return e?"open":"closed"}var aoe=mI,soe=yI,ooe=xI,ioe=vI;function G2({...e}){return a.jsx(aoe,{"data-slot":"popover",...e})}function B2({...e}){return a.jsx(soe,{"data-slot":"popover-trigger",...e})}function q2({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(ooe,{children:a.jsx(ioe,{"data-slot":"popover-content",align:t,sideOffset:n,className:se("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 K2({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:i,disabled:c=!1}){const[u,f]=h.useState(!1),[m,y]=h.useState(""),g=h.useMemo(()=>{const C={};return e.forEach(S=>{const w=S.group??"";Object.prototype.hasOwnProperty.call(C,w)||(C[w]=[]),C[w].push(S)}),C},[e]),x=e.find(C=>C.value===t),v=h.useCallback(C=>{n(C),requestAnimationFrame(()=>{y(""),f(!1)})},[n]);return a.jsxs(G2,{open:u,onOpenChange:f,modal:!0,children:[a.jsx(B2,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":u,className:se("w-full justify-between",!t&&"text-muted-foreground",i),disabled:c,children:[x?x.label:r,a.jsx(rS,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(q2,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(lI,{children:[a.jsx(cI,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:y}),a.jsx(uI,{children:s}),Object.entries(g).map(([C,S])=>a.jsx(dI,{heading:C,children:S.map(w=>a.jsxs(fI,{value:w.value,onSelect:()=>{v(w.value)},keywords:[w.label],children:[a.jsx(oa,{className:se("mr-2 h-4 w-4",t===w.value?"opacity-100":"opacity-0")}),w.label]},w.value))},C||"default"))]})})]})}function loe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"service-account-details",children:[a.jsx(Zt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Yt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Assign the ",a.jsx("strong",{children:"bigquery.dataEditor"})," and ",a.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function coe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"project-id-details",children:[a.jsx(Zt,{children:"How do I find my Project ID?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),a.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),a.jsxs("li",{children:["Find your project in the list. The ",a.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),a.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function uoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"gbq-location-details",children:[a.jsx(Zt,{children:"How do I find my dataset location?"}),a.jsxs(Yt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),a.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),a.jsxs("li",{children:["Click each dataset name to open its details. The ",a.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",a.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),a.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."}),a.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const doe=({form:e})=>{const[t,n]=h.useState(!1);if(e.watch("type")!==Re.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},i=e.watch("credentials.serviceAccount"),c=i?C5(i):null;return a.jsxs(a.Fragment,{children:[a.jsxs(Yr,{title:"Connection Settings",children:[a.jsx(Nt,{control:e.control,name:"config.projectId",render:({field:u})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),a.jsx(wt,{children:a.jsx(It,{...u,placeholder:"Enter a Project Id"})}),a.jsx(xn,{children:a.jsx(coe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"config.location",render:({field:u})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),a.jsx(wt,{children:a.jsx(K2,{options:UX,value:u.value,onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(xn,{children:a.jsx(uoe,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Authentication",children:a.jsx(Nt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(wt,{children:!t&&c?a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(gn,{href:c.url,children:c.email})}),a.jsx(jt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Eo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(xn,{children:a.jsx(loe,{})}),a.jsx(Mt,{})]})})})]})};function foe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-region-details",children:[a.jsx(Zt,{children:"How do I find my Athena region?"}),a.jsxs(Yt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),a.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),a.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function hoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-output-bucket-details",children:[a.jsx(Zt,{children:"How do I find a bucket?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",a.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),a.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),a.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),a.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function moe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-access-key-id-details",children:[a.jsx(Zt,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(Yt,{children:[a.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."}),a.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",a.jsx(gn,{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"}),"."]}),a.jsx(lS,{className:"my-4"}),a.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),a.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function poe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-secret-access-key-details",children:[a.jsx(Zt,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(Yt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),a.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 goe=({form:e})=>{const[t,n]=h.useState("");return h.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")!==Re.AWS_ATHENA?null:a.jsxs(a.Fragment,{children:[a.jsxs(Yr,{title:"Connection Settings",children:[a.jsx(Nt,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),a.jsx(wt,{children:a.jsx(It,{...r,placeholder:"Enter a region"})}),a.jsx(xn,{children:a.jsx(foe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"config.outputBucket",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),a.jsx(wt,{children:a.jsx(It,{...r,placeholder:"Enter an output bucket"})}),a.jsx(xn,{children:a.jsx(hoe,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{title:"Authentication",children:[a.jsx(Nt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(wt,{children:a.jsx(It,{...r,placeholder:"Enter an access key id"})}),a.jsx(xn,{children:a.jsx(moe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(wt,{children:a.jsx(It,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(xn,{children:a.jsx(poe,{})}),a.jsx(Mt,{})]})})]})]})};function yoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-account-details",children:[a.jsx(Zt,{children:"How do I find my Snowflake account identifier?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To find the region and locator for your account, see"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/admin-account-identifier#finding-the-region-and-locator-for-an-account",children:"Snowflake documentation"}),"."]}),a.jsxs("ol",{className:"list-inside list-decimal space-y-3 text-sm",children:[a.jsx("li",{children:"Open the account selector and review the list of accounts that you previously signed in to."}),a.jsxs("li",{children:["Select ",a.jsx("strong",{children:"View account details"}),"."]}),a.jsxs("li",{children:["The ",a.jsx("strong",{children:"Account Details"})," dialog displays information about the account, including the account identifier and the account URL."]}),a.jsxs("li",{children:["Copy part of your account identifier from the ",a.jsx("strong",{children:"Account locator"})," field."]}),a.jsx("li",{children:"Find the region in the account selector (e.g. Europe West4 (Netherlands))."}),a.jsxs("li",{children:["Compare the found region with the ",a.jsx("strong",{children:"Account Identifier Region"})," in"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/admin-account-identifier#non-vps-account-locator-formats-by-cloud-platform-and-region",children:"Snowflake documentation"})," ","for locator formats by cloud platform and region."]}),a.jsxs("li",{children:["Create the account identifier by combining the locator and the region like this:"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"locator.region"}),a.jsxs("div",{className:"mt-2",children:["Examples:",a.jsxs("ul",{className:"mt-1 ml-4 space-y-1",children:[a.jsx("li",{children:a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"xy12345.ap-northeast-3.aws"})}),a.jsx("li",{children:a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"xy12345.north-europe.azure"})})]})]})]})]}),a.jsxs("div",{className:"mt-4 text-sm",children:["More details in"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",children:"OWOX Snowflake documentation"}),"."]})]})]})})}function xoe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-warehouse-details",children:[a.jsx(Zt,{children:"How do I find my Snowflake warehouse?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"A warehouse in Snowflake is a cluster of compute resources that executes queries and performs data loading operations."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your warehouse:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:'Log in to your Snowflake account and navigate to the "Warehouses" section in the left sidebar.'}),a.jsx("li",{children:`You'll see a list of available warehouses. Common default names include "COMPUTE_WH" or "PROD_WH".`}),a.jsx("li",{children:"Select the warehouse you want to use for this connection. Make sure it has the appropriate size and auto-suspend settings for your workload."}),a.jsx("li",{children:`If you don't have a warehouse, you can create one using the "Create Warehouse" button or run: CREATE WAREHOUSE my_warehouse;`})]})]})]})})}function voe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-auth-method-details",children:[a.jsx(Zt,{children:"Which authentication method should I choose?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"Snowflake supports two authentication methods for programmatic access:"}),a.jsxs("div",{className:"space-y-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("strong",{className:"font-medium",children:"Username & Password:"}),a.jsx("p",{className:"mt-1",children:"The simplest method using your Snowflake username and password. Suitable for development and testing environments."})]}),a.jsxs("div",{children:[a.jsx("strong",{className:"font-medium",children:"Key Pair Authentication:"}),a.jsx("p",{className:"mt-1",children:"More secure method using public/private key cryptography. Recommended for production environments. You'll need to generate an RSA key pair and assign the public key to your Snowflake user."}),a.jsxs("p",{className:"mt-1",children:["Learn more about"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"key pair authentication"}),"."]})]})]})]})]})})}function boe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-username-details",children:[a.jsx(Zt,{children:"How do I find my Snowflake username?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"Your Snowflake username is the login identifier for your Snowflake account."}),a.jsx("p",{className:"mb-2",children:"Here's what you need to know:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"Use the same username you use to log in to the Snowflake web interface."}),a.jsx("li",{children:"Snowflake usernames are case-insensitive and are typically in uppercase by default."}),a.jsx("li",{children:"If you're using SSO (Single Sign-On) for the web interface, you may need to create a separate user account with password authentication for programmatic access."}),a.jsx("li",{children:"You can view all users in your account by running: SHOW USERS; (requires appropriate privileges)"})]})]})]})})}function Soe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-password-details",children:[a.jsx(Zt,{children:"How do I manage my Snowflake password?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"Use the password associated with your Snowflake user account for authentication."}),a.jsx("p",{className:"mb-2",children:"Important security considerations:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"Your password must meet Snowflake's security requirements (minimum length, complexity, etc.)."}),a.jsx("li",{children:"If you've forgotten your password, a Snowflake administrator can reset it using: ALTER USER username SET PASSWORD = 'new_password';"}),a.jsxs("li",{children:["For production environments, consider using"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Key-Pair authentication"})," ","instead of passwords for enhanced security."]}),a.jsx("li",{children:"Your password is encrypted and securely stored. It will never be displayed in plain text after saving."})]})]})]})})}function Coe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-keypair-details",children:[a.jsx(Zt,{children:"How do I set up key pair authentication?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"To use key pair authentication, you need to generate an RSA key pair and configure your Snowflake user."}),a.jsx("p",{className:"mb-2",children:"Here's how to set it up:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Generate an RSA key pair using OpenSSL:",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt"})]}),a.jsxs("li",{children:["Extract the public key:",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub"})]}),a.jsxs("li",{children:["Assign the public key to your Snowflake user (run this in Snowflake as ACCOUNTADMIN):",a.jsx("pre",{className:"mt-1 rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",children:"ALTER USER your_username SET RSA_PUBLIC_KEY='MIIBIjANBg...';"})]}),a.jsx("li",{children:"Copy the private key content from rsa_key.p8 and paste it in the Private Key field above."})]}),a.jsxs("p",{className:"mt-2 text-xs",children:["For more details, see"," ",a.jsx(gn,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Snowflake's key pair authentication documentation"}),"."]})]})]})})}function woe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"snowflake-passphrase-details",children:[a.jsx(Zt,{children:"What is a passphrase and when do I need it?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"A passphrase is an optional encryption password that protects your private key."}),a.jsx("p",{className:"mb-2",children:"Here's what you need to know:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-2 text-sm",children:[a.jsx("li",{children:"If you generated your private key with a passphrase (encrypted key), you must provide it here."}),a.jsx("li",{children:"If your private key is not encrypted (generated without the -nocrypt flag), leave this field empty."}),a.jsx("li",{children:"When generating an encrypted key with OpenSSL, you set the passphrase during the key generation process."}),a.jsx("li",{children:"The passphrase adds an extra layer of security by encrypting the private key file itself."}),a.jsx("li",{children:"This passphrase is only used to decrypt the private key and is never sent to Snowflake."})]})]})]})})}const Eoe=({form:e})=>{const t=e.watch("credentials.authMethod");return e.watch("type")!==Re.SNOWFLAKE?null:a.jsxs(a.Fragment,{children:[a.jsxs(Yr,{title:"Connection Settings",children:[a.jsx(Nt,{control:e.control,name:"config.account",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter your Snowflake account identifier",children:"Account"}),a.jsx(wt,{children:a.jsx(It,{...n,placeholder:"e.g., xy12345.us-east-1"})}),a.jsx(xn,{children:a.jsx(yoe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"config.warehouse",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Specify the Snowflake warehouse to use for query execution",children:"Warehouse"}),a.jsx(wt,{children:a.jsx(It,{...n,placeholder:"Enter warehouse name"})}),a.jsx(xn,{children:a.jsx(xoe,{})}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{title:"Authentication",children:[a.jsx(Nt,{control:e.control,name:"credentials.authMethod",render:({field:n})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{children:"Authentication Method"}),a.jsx(_2,{value:n.value,onValueChange:n.onChange,children:a.jsxs(N2,{children:[a.jsx(sh,{value:Ps.PASSWORD,children:"Username & Password"}),a.jsx(sh,{value:Ps.KEY_PAIR,children:"Key Pair"})]})})]}),a.jsx(xn,{children:a.jsx(voe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"credentials.username",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your Snowflake username",children:"Username"}),a.jsx(wt,{children:a.jsx(It,{...n,placeholder:"Enter username"})}),a.jsx(xn,{children:a.jsx(boe,{})}),a.jsx(Mt,{})]})}),t===Ps.PASSWORD&&a.jsx(Nt,{control:e.control,name:"credentials.password",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Your Snowflake password",children:"Password"}),a.jsx(wt,{children:a.jsx(It,{...n,type:"password",placeholder:"Enter password"})}),a.jsx(xn,{children:a.jsx(Soe,{})}),a.jsx(Mt,{})]})}),t===Ps.KEY_PAIR&&a.jsxs(a.Fragment,{children:[a.jsx(Nt,{control:e.control,name:"credentials.privateKey",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Paste your private key in PEM format",children:"Private Key"}),a.jsx(wt,{children:a.jsx(Eo,{...n,placeholder:`-----BEGIN PRIVATE KEY-----
|
|
814
|
-
...
|
|
815
|
-
-----END PRIVATE KEY-----`,rows:6})}),a.jsx(xn,{children:a.jsx(Coe,{})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:e.control,name:"credentials.privateKeyPassphrase",render:({field:n})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Enter the passphrase if your private key is encrypted",children:"Passphrase (Optional)"}),a.jsx(wt,{children:a.jsx(It,{...n,type:"password",value:n.value??"",placeholder:"Enter passphrase if key is encrypted"})}),a.jsx(xn,{children:a.jsx(woe,{})}),a.jsx(Mt,{})]})})]})]})]})},Roe=()=>a.jsx(a.Fragment,{children:a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,className:"mt-2",children:a.jsxs(Kt,{value:"snowflake-setup",children:[a.jsx(Zt,{children:"How do I get started with Snowflake?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"To use Snowflake as your storage provider, you'll need an active Snowflake account with appropriate permissions."}),a.jsx("p",{className:"mb-2",children:"Here's how to get started:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Sign up for a"," ",a.jsx(gn,{className:"underline",href:"https://signup.snowflake.com/",children:"Snowflake account"})," ","if you don't have one yet."]}),a.jsx("li",{children:"Make sure you have the necessary privileges to create and access databases, schemas, and warehouses."}),a.jsx("li",{children:"Choose your authentication method: Username & Password for quick setup, or Key-Pair authentication for production environments."}),a.jsx("li",{children:"Fill in the connection details below (account identifier and warehouse)."}),a.jsx("li",{children:"You can access tables using the full path format: database.schema.table (similar to BigQuery and Athena)."})]})]})]})})});function joe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"bigquery-api-details",children:[a.jsx(Zt,{children:"How do I enable the BigQuery API?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx(gn,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function Toe(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"athena-api-details",children:[a.jsx(Zt,{children:"How do I activate Athena API?"}),a.jsxs(Yt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(gn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),a.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),a.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function _oe({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Ro({resolver:yi(cQ),defaultValues:e}),{watch:i,control:c,formState:{isDirty:u,isSubmitting:f}}=s,m=i("type");re.useEffect(()=>{r==null||r(u)},[u,r]);const y=async g=>{const{dirtyFields:x}=s.formState,v=S5(g);return x.credentials||delete v.credentials,t(v)};return a.jsx(_l,{...s,children:a.jsxs(gi,{onSubmit:g=>{s.handleSubmit(y)(g)},noValidate:!0,children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:c,name:"title",render:({field:g})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),a.jsx(wt,{children:a.jsx(It,{...g,placeholder:"Storage title"})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:c,name:"type",render:({field:g})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),a.jsx(wt,{children:a.jsxs(ua,{value:g.value,onValueChange:g.onChange,disabled:!!e,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a storage type"})}),a.jsx(ha,{children:a.jsx(Hy,{children:Sl.getAllTypes().map(({type:x,displayName:v,icon:C,status:S})=>a.jsx(Bn,{value:x,disabled:S===Xo.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(C,{size:20}),v]})},x))})})]})}),a.jsxs(xn,{children:[m===Re.GOOGLE_BIGQUERY&&a.jsx(joe,{}),m===Re.AWS_ATHENA&&a.jsx(Toe,{}),m===Re.SNOWFLAKE&&a.jsx(Roe,{})]}),a.jsx(Mt,{})]})})]}),m===Re.GOOGLE_BIGQUERY&&a.jsx(doe,{form:s}),m===Re.AWS_ATHENA&&a.jsx(goe,{form:s}),m===Re.SNOWFLAKE&&a.jsx(Eoe,{form:s})]}),a.jsxs(Mc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!u||f,children:"Save"}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function kc(e){const[t,n]=h.useState(!1),[r,s]=h.useState(!1),i=h.useCallback(()=>{r?n(!0):e()},[r,e]),c=h.useCallback(()=>{n(!1),s(!1),e()},[e]),u=h.useCallback(m=>{s(m)},[]),f=h.useCallback(()=>{s(!1),e()},[e]);return{showUnsavedDialog:t,setShowUnsavedDialog:n,isDirty:r,handleClose:i,confirmClose:c,handleFormDirtyChange:u,handleFormSubmitSuccess:f}}function wI({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=$y();Ol(e);const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=kc(t),g=async v=>{if(n){const C=await s(n.id,v);C&&(r(C),y())}},x=h.useRef(!1);return h.useEffect(()=>{const v=n?"Edit":"Create";e&&!x.current?(Le({event:"data_storage_config_open",category:"DataStorage",action:v,label:n==null?void 0:n.type}),x.current=!0):!e&&x.current&&(Le({event:"data_storage_config_close",category:"DataStorage",action:v,label:n==null?void 0:n.type}),x.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:v=>{v||u()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:"Configure Storage Provider"}),a.jsx(yl,{children:"Customize settings for your storage provider"})]}),a.jsx(_oe,{initialData:n??void 0,onSubmit:g,onCancel:u,onDirtyChange:m})]})}),a.jsx(br,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const Noe=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=h.useState(!1),s=Sl.getInfo(e.type),i=()=>{r(!0)},c=()=>{r(!1)},u=()=>{if(!c5(e))return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(bh,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(g,x)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),y=(g,x,v)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx(gn,{href:v,onClick:C=>{C.stopPropagation()},children:x})]});switch(e.type){case Re.GOOGLE_BIGQUERY:{const g=e.config.projectId,x=e.config.location,v=`https://console.cloud.google.com/bigquery?project=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[y("Project ID",g,v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",x)]})}case Re.AWS_ATHENA:{const g=e.config.region,x=e.config.outputBucket,v=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",g),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Bucket",x,v)]})}case Re.SNOWFLAKE:{const g=e.config.account,x=e.config.warehouse;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[y("Account",g,"https://app.snowflake.com/"),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Warehouse",x)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(Eb,{title:e.title,icon:s.icon,subtitle:u(),onClick:i}),a.jsx(j2,{children:a.jsx(wI,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function Aoe({initialType:e,onTypeSelect:t}){var c;const[n,r]=h.useState(e??null);h.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const s=u=>{r(u),t(u)},i=[{type:$e.SQL,label:"SQL",description:"SQL query"},{type:$e.TABLE,label:"Table",description:"Existing table"},{type:$e.VIEW,label:"View",description:"Existing view"},{type:$e.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:$e.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return a.jsxs("div",{className:"dm-card-block",children:[a.jsx(Ta,{className:"text-foreground",children:"Definition Type"}),a.jsxs(ua,{value:n??"",onValueChange:u=>{s(u)},children:[a.jsx(fa,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:a.jsx(da,{placeholder:"Select definition type",children:n&&((c=i.find(u=>u.type===n))==null?void 0:c.label)})}),a.jsx(ha,{children:a.jsx(Hy,{children:i.map(u=>a.jsxs(Bn,{value:u.type,children:[u.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:u.description})]},u.type))})})]})]})}const Doe=rn({definitionType:Gr($e.SQL),definition:rn({sqlQuery:Dt().min(1,"SQL query is required")})}),Ooe=e=>{const t=A5(e);return rn({definitionType:Gr($e.TABLE),definition:t})},Ioe=e=>{const t=A5(e);return rn({definitionType:Gr($e.VIEW),definition:t})},Moe=e=>{const t=RJ(e);return rn({definitionType:Gr($e.TABLE_PATTERN),definition:t})},koe=rn({definitionType:Gr($e.CONNECTOR),definition:rn({connector:rn({source:rn({name:Dt().min(1,"Connector name is required"),configuration:eb(fY(uY())).min(1,"At least one configuration is required"),node:Dt().min(1,"Node is required"),fields:eb(Dt()).min(1,"At least one field is required")}),storage:rn({fullyQualifiedName:Dt().min(1,"fully qualified name is required")})})})}),Loe=(e,t)=>{if(!e)return rn({definitionType:hY(Ey($e)),definition:rn({}).optional()});switch(e){case $e.SQL:return Doe;case $e.TABLE:return Ooe(t);case $e.VIEW:return Ioe(t);case $e.TABLE_PATTERN:return Moe(t);case $e.CONNECTOR:return koe;default:return rn({})}};function Poe({control:e}){return a.jsx(Nt,{control:e,name:"definition.sqlQuery",render:({field:t})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{className:"text-foreground",children:"SQL Query"}),a.jsx(wt,{children:a.jsx(gse,{initialValue:t.value?{sqlQuery:t.value}:void 0,onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(Mt,{})]})})}function Uoe({control:e,storageType:t}){const n=f5(t),r=h5(t);return a.jsx(Nt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Fully Qualified Table Name"}),a.jsx(wt,{children:a.jsx(It,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function zoe({control:e,storageType:t}){const n=f5(t),r=h5(t);return a.jsx(Nt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Fully Qualified View Name"}),a.jsx(wt,{children:a.jsx(It,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}function Foe({control:e,storageType:t}){const n=gQ(t),r=yQ(t);return a.jsx(Nt,{control:e,name:"definition.pattern",render:({field:s})=>a.jsxs(xt,{className:"dm-card-block",children:[a.jsx(yt,{children:"Table Pattern"}),a.jsx(wt,{children:a.jsx(It,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(xn,{className:"text-muted-foreground/75",children:r}),a.jsx(Mt,{})]})})}const Z2=e=>{switch(e){case $e.SQL:return{sqlQuery:""};case $e.TABLE:return{fullyQualifiedName:""};case $e.VIEW:return{fullyQualifiedName:""};case $e.TABLE_PATTERN:return{pattern:""};case $e.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},Hoe=Ec("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 Y2({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:se(Hoe({variant:t}),e),...n})}function EI({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:se("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function W2({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:se("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function $oe({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:i}){return n?a.jsx(k2,{variant:"grid"}):r?a.jsxs(Y2,{variant:"destructive",children:[a.jsx(xh,{className:"h-4 w-4"}),a.jsx(W2,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(ni,{children:[a.jsx(al,{title:"Choose Connector",children:a.jsx(Ire,{children:e.map(c=>a.jsx(Mre,{icon:c.logoBase64?a.jsx(Ac,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),i==null||i(c)}},c.name))})}),e.length===0&&a.jsx(ti,{icon:a.jsx(Yf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function Voe({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:i,onBack:c,onFinish:u,nextLabel:f="Next",backLabel:m="Back",finishLabel:y="Save"}){const g=e===t;return t===1?a.jsx("div",{className:"w-full",children:a.jsx(we,{className:"w-full",variant:"default",onClick:u,disabled:!n||s,children:y})}):a.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[a.jsx("div",{className:"flex-1",children:r&&a.jsxs(we,{variant:"outline",onClick:c,disabled:s,children:[a.jsx(kP,{className:"h-4 w-4"}),m]})}),a.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),a.jsx("div",{className:"flex flex-1 justify-end",children:g?a.jsx(we,{variant:"default",onClick:u,disabled:!n||s,children:y}):a.jsxs(we,{variant:"default",onClick:i,disabled:!n||s,children:[f,a.jsx(_a,{className:"h-4 w-4"})]})})]})}function ic({connector:e,size:t=24,variant:n="compact"}){return a.jsx(ti,{icon:a.jsx(Ac,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function Gu({label:e}){return a.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(ai,{className:"h-4 w-4"})]})})})}const Tb="**********";function Goe({specification:e,configuration:t,onValueChange:n}){const{name:r,title:s}=e,i=s??r,c=r;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(It,{type:"checkbox",id:c,name:r,checked:t[r]||!1,onChange:u=>{n(r,u.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),a.jsx(Ta,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(Ba,{htmlFor:c,required:e.required,tooltip:e.description,children:i})})]})}function Boe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(It,{id:r,name:r,type:"number",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{const u=c.target.value,f=u===""?void 0:parseFloat(u);n(r,f)}})}function qoe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name;return a.jsx(Eo,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
816
|
-
`):Array.isArray(i)?i.join(`
|
|
817
|
-
`):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:u=>{const f=u.target.value.split(`
|
|
818
|
-
`).filter(m=>m.trim());n(r,f)}})}function Koe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name,u=f=>{if(!f||typeof f!="string"&&typeof f!="number")return"";const m=typeof f=="string"?f:f.toString();try{const y=new Date(m);return isNaN(y.getTime())?"":y.toISOString().split("T")[0]}catch{return""}};return a.jsx(It,{id:r,name:r,type:"date",value:t[r]||u(i)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function Zoe({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(It,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function Yoe({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:i,default:c}=e;return a.jsx(Eo,{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:i??`Enter ${r.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:u=>{try{const f=JSON.parse(u.target.value);n(s,f)}catch{n(s,u.target.value)}}})}function Woe({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const i=e.title??e.name,c=r&&!s;return a.jsx(It,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?Tb:t[e.name]||"",...c?{readOnly:!0,disabled:!0}:{},...c?{}:{placeholder:e.placeholder??`Enter ${i.toLowerCase()}`},...c?{}:{onChange:u=>{n(e.name,u.target.value)}}})}function Xoe({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:s,placeholder:i,default:c}=e,u=e.title??e.name,f=r.map(m=>({value:m,label:m}));return a.jsx(K2,{options:f,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:i??`Select ${u.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function Qoe(){const e=h.useRef(new zf),t=h.useCallback(async(s,i,c)=>await e.current.exchangeCredentials(s,{fieldPath:c,payload:i}),[]),n=h.useCallback(async(s,i)=>{try{return await e.current.checkOAuthStatus(s,i)}catch{return{valid:!1}}},[]),r=h.useCallback(async(s,i)=>await e.current.getOAuthSettings(s,i),[]);return{exchangeCredentials:t,checkStatus:n,getSettings:r}}let jf=null;function Joe({appId:e,scope:t,onSuccess:n,onError:r,disabled:s=!1,children:i}){const[c,u]=h.useState(!1),[f,m]=h.useState(!1),[y,g]=h.useState(null);h.useEffect(()=>{if(window.FB){m(!0);return}if(document.getElementById("facebook-jssdk")){const w=setInterval(()=>{window.FB&&(m(!0),clearInterval(w))},100);return()=>{clearInterval(w)}}if(!e)return;if(jf&&jf!==e){console.warn("Facebook SDK already initialized with different appId");return}jf??(jf=e),window.fbAsyncInit=function(){window.FB&&jf&&(window.FB.init({appId:jf,cookie:!0,xfbml:!0,version:"v23.0"}),m(!0))};const S=document.createElement("script");S.id="facebook-jssdk",S.src="https://connect.facebook.net/en_US/sdk.js",S.async=!0,S.defer=!0,S.crossOrigin="anonymous",document.body.appendChild(S)},[e]);const x=()=>{if(!window.FB||!f){const S=new Error("Facebook SDK not loaded or not ready");g(S.message),r==null||r(S);return}u(!0),g(null),window.FB.login(S=>{var w;if(S.status==="connected"&&S.authResponse){const{accessToken:R,expiresIn:j,userID:_}=S.authResponse;(w=window.FB)==null||w.api("/me?fields=name,email",O=>{const A={accessToken:R,expiresIn:j,userID:_,userName:O.name,userEmail:O.email};n(A),u(!1)})}else{const R=new Error("User cancelled login or did not fully authorize");g(R.message),r==null||r(R),u(!1)}},{scope:t})},v=s||c||!f,C=()=>c?"Connecting...":i||(f?"Continue with Facebook":"Loading...");return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(we,{type:"button",onClick:x,disabled:v,className:"flex items-center justify-center gap-2 rounded-md border-none bg-[#1877F2] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#166FE5] disabled:cursor-not-allowed disabled:opacity-60",children:[a.jsx("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"})}),C()]}),y&&a.jsx("div",{className:"mt-1 text-xs text-red-600",children:y})]})}function eie({isLoading:e,status:t,settings:n,onOAuthSuccess:r}){const s=i=>{r({accessToken:i.accessToken})};return a.jsx("div",{className:"mt-2 mb-2",children:a.jsx(Joe,{appId:n==null?void 0:n.vars.AppId,scope:n==null?void 0:n.vars.Scopes,onSuccess:s,disabled:e,children:t!=null&&t.user?a.jsxs(a.Fragment,{children:["Authenticated as ",a.jsx("strong",{children:t.user.name??t.user.id})]}):"Continue with Facebook"})})}function RI({specification:e,option:t,configuration:n,onValueChange:r,connectorName:s,onSecretEditToggle:i,secretEditing:c={},isEditingExisting:u=!1}){const[f,m]=h.useState(!1),[y,g]=h.useState(null),[x,v]=h.useState(null),[C,S]=h.useState(null),w=h.useMemo(()=>{const B=n[e.name],Z=t!=null&&t.value&&B?B[t.value]:B;return Z==null?void 0:Z._source_credential_id},[n,e.name,t==null?void 0:t.value]),R=h.useMemo(()=>t?`${e.name}.${t.value}`:e.name,[e.name,t]),j=h.useMemo(()=>{const B=n[e.name];if(t!=null&&t.value&&B){const Z=B[t.value];return Z&&typeof Z=="object"&&!Array.isArray(Z)?Z:{}}return B&&typeof B=="object"&&!Array.isArray(B)?B:{}},[n,e.name,t==null?void 0:t.value]),_=h.useMemo(()=>{const B=j;return"_source_credential_id"in B?!1:!!(t!=null&&t.items&&Object.keys(t.items).some(H=>H in B&&B[H]!==void 0&&B[H]!==""))},[j,t]),[O,A]=h.useState(_);h.useEffect(()=>{const B="_source_credential_id"in j,Z=(t==null?void 0:t.items)&&Object.keys(t.items).some(H=>H in j&&j[H]!==void 0&&j[H]!=="");B&&O?A(!1):Z&&!O&&A(!0)},[j,t,O]);const D=(B,Z)=>{if(!(t!=null&&t.value))return;const H=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...H,[t.value]:{...typeof H[t.value]=="object"&&H[t.value]!==null?H[t.value]:{},[B]:Z}})},{checkStatus:T,getSettings:I,exchangeCredentials:k}=Qoe(),F=async B=>{try{m(!0),S(null);const Z=await k(s,B,R),H=n[e.name];t?r(e.name,{...H,[t.value]:{_source_credential_id:Z.credentialId}}):r(e.name,{_source_credential_id:Z.credentialId})}catch(Z){const H=Z instanceof Error?Z.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",Z),S(H)}finally{m(!1)}};h.useEffect(()=>{if(!w){g(null),m(!1);return}let B=!1;return(async()=>{try{m(!0);const H=await T(s,w);B||g(H)}catch(H){B||(console.error("Failed to validate credentials:",H),g({valid:!1}))}finally{B||m(!1)}})(),()=>{B=!0}},[w,s,T]),h.useEffect(()=>{(async()=>{try{const Z=await I(s,R);v(Z)}catch(Z){console.error("Failed to fetch settings:",Z),v(null)}})()},[s,R,I]);const G=!!(x!=null&&x.isEnabled);if((O||!G)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([B,Z])=>{const H=Array.isArray(Z.attributes)?Z.attributes.includes("SECRET")&&j[B]!==void 0:!1,M=c[e.name]??!1;return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ba,{htmlFor:B,required:Z.required,tooltip:Z.description,className:"mb-2 justify-start",children:Z.title??B}),H&&u&&i&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!M)},children:M?"Cancel":"Edit"})]}),X2({specification:{...Z,name:B},configuration:j,onValueChange:(V,$)=>{D(V,$)},flags:{isEditingExisting:u,isSecret:H,isSecretEditing:M},connectorName:s})]},B)}),G&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!1),m(!1)},className:"px-0",children:"Back to OAuth"})]});const Y=(()=>{switch(s){case"FacebookMarketing":return a.jsx(eie,{isLoading:f,status:y,settings:x,onOAuthSuccess:F});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[Y,C&&a.jsx("div",{className:"text-destructive text-sm",children:C}),(t==null?void 0:t.items)&&Object.keys(t.items).length>0&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!0)},className:"px-0",children:"Manually"})]})}function X2({specification:e,configuration:t,onValueChange:n,flags:r,connectorName:s}){const{requiredType:i,options:c}=e,{isSecret:u=!1,isEditingExisting:f=!1,isSecretEditing:m=!1}=r??{};if(e.attributes&&Array.isArray(e.attributes)&&e.attributes.includes("OAUTH_FLOW"))return a.jsx(RI,{specification:e,configuration:t,onValueChange:n,connectorName:s});if(u)return a.jsx(Woe,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:m});if(c&&c.length>0)return a.jsx(Xoe,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(i){case Os.BOOLEAN:return a.jsx(Goe,{specification:e,configuration:t,onValueChange:n});case Os.NUMBER:return a.jsx(Boe,{specification:e,configuration:t,onValueChange:n});case Os.ARRAY:return a.jsx(qoe,{specification:e,configuration:t,onValueChange:n});case Os.OBJECT:return a.jsx(Yoe,{specification:e,configuration:t,onValueChange:n});case Os.DATE:return a.jsx(Koe,{specification:e,configuration:t,onValueChange:n});case Os.STRING:default:return a.jsx(Zoe,{specification:e,configuration:t,onValueChange:n})}}function tie({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:i,onSecretEditToggle:c,connectorName:u}){return a.jsxs(Gi,{children:[e.requiredType!==Os.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ba,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),X2({specification:e,configuration:t,onValueChange:i,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r},connectorName:u})]},e.name)}function nie({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:i,connectorName:c}){const u=h.useMemo(()=>{var v,C;const x=t[e.name];if(x&&typeof x=="object"){const S=Object.keys(x);if(S.length>0)return S[0]}return((C=(v=e.oneOf)==null?void 0:v[0])==null?void 0:C.value)??""},[t,e.name,e.oneOf]),[f,m]=h.useState(u);if(h.useEffect(()=>{m(u)},[u]),h.useEffect(()=>{if(f){const x=t[e.name];x&&typeof x=="object"&&f in x||n(e.name,{[f]:{}})}},[f,e.name]),!e.oneOf)return null;const y=x=>{m(x)},g=(x,v,C)=>{const S=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[x]:{...typeof S[x]=="object"&&S[x]!==null?S[x]:{},[v]:C}})};return a.jsx(Ore,{label:e.title??e.name,options:e.oneOf.map(x=>({value:x.value,label:x.label})),value:f,onValueChange:y,children:e.oneOf.map(x=>{const v=x.attributes&&Array.isArray(x.attributes)&&x.attributes.includes("OAUTH_FLOW");return a.jsx(bre,{value:x.value,children:v?a.jsx(RI,{specification:e,option:x,configuration:t,onValueChange:n,connectorName:c,onSecretEditToggle:i,secretEditing:{[e.name]:s},isEditingExisting:r}):Object.entries(x.items).map(([C,S])=>{const w=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},R=Array.isArray(S.attributes)&&Object.keys(w)[0]===x.value?S.attributes.includes("SECRET"):!1,j=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},_=typeof j[x.value]=="object"&&j[x.value]!==null?j[x.value]:{};return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ba,{htmlFor:C,required:S.required,tooltip:S.description,className:"mb-2 justify-start",children:C}),R&&r&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!s)},children:s?"Cancel":"Edit"})]}),X2({specification:{...S,name:C},configuration:_,onValueChange:(O,A)=>{g(x.value,O,A)},flags:{isEditingExisting:r,isSecret:R,isSecretEditing:s},connectorName:c})]},C)})},x.value)})},e.name)}function eN(e,t,n,r,s,i,c){return e.map(u=>{const f=Array.isArray(u.attributes)?u.attributes.includes("SECRET"):!1,m=s[u.name];return u.oneOf&&u.requiredType===Os.OBJECT?a.jsx(nie,{specification:u,configuration:t,onValueChange:n,isEditingExisting:i,isSecretEditing:m,onSecretEditToggle:r,connectorName:c},u.name):a.jsx(tie,{specification:u,configuration:t,isEditingExisting:i,isSecret:f,isSecretEditing:m,onValueChange:n,onSecretEditToggle:r,connectorName:c},u.name)})}function tN({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:i,isEditingExisting:c,connectorName:u}){return e?a.jsx(A6,{title:e,children:eN(t,n,r,s,i,c,u)}):eN(t,n,r,s,i,c,u)}function rie({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=h.useState([]),[i,c]=h.useState(!1),[u,f]=h.useState(!1),m=h.useCallback(async()=>{c(!0);try{const x=await Tn.getDataMartsByConnectorName(e);s(x)}catch{s([])}finally{c(!1)}},[e]);h.useEffect(()=>{u&&m()},[u,m]);const y=(x,v)=>{const C=v._id;if(!C){console.error("Configuration does not have _id field");return}t({dataMartId:x.id,dataMartTitle:x.title,configId:C,configuration:v}),f(!1)},g=x=>{const C=[],S=R=>{if(!n)return!0;const j=n.find(_=>_.name===R);return(j==null?void 0:j.required)??!1},w=(R,j,_=0,O=!0)=>{if(R.startsWith("_")||O&&_===0&&!S(R))return;let A=null;if(j==null)A="N/A";else if(typeof j=="string")A=j;else if(typeof j=="number"||typeof j=="boolean")A=String(j);else if(Array.isArray(j))A=JSON.stringify(j);else if(typeof j=="object"){C.push({key:R,value:"{",indent:_}),Object.entries(j).forEach(([D,T])=>{w(D,T,_+1,!1)}),C.push({key:"",value:"}",indent:_});return}else A=JSON.stringify(j);C.push({key:R,value:A,indent:_})};for(const[R,j]of Object.entries(x))w(R,j);return a.jsx("div",{className:"space-y-1 font-mono text-xs",children:C.map(({key:R,value:j,indent:_},O)=>a.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&a.jsxs("span",{className:"font-medium",children:[R,":"]}),a.jsx("span",{className:"text-muted-foreground truncate",title:j,children:j})]},O))})};return a.jsx(Ya,{children:a.jsxs(Cr,{open:u,onOpenChange:f,children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),a.jsx(_a,{className:se("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",u&&"rotate-90")})]})}),a.jsx(Er,{side:"bottom",align:"end",className:"w-72",children:i?a.jsx(vt,{disabled:!0,children:"Loading…"}):r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[a.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:a.jsx(az,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),a.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"You can reuse configuration settings only from connector-based Data Marts that use the same source."})]}):a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to reuse its configuration settings."}),a.jsx("div",{children:r.map(x=>{const C=x.definition.connector.source.configuration;return C.length===0?null:C.length===1?a.jsxs(Et,{delayDuration:300,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs(vt,{onSelect:()=>{y(x,C[0])},children:[a.jsx(ng,{className:"text-foreground h-4 w-4"}),x.title]})}),a.jsx(jt,{side:"right",className:"max-w-sm",children:g(C[0])})]},x.id):a.jsxs(gy,{children:[a.jsxs(yy,{className:"flex items-center gap-2",children:[a.jsx(ng,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:x.title})]}),a.jsx(xy,{children:C.map((S,w)=>a.jsxs(Et,{delayDuration:300,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs(vt,{onSelect:()=>{y(x,S)},children:["Configuration ",w+1]})}),a.jsx(jt,{side:"right",className:"max-w-sm",children:g(S)})]},w))})]},x.id)})})]})})]})})}function nN({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:i=!1,isEditingExisting:c=!1}){const[u,f]=h.useState({}),m=h.useRef(!1),y=h.useRef(!1),[g,x]=h.useState({});h.useEffect(()=>{if(t){y.current=!0;const D={...s??{}};t.forEach(T=>{const I=Array.isArray(T.attributes)?T.attributes.includes("SECRET"):!1;D[T.name]===void 0&&T.default!==void 0&&(D[T.name]=T.default),c&&I&&(D[T.name]=Tb)}),f(D),m.current=!0,setTimeout(()=>{y.current=!1},0)}},[t,s,c]),h.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(y.current=!0,f({...s}),setTimeout(()=>{y.current=!1},0))},[s]),h.useEffect(()=>{m.current&&!y.current&&Object.keys(u).length>0&&(n==null||n(u))},[u,n]);const v=(D,T)=>{f(I=>({...I,[D]:T}))},C=h.useCallback(D=>!(D==null||typeof D=="string"&&D.trim()===""||typeof D=="number"&&isNaN(D)||Array.isArray(D)&&D.length===0),[]),S=h.useCallback((D,T)=>{var k,F;if(typeof D!="object"||D===null)return C(D);if((k=T.attributes)!=null&&k.includes("OAUTH_FLOW")&&"_source_credential_id"in D)return!0;const I=(F=T.oneOf)==null?void 0:F.filter(G=>G.value===Object.keys(D)[0]);return I?I.every(G=>{var Y;if((Y=G.attributes)!=null&&Y.includes("OAUTH_FLOW")){const B=D[G.value];if(typeof B=="object"&&B!==null){if("_source_credential_id"in B)return!0;const Z=Object.entries(G.items).filter(([,H])=>H.required);if(Z.length>0)return Z.every(([H])=>{const M=B[H];return C(M)})}return!1}return Object.entries(G.items).every(([,B])=>G.value in D?S(D[G.value],B):!1)}):C(D[T.name])},[C]),w=h.useCallback((D,T)=>{const I=T.filter(Y=>Y.required&&Y.oneOf),k=I.length===0?!0:I.some(Y=>S(D[Y.name],Y)),G=T.filter(Y=>Y.required&&Y.name!=="Fields").every(Y=>C(D[Y.name]));return k&&G},[C,S]),R=(D,T)=>{x(I=>({...I,[D]:T})),f(T?I=>({...I,[D]:""}):I=>({...I,[D]:Tb}))},j=D=>{const T={...u};Object.entries(D.configuration).forEach(([I,k])=>{["_id","_copiedFrom"].includes(I)||(T[I]=k)}),T._copiedFrom={dataMartId:D.dataMartId,dataMartTitle:D.dataMartTitle,configId:D.configId},f(T)};if(h.useEffect(()=>{if(t&&r){const D=w(u,t);r(D)}},[u,t,r,w]),i)return a.jsx(k2,{variant:"list"});if(!t||t.length===0)return a.jsxs(ni,{children:[a.jsx(ic,{connector:e}),a.jsx(ti,{icon:a.jsx(Yf,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(Gu,{label:"Need configuration?"})]});const _=[...t].filter(D=>{var T;return D.name!=="Fields"&&!((T=D.attributes)!=null&&T.includes("HIDE_IN_CONFIG_FORM"))}).sort((D,T)=>{const I=k=>{const F=k.default!=null&&k.default!=="";return k.required&&!F?1:k.required&&F?2:!k.required&&!F?3:4};return I(D)-I(T)}),O=_.filter(D=>{var T;return!((T=D.attributes)!=null&&T.includes("ADVANCED"))}),A=_.filter(D=>{var T;return(T=D.attributes)==null?void 0:T.includes("ADVANCED")});return a.jsx(a.Fragment,{children:a.jsxs(ni,{children:[a.jsx(ic,{connector:e}),a.jsxs(al,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),a.jsx(rie,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),O.length>0&&a.jsx(tN,{items:O,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name}),A.length>0&&a.jsx(tN,{collapsibleTitle:"Advanced Settings",items:A,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name})]})]})})}function aie({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:s=!1,onFieldSelect:i}){const c=r?`Select data for ${r}`:"Select data";return s?a.jsx(k2,{variant:"list"}):!t||t.length===0?a.jsxs(ni,{children:[a.jsx(ic,{connector:e}),a.jsx(ti,{icon:a.jsx(Yf,{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."}),a.jsx(Gu,{label:"Missing some data?"})]}):a.jsxs(ni,{children:[a.jsx(ic,{connector:e}),a.jsxs(al,{title:c,children:[a.jsx(D6,{children:t.map(u=>a.jsx(O6,{type:"radio",id:u.name,name:"selectedField",value:u.name,label:u.overview??u.name,checked:n===u.name,onChange:f=>{i(f)},tooltip:u.name&&a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Table name:"})," ",u.destinationName??u.name]}),u.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",u.description]}),u.documentation&&a.jsxs(Wr,{to:u.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",a.jsx(_a,{className:"h-3 w-3"})]})]}),selected:n===u.name},u.name))}),a.jsx(Gu,{label:"Missing some data?"})]})]})}var so=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(so||{});function rN({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const i=h.useRef(null),[c,u]=h.useState(""),[f,m]=h.useState(so.ORIGINAL),y=t==null?void 0:t.find(R=>R.name===n),g=h.useMemo(()=>(y==null?void 0:y.fields)??[],[y==null?void 0:y.fields]),x=h.useMemo(()=>(y==null?void 0:y.uniqueKeys)??[],[y==null?void 0:y.uniqueKeys]),v=h.useMemo(()=>{const R=new Map;return g.forEach((j,_)=>R.set(j.name,_)),R},[g]),C=h.useMemo(()=>{const R=g.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),j=(_,O)=>{const A=x.includes(_.name),D=x.includes(O.name);if(A&&!D)return-1;if(!A&&D)return 1;if(f===so.ASC)return _.name.localeCompare(O.name);if(f===so.DESC)return O.name.localeCompare(_.name);const T=v.get(_.name)??0,I=v.get(O.name)??0;return T-I};return[...R].sort(j)},[g,c,x,f,v]),S=g.map(R=>R.name),w=r.filter(R=>S.includes(R)).length;return h.useEffect(()=>{if(x.length>0){const R=x.filter(j=>g.some(_=>_.name===j)&&!r.includes(j));R.length>0&&R.forEach(j=>{s(j,!0)})}},[n,x,g,r,s]),h.useEffect(()=>{const R=j=>{const O=(j.ctrlKey||j.metaKey)&&j.shiftKey&&j.key.toLowerCase()==="a",A=document.activeElement.tagName;if(!(A==="INPUT"||A==="TEXTAREA")&&O){j.preventDefault();const D=g.map(k=>k.name),I=D.filter(k=>!r.includes(k)).length>0;D.forEach(k=>{s(k,I)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[g,r,s]),!n||!t?a.jsxs(ni,{children:[a.jsx(ic,{connector:e}),a.jsx(ti,{icon:a.jsx(Yf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(Gu,{label:"Need fields?"})]}):g.length?a.jsx(ni,{children:a.jsxs(a.Fragment,{children:[a.jsx(ic,{connector:e}),a.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(jc,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=i.current)==null||R.focus()}}),a.jsx("input",{ref:i,type:"text",placeholder:"Search field",value:c,onChange:R=>{u(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&a.jsx("button",{type:"button",onClick:()=>{u("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:a.jsx(uc,{className:"h-4 w-4"})})]}),a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===so.ASC&&a.jsx(tT,{className:"text-muted-foreground h-4 w-4"}),f===so.DESC&&a.jsx(eT,{className:"text-muted-foreground h-4 w-4"}),f===so.ORIGINAL&&a.jsx(nT,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(Er,{align:"end",children:[a.jsxs(vt,{onSelect:()=>{m(so.ASC)},children:[a.jsx(tT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(vt,{onSelect:()=>{m(so.DESC)},children:[a.jsx(eT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(vt,{onSelect:()=>{m(so.ORIGINAL)},children:[a.jsx(nT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(al,{title:`Selected ${String(w)} of ${String(S.length)} fields for "${n}" data`,children:[a.jsxs(D6,{children:[C.map(R=>{const j=x.includes(R.name);return a.jsx(O6,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||j,disabled:j,onChange:_=>{s(R.name,_)},label:R.name,tooltip:a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[j&&a.jsxs("p",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:"Unique key"})," ",a.jsx(O1,{className:"text-secondary h-3 w-3"})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:j?a.jsx(O1,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),C.length===0&&c&&a.jsxs("div",{className:"text-muted-foreground p-8 text-center text-sm",children:['No fields match "',c,'"']})]}),a.jsx(Gu,{label:"Need another field?"})]})]})}):a.jsxs(ni,{children:[a.jsx(ic,{connector:e}),a.jsx(ti,{icon:a.jsx(Yf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(Gu,{label:"Need fields?"})]})}const jI=h.createContext(void 0),TI={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function sie(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 TI;default:return e}}class oie 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 oo=new oie;var Fn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(Fn||{});const sl={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class _b{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!==Fn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await Yo.getReportById(n.reportId),s=ec(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:Fn.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 iie{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:Fn.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 u1={getMapper(e){switch(e){case Fn.REPORT_RUN:return new _b;case Fn.CONNECTOR_RUN:return new iie;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Tf={mapFromDto(e){return u1.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 Fn.REPORT_RUN:return new _b().enhanceWithReportData(n);case Fn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new _b,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===Fn.REPORT_RUN),i=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case Fn.REPORT_RUN:return i.find(u=>u.id===c.id)??c;case Fn.CONNECTOR_RUN:{const u=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:u}}}default:return c}})},mapToCreateRequest(e){return u1.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return u1.getMapper(e.type).mapToUpdateRequest(e)}};function lie({children:e}){const[t,n]=h.useReducer(sie,TI),{dataMart:r}=ws(),{fetchAvailableConnectors:s}=Ic();if(!r)throw new Error("Trigger provider must be used within a data mart context");const i=h.useCallback(async v=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const C=await oo.getScheduledTriggers(v),S=await Tf.mapFromDtoListWithReportData(C,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:S})}catch(C){const S=C instanceof Error?C.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:S}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:S})}},[r,s]),c=h.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGERS_START"});try{const w=(await oo.getScheduledTriggers(v)).filter(j=>j.type===C),R=await Tf.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(S){const w=S instanceof Error?S.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:w}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:w})}},[r]),u=h.useCallback(async(v,C)=>{n({type:"FETCH_TRIGGER_START"});try{const S=await oo.getScheduledTrigger(v,C),w=await Tf.mapFromDtoWithReportData(S,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:w})}catch(S){const w=S instanceof Error?S.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:w}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:w})}},[r]),f=h.useCallback(async(v,C,S,w,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:C,cronExpression:S,timeZone:w,isActive:R,triggerConfig:j},O=await oo.createScheduledTrigger(v,_),A=await Tf.mapFromDtoWithReportData(O,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),Le({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:C}),Dn.success("Trigger created"),A}catch(_){const O=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:O}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:O}),_}},[r]),m=h.useCallback(async(v,C,S,w,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:S,timeZone:w,isActive:R},_=await oo.updateScheduledTrigger(v,C,j),O=await Tf.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:O}),Le({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:O.type}),Dn.success("Trigger updated")}catch(j){const _=j instanceof Error?j.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),j}},[r]),y=h.useCallback(async(v,C)=>{n({type:"DELETE_TRIGGER_START"});try{await oo.deleteScheduledTrigger(v,C),n({type:"DELETE_TRIGGER_SUCCESS",payload:C}),Le({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:C}),Dn.success("Trigger deleted")}catch(S){const w=S instanceof Error?S.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:w}),Le({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:w}),S}},[]),g=h.useCallback(v=>{n({type:"SELECT_TRIGGER",payload:v})},[]),x=h.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(jI.Provider,{value:{...t,getScheduledTriggers:i,getScheduledTriggersByType:c,getScheduledTrigger:u,createScheduledTrigger:f,updateScheduledTrigger:m,deleteScheduledTrigger:y,selectScheduledTrigger:g,reset:x},children:e})}function _I(){const e=h.useContext(jI);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function cie(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:i,deleteScheduledTrigger:c,selectScheduledTrigger:u,reset:f,triggers:m,selectedTrigger:y,isLoading:g,error:x}=_I();return h.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:m,selectedTrigger:y,isLoading:g,error:x,getScheduledTriggers:v=>t(v),getScheduledTriggersByType:(v,C)=>n(v,C),getScheduledTrigger:(v,C)=>r(v,C),createScheduledTrigger:(v,C,S,w,R,j)=>s(v,C,S,w,R,j),updateScheduledTrigger:(v,C,S,w,R)=>i(v,C,S,w,R),deleteScheduledTrigger:(v,C)=>c(v,C),selectScheduledTrigger:u}}const uie=rn({type:Gr(sl.SCHEDULED_REPORT_RUN),reportId:Dt().min(1,"Report ID is required")}),die=cY(),fie=rn({type:Ey(Fn),cronExpression:Dt().min(1,"Cron expression is required"),timeZone:Dt().min(1,"Time zone is required"),isActive:lY(),triggerConfig:dY([uie,die])});function hie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=Ro({resolver:yi(fie),defaultValues:{type:e?e.type:n??Fn.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:sl.SCHEDULED_REPORT_RUN,reportId:t??""}}});h.useEffect(()=>{t&&s.getValues("type")===Fn.REPORT_RUN&&s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),h.useEffect(()=>{n&&(s.setValue("type",n),n===Fn.REPORT_RUN?s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const i=u=>{s.setValue("type",u),u===Fn.REPORT_RUN?s.setValue("triggerConfig",{type:sl.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async u=>{try{await r(u)}catch(f){console.error("Error submitting form:",f)}};return{form:s,handleTypeChange:i,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}const mie=[Ae.GOOGLE_SHEETS,Ae.EMAIL,Ae.SLACK,Ae.MS_TEAMS,Ae.GOOGLE_CHAT];function pie({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=ts(),{dataMart:i}=ws();h.useEffect(()=>{i&&s(i.id)},[s,i]);const c=r.filter(u=>mie.includes(u.dataDestination.type));return a.jsxs(ua,{value:e,onValueChange:t,disabled:n,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a report"})}),a.jsx(ha,{children:c.map(u=>{const f=aa.getInfo(u.dataDestination.type).icon;return a.jsx(Bn,{value:u.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(f,{className:"h-4 w-4",size:16}),a.jsx("span",{children:u.title})]})},u.id)})})]})}var Wy="Switch",[gie]=Sr(Wy),[yie,xie]=gie(Wy),NI=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f="on",onCheckedChange:m,form:y,...g}=e,[x,v]=h.useState(null),C=ht(t,_=>v(_)),S=h.useRef(!1),w=x?y||!!x.closest("form"):!0,[R,j]=ia({prop:s,defaultProp:i??!1,onChange:m,caller:Wy});return a.jsxs(yie,{scope:n,checked:R,disabled:u,children:[a.jsx(Je.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":II(R),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:C,onClick:Ie(e.onClick,_=>{j(O=>!O),w&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),w&&a.jsx(OI,{control:x,bubbles:!S.current,name:r,value:f,checked:R,required:c,disabled:u,form:y,style:{transform:"translateX(-100%)"}})]})});NI.displayName=Wy;var AI="SwitchThumb",DI=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=xie(AI,n);return a.jsx(Je.span,{"data-state":II(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});DI.displayName=AI;var vie="SwitchBubbleInput",OI=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const c=h.useRef(null),u=ht(c,i),f=E2(n),m=bS(t);return h.useEffect(()=>{const y=c.current;if(!y)return;const g=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(g,"checked").set;if(f!==n&&v){const C=new Event("click",{bubbles:r});v.call(y,n),y.dispatchEvent(C)}},[f,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:u,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});OI.displayName=vie;function II(e){return e?"checked":"unchecked"}var bie=NI,Sie=DI;function Q2({className:e,...t}){return a.jsx(bie,{"data-slot":"switch",className:se("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 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 dark:data-[state=unchecked]:bg-white/16",e),...t,children:a.jsx(Sie,{"data-slot":"switch-thumb",className:se("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 Cie(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 Nb(e,t="UTC"){const n=Cie(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:i,month:c,dayOfWeek:u}=n;if(r.startsWith("*/")&&s==="*"&&i==="*"&&c==="*"&&u==="*"){const g=Number.parseInt(r.substring(2));if(!isNaN(g))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:g,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&i==="*"&&c==="*"&&u==="*"){const g=Number.parseInt(s.substring(2));if(!isNaN(g)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:g,timezone:t}}const f=Number.parseInt(r),m=Number.parseInt(s),y=!isNaN(f)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`:"09:00";if(!isNaN(f)&&!isNaN(m)&&i==="*"&&c==="*"&&u==="*")return{type:"daily",time:y,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(f)&&!isNaN(m)&&i==="*"&&c==="*"&&u!=="*"){const g=u.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(g.length>0)return{type:"weekly",time:y,weekdays:g,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(f)&&!isNaN(m)&&i!=="*"&&c==="*"&&u==="*"){const g=i.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(g.length>0)return{type:"monthly",time:y,weekdays:[1,2,3,4,5],monthDays:g,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 MI({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:i=3}){const[c,u]=h.useState(!1),f=g=>{const x=t.includes(g)?t.filter(v=>v!==g):[...t,g].sort((v,C)=>v-C);n(x)},m=(g,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(v=>v!==g))},y=()=>{if(t.length===0)return a.jsx("span",{className:"text-muted-foreground text-sm",children:r});const g=t.map(x=>e.find(v=>v.value===x)).filter(Boolean);return g.length<=i?a.jsx("div",{className:"flex flex-wrap gap-1",children:g.map(x=>a.jsxs(Nr,{variant:"secondary",className:"h-5 text-xs",children:[x.label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:v=>m(x.value,v),children:a.jsx(uc,{className:"h-2 w-2"})})]},x.value))}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(Nr,{variant:"secondary",className:"h-5 text-xs",children:[g[0].label,a.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(g[0].value,x),children:a.jsx(uc,{className:"h-2 w-2"})})]}),g.length>1&&a.jsxs(Nr,{variant:"outline",className:"h-5 text-xs",children:["+",g.length-1]})]})};return a.jsxs(G2,{open:c,onOpenChange:u,modal:!0,children:[a.jsx(B2,{asChild:!0,children:a.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[a.jsx("div",{className:"flex-1 text-left",children:y()}),a.jsx(rS,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx(q2,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(lI,{className:"h-full overflow-visible",children:[a.jsx(cI,{placeholder:s,className:"h-8"}),a.jsxs(Hse,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(uI,{children:"No items found."}),a.jsx(dI,{className:"h-full overflow-visible",children:e.map(g=>a.jsxs(fI,{value:g.value.toString(),onSelect:()=>f(g.value),className:"text-sm",children:[a.jsx(oa,{className:se("mr-2 h-3 w-3",t.includes(g.value)?"opacity-100":"opacity-0")}),g.label]},g.value))})]})]})})]})}const kI=[{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"}],Ip=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function LI(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 i;return(i=kI.find(c=>c.value===s))==null?void 0:i.label}).join(", ")} at ${n}`;case"monthly":{const s=[...e.monthDays].sort((c,u)=>c-u).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 wie(e,t,n=!0){const r=Nb(e,t);return LI(r,n)}const Eie=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),Ab=[5,10,15,30],Db=[1,2,3,4,6,8,12],Rie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Type"}),a.jsxs(ua,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:"daily",children:"Daily"}),a.jsx(Bn,{value:"weekly",children:"Weekly"}),a.jsx(Bn,{value:"monthly",children:"Monthly"}),a.jsx(Bn,{value:"interval",children:"Interval"})]})]})]}),jie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Time"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(It,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),aN=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Ta,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(K2,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),Tie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(MI,{options:kI,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),_ie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(MI,{options:Eie,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),Nie=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Type"}),a.jsxs(ua,{value:e,onValueChange:i=>{n(i)},disabled:s,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:"minutes",children:"Minutes"}),a.jsx(Bn,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ta,{children:"Every"}),a.jsxs(ua,{value:t.toString(),onValueChange:i=>{r(Number.parseInt(i)||1)},disabled:s,children:[a.jsx(fa,{className:"w-full",children:a.jsx(da,{})}),a.jsx(ha,{children:(e==="minutes"?Ab:Db).map(i=>a.jsxs(Bn,{value:i.toString(),children:[i," ",e==="minutes"?"min":"hr"]},i))})]})]})]}),Aie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ta,{className:"text-sm",children:"Cron Expression"}),a.jsx(It,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),a.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function Ob({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:i=!0,showSaveButton:c=!1,hideEnableSwitch:u=!1}){const[f,m]=h.useState(n),[y,g]=h.useState(t??Ip()),[x,v]=h.useState(!1),C=h.useMemo(()=>BW.getTimezonesWithOffset().map(H=>({value:H.identifier,label:H.displayName,offset:H.offsetString,isDST:H.isDST})),[]),[S,w]=h.useState(()=>Nb(e,y)),[R,j]=h.useState(""),[_,O]=h.useState("");h.useEffect(()=>{m(n)},[n]),h.useEffect(()=>{const H=t??Ip();g(H)},[t]),h.useEffect(()=>{if(e){const H=Nb(e,y);w(H)}},[e,y]);const A=H=>{const[M,V]=H.time.split(":").map(Number);switch(H.type){case"daily":return`${String(V)} ${String(M)} * * *`;case"weekly":return`${String(V)} ${String(M)} * * ${H.weekdays.join(",")}`;case"monthly":return`${String(V)} ${String(M)} ${H.monthDays.join(",")} * *`;case"interval":return H.intervalType==="minutes"?`*/${String(H.intervalValue)} * * * *`:`0 */${String(H.intervalValue)} * * *`;case"custom":return H.customCron;default:return`${String(V)} ${String(M)} * * *`}},D=h.useCallback(H=>{w(M=>{if(M.intervalType===H)return console.log("Type unchanged, skipping update"),M;const $=(H==="minutes"?Ab:Db)[0];return{...M,intervalType:H,intervalValue:$}})},[]),T=h.useCallback(H=>{w(M=>(M.intervalType==="minutes"?Ab:Db).includes(H)?{...M,intervalValue:H}:M)},[]),I=h.useMemo(()=>H=>LI(H,f),[f]);h.useEffect(()=>{const H=A(S);j(H),O(I(S))},[S,f,y,I]);const k=h.useRef(""),F=h.useRef(""),G=h.useRef(!1);h.useEffect(()=>{const H=A(S);r&&(k.current!==H||F.current!==y||G.current!==f)&&(r({cron:H,timezone:y,enabled:f}),k.current=H,F.current=y,G.current=f)},[S,y,f,r]);const Y=H=>{m(H)},B=H=>{g(H),w(M=>({...M,timezone:H}))},Z=["daily","weekly","monthly"].includes(S.type);return a.jsxs("div",{className:s,children:[!u&&a.jsx("div",{className:"mb-4 space-y-4 pt-0",children:a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ta,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:f?"Enabled":"Disabled"}),a.jsx(Q2,{id:"schedule-enabled",checked:f,onCheckedChange:Y})]})})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${f?"":"opacity-50"}`,children:[a.jsx(Rie,{value:S.type,onChange:H=>{w(M=>({...M,type:H}))},disabled:!f}),S.type!=="custom"&&S.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(jie,{value:S.time,onChange:H=>{w(M=>({...M,time:H}))},disabled:!f}),Z&&a.jsx(aN,{value:y,onChange:B,disabled:!f,timezones:C})]}),(S.type==="interval"||S.type==="custom")&&a.jsx(aN,{value:y,onChange:B,disabled:!f,timezones:C}),S.type==="weekly"&&a.jsx(Tie,{value:S.weekdays,onChange:H=>{w(M=>({...M,weekdays:H}))},disabled:!f}),S.type==="monthly"&&a.jsx(_ie,{value:S.monthDays,onChange:H=>{w(M=>({...M,monthDays:H}))},disabled:!f}),S.type==="interval"&&a.jsx(Nie,{intervalType:S.intervalType,intervalValue:S.intervalValue,onTypeChange:D,onValueChange:T,disabled:!f}),S.type==="custom"&&a.jsx(Aie,{value:S.customCron,onChange:H=>{w(M=>({...M,customCron:H}))},disabled:!f})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(lS,{className:"my-3"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!x)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(OA,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),x?a.jsx(Zu,{className:"text-muted-foreground h-4 w-4"}):a.jsx(Ss,{className:"text-muted-foreground h-4 w-4"})]}),x&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),a.jsx(Nr,{variant:f?"default":"secondary",className:"text-xs",children:f?"Enabled":"Disabled"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),a.jsx(Nr,{variant:"secondary",className:"font-mono text-xs",children:R})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),a.jsx(Nr,{variant:"outline",className:"text-xs",children:y})]}),a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),a.jsx("span",{className:"flex-1 text-right text-xs",children:_})]})]}),f&&Z&&y!==Ip()&&a.jsxs(Y2,{className:"border-amber-200 bg-amber-50",children:[a.jsx(xh,{className:"h-4 w-4"}),a.jsx(EI,{children:"Time Zone"}),a.jsxs(W2,{children:["Schedule runs in ",y," (not your local ",Ip()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(we,{className:"w-full",disabled:!f,children:"Save Schedule"})]})]})}function Die(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"trigger-type-options-description-details",children:[a.jsx(Zt,{children:"How do I choose a type?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:[a.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)."]}),a.jsxs("p",{className:"mb-2",children:[a.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 Oie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"trigger-type-change-description-details",children:[a.jsx(Zt,{children:"How do I change the trigger type?"}),a.jsx(Yt,{children:a.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 Iie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"report-change-description-details",children:[a.jsx(Zt,{children:"How do I change a report?"}),a.jsx(Yt,{children:a.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 Mie(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"report-select-description-details",children:[a.jsx(Zt,{children:"How do I choose the report?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),a.jsxs("p",{children:["You can use an existing one or create a new one on the ",a.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function kie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:i}){const[c,u]=h.useState(!1),{form:f,handleTypeChange:m,handleSubmit:y,isDirty:g}=hie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async w=>{u(!0);try{await r(w)}finally{u(!1)}}});h.useEffect(()=>{i==null||i(g)},[g,i]);const{control:x,watch:v}=f,S=v("type")===Fn.REPORT_RUN;return a.jsx(_l,{...f,children:a.jsxs(gi,{onSubmit:w=>void y(w),noValidate:!1,children:[a.jsxs(Nl,{children:[a.jsx(Nt,{control:x,name:"type",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),a.jsxs(ua,{onValueChange:R=>{w.onChange(R),m(R)},defaultValue:w.value,disabled:!!n||!!e||!!v("triggerConfig.reportId"),children:[a.jsx(wt,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select trigger type"})})}),a.jsxs(ha,{children:[a.jsx(Bn,{value:Fn.REPORT_RUN,children:"Report Run"}),a.jsx(Bn,{value:Fn.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(xn,{children:e?a.jsx(Oie,{}):a.jsx(Die,{})}),a.jsx(Mt,{})]})}),S&&a.jsx(Nt,{control:x,name:"triggerConfig.reportId",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),a.jsx(wt,{children:a.jsx(ZS,{children:a.jsx(pie,{value:w.value,onChange:w.onChange,disabled:!!t||!!e})})}),a.jsx(xn,{children:e!=null&&e.triggerConfig?a.jsx(Iie,{}):a.jsx(Mie,{})}),a.jsx(Mt,{})]})}),a.jsx(Ob,{showPreview:!1,cron:v("cronExpression"),timezone:v("timeZone"),enabled:v("isActive"),onChange:w=>{f.setValue("cronExpression",w.cron,{shouldDirty:!0}),f.setValue("timeZone",w.timezone,{shouldDirty:!0}),f.setValue("isActive",w.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"})]}),a.jsxs(Mc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!g||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&a.jsx(we,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Lie({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=h.useMemo(()=>wie(e,t,n),[e,t,n]);return a.jsxs("div",{children:[a.jsx("div",{children:r}),n&&a.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function Pie({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),u=()=>{c(!1),n(e.id)};return a.jsxs("div",{className:"text-right",onClick:f=>{f.stopPropagation()},children:[a.jsxs(Cr,{open:r,onOpenChange:s,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{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:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(vt,{onClick:()=>{t(e.id)},children:[a.jsx(od,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),a.jsx(la,{}),a.jsxs(vt,{onClick:()=>{c(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(br,{open:i,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:u,variant:"destructive"})]})}function Uie({connector:e}){const{connectors:t}=Ic(),n=Ste(e,t);return a.jsx(a.Fragment,{children:n})}function PI({connector:e}){return a.jsx(Uie,{connector:e})}function zie(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 Fie=e=>{const{connectors:t}=Ic();return h.useMemo(()=>t.find(n=>n.name===e),[t,e])},Hie=re.memo(function({connector:t,children:n}){const r=Fie(t.source.name),{dataMart:s,runs:i,getDataMartRuns:c}=ws();h.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const u=h.useMemo(()=>r!=null&&r.logoBase64?a.jsx(Ac,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=h.useCallback(()=>{s!=null&&s.storage&&XX(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=h.useMemo(()=>zie(i),[i]),y=h.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:vJ(m.lastRunStatus),statusText:SJ(m.lastRunStatus),date:m.lastRunDate},[m]),g=h.useMemo(()=>(s==null?void 0:s.storage)&&QX(s.storage),[s]),x=h.useMemo(()=>{const v=t.source.fields.length.toString();return`${t.source.node} • ${v} fields`},[t.source.node,t.source.fields.length]);return a.jsxs(Oy,{children:[a.jsx(Iy,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(My,{children:[a.jsxs(QS,{children:[a.jsx(JS,{children:u}),a.jsxs(e2,{children:[a.jsx(t2,{children:a.jsx(PI,{connector:t})}),a.jsx(n2,{children:x})]})]}),a.jsxs(r2,{children:[a.jsxs(el,{children:[a.jsx(tl,{children:"Last run status:"}),a.jsx(nl,{children:y?a.jsx(Uh,{type:y.statusType,variant:"ghost",children:y.statusText}):"Not run yet"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Last run date:"}),a.jsx(nl,{children:y?a.jsx(Vs,{date:y.date}):"Never run"})]}),a.jsxs(el,{children:[a.jsx(tl,{children:"Total runs:"}),a.jsxs(nl,{children:[m.totalRuns," runs",m.firstRunDate&&a.jsxs(a.Fragment,{children:[", since"," ",m.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),a.jsx(a2,{children:a.jsxs(we,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[g,a.jsx(ai,{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 $ie(e){const t=e.triggerConfig,n=aa.getInfo(t.report.dataDestination.type).icon;return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[a.jsx(n,{className:"h-4 w-4",size:16}),t.report.title,a.jsx(yJ,{report:t.report,children:a.jsx(Fr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Vie(e){var s;const t=e.triggerConfig,{connector:n}=t.connector,r=(s=n.info)!=null&&s.logoBase64?a.jsx(Ac,{base64:n.info.logoBase64,className:"h-4 w-4",size:16}):a.jsx(cc,{className:"h-4 w-4",size:16});return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[r,a.jsx(PI,{connector:n}),a.jsx(Hie,{connector:n,children:a.jsx(Fr,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Gie({trigger:e}){switch(e.type){case Fn.REPORT_RUN:return $ie(e);case Fn.CONNECTOR_RUN:return Vie(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Bie({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===Fn.REPORT_RUN?"Report Run":"Connector Run";return a.jsx(Nr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>a.jsx(Gie,{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,i=n.getValue("isActive");return a.jsx(Lie,{cronExpression:String(r),timeZone:s,isEnabled:i})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Vs,{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 a.jsx("div",{className:"text-sm",children:r?a.jsx(Vs,{date:new Date(r)}):a.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 a.jsx(Uh,{type:r?Jn.SUCCESS:Jn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>a.jsx(xd,{table:n}),cell:({row:n})=>a.jsx(Pie,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function qie({table:e,onPreviousClick:t,onNextClick:n}){return a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function J2({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){Ol(e);const{createScheduledTrigger:i,updateScheduledTrigger:c,selectedTrigger:u}=_I(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=kc(t),C=!!u,S=h.useMemo(()=>u?{type:u.type,cronExpression:u.cronExpression,timeZone:u.timeZone,isActive:u.isActive,triggerConfig:u.type===Fn.REPORT_RUN?{type:sl.SCHEDULED_REPORT_RUN,reportId:u.triggerConfig.reportId}:null}:void 0,[u]),w=async j=>{C?await c(n,u.id,j.cronExpression,j.timeZone,j.isActive):await i(n,j.type,j.cronExpression,j.timeZone,j.isActive,j.triggerConfig),v()},R=h.useRef(!1);return h.useEffect(()=>{const j=C?"Edit":"Create",_=(u==null?void 0:u.type)??s;e&&!R.current?(Le({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:j,label:_}),R.current=!0):!e&&R.current&&(Le({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:j,label:_}),R.current=!1)},[e,C,u,s]),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:j=>{j||y()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsxs(fi,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(yl,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx(kie,{preSelectedReportId:r,preSelectedType:s,initialData:S,onSubmit:w,onCancel:y,onDirtyChange:x})]})}),a.jsx(br,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function Kie({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,i]=h.useState(!1),c=h.useCallback(()=>{i(!1)},[]),u=h.useCallback(R=>{r(R)},[r]),f=h.useMemo(()=>Bie({onEditTrigger:n,onDeleteTrigger:u}),[n,u]),{sorting:m,setSorting:y,columnVisibility:g,setColumnVisibility:x}=Oc({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),v=wl({data:e,columns:f,getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:y,getSortedRowModel:Dc(),getFilteredRowModel:yd(),state:{sorting:m,columnVisibility:g},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),C=h.useCallback(()=>{v.previousPage()},[v]),S=h.useCallback(()=>{v.nextPage()},[v]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(Rl,{className:"dm-card-table-header",children:v.getHeaderGroups().map(R=>a.jsx(Hn,{className:"dm-card-table-header-row",children:R.headers.map(j=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:typeof j.column.columnDef.header=="function"?j.column.columnDef.header(j.getContext()):j.column.columnDef.header},j.id))},R.id))}),a.jsx(jl,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map((R,j)=>a.jsx(Hn,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":j+1,children:R.getVisibleCells().map((_,O)=>a.jsx($r,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":O+1,style:_.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:typeof _.column.columnDef.cell=="function"?_.column.columnDef.cell(_.getContext()):_.column.columnDef.cell},_.id))},R.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),a.jsx(qie,{table:v,onPreviousClick:C,onNextClick:S}),a.jsx(J2,{isOpen:s,onClose:c,dataMartId:t})]})}function Zie({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=cie(e),[i,c]=h.useState(!1);h.useEffect(()=>{s&&c(!0)},[s]);const u=y=>{const g=t.find(x=>x.id===y);g&&r(g)},f=()=>{c(!1),r(null)},m=async y=>{try{await n(e,y)}catch(g){console.error("Error deleting trigger:",g)}};return a.jsxs(a.Fragment,{children:[a.jsx(Kie,{triggers:t,dataMartId:e,onEditTrigger:u,onDeleteTrigger:y=>void m(y)}),a.jsx(J2,{isOpen:i,onClose:f,dataMartId:e})]})}function eC(){return a.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:a.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[a.jsx(nS,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Time Triggers"}),a.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",a.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function Mp(e){return e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}function kg(e){return e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Yie({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const i=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[u,f]=h.useState(""),[m,y]=h.useState(""),[g,x]=h.useState(""),[v,C]=h.useState(null),[S,w]=h.useState(null),[R,j]=h.useState(null),_=(I,k=!1)=>I.trim()?k&&I.startsWith('"')&&I.endsWith('"')?I.slice(1,-1)?null:"Quoted identifier cannot be empty":/^[A-Za-z][A-Za-z0-9_]*$/.test(I)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",O=h.useCallback((I,k,F,G,Y,B)=>{let Z;if(e===Re.SNOWFLAKE&&Y){const M=Mp(Y),V=Mp(k);Z=`${I}.${M}.${V}`}else Z=`${I}.${k}`;const H=e===Re.SNOWFLAKE?!!(I&&Y&&k&&F===null&&B===null&&G===null):!!(I&&k&&F===null&&G===null);s({fullyQualifiedName:Z,isValid:H})},[s,e]);h.useEffect(()=>{let I="",k="",F="";if(t!=null&&t.fullyQualifiedName){const M=t.fullyQualifiedName.match(/(?:[^."]+|"[^"]*")+/g)??[];if(e===Re.SNOWFLAKE&&M.length===3){const V=M[0],$=M[1],oe=M[2];V&&$&&oe&&(I=V,k=kg($),F=kg(oe))}else if(M.length>=2){const V=M[0],$=M[1];V&&$&&(I=V,F=$)}}else I=`${c}_owox`,e===Re.SNOWFLAKE&&(k="PUBLIC"),F=i;const G=_(I),Y=e===Re.SNOWFLAKE?_(k,!0):null,B=_(F,e===Re.SNOWFLAKE);f(I),y(k),x(F),C(G),w(Y),j(B);const Z=e===Re.SNOWFLAKE&&k?`${I}.${Mp(k)}.${Mp(F)}`:`${I}.${F}`,H=e===Re.SNOWFLAKE?!!(I&&k&&F&&G===null&&Y===null&&B===null):!!(I&&F&&G===null&&B===null);((t==null?void 0:t.fullyQualifiedName)!==Z||t.isValid!==H)&&O(I,F,G,B,k,Y)},[t,i,c,e,O]);const A=I=>{f(I);const k=_(I);C(k),O(I,g,k,R,m,S)},D=I=>{y(I);const k=_(I,!0);w(k),O(u,g,v,R,I,k)},T=I=>{x(I);const k=_(I,e===Re.SNOWFLAKE);j(k),O(u,I,v,k,m,S)};return a.jsxs(ni,{children:[e===Re.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(ti,{icon:a.jsx(jD,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Gi,{children:[a.jsx(Ba,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),a.jsx(It,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:I=>{A(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Gi,{children:[a.jsx(Ba,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(It,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"table-name-error":void 0,onChange:I=>{T(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===Re.AWS_ATHENA&&a.jsxs(a.Fragment,{children:[a.jsx(ti,{icon:a.jsx(TD,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Gi,{children:[a.jsx(Ba,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),a.jsx(It,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:I=>{A(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),v&&a.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Gi,{children:[a.jsx(Ba,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(It,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"athena-table-name-error":void 0,onChange:I=>{T(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),R&&a.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),e===Re.SNOWFLAKE&&a.jsxs(a.Fragment,{children:[a.jsx(ti,{icon:a.jsx(_D,{}),title:"Snowflake",docUrl:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",variant:"compact"}),a.jsxs(al,{title:"Choose where to store your data",children:[a.jsxs(Gi,{children:[a.jsx(Ba,{required:!0,htmlFor:"snowflake-database-name",tooltip:"Enter database name for Snowflake where the connector data will be stored.",children:"Database name"}),a.jsx(It,{type:"text",id:"snowflake-database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:u,"aria-invalid":!!v,"aria-describedby":v?"snowflake-database-name-error":void 0,onChange:I=>{A(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn't exist"}),v&&a.jsx("p",{id:"snowflake-database-name-error",className:"text-destructive text-sm",children:v})]}),a.jsxs(Gi,{children:[a.jsx(Ba,{required:!0,htmlFor:"snowflake-schema-name",tooltip:"Enter schema name for Snowflake where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Schema name"}),a.jsx(It,{type:"text",id:"snowflake-schema-name",placeholder:"PUBLIC",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!S,"aria-describedby":S?"snowflake-schema-name-error":void 0,onChange:I=>{D(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Schema is auto-created on first run if it doesn't exist"}),S&&a.jsx("p",{id:"snowflake-schema-name-error",className:"text-destructive text-sm",children:S})]}),a.jsxs(Gi,{children:[a.jsx(Ba,{required:!0,htmlFor:"snowflake-table-name",tooltip:"Enter table name where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Table name"}),a.jsx(It,{type:"text",id:"snowflake-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"snowflake-table-name-error":void 0,onChange:I=>{T(I.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn't exist"}),R&&a.jsx("p",{id:"snowflake-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),a.jsx(al,{title:"Schedule updates",children:a.jsx(eC,{})})]})}function Wie({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full",initialStep:i,preselectedConnector:c,onDirtyChange:u}){const[f,m]=h.useState(!1),[y,g]=h.useState(null),[x,v]=h.useState(""),[C,S]=h.useState([]),[w,R]=h.useState(1),[j,_]=h.useState({}),[O,A]=h.useState(!1),[D,T]=h.useState(new Set),[I,k]=h.useState(new Set),{connectors:F,connectorSpecification:G,connectorFields:Y,loading:B,loadingSpecification:Z,loadingFields:H,error:M,fetchAvailableConnectors:V,fetchConnectorSpecification:$,fetchConnectorFields:oe}=Ic();h.useEffect(()=>{u==null||u(f)},[f,u]);const[ge,P]=h.useState(null),U=h.useMemo(()=>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"}],[n,s]),z=U.length,X=h.useCallback(async Me=>{!D.has(Me)&&!Z&&(T(q=>new Set(q).add(Me)),await $(Me))},[D,Z,$]),W=h.useCallback(async Me=>{I.has(Me)||(k(q=>new Set(q).add(Me)),await oe(Me))},[I,oe]);h.useEffect(()=>{if(!c||y||F.length===0)return;const Me=F.find(q=>q.name===c);Me&&(g(Me),R(i??2),X(Me.name),!n&&s!=="fields-only"&&W(Me.name))},[c,F,y,i,n,s,X,W]),h.useEffect(()=>{if(F.length===0&&!B&&V(),r&&F.length>0&&!y){const{source:Me,storage:q}=r;v(Me.node),S(Me.fields),_(Me.configuration[0]||{}),P({fullyQualifiedName:q.fullyQualifiedName,isValid:!0});const ne=F.find(ce=>ce.name===Me.name);ne&&(g(ne),X(ne.name),!n&&s!=="fields-only"&&W(ne.name),s==="fields-only"&&W(ne.name))}if(n&&F.length>0&&!y&&!r){const Me=F[0];g(Me),X(Me.name)}},[s,r,F,n,B,V,X,W,y]);const ae=Me=>{g(Me),_({}),A(!1),m(!0),T(q=>{const ne=new Set(q);return ne.delete(Me.name),ne}),X(Me.name),W(Me.name),Le({event:"connector_setup",category:Me.name,action:"connector_selected",label:Me.displayName})},J=Me=>{v(Me),S([]),m(!0)},le=(Me,q)=>{S(q?ne=>ne.includes(Me)?ne:[...ne,Me]:ne=>ne.filter(ce=>ce!==Me)),m(!0)},ye=(Me,q)=>{S(q?ne=>{const ce=Me.filter(Oe=>!ne.includes(Oe));return[...ne,...ce]}:ne=>ne.filter(ce=>!Me.includes(ce))),m(!0)},Ce=Me=>{P(Me),m(!0)},Ve=h.useCallback(Me=>{_(Me),m(!0)},[]),De=h.useCallback(Me=>{A(Me)},[]);h.useEffect(()=>{G&&(G.some(q=>q.required&&q.name!=="Fields")||A(!0))},[G]),h.useEffect(()=>{var q;const Me=((q=U[w-1])==null?void 0:q.title)??`Step ${String(w)}`;y&&Le({event:"connector_setup",category:y.name,action:"step",label:Me})},[w,y]);const et=()=>{w<z&&R(w+1)},rt=()=>{w>1&&R(w-1)},dn=()=>{if(n)return y!==null&&O;if(s==="fields-only")switch(w){case 1:return C.length>0;default:return!1}switch(w){case 1:return y!==null;case 2:return O;case 3:return x!=="";case 4:return C.length>0;case 5:return ge!==null&&ge.fullyQualifiedName!==""&&ge.isValid;default:return!1}},zt=()=>w>1,On=(Me,q)=>{if(!Me)return q;const ne=Me.find(ce=>ce.name===q);return(ne==null?void 0:ne.destinationName)??q},yn=()=>{if(n&&w===1)return G&&y?a.jsx(nN,{connector:y,connectorSpecification:G,onConfigurationChange:Ve,onValidationChange:De,initialConfiguration:j,loading:Z,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(w){case 1:return y&&x&&Y?a.jsx(rN,{connector:y,connectorFields:Y,selectedField:x,selectedFields:C,onFieldToggle:le,onSelectAllFields:ye}):null;default:return null}switch(w){case 1:return a.jsx($oe,{connectors:F,selectedConnector:y,loading:B,error:M,onConnectorSelect:ae,onConnectorDoubleClick:()=>{R(Me=>Me<z?Me+1:Me)}});case 2:return y&&G?a.jsx(nN,{connector:y,connectorSpecification:G,onConfigurationChange:Ve,onValidationChange:De,initialConfiguration:j,loading:Z,isEditingExisting:!1}):null;case 3:return y&&Y?a.jsx(aie,{connectorFields:Y,connector:y,selectedField:x,connectorName:y.displayName,loading:H,onFieldSelect:J}):null;case 4:return y&&x&&Y?a.jsx(rN,{connector:y,connectorFields:Y,selectedField:x,selectedFields:C,onFieldToggle:le,onSelectAllFields:ye}):null;case 5:return x&&Y?a.jsx(Yie,{dataStorageType:t,destinationName:On(Y,x),connectorName:(y==null?void 0:y.displayName)??"",target:ge,onTargetChange:Ce}):null;default:return null}};return a.jsxs(Nre,{children:[a.jsx(Are,{children:yn()}),a.jsx(Dre,{variant:"horizontal",children:a.jsx(Voe,{currentStep:w,totalSteps:z,canGoNext:dn(),canGoBack:zt(),isLoading:Z||H,onNext:et,onBack:rt,onFinish:()=>{n&&y?(e({source:{name:y.name,configuration:[j],node:(r==null?void 0:r.source.node)??x,fields:(r==null?void 0:r.source.fields)??C},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}),Le({event:"connector_setup",category:y.name,action:"created",label:"configuration-only"})):s==="fields-only"&&r?(e({source:{...r.source,fields:C},storage:r.storage}),Le({event:"connector_setup",category:r.source.name,action:"created",label:"fields-only"})):y&&ge&&(e({source:{name:y.name,configuration:[j],node:x,fields:C},storage:{fullyQualifiedName:ge.fullyQualifiedName}}),Le({event:"connector_setup",category:y.name,action:"created",label:"full"})),m(!1)}})})]})}function UI({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:i=null,mode:c="full",initialStep:u,preselectedConnector:f}){const{showUnsavedDialog:m,setShowUnsavedDialog:y,handleClose:g,confirmClose:x,handleFormDirtyChange:v,handleFormSubmitSuccess:C}=kc(t);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:S=>{S||g()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:c==="fields-only"?"Connector Fields":i!=null&&i.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(yl,{children:c==="fields-only"?"Select fields for your Data Mart":i!=null&&i.source.name?"Update configuration":"Follow these steps to set it up"})]}),a.jsx(Wie,{onSubmit:S=>{r(S),C()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:i,mode:c,initialStep:u,preselectedConnector:f,onDirtyChange:v})]})}),a.jsx(br,{open:m,onOpenChange:y,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:x,variant:"destructive"})]})}const tC=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:i,isOpen:c,onClose:u})=>{const[f,m]=h.useState(!1),[y,g]=h.useState(1),[x,v]=h.useState();h.useEffect(()=>{c!==void 0&&m(c)},[c]);const C=()=>{v(void 0),g(1),m(!0)},S=()=>{m(!1),u==null||u()};return h.useEffect(()=>{i&&(i==="connector"?(v(void 0),g(1),m(!0)):(v(i),g(2),m(!0)))},[i]),a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{onClick:C,style:{cursor:"pointer"},children:n}),a.jsx(rd,{children:a.jsx(UI,{isOpen:f,onClose:S,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:y,preselectedConnector:x})})]})};function Xie({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return a.jsx(tC,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:a.jsxs(we,{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:[a.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:a.jsx(sS,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(_a,{className:"h-6 w-6"})]})})}const Qie=e=>{switch(e){case Re.GOOGLE_BIGQUERY:return"Google BigQuery";case Re.AWS_ATHENA:return"AWS Athena";case Re.SNOWFLAKE:return"Snowflake";default:return e}},Ou=e=>typeof e=="object"&&"connector"in e,_f=e=>{if(!Ou(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.split("."),i=s.length===2||s.length===3;return r&&i};function Jie({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:i}){const c=Sl.getInfo(i.type),{connectors:u,fetchAvailableConnectors:f}=Ic();h.useEffect(()=>{f()},[f]);const m=C=>{const S=u.find(w=>w.name===C);if(S!=null&&S.logoBase64)return()=>a.jsx(Ac,{base64:S.logoBase64,size:24})},y=()=>{const C=t.connector.source.node||"No node selected";return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:C}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[a.jsx("span",{children:"Edit config"}),a.jsx(_a,{className:"h-3 w-3"})]})}),a.jsx(jt,{children:"Edit connector configuration"})]})]})},g=(C,S,w)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",a.jsx(gn,{href:w,onClick:R=>{R.stopPropagation()},children:S})]}),x=()=>{switch(i.type){case Re.GOOGLE_BIGQUERY:{const C=i.config.projectId,S=t.connector.storage.fullyQualifiedName,w=S.split(".")[0],R=S.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${w}`,_=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${w}!3s${R}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Dataset",w,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,_),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Fr,{className:"h-4 w-4"})}),a.jsx(jt,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Re.AWS_ATHENA:{const C=i.config.region,S=t.connector.storage.fullyQualifiedName,[w,R]=S.split("."),j=`https://console.aws.amazon.com/athena/home?region=${C}#/query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",w,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,j),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Fr,{className:"h-4 w-4"})}),a.jsx(jt,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Re.SNOWFLAKE:{const C=i.config.account,w=t.connector.storage.fullyQualifiedName.split("."),R=w[0],j=w[1],_=w[2],O=`https://${C}.snowflakecomputing.com`,A=`${O}/#/data/databases/${R}`,D=`${O}/#/data/databases/${R}/schemas/${j}`,T=`${O}/#/data/databases/${R}/schemas/${j}/table/${_}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",R,A),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",kg(j),D),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",kg(_),T),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Fr,{className:"h-4 w-4"})}),a.jsx(jt,{children:"The database, schema 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"}},v=()=>s!==1;return a.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[a.jsx("div",{className:"flex-grow",children:a.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[a.jsx(tC,{dataStorageType:i.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:a.jsx(Eb,{icon:m(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:y(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),a.jsx(Eb,{title:Qie(i.type),icon:c.icon,subtitle:x(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),a.jsx("div",{className:"shrink-0 px-4",children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("span",{children:a.jsx(we,{type:"button",variant:"ghost",onClick:()=>{v()&&n(e)},disabled:!v(),children:a.jsx(es,{className:"h-4 w-4"})})})}),!v()&&a.jsx(jt,{children:"Remove last configuration only after adding a new one."})]})})]})}function ele({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(tC,{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:a.jsxs(we,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(ma,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function tle({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:i,runDataMart:c}=bs(),{setValue:u,getValues:f,trigger:m}=vd(),[y,g]=h.useState(!1),[x,v]=h.useState(!1);h.useEffect(()=>{r&&v(!0)},[r]);const C=(i==null?void 0:i.status)??zr.DRAFT,S=async Z=>{u("definition",Z,{shouldDirty:!0,shouldTouch:!0}),await m("definition")&&s&&s()},w=async Z=>{const H=Z.source,M=Z.storage;await S({connector:{source:H,storage:M}})},R=async Z=>{if(i){if(i.status.code!==zr.PUBLISHED){_t.error("Manual run is only available for published data marts");return}await c({id:i.id,payload:Z})}},j=Z=>async H=>{const V=f().definition;if(typeof V=="object"&&Ou(V)){const $=[...V.connector.source.configuration];$[Z]=H.source.configuration[0]||{};const oe={connector:{...V.connector,source:{...V.connector.source,configuration:$}}};await S(oe)}},_=async Z=>{const M=f().definition;if(typeof M=="object"&&Ou(M)){const V={connector:{...M.connector,source:{...M.connector.source,fields:Z.source.fields}}};await S(V)}g(!1)},O=Z=>{R({runType:Z.runType,data:Z.data})},A=Z=>{const H=Z.connector.source.fields.length;return a.jsxs(we,{type:"button",variant:"outline",onClick:()=>{g(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(oz,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(H),")"]})]})},[D,T]=h.useState(null),[I,k]=h.useState(!1),F=Z=>{T(Z),k(!0)},G=async()=>{D!==null&&(await Y(D),T(null),k(!1))},Y=async Z=>{const M=f().definition;if(Ou(M)&&M.connector.source.configuration.length<=1){const V=Z2($e.CONNECTOR);await S(V)}if(typeof M=="object"&&Ou(M)&&M.connector.source.configuration.length>1){const V={...M.connector.source,configuration:M.connector.source.configuration.filter((oe,ge)=>ge!==Z)},$={connector:{...M.connector,source:V}};await S($)}},B=async Z=>{const M=f().definition;if(Ou(M)){const V={...M.connector.source,configuration:[...M.connector.source.configuration,Z]},$={connector:{...M.connector,source:V}};await S($)}};return a.jsxs(a.Fragment,{children:[a.jsx(Nt,{control:e,name:"definition",render:({field:Z})=>a.jsxs(xt,{className:"dark:bg-white/2",children:[a.jsx(wt,{children:a.jsx("div",{className:"space-y-3",children:!_f(Z.value)||C===zr.DRAFT?a.jsx(Xie,{storageType:t,onSetupConnector:H=>{w(H),v(!1)},preset:n,isOpen:x,onClose:()=>{v(!1)}}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ele,{storageType:t,onAddConfiguration:H=>void B(H),existingConnector:_f(Z.value)?{source:Z.value.connector.source,storage:Z.value.connector.storage}:void 0}),_f(Z.value)&&A(Z.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:i&&i.definitionType===$e.CONNECTOR&&a.jsx(B6,{configuration:i.definition,onManualRun:O,children:a.jsxs(we,{variant:"outline",children:[a.jsx(Xg,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:_f(Z.value)&&(i!=null&&i.storage)?Z.value.connector.source.configuration.map((H,M)=>{const V=Z.value;return a.jsx(rd,{children:a.jsx(Jie,{configIndex:M,connectorDef:V,dataStorage:i.storage,onRemoveConfiguration:$=>{F($)},onUpdateConfiguration:$=>j($),dataMartStatus:typeof C=="object"?C.code:C,totalConfigurations:V.connector.source.configuration.length},M)},M)}):null})]})})}),a.jsx(Mt,{})]})}),a.jsx(rd,{children:a.jsx(UI,{isOpen:y,onClose:()=>{g(!1)},onSubmit:Z=>void _(Z),dataStorageType:t,existingConnector:_f(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(br,{open:I,onOpenChange:k,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{G()},onCancel:()=>{T(null)},variant:"destructive"})]})}function nle({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=vd(),[i,c]=h.useState(!1);return h.useEffect(()=>{e===$e.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),a.jsxs("div",{className:"space-y-2",children:[e===$e.SQL&&a.jsx(Poe,{control:s}),e===$e.TABLE&&a.jsx(Uoe,{control:s,storageType:t}),e===$e.VIEW&&a.jsx(zoe,{control:s,storageType:t}),e===$e.TABLE_PATTERN&&a.jsx(Foe,{control:s,storageType:t}),e===$e.CONNECTOR&&a.jsx(tle,{control:s,storageType:t,preset:n,autoOpen:i,saveDataMartDefinition:r})]})}function zI(){const[e]=ZL(),t=e.get("preset");return h.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return Vee(n)},[t])}function rle(e,t){const[n,r]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const ale=1e3,sle=[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED];function ole(e){const[t,n]=h.useState(!1),[r,s]=h.useState(null),i=h.useRef({triggerId:null,abortController:null}),c=h.useCallback(g=>i.current.triggerId===g,[]),u=h.useCallback(g=>{s({isValid:!1,error:g instanceof Error?g.message:"Validation failed"}),n(!1)},[]),f=h.useCallback(async()=>{const{triggerId:g,abortController:x}=i.current;if(g){x==null||x.abort(),i.current={triggerId:null,abortController:null},s(null),n(!1);try{await Tn.abortSqlDryRunTrigger(e,g)}catch(v){console.error("Failed to cancel trigger:",v)}}},[e]),m=h.useCallback(async(g,x)=>{for(;!x.aborted&&c(g);)try{const v=await Tn.getSqlDryRunTriggerStatus(e,g);if(sle.includes(v)){const C=await Tn.getSqlDryRunTriggerResponse(e,g);s({isValid:C.isValid,error:C.error??void 0,bytes:C.bytes}),n(!1),i.current={triggerId:null,abortController:null};return}await new Promise(C=>setTimeout(C,ale))}catch(v){u(v),i.current={triggerId:null,abortController:null};return}},[e,c,u]),y=h.useCallback(async g=>{await f(),n(!0),s(null);try{const{triggerId:x}=await Tn.createSqlDryRunTrigger(e,g),v=new AbortController;i.current={triggerId:x,abortController:v},await m(x,v.signal)}catch(x){u(x)}},[e,f,m,u]);return h.useEffect(()=>()=>{const{triggerId:g,abortController:x}=i.current;x==null||x.abort(),g&&Tn.abortSqlDryRunTrigger(e,g).catch(()=>{})},[e]),{validateSql:y,isLoading:t,result:r,cancel:f}}const ile=300;function lle({sql:e,dataMartId:t,debounceDelay:n=ile,className:r="",onValidationStateChange:s}){const i=rle(e.trim(),n),{validateSql:c,isLoading:u,result:f,cancel:m}=ole(t);h.useEffect(()=>{if(!i){m();const g={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(g);return}c(i)},[i,c,m,s]),h.useEffect(()=>{const g={isLoading:u,isValid:(f==null?void 0:f.isValid)??null,error:(f==null?void 0:f.error)??null,bytes:(f==null?void 0:f.bytes)??null};s==null||s(g)},[u,f,s]);const y=()=>u?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(Rc,{className:"h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-sm",children:"Validating..."})]}):f?f.isValid?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(VP,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),f.bytes!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(cc,{className:"h-3 w-3 text-gray-600"}),a.jsx("span",{className:"text-xs text-gray-600",children:tJ(f.bytes)})]})}),a.jsx(jt,{children:a.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):a.jsxs("div",{className:"flex h-9 items-center gap-2",children:[a.jsx(rg,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),f.error&&a.jsx("span",{className:"text-xs text-red-500",children:f.error})]}):a.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[a.jsx(cc,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return a.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:y()})}const cle={isValid:null,isLoading:!1,error:null},ule=(e,t)=>{if(e!==$e.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},dle=e=>Z2(e);function fle({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:i}=bs(),c=zI();if(!r)throw new Error("Data mart not found");const{definition:u,id:f,storage:{type:m}}=r,[,y]=h.useState(cle),[g,x]=h.useState(!1),v=h.useCallback(()=>{if(!e)return;const B={definitionType:e,definition:Z2(e)};return u?{definitionType:e,definition:u}:B},[e,u]),C=h.useCallback(()=>{if(!e)return;const B=Loe(e,m);return yi(B)},[e,m]),S=Ro({resolver:C(),defaultValues:v(),mode:"onChange"}),{handleSubmit:w,reset:R,watch:j,formState:{isDirty:_,isValid:O}}=S,A=j("definition"),D=ule(e,A);h.useEffect(()=>{e&&R(v())},[e,R,v]),h.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const B={definitionType:c.definitionType,definition:dle(c.definitionType)};R(B)}},[c,e,t,R,n]);const T=h.useCallback(B=>{y({isLoading:B.isLoading,isValid:B.isValid,error:B.error})},[]),I=h.useCallback(B=>{n(B)},[n]),k=h.useCallback(async B=>{if(e&&f)try{await s(f,B.definitionType,B.definition),x(!0),R(B)}catch(Z){console.error("Failed to update data mart definition:",Z)}},[f,e,s,R]);h.useEffect(()=>{g&&(x(!1),i==null||i())},[g,i]);const F=h.useCallback(B=>{B==null||B.preventDefault(),w(k)(B)},[w,k]),G=h.useCallback(()=>{R(v())},[R,v]),Y=()=>e?a.jsxs("form",{onSubmit:F,className:"space-y-4",children:[a.jsx(nle,{definitionType:e,storageType:m,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:F}),e!==$e.CONNECTOR&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(we,{variant:"default",type:"submit",disabled:!O||!_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:G,disabled:!_,children:"Discard"}),e===$e.SQL&&D&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(lle,{sql:D,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return a.jsx(vO,{...S,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(Aoe,{initialType:e,onTypeSelect:I}),Y()]})})}function hle(e){switch(e){case Re.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Re.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};case Re.SNOWFLAKE:return{type:"snowflake-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function FI(e){return e.type==="bigquery-data-mart-schema"}function HI(e){return e.type==="athena-data-mart-schema"}function $I(e){return e.type==="snowflake-data-mart-schema"}function sN(e){return e!==null&&typeof e=="object"&&"mode"in e}function oN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function iN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function mle(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function d1(e){return e==null?e:JSON.parse(JSON.stringify(e))}function ple(e){const t=d1(e),[n,r]=h.useState(t),[s,i]=h.useState(!1);h.useEffect(()=>{const f=d1(e);r(f),i(!1)},[e]);const c=h.useCallback(f=>{n?FI(n)&&f.every(sN)?(r({...n,fields:f}),i(!0)):HI(n)&&f.every(oN)?(r({...n,fields:f}),i(!0)):$I(n)&&f.every(iN)&&(r({...n,fields:f}),i(!0)):f.length>0&&(sN(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),i(!0)):oN(f[0])?(r({type:"athena-data-mart-schema",fields:f}),i(!0)):iN(f[0])&&(r({type:"snowflake-data-mart-schema",fields:f}),i(!0)))},[n]),u=h.useCallback(()=>{const f=d1(e);r(f),i(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:u,setIsDirty:i}}function gle(e,t){const n=h.useRef(!1),r=h.useRef(!1),[s,i]=h.useState("idle");return h.useEffect(()=>{e||(n.current||r.current)&&(i(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,i("idle")},startActualizeOperation:()=>{r.current=!0,i("idle")},resetOperationStatus:()=>{i("idle")}}}function yle(e){const t=h.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]=h.useState({});return h.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function VI(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 i=e;return i.fields&&i.fields.length>0?i.fields.some(c=>VI(c,t)):!1}function GI(e,t,n=""){const r=[];return e.forEach((s,i)=>{const c=n?`${n}.${String(i)}`:String(i),u=s.name?s.name.toLowerCase().includes(t):!1,f=s.alias?s.alias.toLowerCase().includes(t):!1,m=s.description?s.description.toLowerCase().includes(t):!1;if((u||f||m)&&r.push(c),s.fields&&s.fields.length>0){const y=GI(s.fields,t,c);y.length>0&&(r.includes(c)||r.push(c),r.push(...y))}}),r}function xle(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return VI(r,s)}function vle(e){const[t,n]=h.useState(""),r=h.useCallback(i=>{n(i),e.setGlobalFilter(i)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}function ble(e){const[t,n]=h.useState(new Set),[r,s]=h.useState(null),i=h.useRef(""),c=h.useMemo(()=>{const C=S=>S.some(w=>w.type===ar.RECORD||w.type===ar.STRUCT||w.fields&&C(w.fields));return C(e)},[e]),u=h.useCallback(C=>{n(S=>{const w=new Set(S);return w.has(C)?w.delete(C):w.add(C),w})},[]),f=h.useCallback(()=>{const C=[],S=(w,R="")=>{w.forEach((j,_)=>{const O=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(O),S(j.fields,O))})};S(e),n(w=>C.every(j=>w.has(j))?new Set:new Set(C))},[e]),m=h.useMemo(()=>{const C=[],S=(w,R="",j=0)=>{w.forEach((_,O)=>{const A=R?`${R}.${String(O)}`:String(O),D=_.type===ar.RECORD||_.type===ar.STRUCT;C.push({..._,path:A,level:j}),D&&_.fields&&t.has(A)&&S(_.fields,A,j+1)})};return S(e),C},[e,t]),y=h.useCallback(C=>{if(C!==i.current)if(i.current=C,C){r===null&&s(new Set(t));const w=GI(e,C).filter(R=>{const j=R.split(".").map(Number);let _=e,O;for(let A=0;A<j.length;A++){if(O=_[j[A]],!O)return!1;if((O.type===ar.RECORD||O.type===ar.STRUCT)&&O.fields&&O.fields.length>0)return!0;A<j.length-1&&(_=O.fields??[])}return!1});n(R=>{const j=new Set(R);return w.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),s(null))},[e,t,r]),g=h.useCallback(C=>{const S=m[C];return S.type===ar.RECORD||S.type===ar.STRUCT},[m]),x=h.useMemo(()=>e.map(C=>({...C,fields:void 0})),[e]),v=h.useMemo(()=>{const C=[],S=(w,R="")=>{w.forEach((j,_)=>{const O=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(C.push(O),S(j.fields,O))})};return S(e),C.length===0?!1:C.every(w=>t.has(w))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:u,toggleAllRecords:f,flattenedFields:m,handleSearchChange:y,isRecordType:g,topLevelFields:x,allExpanded:v}}function Sle(e,t,n,r){const s=h.useCallback((f,m)=>{if(n){const y=[...e],g=t[f].path;if(!g)y[f]={...y[f],...m};else{const x=g.split(".").map(Number);let v=y,C;for(let w=0;w<x.length-1;w++)C=v[x[w]],v=C.fields??[];const S=x[x.length-1];v[S]&&(v[S]={...v[S],...m})}n(y)}},[e,t,n]),i=h.useCallback(()=>{if(n){const f={name:"",type:ar.STRING,mode:ah.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED};n([...e,f])}},[e,n]),c=h.useCallback(f=>{if(n){const m=[...e],y=t[f].path;if(!y)m.splice(f,1);else{const g=y.split(".").map(Number);let x=m,v;for(let S=0;S<g.length-1;S++)v=x[g[S]],x=v.fields??[];const C=g[g.length-1];x.splice(C,1)}n(m)}},[e,t,n]),u=h.useCallback(f=>{var m,y;if(n&&r){const g=[...e],x=t[f].path,v={name:"",type:ar.STRING,mode:ah.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED};if(!x)(m=g[f]).fields??(m.fields=[]),g[f].fields.push(v);else{const C=x.split(".").map(Number);let S=g;for(let w=0;w<C.length;w++){const R=C[w];w===C.length-1?((y=S[R]).fields??(y.fields=[]),S[R].fields.push(v)):S=S[R].fields??[]}}n(g)}},[e,t,n,r]);return{updateField:s,handleAddRow:i,handleDeleteRow:c,handleAddNestedField:u}}function nC(e,t,n){return{handleDragEnd:h.useCallback(s=>{const{active:i,over:c}=s;if(!c||i.id===c.id||!t)return;if(!n){const x=Number(i.id),v=Number(c.id),C=[...e],[S]=C.splice(x,1);C.splice(v,0,S),t(C);return}const u=n.findIndex((x,v)=>(x.path??String(v))===i.id),f=n.findIndex((x,v)=>(x.path??String(v))===c.id);if(u===-1||f===-1)return;const m=n[u].path,y=n[f].path,g=[...e];if(!m&&!y){const[x]=g.splice(u,1);g.splice(f,0,x),t(g);return}if(m&&y){const x=m.split(".").map(Number),v=y.split(".").map(Number);if(x.length===v.length&&x.slice(0,-1).join(".")===v.slice(0,-1).join(".")){let C=g;for(let j=0;j<x.length-1;j++)C=C[x[j]].fields??[];const S=x[x.length-1],w=v[v.length-1],[R]=C.splice(S,1);C.splice(w,0,R),t(g)}}},[e,n,t])}}function Cle(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Xy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Cd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function rC(e){return"nodeType"in e}function Na(e){var t,n;return e?Cd(e)?e:rC(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function aC(e){const{Document:t}=Na(e);return e instanceof t}function Kh(e){return Cd(e)?!1:e instanceof Na(e).HTMLElement}function BI(e){return e instanceof Na(e).SVGElement}function wd(e){return e?Cd(e)?e.document:rC(e)?aC(e)?e:Kh(e)||BI(e)?e.ownerDocument:document:document:document}const So=Xy?h.useLayoutEffect:h.useEffect;function sC(e){const t=h.useRef(e);return So(()=>{t.current=e}),h.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 wle(){const e=h.useRef(null),t=h.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ih(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return So(()=>{n.current!==e&&(n.current=e)},t),n}function Zh(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Lg(e){const t=sC(e),n=h.useRef(null),r=h.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Ib(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let f1={};function Yh(e,t){return h.useMemo(()=>{if(t)return t;const n=f1[e]==null?0:f1[e]+1;return f1[e]=n,e+"-"+n},[e,t])}function qI(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((i,c)=>{const u=Object.entries(c);for(const[f,m]of u){const y=i[f];y!=null&&(i[f]=y+e*m)}return i},{...t})}}const Bu=qI(1),Pg=qI(-1);function Ele(e){return"clientX"in e&&"clientY"in e}function oC(e){if(!e)return!1;const{KeyboardEvent:t}=Na(e.target);return t&&e instanceof t}function Rle(e){if(!e)return!1;const{TouchEvent:t}=Na(e.target);return t&&e instanceof t}function Mb(e){if(Rle(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 Ele(e)?{x:e.clientX,y:e.clientY}:null}const lh=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[lh.Translate.toString(e),lh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),lN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function jle(e){return e.matches(lN)?e:e.querySelector(lN)}const Tle={display:"none"};function _le(e){let{id:t,value:n}=e;return re.createElement("div",{id:t,style:Tle},n)}function Nle(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 re.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Ale(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const KI=h.createContext(null);function Dle(e){const t=h.useContext(KI);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Ole(){const[e]=h.useState(()=>new Set),t=h.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[h.useCallback(r=>{let{type:s,event:i}=r;e.forEach(c=>{var u;return(u=c[s])==null?void 0:u.call(c,i)})},[e]),t]}const Ile={draggable:`
|
|
819
|
-
To pick up a draggable item, press the space bar.
|
|
820
|
-
While dragging, use the arrow keys to move the item.
|
|
821
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
822
|
-
`},Mle={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 kle(e){let{announcements:t=Mle,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Ile}=e;const{announce:i,announcement:c}=Ale(),u=Yh("DndLiveRegion"),[f,m]=h.useState(!1);if(h.useEffect(()=>{m(!0)},[]),Dle(h.useMemo(()=>({onDragStart(g){let{active:x}=g;i(t.onDragStart({active:x}))},onDragMove(g){let{active:x,over:v}=g;t.onDragMove&&i(t.onDragMove({active:x,over:v}))},onDragOver(g){let{active:x,over:v}=g;i(t.onDragOver({active:x,over:v}))},onDragEnd(g){let{active:x,over:v}=g;i(t.onDragEnd({active:x,over:v}))},onDragCancel(g){let{active:x,over:v}=g;i(t.onDragCancel({active:x,over:v}))}}),[i,t])),!f)return null;const y=re.createElement(re.Fragment,null,re.createElement(_le,{id:r,value:s.draggable}),re.createElement(Nle,{id:u,announcement:c}));return n?Ls.createPortal(y,n):y}var vr;(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"})(vr||(vr={}));function Ug(){}function iC(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function lC(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Gs=Object.freeze({x:0,y:0});function Lle(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Ple(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ule(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function zle(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function cN(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 cC=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=cN(t,t.left,t.top),i=[];for(const c of r){const{id:u}=c,f=n.get(u);if(f){const m=Lle(cN(f),s);i.push({id:u,data:{droppableContainer:c,value:m}})}}return i.sort(Ple)};function Fle(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),i=Math.min(t.top+t.height,e.top+e.height),c=s-r,u=i-n;if(r<s&&n<i){const f=t.width*t.height,m=e.width*e.height,y=c*u,g=y/(f+m-y);return Number(g.toFixed(4))}return 0}const Hle=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:c}=i,u=n.get(c);if(u){const f=Fle(u,t);f>0&&s.push({id:c,data:{droppableContainer:i,value:f}})}}return s.sort(Ule)};function $le(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ZI(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Gs}function Vle(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((c,u)=>({...c,top:c.top+e*u.y,bottom:c.bottom+e*u.y,left:c.left+e*u.x,right:c.right+e*u.x}),{...n})}}const Gle=Vle(1);function Ble(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 qle(e,t,n){const r=Ble(t);if(!r)return e;const{scaleX:s,scaleY:i,x:c,y:u}=r,f=e.left-c-(1-s)*parseFloat(n),m=e.top-u-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),y=s?e.width/s:e.width,g=i?e.height/i:e.height;return{width:y,height:g,top:m,right:f+y,bottom:m+g,left:f}}const Kle={ignoreTransform:!1};function Ed(e,t){t===void 0&&(t=Kle);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:y}=Na(e).getComputedStyle(e);m&&(n=qle(n,m,y))}const{top:r,left:s,width:i,height:c,bottom:u,right:f}=n;return{top:r,left:s,width:i,height:c,bottom:u,right:f}}function uN(e){return Ed(e,{ignoreTransform:!0})}function Zle(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Yle(e,t){return t===void 0&&(t=Na(e).getComputedStyle(e)),t.position==="fixed"}function Wle(e,t){t===void 0&&(t=Na(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function uC(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(aC(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Kh(s)||BI(s)||n.includes(s))return n;const i=Na(e).getComputedStyle(s);return s!==e&&Wle(s,i)&&n.push(s),Yle(s,i)?n:r(s.parentNode)}return e?r(e):n}function YI(e){const[t]=uC(e,1);return t??null}function h1(e){return!Xy||!e?null:Cd(e)?e:rC(e)?aC(e)||e===wd(e).scrollingElement?window:Kh(e)?e:null:null}function WI(e){return Cd(e)?e.scrollX:e.scrollLeft}function XI(e){return Cd(e)?e.scrollY:e.scrollTop}function kb(e){return{x:WI(e),y:XI(e)}}var _r;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(_r||(_r={}));function QI(e){return!Xy||!e?!1:e===document.scrollingElement}function JI(e){const t={x:0,y:0},n=QI(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,i=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:c,isRight:u,maxScroll:r,minScroll:t}}const Xle={x:.2,y:.2};function Qle(e,t,n,r,s){let{top:i,left:c,right:u,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=Xle);const{isTop:m,isBottom:y,isLeft:g,isRight:x}=JI(e),v={x:0,y:0},C={x:0,y:0},S={height:t.height*s.y,width:t.width*s.x};return!m&&i<=t.top+S.height?(v.y=_r.Backward,C.y=r*Math.abs((t.top+S.height-i)/S.height)):!y&&f>=t.bottom-S.height&&(v.y=_r.Forward,C.y=r*Math.abs((t.bottom-S.height-f)/S.height)),!x&&u>=t.right-S.width?(v.x=_r.Forward,C.x=r*Math.abs((t.right-S.width-u)/S.width)):!g&&c<=t.left+S.width&&(v.x=_r.Backward,C.x=r*Math.abs((t.left+S.width-c)/S.width)),{direction:v,speed:C}}function Jle(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,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 eM(e){return e.reduce((t,n)=>Bu(t,kb(n)),Gs)}function ece(e){return e.reduce((t,n)=>t+WI(n),0)}function tce(e){return e.reduce((t,n)=>t+XI(n),0)}function nce(e,t){if(t===void 0&&(t=Ed),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);YI(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const rce=[["x",["left","right"],ece],["y",["top","bottom"],tce]];class dC{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=uC(n),s=eM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,u]of rce)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=u(r),y=s[i]-m;return this.rect[f]+y},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Vf{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 ace(e){const{EventTarget:t}=Na(e);return e instanceof t?e:wd(e)}function m1(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 ms;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ms||(ms={}));function dN(e){e.preventDefault()}function sce(e){e.stopPropagation()}var pn;(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"})(pn||(pn={}));const tM={start:[pn.Space,pn.Enter],cancel:[pn.Esc],end:[pn.Space,pn.Enter,pn.Tab]},oce=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case pn.Right:return{...n,x:n.x+25};case pn.Left:return{...n,x:n.x-25};case pn.Down:return{...n,y:n.y+25};case pn.Up:return{...n,y:n.y-25}}};class nM{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 Vf(wd(n)),this.windowListeners=new Vf(Na(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ms.Resize,this.handleCancel),this.windowListeners.add(ms.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ms.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&nce(r),n(Gs)}handleKeyDown(t){if(oC(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=tM,coordinateGetter:c=oce,scrollBehavior:u="smooth"}=s,{code:f}=t;if(i.end.includes(f)){this.handleEnd(t);return}if(i.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:m}=r.current,y=m?{x:m.left,y:m.top}:Gs;this.referenceCoordinates||(this.referenceCoordinates=y);const g=c(t,{active:n,context:r.current,currentCoordinates:y});if(g){const x=Pg(g,y),v={x:0,y:0},{scrollableAncestors:C}=r.current;for(const S of C){const w=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:O,maxScroll:A,minScroll:D}=JI(S),T=Jle(S),I={x:Math.min(w===pn.Right?T.right-T.width/2:T.right,Math.max(w===pn.Right?T.left:T.left+T.width/2,g.x)),y:Math.min(w===pn.Down?T.bottom-T.height/2:T.bottom,Math.max(w===pn.Down?T.top:T.top+T.height/2,g.y))},k=w===pn.Right&&!j||w===pn.Left&&!_,F=w===pn.Down&&!O||w===pn.Up&&!R;if(k&&I.x!==g.x){const G=S.scrollLeft+x.x,Y=w===pn.Right&&G<=A.x||w===pn.Left&&G>=D.x;if(Y&&!x.y){S.scrollTo({left:G,behavior:u});return}Y?v.x=S.scrollLeft-G:v.x=w===pn.Right?S.scrollLeft-A.x:S.scrollLeft-D.x,v.x&&S.scrollBy({left:-v.x,behavior:u});break}else if(F&&I.y!==g.y){const G=S.scrollTop+x.y,Y=w===pn.Down&&G<=A.y||w===pn.Up&&G>=D.y;if(Y&&!x.x){S.scrollTo({top:G,behavior:u});return}Y?v.y=S.scrollTop-G:v.y=w===pn.Down?S.scrollTop-A.y:S.scrollTop-D.y,v.y&&S.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(t,Bu(Pg(g,this.referenceCoordinates),v))}}}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()}}nM.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=tM,onActivation:s}=t,{active:i}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const u=i.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function fN(e){return!!(e&&"distance"in e)}function hN(e){return!!(e&&"delay"in e)}class fC{constructor(t,n,r){var s;r===void 0&&(r=ace(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:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=wd(c),this.documentListeners=new Vf(this.document),this.listeners=new Vf(r),this.windowListeners=new Vf(Na(c)),this.initialCoordinates=(s=Mb(i))!=null?s:Gs,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(ms.Resize,this.handleCancel),this.windowListeners.add(ms.DragStart,dN),this.windowListeners.add(ms.VisibilityChange,this.handleCancel),this.windowListeners.add(ms.ContextMenu,dN),this.documentListeners.add(ms.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(hN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(fN(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(ms.Click,sce,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ms.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:c,options:{activationConstraint:u}}=i;if(!s)return;const f=(n=Mb(t))!=null?n:Gs,m=Pg(s,f);if(!r&&u){if(fN(u)){if(u.tolerance!=null&&m1(m,u.tolerance))return this.handleCancel();if(m1(m,u.distance))return this.handleStart()}if(hN(u)&&m1(m,u.tolerance))return this.handleCancel();this.handlePending(u,m);return}t.cancelable&&t.preventDefault(),c(f)}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===pn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ice={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Wh extends fC{constructor(t){const{event:n}=t,r=wd(n.target);super(t,ice,r)}}Wh.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 lce={move:{name:"mousemove"},end:{name:"mouseup"}};var Lb;(function(e){e[e.RightClick=2]="RightClick"})(Lb||(Lb={}));class cce extends fC{constructor(t){super(t,lce,wd(t.event.target))}}cce.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 p1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class uce extends fC{constructor(t){super(t,p1)}static setup(){return window.addEventListener(p1.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(p1.move.name,t)};function t(){}}}uce.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 Gf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Gf||(Gf={}));var zg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zg||(zg={}));function dce(e){let{acceleration:t,activator:n=Gf.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:c=5,order:u=zg.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:y,delta:g,threshold:x}=e;const v=hce({delta:g,disabled:!i}),[C,S]=wle(),w=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),j=h.useMemo(()=>{switch(n){case Gf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Gf.DraggableRect:return s}},[n,s,f]),_=h.useRef(null),O=h.useCallback(()=>{const D=_.current;if(!D)return;const T=w.current.x*R.current.x,I=w.current.y*R.current.y;D.scrollBy(T,I)},[]),A=h.useMemo(()=>u===zg.TreeOrder?[...m].reverse():m,[u,m]);h.useEffect(()=>{if(!i||!m.length||!j){S();return}for(const D of A){if((r==null?void 0:r(D))===!1)continue;const T=m.indexOf(D),I=y[T];if(!I)continue;const{direction:k,speed:F}=Qle(D,I,j,t,x);for(const G of["x","y"])v[G][k[G]]||(F[G]=0,k[G]=0);if(F.x>0||F.y>0){S(),_.current=D,C(O,c),w.current=F,R.current=k;return}}w.current={x:0,y:0},R.current={x:0,y:0},S()},[t,O,r,S,i,c,JSON.stringify(j),JSON.stringify(v),C,m,A,y,JSON.stringify(x)])}const fce={x:{[_r.Backward]:!1,[_r.Forward]:!1},y:{[_r.Backward]:!1,[_r.Forward]:!1}};function hce(e){let{delta:t,disabled:n}=e;const r=Ib(t);return Zh(s=>{if(n||!r||!s)return fce;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[_r.Backward]:s.x[_r.Backward]||i.x===-1,[_r.Forward]:s.x[_r.Forward]||i.x===1},y:{[_r.Backward]:s.y[_r.Backward]||i.y===-1,[_r.Forward]:s.y[_r.Forward]||i.y===1}}},[n,t,r])}function mce(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Zh(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function pce(e,t){return h.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...i]},[]),[e,t])}var ch;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ch||(ch={}));var Pb;(function(e){e.Optimized="optimized"})(Pb||(Pb={}));const mN=new Map;function gce(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,c]=h.useState(null),{frequency:u,measure:f,strategy:m}=s,y=h.useRef(e),g=w(),x=ih(g),v=h.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[x]),C=h.useRef(null),S=Zh(R=>{if(g&&!n)return mN;if(!R||R===mN||y.current!==e||i!=null){const j=new Map;for(let _ of e){if(!_)continue;if(i&&i.length>0&&!i.includes(_.id)&&_.rect.current){j.set(_.id,_.rect.current);continue}const O=_.node.current,A=O?new dC(f(O),O):null;_.rect.current=A,A&&j.set(_.id,A)}return j}return R},[e,i,n,g,f]);return h.useEffect(()=>{y.current=e},[e]),h.useEffect(()=>{g||v()},[n,g]),h.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),h.useEffect(()=>{g||typeof u!="number"||C.current!==null||(C.current=setTimeout(()=>{v(),C.current=null},u))},[u,g,v,...r]),{droppableRects:S,measureDroppableContainers:v,measuringScheduled:i!=null};function w(){switch(m){case ch.Always:return!1;case ch.BeforeDragging:return n;default:return!n}}}function rM(e,t){return Zh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function yce(e,t){return rM(e,t)}function xce(e){let{callback:t,disabled:n}=e;const r=sC(t),s=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return h.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Qy(e){let{callback:t,disabled:n}=e;const r=sC(t),s=h.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return h.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function vce(e){return new dC(Ed(e),e)}function pN(e,t,n){t===void 0&&(t=vce);const[r,s]=h.useState(null);function i(){s(f=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=f??n)!=null?m:null}const y=t(e);return JSON.stringify(f)===JSON.stringify(y)?f:y})}const c=xce({callback(f){if(e)for(const m of f){const{type:y,target:g}=m;if(y==="childList"&&g instanceof HTMLElement&&g.contains(e)){i();break}}}}),u=Qy({callback:i});return So(()=>{i(),e?(u==null||u.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),c==null||c.disconnect())},[e]),r}function bce(e){const t=rM(e);return ZI(e,t)}const gN=[];function Sce(e){const t=h.useRef(e),n=Zh(r=>e?r&&r!==gN&&e&&t.current&&e.parentNode===t.current.parentNode?r:uC(e):gN,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function Cce(e){const[t,n]=h.useState(null),r=h.useRef(e),s=h.useCallback(i=>{const c=h1(i.target);c&&n(u=>u?(u.set(c,kb(c)),new Map(u)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const u=e.map(f=>{const m=h1(f);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,kb(m)]):null}).filter(f=>f!=null);n(u.length?new Map(u):null),r.current=e}return()=>{c(e),c(i)};function c(u){u.forEach(f=>{const m=h1(f);m==null||m.removeEventListener("scroll",s)})}},[s,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>Bu(i,c),Gs):eM(e):Gs,[e,t])}function yN(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==Gs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Pg(e,n.current):Gs}function wce(e){h.useEffect(()=>{if(!Xy)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 Ece(e,t){return h.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=c=>{i(c,t)},n},{}),[e,t])}function aM(e){return h.useMemo(()=>e?Zle(e):null,[e])}const xN=[];function Rce(e,t){t===void 0&&(t=Ed);const[n]=e,r=aM(n?Na(n):null),[s,i]=h.useState(xN);function c(){i(()=>e.length?e.map(f=>QI(f)?r:new dC(t(f),f)):xN)}const u=Qy({callback:c});return So(()=>{u==null||u.disconnect(),c(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),s}function jce(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Kh(t)?t:e}function Tce(e){let{measure:t}=e;const[n,r]=h.useState(null),s=h.useCallback(m=>{for(const{target:y}of m)if(Kh(y)){r(g=>{const x=t(y);return g?{...g,width:x.width,height:x.height}:x});break}},[t]),i=Qy({callback:s}),c=h.useCallback(m=>{const y=jce(m);i==null||i.disconnect(),y&&(i==null||i.observe(y)),r(y?t(y):null)},[t,i]),[u,f]=Lg(c);return h.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const _ce=[{sensor:Wh,options:{}},{sensor:nM,options:{}}],Nce={current:{}},Xp={draggable:{measure:uN},droppable:{measure:uN,strategy:ch.WhileDragging,frequency:Pb.Optimized},dragOverlay:{measure:Ed}};class Bf 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 Ace={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Bf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ug},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Xp,measureDroppableContainers:Ug,windowRect:null,measuringScheduled:!1},Dce={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ug,draggableNodes:new Map,over:null,measureDroppableContainers:Ug},Jy=h.createContext(Dce),sM=h.createContext(Ace);function Oce(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Bf}}}function Ice(e,t){switch(t.type){case vr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case vr.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 vr.DragEnd:case vr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case vr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Bf(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case vr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const c=new Bf(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case vr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Bf(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Mce(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=h.useContext(Jy),i=Ib(r),c=Ib(n==null?void 0:n.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!oC(i)||document.activeElement===i.target)return;const u=s.get(c);if(!u)return;const{activatorNode:f,node:m}=u;if(!f.current&&!m.current)return;requestAnimationFrame(()=>{for(const y of[f.current,m.current]){if(!y)continue;const g=jle(y);if(g){g.focus();break}}})}},[r,t,s,c,i]),null}function kce(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function Lce(e){return h.useMemo(()=>({draggable:{...Xp.draggable,...e==null?void 0:e.draggable},droppable:{...Xp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Xp.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 Pce(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=h.useRef(!1),{x:c,y:u}=typeof s=="boolean"?{x:s,y:s}:s;So(()=>{if(!c&&!u||!t){i.current=!1;return}if(i.current||!r)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const y=n(m),g=ZI(y,r);if(c||(g.x=0),u||(g.y=0),i.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const x=YI(m);x&&x.scrollBy({top:g.y,left:g.x})}},[t,c,u,r,n])}const oM=h.createContext({...Gs,scaleX:1,scaleY:1});var qi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(qi||(qi={}));const hC=h.memo(function(t){var n,r,s,i;let{id:c,accessibility:u,autoScroll:f=!0,children:m,sensors:y=_ce,collisionDetection:g=Hle,measuring:x,modifiers:v,...C}=t;const S=h.useReducer(Ice,void 0,Oce),[w,R]=S,[j,_]=Ole(),[O,A]=h.useState(qi.Uninitialized),D=O===qi.Initialized,{draggable:{active:T,nodes:I,translate:k},droppable:{containers:F}}=w,G=T!=null?I.get(T):null,Y=h.useRef({initial:null,translated:null}),B=h.useMemo(()=>{var wn;return T!=null?{id:T,data:(wn=G==null?void 0:G.data)!=null?wn:Nce,rect:Y}:null},[T,G]),Z=h.useRef(null),[H,M]=h.useState(null),[V,$]=h.useState(null),oe=ih(C,Object.values(C)),ge=Yh("DndDescribedBy",c),P=h.useMemo(()=>F.getEnabled(),[F]),U=Lce(x),{droppableRects:z,measureDroppableContainers:X,measuringScheduled:W}=gce(P,{dragging:D,dependencies:[k.x,k.y],config:U.droppable}),ae=mce(I,T),J=h.useMemo(()=>V?Mb(V):null,[V]),le=Es(),ye=yce(ae,U.draggable.measure);Pce({activeNode:T!=null?I.get(T):null,config:le.layoutShiftCompensation,initialRect:ye,measure:U.draggable.measure});const Ce=pN(ae,U.draggable.measure,ye),Ve=pN(ae?ae.parentElement:null),De=h.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),et=F.getNodeFor((n=De.current.over)==null?void 0:n.id),rt=Tce({measure:U.dragOverlay.measure}),dn=(r=rt.nodeRef.current)!=null?r:ae,zt=D?(s=rt.rect)!=null?s:Ce:null,On=!!(rt.nodeRef.current&&rt.rect),yn=bce(On?null:Ce),Me=aM(dn?Na(dn):null),q=Sce(D?et??ae:null),ne=Rce(q),ce=kce(v,{transform:{x:k.x-yn.x,y:k.y-yn.y,scaleX:1,scaleY:1},activatorEvent:V,active:B,activeNodeRect:Ce,containerNodeRect:Ve,draggingNodeRect:zt,over:De.current.over,overlayNodeRect:rt.rect,scrollableAncestors:q,scrollableAncestorRects:ne,windowRect:Me}),Oe=J?Bu(J,k):null,Ee=Cce(q),je=yN(Ee),He=yN(Ee,[Ce]),mt=Bu(ce,je),st=zt?Gle(zt,ce):null,Wt=B&&st?g({active:B,collisionRect:st,droppableRects:z,droppableContainers:P,pointerCoordinates:Oe}):null,sr=zle(Wt,"id"),[$n,Dr]=h.useState(null),Jr=On?ce:Bu(ce,He),fn=$le(Jr,(i=$n==null?void 0:$n.rect)!=null?i:null,Ce),or=h.useRef(null),kn=h.useCallback((wn,In)=>{let{sensor:Ye,options:Gt}=In;if(Z.current==null)return;const Xt=I.get(Z.current);if(!Xt)return;const Bt=wn.nativeEvent,Vn=new Ye({active:Z.current,activeNode:Xt,event:Bt,options:Gt,context:De,onAbort(Qt){if(!I.get(Qt))return;const{onDragAbort:K}=oe.current,ee={id:Qt};K==null||K(ee),j({type:"onDragAbort",event:ee})},onPending(Qt,Rr,K,ee){if(!I.get(Qt))return;const{onDragPending:Se}=oe.current,Ne={id:Qt,constraint:Rr,initialCoordinates:K,offset:ee};Se==null||Se(Ne),j({type:"onDragPending",event:Ne})},onStart(Qt){const Rr=Z.current;if(Rr==null)return;const K=I.get(Rr);if(!K)return;const{onDragStart:ee}=oe.current,fe={activatorEvent:Bt,active:{id:Rr,data:K.data,rect:Y}};Ls.unstable_batchedUpdates(()=>{ee==null||ee(fe),A(qi.Initializing),R({type:vr.DragStart,initialCoordinates:Qt,active:Rr}),j({type:"onDragStart",event:fe}),M(or.current),$(Bt)})},onMove(Qt){R({type:vr.DragMove,coordinates:Qt})},onEnd:Jt(vr.DragEnd),onCancel:Jt(vr.DragCancel)});or.current=Vn;function Jt(Qt){return async function(){const{active:K,collisions:ee,over:fe,scrollAdjustedTranslate:Se}=De.current;let Ne=null;if(K&&Se){const{cancelDrop:Be}=oe.current;Ne={activatorEvent:Bt,active:K,collisions:ee,delta:Se,over:fe},Qt===vr.DragEnd&&typeof Be=="function"&&await Promise.resolve(Be(Ne))&&(Qt=vr.DragCancel)}Z.current=null,Ls.unstable_batchedUpdates(()=>{R({type:Qt}),A(qi.Uninitialized),Dr(null),M(null),$(null),or.current=null;const Be=Qt===vr.DragEnd?"onDragEnd":"onDragCancel";if(Ne){const Fe=oe.current[Be];Fe==null||Fe(Ne),j({type:Be,event:Ne})}})}}},[I]),Ws=h.useCallback((wn,In)=>(Ye,Gt)=>{const Xt=Ye.nativeEvent,Bt=I.get(Gt);if(Z.current!==null||!Bt||Xt.dndKit||Xt.defaultPrevented)return;const Vn={active:Bt};wn(Ye,In.options,Vn)===!0&&(Xt.dndKit={capturedBy:In.sensor},Z.current=Gt,kn(Ye,In))},[I,kn]),Aa=pce(y,Ws);wce(y),So(()=>{Ce&&O===qi.Initializing&&A(qi.Initialized)},[Ce,O]),h.useEffect(()=>{const{onDragMove:wn}=oe.current,{active:In,activatorEvent:Ye,collisions:Gt,over:Xt}=De.current;if(!In||!Ye)return;const Bt={active:In,activatorEvent:Ye,collisions:Gt,delta:{x:mt.x,y:mt.y},over:Xt};Ls.unstable_batchedUpdates(()=>{wn==null||wn(Bt),j({type:"onDragMove",event:Bt})})},[mt.x,mt.y]),h.useEffect(()=>{const{active:wn,activatorEvent:In,collisions:Ye,droppableContainers:Gt,scrollAdjustedTranslate:Xt}=De.current;if(!wn||Z.current==null||!In||!Xt)return;const{onDragOver:Bt}=oe.current,Vn=Gt.get(sr),Jt=Vn&&Vn.rect.current?{id:Vn.id,rect:Vn.rect.current,data:Vn.data,disabled:Vn.disabled}:null,Qt={active:wn,activatorEvent:In,collisions:Ye,delta:{x:Xt.x,y:Xt.y},over:Jt};Ls.unstable_batchedUpdates(()=>{Dr(Jt),Bt==null||Bt(Qt),j({type:"onDragOver",event:Qt})})},[sr]),So(()=>{De.current={activatorEvent:V,active:B,activeNode:ae,collisionRect:st,collisions:Wt,droppableRects:z,draggableNodes:I,draggingNode:dn,draggingNodeRect:zt,droppableContainers:F,over:$n,scrollableAncestors:q,scrollAdjustedTranslate:mt},Y.current={initial:zt,translated:st}},[B,ae,Wt,st,I,dn,zt,z,F,$n,q,mt]),dce({...le,delta:k,draggingRect:st,pointerCoordinates:Oe,scrollableAncestors:q,scrollableAncestorRects:ne});const ea=h.useMemo(()=>({active:B,activeNode:ae,activeNodeRect:Ce,activatorEvent:V,collisions:Wt,containerNodeRect:Ve,dragOverlay:rt,draggableNodes:I,droppableContainers:F,droppableRects:z,over:$n,measureDroppableContainers:X,scrollableAncestors:q,scrollableAncestorRects:ne,measuringConfiguration:U,measuringScheduled:W,windowRect:Me}),[B,ae,Ce,V,Wt,Ve,rt,I,F,z,$n,X,q,ne,U,W,Me]),Da=h.useMemo(()=>({activatorEvent:V,activators:Aa,active:B,activeNodeRect:Ce,ariaDescribedById:{draggable:ge},dispatch:R,draggableNodes:I,over:$n,measureDroppableContainers:X}),[V,Aa,B,Ce,R,ge,I,$n,X]);return re.createElement(KI.Provider,{value:_},re.createElement(Jy.Provider,{value:Da},re.createElement(sM.Provider,{value:ea},re.createElement(oM.Provider,{value:fn},m)),re.createElement(Mce,{disabled:(u==null?void 0:u.restoreFocus)===!1})),re.createElement(kle,{...u,hiddenTextDescribedById:ge}));function Es(){const wn=(H==null?void 0:H.autoScrollEnabled)===!1,In=typeof f=="object"?f.enabled===!1:f===!1,Ye=D&&!wn&&!In;return typeof f=="object"?{...f,enabled:Ye}:{enabled:Ye}}}),Uce=h.createContext(null),vN="button",zce="Draggable";function Fce(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Yh(zce),{activators:c,activatorEvent:u,active:f,activeNodeRect:m,ariaDescribedById:y,draggableNodes:g,over:x}=h.useContext(Jy),{role:v=vN,roleDescription:C="draggable",tabIndex:S=0}=s??{},w=(f==null?void 0:f.id)===t,R=h.useContext(w?oM:Uce),[j,_]=Lg(),[O,A]=Lg(),D=Ece(c,t),T=ih(n);So(()=>(g.set(t,{id:t,key:i,node:j,activatorNode:O,data:T}),()=>{const k=g.get(t);k&&k.key===i&&g.delete(t)}),[g,t]);const I=h.useMemo(()=>({role:v,tabIndex:S,"aria-disabled":r,"aria-pressed":w&&v===vN?!0:void 0,"aria-roledescription":C,"aria-describedby":y.draggable}),[r,v,S,w,C,y.draggable]);return{active:f,activatorEvent:u,activeNodeRect:m,attributes:I,isDragging:w,listeners:r?void 0:D,node:j,over:x,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function Hce(){return h.useContext(sM)}const $ce="Droppable",Vce={timeout:25};function Gce(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Yh($ce),{active:c,dispatch:u,over:f,measureDroppableContainers:m}=h.useContext(Jy),y=h.useRef({disabled:n}),g=h.useRef(!1),x=h.useRef(null),v=h.useRef(null),{disabled:C,updateMeasurementsFor:S,timeout:w}={...Vce,...s},R=ih(S??r),j=h.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),v.current=null},w)},[w]),_=Qy({callback:j,disabled:C||!c}),O=h.useCallback((I,k)=>{_&&(k&&(_.unobserve(k),g.current=!1),I&&_.observe(I))},[_]),[A,D]=Lg(O),T=ih(t);return h.useEffect(()=>{!_||!A.current||(_.disconnect(),g.current=!1,_.observe(A.current))},[A,_]),h.useEffect(()=>(u({type:vr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:x,data:T}}),()=>u({type:vr.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==y.current.disabled&&(u({type:vr.SetDroppableDisabled,id:r,key:i,disabled:n}),y.current.disabled=n)},[r,i,n,u]),{active:c,rect:x,isOver:(f==null?void 0:f.id)===r,node:A,over:f,setNodeRef:D}}function iM(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Bce(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function kp(e){return e!==null&&e>=0}function qce(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 Kce(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const lM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=iM(t,r,n),c=t[s],u=i[s];return!u||!c?null:{x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height}},Lp={scaleX:1,scaleY:1},mC=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:c}=e;const u=(t=i[n])!=null?t:r;if(!u)return null;if(s===n){const m=i[c];return m?{x:0,y:n<c?m.top+m.height-(u.top+u.height):m.top-u.top,...Lp}:null}const f=Zce(i,s,n);return s>n&&s<=c?{x:0,y:-u.height-f,...Lp}:s<n&&s>=c?{x:0,y:u.height+f,...Lp}:{x:0,y:0,...Lp}};function Zce(e,t,n){const r=e[t],s=e[t-1],i=e[t+1];return r?n<t?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const cM="Sortable",uM=re.createContext({activeIndex:-1,containerId:cM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:lM,disabled:{draggable:!1,droppable:!1}});function pC(e){let{children:t,id:n,items:r,strategy:s=lM,disabled:i=!1}=e;const{active:c,dragOverlay:u,droppableRects:f,over:m,measureDroppableContainers:y}=Hce(),g=Yh(cM,n),x=u.rect!==null,v=h.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),C=c!=null,S=c?v.indexOf(c.id):-1,w=m?v.indexOf(m.id):-1,R=h.useRef(v),j=!qce(v,R.current),_=w!==-1&&S===-1||j,O=Kce(i);So(()=>{j&&C&&y(v)},[j,v,C,y]),h.useEffect(()=>{R.current=v},[v]);const A=h.useMemo(()=>({activeIndex:S,containerId:g,disabled:O,disableTransforms:_,items:v,overIndex:w,useDragOverlay:x,sortedRects:Bce(v,f),strategy:s}),[S,g,O.draggable,O.droppable,_,v,w,f,x,s]);return re.createElement(uM.Provider,{value:A},t)}const Yce=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return iM(n,r,s).indexOf(t)},Wce=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:i,newIndex:c,previousItems:u,previousContainerId:f,transition:m}=e;return!m||!r||u!==i&&s===c?!1:n?!0:c!==s&&t===f},Xce={duration:200,easing:"ease"},dM="transform",Qce=lh.Transition.toString({property:dM,duration:0,easing:"linear"}),Jce={roleDescription:"sortable"};function eue(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,c]=h.useState(null),u=h.useRef(n);return So(()=>{if(!t&&n!==u.current&&r.current){const f=s.current;if(f){const m=Ed(r.current,{ignoreTransform:!0}),y={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(y.x||y.y)&&c(y)}}n!==u.current&&(u.current=n)},[t,n,r,s]),h.useEffect(()=>{i&&c(null)},[i]),i}function tue(e){let{animateLayoutChanges:t=Wce,attributes:n,disabled:r,data:s,getNewIndex:i=Yce,id:c,strategy:u,resizeObserverConfig:f,transition:m=Xce}=e;const{items:y,containerId:g,activeIndex:x,disabled:v,disableTransforms:C,sortedRects:S,overIndex:w,useDragOverlay:R,strategy:j}=h.useContext(uM),_=nue(r,v),O=y.indexOf(c),A=h.useMemo(()=>({sortable:{containerId:g,index:O,items:y},...s}),[g,s,O,y]),D=h.useMemo(()=>y.slice(y.indexOf(c)),[y,c]),{rect:T,node:I,isOver:k,setNodeRef:F}=Gce({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...f}}),{active:G,activatorEvent:Y,activeNodeRect:B,attributes:Z,setNodeRef:H,listeners:M,isDragging:V,over:$,setActivatorNodeRef:oe,transform:ge}=Fce({id:c,data:A,attributes:{...Jce,...n},disabled:_.draggable}),P=Cle(F,H),U=!!G,z=U&&!C&&kp(x)&&kp(w),X=!R&&V,W=X&&z?ge:null,J=z?W??(u??j)({rects:S,activeNodeRect:B,activeIndex:x,overIndex:w,index:O}):null,le=kp(x)&&kp(w)?i({id:c,items:y,activeIndex:x,overIndex:w}):O,ye=G==null?void 0:G.id,Ce=h.useRef({activeId:ye,items:y,newIndex:le,containerId:g}),Ve=y!==Ce.current.items,De=t({active:G,containerId:g,isDragging:V,isSorting:U,id:c,index:O,items:y,newIndex:Ce.current.newIndex,previousItems:Ce.current.items,previousContainerId:Ce.current.containerId,transition:m,wasDragging:Ce.current.activeId!=null}),et=eue({disabled:!De,index:O,node:I,rect:T});return h.useEffect(()=>{U&&Ce.current.newIndex!==le&&(Ce.current.newIndex=le),g!==Ce.current.containerId&&(Ce.current.containerId=g),y!==Ce.current.items&&(Ce.current.items=y)},[U,le,g,y]),h.useEffect(()=>{if(ye===Ce.current.activeId)return;if(ye&&!Ce.current.activeId){Ce.current.activeId=ye;return}const dn=setTimeout(()=>{Ce.current.activeId=ye},50);return()=>clearTimeout(dn)},[ye]),{active:G,activeIndex:x,attributes:Z,data:A,rect:T,index:O,newIndex:le,items:y,isOver:k,isSorting:U,isDragging:V,listeners:M,node:I,overIndex:w,over:$,setNodeRef:P,setActivatorNodeRef:oe,setDroppableNodeRef:F,setDraggableNodeRef:H,transform:et??J,transition:rt()};function rt(){if(et||Ve&&Ce.current.newIndex===O)return Qce;if(!(X&&!oC(Y)||!m)&&(U||De))return lh.Transition.toString({...m,property:dM})}}function nue(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}}pn.Down,pn.Right,pn.Up,pn.Left;function qu({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:i,saveButtonText:c="Save",cancelButtonText:u="Discard"}){const[f,m]=h.useState(!1),[y,g]=h.useState(e),x=h.useRef(null),v=j=>{g(j.target.value)},C=()=>{n&&y!==e&&n(y.trim()),m(!1)},S=()=>{g(e),m(!1)},w=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),C()):j.key==="Escape"&&(j.preventDefault(),S())},R=j=>{m(j),j?(g(e),setTimeout(()=>{x.current&&x.current.focus()},0)):S()};return a.jsxs(G2,{open:f,onOpenChange:R,children:[a.jsx(B2,{asChild:!0,children:a.jsx("div",{className:se("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",i),children:e||t})}),a.jsxs(q2,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(Eo,{ref:x,value:y,onChange:v,onKeyDown:w,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),a.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:u}),a.jsx(we,{size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function rue({isAllExpanded:e,onToggle:t}){return a.jsx(we,{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?a.jsx(zP,{className:"h-4 w-4"}):a.jsx(rS,{className:"h-4 w-4"})})}function aue({isExpanded:e,onToggle:t,ariaLabel:n}){return a.jsx(we,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?a.jsx(Ss,{className:"h-4 w-4"}):a.jsx(_a,{className:"h-4 w-4"})})}function sue({className:e="",...t}){return a.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:a.jsx(TA,{className:"h-4 w-4 text-gray-400"})})}function gC({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,transition:c,isDragging:u}=tue({id:e}),f={transform:lh.Transform.toString(i),transition:c,opacity:u?.75:1},m=h.Children.toArray(t),y=[a.jsx($r,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:a.jsx(sue,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return a.jsx(Hn,{ref:s,style:f,className:"group",children:y})}function fM({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,i]=h.useState(!1),c=()=>{t&&t(e.index),i(!1)},u=r&&n&&r(e.index),f=!!t,m=u&&f;return a.jsxs("div",{className:"px-3 text-right",children:[a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{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:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[u&&a.jsxs(vt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[a.jsx(ma,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&a.jsx(la,{}),f&&a.jsxs(vt,{onClick:()=>{i(!0)},children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(br,{open:s,onOpenChange:i,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function oue({mode:e,onModeChange:t}){const n=Object.values(ah),r=s=>{t&&t(s)};return a.jsxs(ua,{value:e,onValueChange:r,children:[a.jsx(fa,{className:"h-90 cursor-pointer",size:"sm",children:a.jsx(da,{placeholder:"Select field mode"})}),a.jsx(ha,{className:"max-h-[300px]",children:n.map(s=>a.jsx(Bn,{value:s,children:s},s))})]})}var ex="Checkbox",[iue]=Sr(ex),[lue,yC]=iue(ex);function cue(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:c,name:u,onCheckedChange:f,required:m,value:y="on",internal_do_not_use_render:g}=e,[x,v]=ia({prop:n,defaultProp:s??!1,onChange:f,caller:ex}),[C,S]=h.useState(null),[w,R]=h.useState(null),j=h.useRef(!1),_=C?!!c||!!C.closest("form"):!0,O={checked:x,disabled:i,setChecked:v,control:C,setControl:S,name:u,form:c,value:y,hasConsumerStoppedPropagationRef:j,required:m,defaultChecked:cl(s)?!1:s,isFormControl:_,bubbleInput:w,setBubbleInput:R};return a.jsx(lue,{scope:t,...O,children:uue(g)?g(O):r})}var hM="CheckboxTrigger",mM=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:c,disabled:u,checked:f,required:m,setControl:y,setChecked:g,hasConsumerStoppedPropagationRef:x,isFormControl:v,bubbleInput:C}=yC(hM,e),S=ht(s,y),w=h.useRef(f);return h.useEffect(()=>{const R=i==null?void 0:i.form;if(R){const j=()=>g(w.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[i,g]),a.jsx(Je.button,{type:"button",role:"checkbox","aria-checked":cl(f)?"mixed":f,"aria-required":m,"data-state":bM(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:S,onKeyDown:Ie(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Ie(n,R=>{g(j=>cl(j)?!0:!j),C&&v&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});mM.displayName=hM;var pM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f,onCheckedChange:m,form:y,...g}=e;return a.jsx(cue,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:c,onCheckedChange:m,name:r,form:y,value:f,internal_do_not_use_render:({isFormControl:x})=>a.jsxs(a.Fragment,{children:[a.jsx(mM,{...g,ref:t,__scopeCheckbox:n}),x&&a.jsx(vM,{__scopeCheckbox:n})]})})});pM.displayName=ex;var gM="CheckboxIndicator",yM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=yC(gM,n);return a.jsx(Vr,{present:r||cl(i.checked)||i.checked===!0,children:a.jsx(Je.span,{"data-state":bM(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});yM.displayName=gM;var xM="CheckboxBubbleInput",vM=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:c,required:u,disabled:f,name:m,value:y,form:g,bubbleInput:x,setBubbleInput:v}=yC(xM,e),C=ht(n,v),S=E2(i),w=bS(r);h.useEffect(()=>{const j=x;if(!j)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,D=!s.current;if(S!==i&&A){const T=new Event("click",{bubbles:D});j.indeterminate=cl(i),A.call(j,cl(i)?!1:i),j.dispatchEvent(T)}},[x,S,i,s]);const R=h.useRef(cl(i)?!1:i);return a.jsx(Je.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:u,disabled:f,name:m,value:y,form:g,...t,tabIndex:-1,ref:C,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});vM.displayName=xM;function uue(e){return typeof e=="function"}function cl(e){return e==="indeterminate"}function bM(e){return cl(e)?"indeterminate":e?"checked":"unchecked"}function due({className:e,...t}){return a.jsx(pM,{"data-slot":"checkbox",className:se("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:a.jsx(yM,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5"})})})}function SM({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return a.jsx(due,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const bN={[Qa.CONNECTED]:{icon:vh,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[Qa.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:bh,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[Qa.DISCONNECTED]:{icon:tz,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function CM({status:e}){if(!(e in bN))return null;const t=bN[e],{icon:n,color:r,label:s,description:i}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(n,{className:se("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),a.jsxs(jt,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs font-medium",children:s}),a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:i})]})]})})}function xC({type:e,storageType:t,onTypeChange:n}){const r=t===Re.GOOGLE_BIGQUERY?Object.values(ar):t===Re.AWS_ATHENA?Object.values(m2):Object.values(p2),s=i=>{n&&(t===Re.GOOGLE_BIGQUERY||Re.AWS_ATHENA,n(i))};return a.jsxs(ua,{value:e,onValueChange:s,children:[a.jsx(fa,{className:"cursor-pointer",size:"sm",children:a.jsx(da,{placeholder:"Select field type"})}),a.jsx(ha,{className:"max-h-[300px]",children:r.map(i=>a.jsx(Bn,{value:i,children:i},i))})]})}function fue({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(vt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.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()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function hue({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:i,"aria-label":c}){const[u,f]=h.useState(n),m=h.useRef(!0);h.useEffect(()=>{(n===""||m.current)&&(f(n),m.current=!1)},[n]);const y=h.useCallback(g=>{const x=g.target.value;f(x);const v=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(v)}},[r,s]);return a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),a.jsx(It,{id:e,placeholder:t,value:u,onChange:y,className:i??"dm-card-toolbar-search-input","aria-label":c??t})]})}function mue({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s,disabled:i=!1}){return a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsx(hue,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),a.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&a.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([c,u])=>u===0?null:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(CM,{status:c}),a.jsx("span",{className:"text-sm font-medium text-gray-500",children:u})]},c))}),a.jsxs(we,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:i,"aria-label":"Add new field",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const pue={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function SN(e,t={}){const n=pue[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 gue({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:i,dragContextProps:c,rowComponent:u=Hn,getRowId:f}){const{isSchemaActualizationLoading:m}=bs(),y=t,g=i,x=u,{columnVisibility:v,setColumnVisibility:C}=yle(y),S=wl({data:e,columns:y,getCoreRowModel:Cl(),getFilteredRowModel:yd(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:v},onColumnVisibilityChange:C,enableGlobalFilter:!0,globalFilterFn:xle,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:w,onChange:R,searchValue:j}=vle(S),_=h.useRef("");h.useEffect(()=>{s&&j!==_.current&&(_.current=j,s(j))},[j,s]);const O=h.useMemo(()=>{const T={[Qa.CONNECTED]:0,[Qa.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[Qa.DISCONNECTED]:0};return(r??e).forEach(k=>{k.status in T&&T[k.status]++}),T},[e,r]);return a.jsxs("div",{className:"space-y-4",children:[n&&a.jsx(mue,{table:S,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:w,onFilterChange:R,statusCounts:O,disabled:m}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(El,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:S.getHeaderGroups().map(T=>a.jsx(Hn,{className:"dm-card-table-header-row",children:T.headers.map(I=>a.jsx(Tl,{className:"bg-secondary dark:bg-background",style:SN(I.column.id,{width:I.getSize()!==0?I.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:I.isPlaceholder?null:typeof I.column.columnDef.header=="function"?I.column.columnDef.header(I.getContext()):I.column.columnDef.header},I.id))},T.id))}),a.jsx(jl,{className:"dm-card-table-body",children:S.getRowModel().rows.length?a.jsx(g,{...c,children:S.getRowModel().rows.map(T=>a.jsx(x,{id:f?f(T):T.index,row:T,children:T.getVisibleCells().map(I=>a.jsx($r,{className:"bg-background dark:bg-muted",style:SN(I.column.id,{width:I.column.getSize()!==0?I.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:I.column.columnDef.cell&&typeof I.column.columnDef.cell=="function"?I.column.columnDef.cell(I.getContext()):null},I.id))},T.id))}):a.jsx(Hn,{children:a.jsx($r,{colSpan:y.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&a.jsxs(we,{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,disabled:m,"aria-label":"Add new field",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function vC({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:i=[],fieldsForStatusCount:c,onSearchChange:u,nameColumnHeader:f,nameColumnCell:m,primaryKeyColumnCell:y,aliasColumnCell:g,descriptionColumnCell:x,actionsColumnCell:v,dragContext:C,dragContextProps:S,rowComponent:w,getRowId:R}){const j=h.useCallback((T,I)=>{if(t){const k=[...e];k[T]={...k[T],...I},t(k)}},[e,t]),_=h.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),O=h.useCallback(T=>{if(t){const I=[...e];I.splice(T,1),t(I)}},[e,t]),A=h.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>a.jsx(CM,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(Et,{children:[a.jsx(Rt,{className:"cursor-default",children:"Name"}),a.jsx(jt,{children:"Field name in the output schema"})]})),size:80,cell:({row:T})=>m?m({row:T,updateField:j}):a.jsx(qu,{value:mle(T.getValue("name")),onValueChange:I=>{j(T.index,{name:I})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(Et,{children:[a.jsx(Rt,{className:"cursor-default",children:"PK"}),a.jsx(jt,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:T})=>y?y({row:T,updateField:j}):a.jsx(SM,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:I=>{j(T.index,{isPrimaryKey:I})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(Et,{children:[a.jsx(Rt,{className:"cursor-default",children:"Alias"}),a.jsx(jt,{children:"Alternative name for the field"})]}),size:80,cell:({row:T})=>g?g({row:T,updateField:j}):a.jsx(qu,{value:T.getValue("alias"),onValueChange:I=>{j(T.index,{alias:I})},placeholder:"-"})},{accessorKey:"description",header:()=>a.jsxs(Et,{children:[a.jsx(Rt,{className:"cursor-default",children:"Description"}),a.jsx(jt,{children:"Detailed information about the field"})]}),cell:({row:T})=>x?x({row:T,updateField:j}):a.jsx(qu,{value:T.getValue("description"),onValueChange:I=>{j(T.index,{description:I})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:T})=>a.jsx(fue,{table:T}),cell:({row:T,table:I})=>v?v({row:T,table:I}):a.jsx(fM,{row:T,onDeleteRow:t?O:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,O,t,f,m,y,g,x,v]),D=h.useMemo(()=>{const I={accessorKey:"type",header:()=>a.jsxs(Et,{children:[a.jsx(Rt,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(jt,{children:"Data type of the field"})]}),size:80,cell:F=>s({row:F.row,updateField:j}),enableHiding:!1},k=[...A];if(k.splice(3,0,I),i.length>0){const F=[...i];F.sort((G,Y)=>{const B=G.columnIndex??1/0,Z=Y.columnIndex??1/0;return B-Z}),F.forEach(G=>{if(G.columnIndex!==void 0){const Y=Math.min(Math.max(0,G.columnIndex),k.length);k.splice(Y,0,G)}else k.splice(k.length-1,0,G)})}return k},[A,s,j,i]);return a.jsx(gue,{fields:e,columns:D,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:u,dragContext:C,dragContextProps:S,rowComponent:w,getRowId:R})}function yue({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:i,flattenedFields:c,handleSearchChange:u,isRecordType:f,topLevelFields:m,allExpanded:y}=ble(e),{updateField:g,handleDeleteRow:x,handleAddNestedField:v,handleAddRow:C}=Sle(e,c,t,G=>G),S=h.useCallback(()=>({name:"",type:ar.STRING,mode:ah.NULLABLE,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),w=h.useCallback(({row:G})=>a.jsx(xC,{type:G.getValue("type"),storageType:Re.GOOGLE_BIGQUERY,onTypeChange:Y=>{g(G.index,{type:Y})}}),[g]),R=h.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(Et,{children:[a.jsx(Rt,{className:"cursor-default pl-[12px]",children:"Mode"}),a.jsx(jt,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
823
|
-
NULLABLE - field can be NULL
|
|
824
|
-
REQUIRED - field cant be NULL
|
|
825
|
-
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:G})=>a.jsx(oue,{mode:G.getValue("mode"),onModeChange:Y=>{g(G.index,{mode:Y})}}),columnIndex:4}],[g]),j=h.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(rue,{isAllExpanded:y,onToggle:i}),a.jsxs(Et,{children:[a.jsx(Rt,{className:"cursor-default",children:"Name"}),a.jsx(jt,{children:"Field name in the output schema"})]})]}),[r,y,i]),_=h.useCallback(({row:G})=>{const Y=c[G.index],Z=(Y.type===ar.RECORD||Y.type===ar.STRUCT)&&Y.fields&&Y.fields.length>0,H=Y.path??"",M=Y.level??0,V=n.has(H);return a.jsxs("div",{className:"flex items-center",children:[M>0&&a.jsx("div",{style:{width:`${String(M*16-(Z?4:0))}px`},className:"flex-shrink-0"}),Z?a.jsx(aue,{isExpanded:V,onToggle:()=>{s(H)},ariaLabel:V?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(qu,{value:G.getValue("name"),onValueChange:$=>{g(G.index,{name:$})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,g]),O=h.useCallback(({row:G})=>{const Y=c[G.index],B=Y.type===ar.RECORD||Y.type===ar.STRUCT;return(Y.level??0)===0&&!B?a.jsx(SM,{isPrimaryKey:G.getValue("isPrimaryKey"),onPrimaryKeyChange:H=>{g(G.index,{isPrimaryKey:H})}}):a.jsx("div",{})},[c,g]),A=h.useCallback(({row:G})=>a.jsx(qu,{value:G.getValue("description"),onValueChange:Y=>{g(G.index,{description:Y})},minRows:5,placeholder:"-"}),[g]),D=h.useCallback(({row:G})=>a.jsx(qu,{value:G.getValue("alias"),onValueChange:Y=>{g(G.index,{alias:Y})},placeholder:"-"}),[g]),T=h.useCallback(({row:G})=>a.jsx(fM,{row:G,onDeleteRow:t?x:void 0,onAddNestedField:t?v:void 0,isRecordType:f}),[t,x,v,f]),{handleDragEnd:I}=nC(e,t,c),k=h.useCallback(G=>{const Y=c[G.index];return Y.path??String(c.indexOf(Y))},[c]),F=lC(iC(Wh,{activationConstraint:{distance:5}}));return a.jsx(hC,{sensors:F,collisionDetection:cC,onDragEnd:I,children:a.jsx(vC,{fields:c,onFieldsChange:t,onAddRow:C,createNewField:S,renderTypeCell:w,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:u,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:O,aliasColumnCell:D,descriptionColumnCell:A,actionsColumnCell:T,dragContext:pC,dragContextProps:{items:c.map(G=>G.path??String(c.indexOf(G))),strategy:mC},rowComponent:gC,getRowId:k})})}function xue({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:m2.STRING,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(xC,{type:c.getValue("type"),storageType:Re.AWS_ATHENA,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=nC(e,t),i=lC(iC(Wh,{activationConstraint:{distance:5}}));return a.jsx(hC,{sensors:i,collisionDetection:cC,onDragEnd:s,children:a.jsx(vC,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:pC,dragContextProps:{items:e.map((c,u)=>u),strategy:mC},rowComponent:gC})})}function vue({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:p2.VARCHAR,isPrimaryKey:!1,status:Qa.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(xC,{type:c.getValue("type"),storageType:Re.SNOWFLAKE,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=nC(e,t),i=lC(iC(Wh,{activationConstraint:{distance:5}}));return a.jsx(hC,{sensors:i,collisionDetection:cC,onDragEnd:s,children:a.jsx(vC,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:pC,dragContextProps:{items:e.map((c,u)=>u),strategy:mC},rowComponent:gC})})}function bue({schema:e,storageType:t,onFieldsChange:n}){const r=h.useMemo(()=>{if(!e){const s=hle(t);return n(s.fields),s}return e},[e,t,n]);return FI(r)?a.jsx(yue,{fields:r.fields,onFieldsChange:n}):HI(r)?a.jsx(xue,{fields:r.fields,onFieldsChange:n}):$I(r)?a.jsx(vue,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function Sue({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:i,isSchemaActualizationLoading:c}=bs(),{id:u="",schema:f}=t??{},{schema:m,isDirty:y,updateSchema:g,resetSchema:x}=ple(f),{operationStatus:v,startSaveOperation:C}=gle(r,s);h.useEffect(()=>{v==="success"&&x()},[v,x]);const S=h.useCallback(O=>{g(O)},[g]),w=h.useCallback(()=>{u&&m&&(C(),n(u,m).then(()=>{i==null||i()}))},[u,m,C,n,i]),R=h.useCallback(()=>{i==null||i()},[i]),j=h.useCallback(()=>{x()},[x]),_=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx(bue,{schema:m,storageType:t.storage.type,onFieldsChange:S}),a.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[a.jsxs("div",{className:"flex space-x-4",children:[a.jsx(we,{variant:"default",onClick:w,disabled:!y||_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:j,disabled:!y||_,children:"Discard"})]}),a.jsx(we,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):a.jsx("div",{children:"Error: Data mart not found"})}function Cue(){const e=Yg(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(pO,{children:a.jsx(oae,{id:t})})}):a.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):a.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function wue({className:e,...t}){return a.jsx("div",{"data-slot":"card",className:se("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Eue({className:e,...t}){return a.jsx("div",{"data-slot":"card-header",className:se("@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 Rue({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:se("leading-none font-semibold",e),...t})}function jue({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:se("text-muted-foreground text-sm",e),...t})}function Tue({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:se("px-6",e),...t})}function _ue({className:e,...t}){return a.jsx("div",{"data-slot":"card-footer",className:se("flex items-center px-6 [.border-t]:pt-6",e),...t})}const bC=h.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function po({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=h.useContext(bC);return a.jsxs("div",{className:"flex items-center gap-2 self-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.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:a.jsx(e,{size:18})}),a.jsx(Rue,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(jue,{className:se("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.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:[a.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),a.jsx("span",{className:"sr-only",children:t})]})}),a.jsx(jt,{children:a.jsx("p",{children:t})})]})})]})}po.displayName="CollapsibleCardHeaderTitle";function Xh({children:e,className:t}){const n=r=>{r.stopPropagation()};return a.jsx("div",{className:se("flex items-center gap-2 self-center",t),onClick:n,children:e})}Xh.displayName="CollapsibleCardHeaderActions";function go({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=h.useContext(bC);let s,i;return h.Children.forEach(e,c=>{if(h.isValidElement(c))switch(c.type){case po:s=c;break;case Xh:i=c;break}}),a.jsxs(Eue,{className:se("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,a.jsxs("div",{className:"flex items-center gap-2",children:[i,t&&a.jsx("div",{className:se("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:a.jsx("div",{className:se("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:a.jsx(Ss,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}go.displayName="CollapsibleCardHeader";function yo({children:e}){return a.jsx(Tue,{className:"px-4 pt-1",children:e})}yo.displayName="CollapsibleCardContent";function ri({left:e,right:t}){return a.jsxs(_ue,{className:"flex items-center gap-2 px-4 py-4",children:[a.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&a.jsx("div",{className:"flex items-center",children:t})]})}ri.displayName="CollapsibleCardFooter";const CN="collapsed-card-";function ul({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:i,name:c}){const u=c?ps.get(`${CN}${c}`,"boolean")??s:s,[f,m]=h.useState(u);h.useEffect(()=>{c&&ps.set(`${CN}${c}`,f)},[f,c]);const y=()=>{const S=!f;m(S),i==null||i(S)};let g,x,v;h.Children.forEach(e,S=>{if(h.isValidElement(S))switch(S.type){case go:g=S;break;case yo:x=S;break;case ri:v=S;break}});const C={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 a.jsx(bC.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:y},children:a.jsxs(wue,{className:se(C[n],t),children:[g,a.jsx("div",{className:se("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:a.jsxs("div",{className:"overflow-hidden",children:[x,v]})})]})})}function Nue(){const{dataMart:e,updateDataMartStorage:t}=ws(),n=(e==null?void 0:e.definitionType)??null,[r,s]=h.useState(n);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs(ul,{collapsible:!0,name:"data-storage",children:[a.jsx(go,{children:a.jsx(po,{icon:cc,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(yo,{children:(e==null?void 0:e.storage)&&a.jsx(Noe,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx(ri,{})]}),a.jsxs(ul,{collapsible:!0,name:"input-source",children:[a.jsx(go,{children:a.jsx(po,{icon:aS,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(yo,{children:e&&a.jsx(fle,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),a.jsx(ri,{})]}),a.jsxs(ul,{collapsible:!0,name:"output-schema",children:[a.jsx(go,{children:a.jsx(po,{icon:WP,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(yo,{children:e&&a.jsx(Sue,{definitionType:r})}),a.jsx(ri,{})]})]})}function Aue({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:y,runReport:g}=ts(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,y,t,e.original.id,e.original.dataMart.id]),C=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=h.useCallback(async()=>{try{s(!0),await g(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[g,e.original.id]),w=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(Cr,{open:i,onOpenChange:c,children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Er,{id:x,align:"end",role:"menu",children:[a.jsxs(vt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem",children:[a.jsx(od,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),ky(e.original.destinationConfig)&&a.jsxs(a.Fragment,{children:[a.jsx(la,{}),a.jsxs(vt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Xg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(vt,{asChild:!0,children:a.jsxs("a",{href:KS(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[a.jsx(hU,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),a.jsx(la,{}),a.jsxs(vt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(br,{open:u,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{v()},variant:"destructive"})]})}const Due={[Mn.SUCCESS]:{icon:vh,color:"text-green-500",label:"Success"},[Mn.ERROR]:{icon:rg,color:"text-red-500",label:"Fail"},[Mn.RUNNING]:{icon:Rc,color:"text-primary animate-spin",label:"In progress"},[Mn.CANCELLED]:{icon:rg,color:"text-gray-500",label:"Cancelled"}};function wM({status:e,error:t}){if(!e)return null;const n=Due[e],{icon:r,color:s,label:i}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,u=()=>e===Mn.ERROR&&t?`${i}: ${t}`:i;return a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(r,{className:se("h-5 w-5",s),role:"img","aria-label":u(),"aria-describedby":c,tabIndex:0})}),a.jsxs(jt,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs",children:i}),e===Mn.ERROR&&t&&a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}var ol=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(ol||{});const Oue={[ol.TITLE]:"Title",[ol.LAST_RUN_DATE]:"Last Run Date",[ol.LAST_RUN_STATUS]:"Last Run Status"},Iue=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:ol.TITLE,header:({column:n})=>a.jsx(xr,{column:n,children:Oue[ol.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:ol.LAST_RUN_DATE,header:({column:n})=>a.jsx(xr,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Vs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:ol.LAST_RUN_STATUS,header:({column:n})=>a.jsx(xr,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(wM,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(xd,{table:n}),cell:({row:n})=>a.jsx(Aue,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Mue({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=ts(),s=h.useMemo(()=>n.filter(x=>x.dataDestination.type===Ae.GOOGLE_SHEETS&&x.dataDestination.id===e.id),[n,e.id]);h.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const i=h.useMemo(()=>Iue({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:u,columnVisibility:f,setColumnVisibility:m}=Oc({columns:i,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),y=wl({data:s,columns:i,getCoreRowModel:Cl(),onSortingChange:u,getSortedRowModel:Dc(),state:{sorting:c,columnVisibility:f},onColumnVisibilityChange:m}),g=`google-sheets-reports-table-${e.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:g,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(Rl,{className:"dm-card-table-header",children:y.getHeaderGroups().map(x=>a.jsx(Hn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(Tl,{style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.column.getSize())}%`},scope:"col",children:v.isPlaceholder?null:typeof v.column.columnDef.header=="function"?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},x.id))}),a.jsx(jl,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map((x,v)=>a.jsx(Hn,{onClick:()=>{const C=n.find(S=>S.id===x.original.id);C&&t(C)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((C,S)=>a.jsx($r,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},role:"cell","aria-colindex":S+1,children:typeof C.column.columnDef.cell=="function"?C.column.columnDef.cell(C.getContext()):C.column.columnDef.cell},C.id))},x.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:i.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function kue({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=h.useState(!1),[i,c]=h.useState(!1),[u,f]=h.useState(!1),{deleteReport:m,fetchReportsByDataMartId:y,runReport:g}=ts(),x=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await y(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[m,y,t,e.original.id,e.original.dataMart.id]),C=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=h.useCallback(async()=>{try{s(!0),await g(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[g,e.original.id]),w=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(Cr,{open:i,onOpenChange:c,children:[a.jsx(wr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${i?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":i,"aria-controls":x,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(Er,{id:x,align:"end",role:"menu",children:[a.jsxs(vt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem",children:[a.jsx(od,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(la,{}),a.jsxs(vt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Xg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(la,{}),a.jsxs(vt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(br,{open:u,onOpenChange:f,title:"Delete Report",description:`Are you sure you want to delete "${e.original.title}"? This action cannot be undone.`,confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{v()},variant:"destructive"})]})}function g1({column:e,children:t,label:n}){const r=e.getIsSorted(),s=h.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),i=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",u=n??(typeof t=="string"?t:"Column");return a.jsxs(we,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${u} - ${i()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(Zu,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Ss,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(Zu,{className:"text-muted-foreground h-4 w-4"})})]})]})}var il=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(il||{});const EM={[il.TITLE]:"Title",[il.LAST_RUN_DATE]:"Last Run Date",[il.LAST_RUN_STATUS]:"Last Run Status"};function Lue({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=EM[t.id]||t.id;return a.jsx(vt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.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()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(oa,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const Pue=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:il.TITLE,header:({column:n})=>a.jsx(g1,{column:n,children:EM[il.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:il.LAST_RUN_DATE,header:({column:n})=>a.jsx(g1,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Vs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:il.LAST_RUN_STATUS,header:({column:n})=>a.jsx(g1,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(wM,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(Lue,{table:n}),cell:({row:n})=>a.jsx(kue,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Uue({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:s}=ts(),i=h.useMemo(()=>r.filter(v=>v.dataDestination.type===e&&v.dataDestination.id===t.id),[r,t.id,e]);h.useEffect(()=>{s({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[s]);const c=h.useMemo(()=>Pue({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:y}=Oc({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),g=wl({data:i,columns:c,getCoreRowModel:Cl(),onSortingChange:f,getSortedRowModel:Dc(),state:{sorting:u,columnVisibility:m},onColumnVisibilityChange:y}),x=`email-reports-table-${t.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:x,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(Rl,{className:"dm-card-table-header",children:g.getHeaderGroups().map(v=>a.jsx(Hn,{className:"dm-card-table-header-row",children:v.headers.map(C=>a.jsx(Tl,{style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},scope:"col",children:C.isPlaceholder?null:typeof C.column.columnDef.header=="function"?C.column.columnDef.header(C.getContext()):C.column.columnDef.header},C.id))},v.id))}),a.jsx(jl,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((v,C)=>a.jsx(Hn,{onClick:()=>{const S=r.find(w=>w.id===v.original.id);S&&n(S)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":C+1,children:v.getVisibleCells().map((S,w)=>a.jsx($r,{className:`px-6 whitespace-normal ${S.column.id==="actions"?"actions-cell":""}`,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},role:"cell","aria-colindex":w+1,children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},v.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:c.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function zue({children:e,className:t,...n}){return a.jsx("div",{className:se("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 Fue({children:e,className:t,...n}){return a.jsx("div",{className:se("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function Hue({children:e,className:t,...n}){return a.jsx("div",{className:se("text-md font-medium",t),...n,children:e})}function $ue({children:e,className:t,...n}){return a.jsx("div",{className:se("text-muted-foreground text-sm",t),...n,children:e})}function Vue({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:s,tooltipTextSwitchOff:i,tooltipTextSwitchDisabled:c}){const u=t?c??"Disabled":e?s:i;return a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?a.jsx(Rc,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(Q2,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(jt,{children:u})]})}function Gue({icon:e,className:t,...n}){return a.jsx("div",{className:se("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:a.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??a.jsx(_a,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Bue(e){const{dataMart:t}=bs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:i}=ts(),[c,u]=h.useState(!1),f=h.useMemo(()=>n.find(v=>v.dataDestination.type===Ae.LOOKER_STUDIO&&v.dataDestination.id===e.id),[n,e.id]),m=h.useMemo(()=>(t==null?void 0:t.status.code)===zr.PUBLISHED,[t==null?void 0:t.status.code]),y=h.useMemo(()=>!!f,[f]),g=h.useMemo(()=>y?"Available in Looker Studio":"Not available in Looker Studio",[y]),x=h.useCallback(async v=>{if(!(!t||!m)){u(!0);try{if(v){const C={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:Ar.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(C),await i(t.id)}else f&&(await s(f.id),await i(t.id))}catch(C){console.error("Failed to toggle Looker Studio report:",C)}finally{u(!1)}}},[t,m,e,f,r,s,i]);return{existingReport:f,isLoading:c,isEnabled:m,isChecked:y,dynamicTitle:g,handleSwitchChange:x}}function que({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:i,isChecked:c,dynamicTitle:u,handleSwitchChange:f}=Bue(e),m=h.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(zue,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[a.jsx(Vue,{checked:c,disabled:!i,loading:s,onCheckedChange:y=>void f(y),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),a.jsxs(Fue,{children:[a.jsx(Hue,{children:u}),a.jsx($ue,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===Mn.SUCCESS&&"successfully ",a.jsx(Vs,{date:new Date(r.lastRunDate)}),r.lastRunStatus===Mn.ERROR&&" but failed with error",r.lastRunError&&a.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&&a.jsx(Gue,{})]})}function Kue(){const{scope:e}=mi();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(tS,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),a.jsx(we,{variant:"outline",asChild:!0,children:a.jsxs(Wr,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(_a,{className:"h-4 w-4"})]})})]})})}function Zue(){const[e,t]=h.useState(!1),[n,r]=h.useState(_n.CREATE),[s,i]=h.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(_n.CREATE),i(null),t(!0),Le({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(_n.EDIT),i(m),t(!0),Le({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),i(null),Le({event:"report_close",category:"Report",action:n===_n.EDIT?"Edit":"Create",label:"ReportForm"})}}}const Yue=[Ae.GOOGLE_SHEETS,Ae.EMAIL,Ae.SLACK,Ae.MS_TEAMS,Ae.GOOGLE_CHAT];function Wue({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=KQ(e),{isOpen:s,mode:i,editingReport:c,handleAddReport:u,handleEditReport:f,handleCloseModal:m}=Zue();return r?a.jsxs(a.Fragment,{children:[a.jsxs(ul,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(go,{children:[a.jsx(po,{icon:n.icon,children:e.title}),a.jsx(Xh,{children:Yue.includes(e.type)&&a.jsx(Xue,{dataMartStatus:t,onAddReport:u})})]}),a.jsx(yo,{children:a.jsx(Kde,{destination:e,onEditReport:f})}),a.jsx(ri,{})]}),a.jsx(qde,{destination:e,isOpen:s,onClose:m,mode:i,initialReport:c})]}):null}function Xue({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===zr.DRAFT;return a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("span",{children:a.jsxs(we,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[a.jsx(ma,{className:"h-4 w-4"}),"Add Report"]})})}),n&&a.jsx(jt,{children:a.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function Que({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){h.useEffect(()=>{{const s=setTimeout(()=>{const i=document.getElementById(e);if(i){const c=i;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 Jue=rn({title:Dt().min(1,"Title is required"),documentUrl:Dt().refine(p5,"Enter a valid Google Sheets URL"),dataDestinationId:Dt().min(1,"Destination is required")});function ede({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=ts();h.useEffect(()=>{f&&x&&(u(x),m(!1))},[x,f]);const C=Ro({resolver:yi(Jue),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&ky(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(i==null?void 0:i.id)??""},mode:"onTouched"}),{register:S,handleSubmit:w,formState:R,reset:j}=C,{errors:_,isDirty:O}=R,A=h.useCallback(async D=>{try{u(null),v(),m(!0);const{spreadsheetId:T,sheetId:I}=EQ(D.documentUrl);if(!T){u("Invalid Google Sheets URL");return}let k;if(t===_n.CREATE)k=await g({title:D.title,dataMartId:n,dataDestinationId:D.dataDestinationId,destinationConfig:{type:Ar.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:I}});else{if(!e){u("Initial report is required for edit mode");return}k=await y(e.id,{title:D.title,dataDestinationId:D.dataDestinationId,destinationConfig:{type:Ar.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:I}})}if(!k||x){u(x??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(k))}catch(F){console.error("onAfterSubmit failed",F)}s==null||s()}catch(T){console.error("Error submitting form:",T),u("An error occurred while submitting the form")}},[t,e,n,g,y,r,s,v,x]);return{form:C,register:S,handleSubmit:w,errors:_,isDirty:O,reset:j,formError:c,isSubmitting:f,setFormError:u,getValues:C.getValues,onSubmit:A}}function tde(e){return e.type===sl.SCHEDULED_REPORT_RUN}function nde(e,t){if(e.length!==t.length)return!1;const n=i=>`${i.id??"new"}|${i.cron}|${i.timezone}|${i.enabled?"1":"0"}`,r=[...e].sort((i,c)=>n(i).localeCompare(n(c))),s=[...t].sort((i,c)=>n(i).localeCompare(n(c)));for(let i=0;i<r.length;i++){const c=r[i],u=s[i];if(c.id!==u.id||c.cron!==u.cron||c.timezone!==u.timezone||c.enabled!==u.enabled)return!1}return!0}const wN=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,EN="0 9 * * *";function rde(e){return{id:e.id,cron:e.cronExpression,timezone:e.timeZone,enabled:e.isActive,lastRun:e.lastRunTimestamp??null,nextRun:e.nextRunTimestamp??null}}async function RN(e,t){return(await oo.getScheduledTriggers(e)).filter(s=>s.type===Fn.REPORT_RUN&&tde(s.triggerConfig)&&s.triggerConfig.reportId===t).map(rde)}const SC=h.forwardRef(({dataMartId:e,reportId:t,onDirtyChange:n},r)=>{const[s,i]=h.useState([]),[c,u]=h.useState([]),f=h.useRef(!1),[m,y]=h.useState(null);h.useEffect(()=>{let S=!1;async function w(){if(!e||!t){u([]),i([]),f.current=!0,n==null||n(!1);return}try{const R=await RN(e,t);S||(u(R),i(R),f.current=!0,n==null||n(!1))}catch{S||(u([]),i([]),f.current=!0,n==null||n(!1))}}return w(),()=>{S=!0}},[e,t,n]),h.useEffect(()=>{f.current&&(n==null||n(!nde(s,c)))},[s,c,n]),h.useImperativeHandle(r,()=>({persist:async S=>{const w=c.filter(A=>A.id!==null),R=s.filter(A=>A.id!==null),j=new Map(w.map(A=>[A.id,A])),_=new Map(R.map(A=>[A.id,A]));for(const[A]of j.entries())_.get(A)||await oo.deleteScheduledTrigger(e,A);for(const[A,D]of _.entries()){const T=j.get(A);T&&(T.cron!==D.cron||T.timezone!==D.timezone||T.enabled!==D.enabled)&&await oo.updateScheduledTrigger(e,A,{cronExpression:D.cron,timeZone:D.timezone,isActive:D.enabled})}const O=s.filter(A=>!A.id);for(const A of O)await oo.createScheduledTrigger(e,{type:Fn.REPORT_RUN,cronExpression:A.cron,timeZone:A.timezone,isActive:A.enabled,triggerConfig:{type:sl.SCHEDULED_REPORT_RUN,reportId:S}});try{const A=await RN(e,S);u(A),i(A),n==null||n(!1)}catch{u(s.map(A=>({...A}))),n==null||n(!1)}}}),[e,s,c,n]);const g=()=>{i(S=>[...S,{id:null,cron:EN,timezone:wN(),enabled:!0}])},x=S=>{i(w=>w.filter((R,j)=>j!==S))},v=(S,w)=>{i(R=>R.map((j,_)=>_===S?{...j,...w}:j))},C=s.length>0;return a.jsxs("div",{className:"flex flex-col gap-4",children:[C?s.map((S,w)=>a.jsxs("div",{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",children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ta,{htmlFor:`trigger-enabled-${String(w)}`,className:"text-sm font-normal",children:S.enabled?"Enabled":"Disabled"}),a.jsx(Q2,{id:`trigger-enabled-${String(w)}`,checked:S.enabled,onCheckedChange:R=>{v(w,{enabled:R})}})]}),a.jsx("div",{children:a.jsx(we,{variant:"ghost",size:"sm",type:"button","aria-label":"Delete trigger",onClick:()=>{y(w)},children:a.jsx(es,{className:"h-4 w-4","aria-hidden":"true"})})})]}),a.jsx(Ob,{cron:S.cron,timezone:S.timezone,enabled:S.enabled,onChange:v.bind(null,w),showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),(S.lastRun??S.nextRun)&&a.jsxs("div",{className:"text-muted-foreground mt-3 grid gap-1 text-xs sm:grid-cols-2",children:[S.lastRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Last run: "}),a.jsx(Vs,{date:new Date(S.lastRun)})]}),S.nextRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Next run: "}),a.jsx(Vs,{date:new Date(S.nextRun)})]})]}),m===w&&a.jsx(J5,{open:m===w,onOpenChange:R=>{R||y(null)},children:a.jsxs(eO,{children:[a.jsxs(tO,{children:[a.jsx(rO,{children:"Delete trigger?"}),a.jsx(aO,{children:"This action will remove this schedule from the report."})]}),a.jsxs(nO,{children:[a.jsx(oO,{onClick:()=>{y(null)},children:"Cancel"}),a.jsx(sO,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{x(w),y(null)},children:"Delete"})]})]})})]},`${S.id??"new"}:${String(w)}`)):a.jsxs("div",{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",children:[a.jsx(Ob,{cron:EN,timezone:wN(),enabled:!1,showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),a.jsx("div",{className:"gp-2 mt-3 flex items-center justify-between text-sm",children:a.jsx(we,{variant:"outline",type:"button",onClick:g,size:"sm",children:"+ Add trigger"})})]}),C&&a.jsx("div",{children:a.jsx(we,{variant:"outline",type:"button",onClick:g,children:"+ Add trigger"})})]})});SC.displayName="ReportSchedulesInlineList";function ade(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"service-account-details",children:[a.jsx(Zt,{children:"How do I get a correct document link?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open your Google Sheets document and select the specific ",a.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),a.jsxs("li",{children:["Share the document with the service account email and grant it ",a.jsx("strong",{children:"Editor"})," ","access."]}),a.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",a.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),a.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function y1(e){return"serviceAccount"in e}function RM({value:e,children:t,doNotTruncateContent:n}){const[r,s]=h.useState(!1),i=async()=>{e&&(await navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),2e3))};return a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("div",{role:"button",tabIndex:0,onClick:i,onKeyDown:c=>c.key==="Enter"&&i(),className:se("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:[a.jsx("span",{className:n?"w-[95%]":"truncate",children:t||e||"No data"}),r?a.jsx(oa,{className:"h-4 w-4 text-green-500"}):a.jsx(Yu,{className:"h-4 w-4"})]})}),a.jsx(jt,{children:a.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const sde=Ec("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l [&>*:not(:first-child)]:border-white/24 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function ode({className:e,orientation:t,...n}){return a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":t,className:se(sde({orientation:t}),e),...n})}const jM=({mode:e,isSubmitting:t,isDirty:n,triggersDirty:r,onRunAndSave:s,onCancel:i})=>{const c=t||!(n||r),u=e===_n.CREATE?"Create & Run report":n||r?"Save & Run report":"Run report";return a.jsxs(Mc,{children:[a.jsxs(ode,{className:"w-full",children:[a.jsx(we,{variant:"default",type:"submit",disabled:c,className:"flex-1",children:e===_n.CREATE?"Create new report":"Save changes to report"}),a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"default",type:"button",disabled:c,"aria-label":"More actions",className:"group",children:a.jsx(Ss,{className:"size-4 transition-transform duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})})}),a.jsx(Er,{align:"end",side:"top",children:a.jsx(vt,{onClick:s,disabled:t,children:u})})]})]}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,disabled:t,children:"Cancel"})]})},ide=h.forwardRef(({initialReport:e,mode:t=_n.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="google-sheets-edit-form",m="google-sheets-title-input",y="google-sheets-document-url-input",g="google-sheets-data-destination-select",{dataMart:x}=bs(),{scope:v}=mi(),{dataDestinations:C,fetchDataDestinations:S,loading:w}=Fh(),[R,j]=h.useState([]);h.useEffect(()=>{x&&S()},[x,S]),h.useEffect(()=>{if(C.length>0){const M=C.filter(V=>V.type===Ae.GOOGLE_SHEETS);j(M)}},[C]),Que({elementId:m,isOpen:!0,delay:150});const _=h.useRef(null),O=h.useRef(!1),[A,D]=h.useState(!1),{runReport:T}=ts(),{isDirty:I,reset:k,form:F,isSubmitting:G,formError:Y,onSubmit:B}=ede({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onAfterSubmit:async M=>{var V;try{await((V=_.current)==null?void 0:V.persist(M.id))}catch($){console.error("Failed to persist schedule for report",$)}if(O.current)try{await T(M.id)}catch($){throw console.error("Failed to run report",$),$}finally{O.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(Y)},[Y,r]),h.useEffect(()=>{if(t===_n.EDIT&&e&&ky(e.destinationConfig))k({title:e.title,documentUrl:KS(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===_n.CREATE){const M=(c==null?void 0:c.id)??"";k({title:"",documentUrl:"",dataDestinationId:M})}},[e,t,k,c]),h.useEffect(()=>{n==null||n(I||A)},[I,A,n]);const Z=F.watch("documentUrl"),H=Z&&p5(Z.trim());return a.jsx(_l,{...F,children:a.jsxs(gi,{id:f,ref:u,noValidate:!0,onSubmit:M=>void F.handleSubmit(B)(M),children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:F.control,name:"title",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(wt,{children:a.jsx(It,{id:m,placeholder:"Enter a report title",...M})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:F.control,name:"dataDestinationId",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(ua,{onValueChange:M.onChange,value:M.value,disabled:w||R.length===0,children:[a.jsx(wt,{children:a.jsx(fa,{id:g,className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{className:"truncate",placeholder:"Select a destination",children:M.value&&R.length>0&&(()=>{const V=R.find($=>$.id===M.value);if(V){const oe=aa.getInfo(V.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(oe,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:V.title})})]})}return null})()})})}),a.jsx(ha,{children:R.map(V=>{const oe=aa.getInfo(V.type).icon;return a.jsx(Bn,{value:V.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(oe,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:V.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(y1(V.credentials)&&B0(V.credentials.serviceAccount))??"No email found"})]})]})},V.id)})})]}),R.length===0&&!w&&a.jsxs(Y2,{className:"mt-2",children:[a.jsx(xh,{className:"h-4 w-4"}),a.jsx(EI,{children:"No destinations available"}),a.jsxs(W2,{children:["You need to create a Destination before you can create a report."," ",a.jsx(Wr,{to:v("/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"})]})]}),M.value&&R.length>0&&(()=>{const V=R.find($=>$.id===M.value);return V?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(yt,{children:"Service Account Email"}),a.jsx(RM,{value:y1(V.credentials)?B0(V.credentials.serviceAccount)??"No email found":"",children:y1(V.credentials)?B0(V.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:F.control,name:"documentUrl",render:({field:M})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),a.jsx(wt,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(It,{id:y,placeholder:"Document URL",className:"flex-1",...M}),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${H?"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:()=>{H&&window.open(Z.trim(),"_blank","noopener,noreferrer")},disabled:!H,"aria-label":H?"Open document in new tab":"Document link is not valid",children:a.jsx(ai,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(jt,{side:"top",align:"center",role:"tooltip",children:H?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(xn,{children:a.jsx(ade,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Automate Report Runs",children:x!=null&&x.id?a.jsx(SC,{ref:_,dataMartId:x.id,reportId:t===_n.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:D}):a.jsx(eC,{})})]}),a.jsx(jM,{mode:t,isSubmitting:G,isDirty:I,triggersDirty:A,onRunAndSave:()=>{O.current=!0,F.handleSubmit(B)()},onCancel:i})]})})});function lde({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=kc(t);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:r===_n.CREATE?"Create new report":"Edit report"}),a.jsx(yl,{children:r===_n.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx(zh,{children:a.jsx(ide,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(br,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const cde=rn({cacheLifetime:iY().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function ude({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,i]=h.useState(null),{createReport:c,updateReport:u}=ts(),f=Ro({resolver:yi(cde),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&N5(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async y=>{try{i(null);const{cacheLifetime:g}=y,x={type:Ar.LOOKER_STUDIO_CONFIG,cacheLifetime:g};e?await u(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(g){console.error("Error submitting form:",g),i("Failed to save report. Please try again.")}},formError:s,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function dde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"cache-lifetime-details",children:[a.jsx(Zt,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(Yt,{children:a.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 fde=[{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"}],hde=h.forwardRef(({initialReport:e,mode:t=_n.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="looker-studio-edit-form",{dataMart:m}=bs(),{isDirty:y,reset:g,form:x,isSubmitting:v,formError:C,onSubmit:S}=ude({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return h.useEffect(()=>{r&&r(C)},[C,r]),h.useEffect(()=>{t===_n.EDIT&&e&&N5(e.destinationConfig)?g({cacheLifetime:e.destinationConfig.cacheLifetime}):t===_n.CREATE&&g({cacheLifetime:300})},[e,t,g]),h.useEffect(()=>{n==null||n(y)},[y,n]),a.jsx(_l,{...x,children:a.jsxs(gi,{id:f,ref:u,noValidate:!0,onSubmit:w=>void x.handleSubmit(S)(w),children:[a.jsx(Nl,{children:a.jsx(Yr,{title:"Cache Configuration",children:a.jsx(Nt,{control:x.control,name:"cacheLifetime",render:({field:w})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),a.jsxs(ua,{onValueChange:R=>{w.onChange(parseInt(R,10))},value:w.value.toString(),defaultValue:"300",children:[a.jsx(wt,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select cache time"})})}),a.jsx(ha,{children:fde.map(R=>a.jsx(Bn,{value:R.value.toString(),children:R.label},R.value))})]}),a.jsx(Mt,{}),a.jsx(xn,{children:a.jsx(dde,{})})]})})})}),a.jsxs(Mc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===_n.CREATE?"Create":"Save changes",disabled:!y||v,children:v?t===_n.CREATE?"Creating...":"Saving...":t===_n.CREATE?"Create":"Save changes"}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function mde({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:y}=kc(t);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:(s==null?void 0:s.title)??"Looker Studio"}),a.jsx(yl,{children:r===_n.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx(zh,{children:a.jsx(hde,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:y,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(br,{open:i,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:f,variant:"destructive"})]})}const jN=({destination:e})=>{const n=aa.getInfo(e.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(n,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:e.title})})]})};function pde(e){return"to"in e}const gde=({destination:e})=>{if(!e)return null;const t=e.credentials,n=pde(t)&&t.to.length?t.to.join(", "):"";return a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(yt,{children:"Recipients of this report"}),a.jsx(RM,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var sc=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(sc||{});const yde=rn({title:Dt().min(1,"Title is required"),dataDestinationId:Dt().min(1,"Destination is required"),reportCondition:Ey(sc),subject:Dt().min(1,"Subject is required"),messageTemplate:Dt().min(1,"Message body is required")});function xde({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:y,createReport:g,error:x,clearError:v}=ts();h.useEffect(()=>{f&&x&&(u(x),m(!1))},[x,f]);const C=Ro({resolver:yi(yde),defaultValues:{title:(e==null?void 0:e.title)??"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(i==null?void 0:i.id)??"",reportCondition:e!=null&&e.destinationConfig&&K0(e.destinationConfig)?e.destinationConfig.reportCondition:sc.ALWAYS,subject:e!=null&&e.destinationConfig&&K0(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&K0(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:S,formState:w,reset:R}=C,{isDirty:j,errors:_}=w,O=h.useCallback(async A=>{try{u(null),v(),m(!0);let D;const T={type:Ar.EMAIL_CONFIG,reportCondition:A.reportCondition,subject:A.subject,messageTemplate:A.messageTemplate};if(t===_n.CREATE)D=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:T});else{if(!e){u("Initial report is required for edit mode");return}D=await y(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:T})}if(!D||x){u(x??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(D))}catch(I){console.error("onAfterSubmit failed",I)}s==null||s()}catch(D){console.error("Error submitting form:",D),u("An error occurred while submitting the form")}},[t,e,n,g,y,r,s,v,x]);return{form:C,handleSubmit:S,errors:_,isDirty:j,reset:R,formError:c,isSubmitting:f,setFormError:u,onSubmit:O}}function vde({value:e,onChange:t,onBlur:n,height:r=240,theme:s="light",options:i,className:c,placeholder:u="Start writing your message…"}){const f=m=>{n&&m.onDidBlurEditorText(n)};return a.jsx(H2,{language:"markdown",height:r,value:e,onChange:m=>{t(m??"")},onMount:f,theme:s,options:{wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",folding:!1,scrollBeyondLastLine:!1,automaticLayout:!0,placeholder:u,...i},className:c})}const bde=()=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ur,{className:"h-6 w-3/4"}),a.jsx(Ur,{className:"h-4 w-1/2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ur,{className:"h-4 w-full"}),a.jsx(Ur,{className:"h-4 w-5/6"}),a.jsx(Ur,{className:"h-4 w-4/5"}),a.jsx(Ur,{className:"h-4 w-3/4"})]})]});function TM({html:e,loading:t=!1,error:n=null,height:r=240,className:s,emptyState:i=a.jsx("div",{className:"text-muted-foreground text-sm",children:"Nothing to preview"})}){const{resolvedTheme:c}=gd(),[u,f]=h.useState({bg:"#fff",fg:"#000"});return h.useEffect(()=>{if(typeof window>"u")return;let m;const y=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{const g=getComputedStyle(document.documentElement),x=g.getPropertyValue("--background").trim()||"#fff",v=g.getPropertyValue("--foreground").trim()||"#000";f({bg:x,fg:v})})});return()=>{cancelAnimationFrame(y),cancelAnimationFrame(m)}},[c]),a.jsxs("div",{className:`bg-background overflow-auto rounded-md pl-2 ${s??""}`,style:{height:r},children:[t&&a.jsx(bde,{}),!t&&n&&a.jsxs("div",{className:"text-destructive text-sm",children:["Error: ",n]}),!t&&!n&&!e&&i,!t&&!n&&!!e&&a.jsx("iframe",{title:"Markdown preview",sandbox:"allow-popups allow-popups-to-escape-sandbox",srcDoc:`<!doctype html>
|
|
826
|
-
<html lang='en' style="background:${u.bg};color:${u.fg}">
|
|
827
|
-
<head>
|
|
828
|
-
<meta charset='utf-8'/>
|
|
829
|
-
<base target='_blank'>
|
|
830
|
-
</head>
|
|
831
|
-
<body>${e}</body>
|
|
832
|
-
</html>`,className:"h-full w-full border-0"})]})}function Sde({value:e,onChange:t}){return a.jsx(_2,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(N2,{children:[a.jsx(sh,{value:"markdown",children:"Markdown"}),a.jsx(sh,{value:"preview",children:"Preview"})]})})}function Cde({markdown:e,enabled:t=!0,debounceMs:n=300,toHtml:r}){const[s,i]=h.useState(""),[c,u]=h.useState(!1),[f,m]=h.useState(null),y=h.useRef(null);return h.useEffect(()=>{var C;if(!t)return;const g=e;if(!g.trim()){i(""),m(null),u(!1);return}const x=new AbortController;(C=y.current)==null||C.abort(),y.current=x,u(!0),m(null);const v=setTimeout(()=>{r(g,x.signal).then(S=>{i(S)}).catch(S=>{if(x.signal.aborted)return;const w=S instanceof Error?S.message:"Failed to load preview";m(w)}).finally(()=>{x.signal.aborted||u(!1)})},n);return()=>{clearTimeout(v),x.abort()}},[e,t,n,r]),{html:s,loading:c,error:f}}function wde(e,t){return Ea.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function _M(e){const t=h.useCallback(wde,[]);return Cde({...e,toHtml:t})}function Ede(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"message-details",children:[a.jsx(Zt,{children:"How can I format my message?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"You can format your message using Markdown — a simple text formatting syntax that lets you add structure and style without using complex editors."}),a.jsxs("p",{className:"mb-2",children:["For example:",a.jsx("br",{}),"**bold text** → ",a.jsx("b",{children:"bold text"}),a.jsx("br",{}),"*italic text* → ",a.jsx("i",{children:"italic text"}),a.jsx("br",{}),"- list item → • list item"]}),a.jsxs("p",{children:["Use the Preview tab to see how your message will look after formatting.",a.jsx("br",{}),"If you’re new to Markdown, learn more from this"," ",a.jsx(gn,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function Rde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"sending-condition-details",children:[a.jsx(Zt,{children:"What are Data Mart Run results?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"A Data Mart Run result is the outcome of processing your Data Mart — for example, running an SQL query that retrieves data for your report."}),a.jsx("p",{children:"Before sending a report, OWOX automatically runs the Data Mart and checks its result. Depending on your settings, the report can be sent always, only if the result is not empty, or only if it’s empty."})]})]})})}function jde(){return a.jsxs(Kt,{value:"sheets-api-details",children:[a.jsx(Zt,{children:"How do I enable the Google Sheets API?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx(gn,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})}function Tde(){return a.jsxs(Kt,{value:"looker-studio-details",children:[a.jsx(Zt,{children:"How do I connect to Looker Studio?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",a.jsx(gn,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),a.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),a.jsx(gn,{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"})]})]})}function _de(){return a.jsxs(Kt,{value:"odata-details",children:[a.jsx(Zt,{children:"How do I use OData?"}),a.jsxs(Yt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]})}function Nde(){return a.jsxs(Kt,{value:"email-details",children:[a.jsx(Zt,{children:"How do I start sending Email?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports by email, first configure the ",a.jsx("strong",{children:"Email"})," destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Email block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected addresses as formatted text."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/email/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-email",children:"OWOX documentation"}),"."]})]})]})}function Ade(){return a.jsxs(Kt,{value:"slack-details",children:[a.jsx(Zt,{children:"How do I start sending to Slack?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Slack, first configure the ",a.jsx("strong",{children:"Slack"})," destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Slack block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/slack/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-slack",children:"OWOX documentation"}),"."]})]})]})}function Dde(){return a.jsxs(Kt,{value:"msteams-details",children:[a.jsx(Zt,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Microsoft Teams, first configure the ",a.jsx("strong",{children:"Microsoft Teams"})," ","destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Microsoft Teams block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/microsoft-teams/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-microsoft-teams",children:"OWOX documentation"}),"."]})]})]})}function Ode(){return a.jsxs(Kt,{value:"googlechat-details",children:[a.jsx(Zt,{children:"How do I start sending to Google Chat?"}),a.jsxs(Yt,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Google Chat, first configure the ",a.jsx("strong",{children:"Google Chat"})," ","destination in this form (add a title and specify recipient addresses). Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Google Chat block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, add a subject and message, and set the delivery conditions. The generated report will be delivered by OWOX Data Marts to the connected space as chat messages."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(gn,{className:"underline",href:"https://docs.owox.com/docs/destinations/supported-destinations/google-chat/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-google-chat",children:"OWOX documentation"}),"."]})]})]})}const Ide={[Ae.GOOGLE_SHEETS]:jde,[Ae.LOOKER_STUDIO]:Tde,[Ae.ODATA]:_de,[Ae.EMAIL]:Nde,[Ae.SLACK]:Ade,[Ae.MS_TEAMS]:Dde,[Ae.GOOGLE_CHAT]:Ode};function Mde({destinationType:e}){const t=Ide[e];return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function kde({form:e,isEditMode:t,allowedDestinationTypes:n}){const{flags:r}=hd();return a.jsx(Nt,{control:e.control,name:"type",render:({field:s})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),a.jsxs(ua,{onValueChange:s.onChange,defaultValue:s.value,disabled:!!t,children:[a.jsx(wt,{children:a.jsx(fa,{className:"w-full",children:a.jsx(da,{placeholder:"Select a destination type"})})}),a.jsx(ha,{children:a.jsx(Hy,{children:aa.getAllTypes().filter(({type:i})=>n&&n.length>0?n.includes(i):!0).map(({type:i,displayName:c,icon:u,status:f})=>{const m=f===As.COMING_SOON,y=f===As.CLOUD_ONLY&&rJ(r);return a.jsx(a.Fragment,{children:y?a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Bn,{value:i,disabled:!0,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,a.jsx(Nr,{variant:"secondary",children:"Cloud & Enterprise"})]})},i)})}),a.jsxs(jt,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",a.jsxs(Wr,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/owox-cloud-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["Cloud edition",a.jsx(ai,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(Wr,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/self-managed-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["an Enterprise plan",a.jsx(ai,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Bn,{value:i,disabled:m,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,m&&a.jsx(Nr,{variant:"outline",children:f})]})},i)})})})})]}),a.jsx(xn,{children:a.jsx(Mde,{destinationType:s.value})}),a.jsx(Mt,{})]})})}const NM="credentials.to",Lde=/[,;\n]/,Pde=", ",AM="Enter emails separated by comma, semicolon or newline",Ude="Emails list";function TN(e){const t=new Set,n=[];for(const r of e.split(Lde)){const s=r.trim();if(!s)continue;const i=s.toLowerCase();t.has(i)||(t.add(i),n.push(s))}return n}function x1(e){return e.join(Pde)}function _N(e,t){e.setValue(NM,t,{shouldDirty:!0,shouldTouch:!0})}function zde({field:e,form:t}){const n=Array.isArray(e.value)?x1(e.value):"",[r,s]=h.useState(n),[i,c]=h.useState(!1),u=Array.isArray(e.value)?x1(e.value):"";h.useEffect(()=>{i||s(u)},[u,i]);const f=g=>{const x=g.target.value;s(x),_N(t,TN(x))},m=()=>{c(!0)},y=g=>{c(!1),e.onBlur();const x=TN(g.target.value);_N(t,x),s(x1(x))};return a.jsx(Eo,{name:e.name,ref:e.ref,onFocus:m,onBlur:y,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:AM})}function Pp({form:e,emailsFieldTitle:t=Ude}){return a.jsx(Nt,{control:e.control,name:NM,render:({field:n})=>a.jsxs(xt,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(yt,{tooltip:AM,children:t})}),a.jsx(wt,{children:a.jsx(zde,{field:n,form:e})}),a.jsx(Mt,{})]})})}function Fde(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"service-account-details",children:[a.jsx(Zt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(Yt,{children:[a.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."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(gn,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Hde({form:e}){const[t,n]=h.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},i=e.watch("credentials.serviceAccount"),c=i?C5(i):null;return a.jsx(Nt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(yt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&i&&a.jsx(we,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(we,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),a.jsx(wt,{children:!t&&c?a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(gn,{href:c.url,children:c.email})}),a.jsx(jt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Eo,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(xn,{children:a.jsx(Fde,{})}),a.jsx(Mt,{})]})})}function CC(e){return"destinationSecretKey"in e}function $de(){return a.jsx(Cn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(Kt,{value:"json-config-details",children:[a.jsx(Zt,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(Yt,{children:[a.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),a.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[a.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),a.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 Vde({form:e}){const t=e.getValues("credentials"),n=h.useMemo(()=>t&&CC(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=h.useMemo(()=>WS(n),[n]);return a.jsx(a.Fragment,{children:n.destinationSecretKey&&a.jsx(Nt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>a.jsxs(xt,{children:[a.jsx(yt,{children:"JSON Config"}),a.jsx(wt,{children:a.jsx(ND,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(Mt,{}),a.jsx(xn,{children:a.jsx($de,{})})]})})})}function Gde({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r,isEditMode:s,allowedDestinationTypes:i}){const c=Ro({resolver:yi(HQ),defaultValues:e??{title:"New Destination",type:Ae.GOOGLE_SHEETS},mode:"onTouched"}),u=c.watch("type");h.useEffect(()=>{r==null||r(c.formState.isDirty)},[c.formState.isDirty,r]);const f=async m=>{const{dirtyFields:y}=c.formState,g=S5(m);return y.credentials||delete g.credentials,t(g)};return a.jsx(_l,{...c,children:a.jsxs(gi,{onSubmit:m=>{c.handleSubmit(f)(m)},children:[a.jsxs(Nl,{children:[a.jsx(Nt,{control:c.control,name:"title",render:({field:m})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),a.jsx(wt,{children:a.jsx(It,{placeholder:"Enter title",...m})}),a.jsx(Mt,{})]})}),a.jsx(kde,{form:c,isEditMode:s,allowedDestinationTypes:i}),u===Ae.GOOGLE_SHEETS&&a.jsx(Hde,{form:c}),u===Ae.LOOKER_STUDIO&&a.jsx(Vde,{form:c}),u===Ae.EMAIL&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter user emails list"}),u===Ae.SLACK&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter Slack channel emails list"}),u===Ae.MS_TEAMS&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),u===Ae.GOOGLE_CHAT&&a.jsx(Pp,{form:c,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(Mc,{children:[a.jsxs(we,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!c.formState.isDirty||c.formState.isSubmitting,children:[c.formState.isSubmitting&&a.jsx(Rc,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),a.jsx(we,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function DM({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r,initialFormData:s,allowedDestinationTypes:i}){const{updateDataDestination:c,createDataDestination:u}=Fh(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:y,confirmClose:g,handleFormDirtyChange:x,handleFormSubmitSuccess:v}=kc(t);Ol(e);const C=async w=>{const R=x5.getMapper(w.type);if(n){const j=R.mapToUpdateRequest(w),_=await c(n.id,j);_&&r(_)}else{const j=R.mapToCreateRequest(w),_=await u(j);_&&r(_)}v()},S=h.useRef(!1);return h.useEffect(()=>{const w=n?"Edit":"Create";e&&!S.current?(Le({event:"data_destination_config_open",category:"DataDestination",action:w,label:n==null?void 0:n.type}),S.current=!0):!e&&S.current&&(Le({event:"data_destination_config_close",category:"DataDestination",action:w,label:n==null?void 0:n.type}),S.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:w=>{w||y()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:"Configure destination"}),a.jsx(yl,{children:"Customize settings for your destination"})]}),a.jsx(Gde,{initialData:n??s??null,onSubmit:C,onCancel:y,onDirtyChange:x,isEditMode:!!n,allowedDestinationTypes:i})]})}),a.jsx(br,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const Bde=[Ae.EMAIL,Ae.SLACK,Ae.GOOGLE_CHAT,Ae.MS_TEAMS],OM=h.forwardRef(({initialReport:e,mode:t=_n.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c,prefill:u,allowedDestinationTypes:f},m)=>{const y="email-report-edit-form",{dataMart:g}=ws(),x=h.useRef(null),v=h.useRef(!1),[C,S]=h.useState(!1),{runReport:w}=ts(),{dataDestinations:R,fetchDataDestinations:j,loading:_}=Fh(),[O,A]=h.useState([]),[D,T]=h.useState(!1);h.useEffect(()=>{g&&j()},[g,j]),h.useEffect(()=>{if(R.length>0){const W=f??(c!=null&&c.type?[c.type]:Bde),ae=R.filter(J=>W.includes(J.type));A(ae)}},[R,c==null?void 0:c.type,f]);const{isDirty:I,reset:k,form:F,isSubmitting:G,formError:Y,onSubmit:B}=xde({initialReport:e,mode:t,dataMartId:(g==null?void 0:g.id)??"",onAfterSubmit:async W=>{var ae;try{await((ae=x.current)==null?void 0:ae.persist(W.id))}catch(J){console.error("Failed to persist schedule for report",J)}if(v.current)try{await w(W.id)}catch(J){throw console.error("Failed to run report",J),J}finally{v.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(Y)},[Y,r]),h.useEffect(()=>{if(!(t===_n.EDIT&&e)){if(t===_n.CREATE){const W=(c==null?void 0:c.id)??"";k({title:(u==null?void 0:u.title)??"",dataDestinationId:W,reportCondition:sc.ALWAYS,subject:(u==null?void 0:u.subject)??"",messageTemplate:(u==null?void 0:u.messageTemplate)??""})}}},[e,t,k,c,u==null?void 0:u.title,u==null?void 0:u.subject,u==null?void 0:u.messageTemplate]),h.useEffect(()=>{n==null||n(I||C)},[I,C,n]);const Z=h.useMemo(()=>[{value:sc.ALWAYS,label:"Send always"},{value:sc.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:sc.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),{resolvedTheme:H}=gd(),M=H==="dark"?"vs-dark":"light",[V,$]=h.useState("markdown"),oe=F.watch("messageTemplate"),{html:ge,loading:P,error:U}=_M({markdown:oe,enabled:V==="preview"}),z=F.watch("dataDestinationId"),X=h.useMemo(()=>z&&O.length>0?O.find(W=>W.id===z)??null:null,[z,O]);return a.jsxs(a.Fragment,{children:[a.jsx(_l,{...F,children:a.jsxs(gi,{id:y,ref:m,noValidate:!0,onSubmit:W=>{F.handleSubmit(B)(W)},children:[a.jsxs(Nl,{children:[a.jsxs(Yr,{title:"General",children:[a.jsx(Nt,{control:F.control,name:"title",render:({field:W})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(wt,{children:a.jsx(It,{placeholder:"Enter a report title",...W})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:F.control,name:"dataDestinationId",render:({field:W})=>a.jsxs(xt,{children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsx(yt,{tooltip:"Select one of your existing destinations",children:"Destination"})}),a.jsxs(ua,{onValueChange:ae=>{if(ae==="__create_new__"){T(!0);return}W.onChange(ae)},value:W.value,disabled:_,children:[a.jsx(wt,{children:a.jsx(fa,{className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{className:"truncate",placeholder:"Select a destination",children:X&&a.jsx(jN,{destination:X})})})}),a.jsxs(ha,{children:[O.map(ae=>a.jsx(Bn,{value:ae.id,children:a.jsx(jN,{destination:ae})},ae.id)),O.length>0&&a.jsx(s6,{}),!c&&a.jsx(Bn,{value:"__create_new__",children:"+ Create new"})]})]}),a.jsx(gde,{destination:X}),a.jsx(Mt,{})]})})]}),a.jsxs(Yr,{title:"Template",children:[a.jsx(Nt,{control:F.control,name:"subject",render:({field:W})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),a.jsx(wt,{children:a.jsx(It,{placeholder:"Enter a message title",...W})}),a.jsx(Mt,{})]})}),a.jsx(Nt,{control:F.control,name:"messageTemplate",render:({field:W})=>a.jsxs(xt,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(yt,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),a.jsx(Sde,{value:V,onChange:$})]}),a.jsx(wt,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:V==="markdown"?a.jsx(vde,{value:W.value,onChange:ae=>{W.onChange(ae)},onBlur:W.onBlur,height:240,theme:M}):a.jsx(TM,{html:ge,loading:P,error:U,height:240})})}),a.jsx(xn,{children:a.jsx(Ede,{})}),a.jsx(Mt,{})]})})]}),a.jsx(Yr,{title:"Sending conditions",children:a.jsx(Nt,{control:F.control,name:"reportCondition",render:({field:W})=>a.jsxs(xt,{children:[a.jsx(yt,{tooltip:"Define when the report should be sent based on your Data Mart’s execution result",children:"Data Mart Run results"}),a.jsxs(ua,{onValueChange:W.onChange,value:W.value,children:[a.jsx(wt,{children:a.jsx(fa,{className:"w-full max-w-full overflow-hidden",children:a.jsx(da,{})})}),a.jsx(ha,{children:Z.map(ae=>a.jsx(Bn,{value:ae.value,children:ae.label},ae.value))})]}),a.jsx(xn,{children:a.jsx(Rde,{})}),a.jsx(Mt,{})]})})}),a.jsx(Yr,{title:"Automate Report Runs",children:g!=null&&g.id?a.jsx(SC,{ref:x,dataMartId:g.id,reportId:t===_n.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:S}):a.jsx(eC,{})})]}),a.jsx(jM,{mode:t,isSubmitting:G,isDirty:I,triggersDirty:C,onRunAndSave:()=>{v.current=!0,F.handleSubmit(B)()},onCancel:i})]})}),a.jsx(DM,{isOpen:D,onClose:()=>{T(!1)},dataDestination:null,initialFormData:{title:"New Destination",type:(f==null?void 0:f[0])??Ae.EMAIL},allowedDestinationTypes:f,onSaveSuccess:W=>{j().then(()=>{F.setValue("dataDestinationId",W.id,{shouldDirty:!0,shouldTouch:!0}),T(!1)})}})]})});OM.displayName="EmailReportEditForm";function IM({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c}){const{projectId:u,id:f}=Yg(),{pathname:m}=Bs(),{showUnsavedDialog:y,setShowUnsavedDialog:g,handleClose:x,confirmClose:v,handleFormDirtyChange:C,handleFormSubmitSuccess:S}=kc(t),w=h.useCallback(()=>{const R=u&&f?`/ui/${u}/data-marts/${f}/reports`:"/";m.includes("/reports")||p_("Report has been created",{closeButton:!0,description:a.jsxs(a.Fragment,{children:["You can view it in"," ",a.jsx(Wr,{to:R,className:"underline underline-offset-4",onClick:()=>p_.dismiss(),children:"Destinations"})," ","page"]}),duration:1/0}),S()},[S,u,f,m]);return Ol(e),a.jsxs(a.Fragment,{children:[a.jsx(ci,{open:e,onOpenChange:R=>{R||x()},children:a.jsxs(ui,{children:[a.jsxs(di,{children:[a.jsx(fi,{children:(s==null?void 0:s.title)??"Report"}),a.jsx(yl,{children:r===_n.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx(zh,{children:a.jsx(OM,{initialReport:n,mode:r,onDirtyChange:C,onSubmit:w,onCancel:x,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c})})]})}),a.jsx(br,{open:y,onOpenChange:g,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}function qde({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Ae.GOOGLE_SHEETS:return a.jsx(lde,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ae.LOOKER_STUDIO:return a.jsx(mde,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Ae.EMAIL:case Ae.SLACK:case Ae.GOOGLE_CHAT:case Ae.MS_TEAMS:return a.jsx(IM,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function Kde({destination:e,onEditReport:t}){switch(e.type){case Ae.GOOGLE_SHEETS:return a.jsx(Mue,{destination:e,onEditReport:t});case Ae.EMAIL:case Ae.SLACK:case Ae.GOOGLE_CHAT:case Ae.MS_TEAMS:return a.jsx(Uue,{destinationType:e.type,destination:e,onEditReport:t});case Ae.LOOKER_STUDIO:return a.jsx(que,{destination:e,onEditReport:t});default:return null}}function MM(){return a.jsx("div",{className:"flex flex-col gap-4",children:a.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>a.jsx("div",{className:"border-border rounded-lg border p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Ur,{className:"h-4 w-4 rounded-full"}),a.jsx(Ur,{className:"h-4 w-40"}),a.jsx(Ur,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ur,{className:"h-6 w-16 rounded-full"}),a.jsx(Ur,{className:"h-4 w-4"})]})]})},t))})})}function wC({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const s=h.useRef(r);s.current=r;const i=h.useRef(null);h.useEffect(()=>{var f;if(!e)return;(f=i.current)==null||f.abort(),i.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const m=new AbortController;s.current(m.signal)}};c();const u=window.setInterval(c,t);return()=>{var m;window.clearInterval(u),(m=i.current)==null||m.abort()}},[e,t,n])}function Zde({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=bs(),{fetchReportsByDataMartId:r}=ts(),s=n==null?void 0:n.id;h.useEffect(()=>{s&&r(s)},[s,r]),wC({enabled:!!s&&e,intervalMs:t,onTick:()=>{s&&r(s,{silent:!0})}})}function Yde(){const{dataMart:e}=bs(),{dataDestinations:t,isLoading:n}=ZQ();return Zde({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(MM,{}):t.length===0?a.jsx(Kue,{}):t.map(r=>a.jsx(Wue,{destination:r,dataMartStatus:e.status},r.id))}):null}function Wde(){return a.jsx(zh,{children:a.jsx(ZS,{children:a.jsx(Yde,{})})})}function NN(){return a.jsxs(ul,{children:[a.jsx(go,{children:a.jsx(po,{icon:TP,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(yo,{children:a.jsx(lae,{})}),a.jsx(ri,{})]})}function Xde(){const{dataMart:e}=ws(),[t,n]=h.useState(!1),r=h.useCallback(()=>{n(!0)},[]),s=h.useCallback(()=>{n(!1)},[]);return a.jsxs(ul,{children:[a.jsxs(go,{children:[a.jsx(po,{icon:nS,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(Xh,{children:a.jsxs(we,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(yo,{children:a.jsx(rd,{children:a.jsx(lie,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(Zie,{dataMartId:e.id}),a.jsx(J2,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),a.jsx(ri,{})]})}const Qde={list:[],listLoadingStatus:St.IDLE,activeInsight:null,activeInsightLoadingStatus:St.IDLE,executionStatus:St.IDLE,executionTriggerId:null,error:null};var ft=(e=>(e.FETCH_INSIGHTS_START="FETCH_INSIGHTS_START",e.FETCH_INSIGHTS_SUCCESS="FETCH_INSIGHTS_SUCCESS",e.FETCH_INSIGHTS_ERROR="FETCH_INSIGHTS_ERROR",e.GET_INSIGHT_START="GET_INSIGHT_START",e.GET_INSIGHT_SUCCESS="GET_INSIGHT_SUCCESS",e.GET_INSIGHT_ERROR="GET_INSIGHT_ERROR",e.CREATE_INSIGHT_START="CREATE_INSIGHT_START",e.CREATE_INSIGHT_SUCCESS="CREATE_INSIGHT_SUCCESS",e.CREATE_INSIGHT_ERROR="CREATE_INSIGHT_ERROR",e.UPDATE_INSIGHT_START="UPDATE_INSIGHT_START",e.UPDATE_INSIGHT_SUCCESS="UPDATE_INSIGHT_SUCCESS",e.UPDATE_INSIGHT_ERROR="UPDATE_INSIGHT_ERROR",e.DELETE_INSIGHT_START="DELETE_INSIGHT_START",e.DELETE_INSIGHT_SUCCESS="DELETE_INSIGHT_SUCCESS",e.DELETE_INSIGHT_ERROR="DELETE_INSIGHT_ERROR",e.RUN_INSIGHT_START="RUN_INSIGHT_START",e.RUN_INSIGHT_START_ERROR="RUN_INSIGHT_START_ERROR",e.RUN_INSIGHT_STARTED="RUN_INSIGHT_STARTED",e.RUN_INSIGHT_SUCCESS="RUN_INSIGHT_SUCCESS",e.RUN_INSIGHT_ERROR="RUN_INSIGHT_ERROR",e.CLEAR_ERROR="CLEAR_ERROR",e))(ft||{});class Jde extends bl{constructor(){super("/data-marts")}async getInsights(t){return this.get(`/${t}/insights`)}async getInsightById(t,n){return await this.get(`/${t}/insights/${n}`)}async createInsight(t,n){return this.post(`/${t}/insights`,n)}async updateInsight(t,n,r){return this.put(`/${t}/insights/${n}`,r)}async updateInsightTitle(t,n,r){return this.put(`/${t}/insights/${n}/title`,r)}async deleteInsight(t,n){return this.delete(`/${t}/insights/${n}`)}async startInsightExecution(t,n){return this.post(`/${t}/insights/${n}/run-triggers`,{})}async checkInsightExecutionStatus(t,n,r,s){return this.get(`/${t}/insights/${r}/run-triggers/${n}/status`,null,s)}async getInsightRunTriggers(t,n,r){return this.get(`/${t}/insights/${n}/run-triggers/`,null,r)}}const Zo=new Jde,kf=e=>({id:e.id,title:e.title,template:e.template??null,output:e.output??null,outputUpdatedAt:e.outputUpdatedAt?new Date(e.outputUpdatedAt):null,lastRun:e.lastManualDataMartRun?{status:e.lastManualDataMartRun.status,id:e.lastManualDataMartRun.id}:null,createdById:e.createdById,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}),efe=e=>e.data.map(kf),tfe=e=>({title:e.title,template:e.template??null}),nfe=e=>({title:e.title,template:e.template??null}),kM=h.createContext(void 0);function LM(){const e=h.useContext(kM);if(!e)throw new Error("useInsightsContext must be used within InsightsProvider");return e}function EC(){const{state:e,dispatch:t}=LM(),{dataMart:n}=ws();if(!n)throw new Error("useInsights must be used within a DataMart context");const r=h.useCallback(async()=>{t({type:ft.FETCH_INSIGHTS_START});try{const v=await Zo.getInsights(n.id),C=efe(v);t({type:ft.FETCH_INSIGHTS_SUCCESS,payload:C})}catch(v){throw t({type:ft.FETCH_INSIGHTS_ERROR,payload:un(v)}),v}},[n.id,t]),s=h.useCallback(async v=>{t({type:ft.GET_INSIGHT_START});try{const C=await Zo.getInsightById(n.id,v),S=kf(C);return t({type:ft.GET_INSIGHT_SUCCESS,payload:S}),S}catch(C){throw t({type:ft.GET_INSIGHT_ERROR,payload:un(C)}),C}},[n.id,t]),i=h.useCallback(async v=>{t({type:ft.CREATE_INSIGHT_START});try{const C=tfe(v),S=await Zo.createInsight(n.id,C),w=kf(S);return t({type:ft.CREATE_INSIGHT_SUCCESS,payload:w}),Le({event:"insight_created",category:"Insights",action:"Create",label:w.id}),_t.success("Insight created"),w}catch(C){return t({type:ft.CREATE_INSIGHT_ERROR,payload:un(C)}),null}},[n.id,t]),c=h.useCallback(async(v,C)=>{t({type:ft.UPDATE_INSIGHT_START});try{const S=nfe(C),w=await Zo.updateInsight(n.id,v,S),R=kf(w);return t({type:ft.UPDATE_INSIGHT_SUCCESS,payload:R}),Le({event:"insight_updated",category:"Insights",action:"Update",label:R.id}),_t.success("Insight updated"),R}catch(S){return t({type:ft.UPDATE_INSIGHT_ERROR,payload:un(S)}),null}},[n.id,t]),u=h.useCallback(async v=>{t({type:ft.DELETE_INSIGHT_START});try{await Zo.deleteInsight(n.id,v),t({type:ft.DELETE_INSIGHT_SUCCESS,payload:v}),Le({event:"insight_deleted",category:"Insights",action:"Delete",label:v}),_t.success("Insight deleted")}catch(C){throw t({type:ft.DELETE_INSIGHT_ERROR,payload:un(C)}),C}},[n.id,t]),f=h.useCallback(async(v,C)=>{t({type:ft.UPDATE_INSIGHT_START});try{const S=await Zo.updateInsightTitle(n.id,v,{title:C}),w=kf(S),R=e.list.find(_=>_.id===v)??e.activeInsight,j=R?{...w,template:R.template}:w;return t({type:ft.UPDATE_INSIGHT_SUCCESS,payload:j}),Le({event:"insight_title_updated",category:"Insights",action:"Update title",label:j.id}),_t.success("Title updated"),j}catch(S){return t({type:ft.UPDATE_INSIGHT_ERROR,payload:un(S)}),null}},[n.id,t,e.activeInsight,e.list]),m=h.useCallback(async v=>{t({type:ft.RUN_INSIGHT_START});try{const C=await Zo.startInsightExecution(n.id,v);t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:C.triggerId}})}catch(C){t({type:ft.RUN_INSIGHT_ERROR,payload:un(C)})}},[t,n.id]),y=h.useCallback(()=>{t({type:ft.RUN_INSIGHT_SUCCESS,payload:{triggerId:""}})},[t]),g=h.useCallback(v=>{t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:v}})},[t]),x=h.useCallback(async()=>{const v=e.activeInsight;if(!(!v||!n.id)&&!e.executionTriggerId&&!(!v.lastRun||wJ(v.lastRun.status)))try{const S=(await Zo.getInsightRunTriggers(n.id,v.id,{skipLoadingIndicator:!0})).data.sort((w,R)=>new Date(R.modifiedAt).getTime()-new Date(w.modifiedAt).getTime()).find(w=>!EJ(w.status));S!=null&&S.id&&(t({type:ft.RUN_INSIGHT_START}),t({type:ft.RUN_INSIGHT_STARTED,payload:{triggerId:S.id}}))}catch(C){t({type:ft.RUN_INSIGHT_ERROR,payload:un(C)})}},[e.activeInsight,e.executionTriggerId,n.id,t]);return{insights:e.list,activeInsight:e.activeInsight,listLoading:e.listLoadingStatus===St.LOADING,insightLoading:e.activeInsightLoadingStatus===St.LOADING,isRunning:e.executionStatus===St.LOADING,triggerId:e.executionTriggerId,error:e.error,fetchInsights:r,getInsight:s,createInsight:i,updateInsight:c,updateInsightTitle:f,deleteInsight:u,runInsight:m,setTriggerId:g,resetTriggerId:y,ensureActiveRunPolling:x}}function rfe(){const{state:e}=LM(),t=h.useMemo(()=>e.list,[e.list]),n=h.useMemo(()=>e.listLoadingStatus===St.LOADING,[e.listLoadingStatus]),r=h.useMemo(()=>e.listLoadingStatus===St.LOADED||e.listLoadingStatus===St.ERROR,[e.listLoadingStatus]),s=h.useMemo(()=>e.error,[e.error]),i=h.useMemo(()=>t.length>0,[t.length]);return{insights:t,isLoading:n,isLoaded:r,error:s,hasInsights:i}}function afe(e,t){var n,r;switch(t.type){case ft.FETCH_INSIGHTS_START:return{...e,listLoadingStatus:St.LOADING,error:null};case ft.GET_INSIGHT_START:return{...e,activeInsightLoadingStatus:St.LOADING,error:null};case ft.CREATE_INSIGHT_START:return{...e,activeInsightLoadingStatus:St.LOADING,error:null};case ft.UPDATE_INSIGHT_START:return{...e,error:null};case ft.DELETE_INSIGHT_START:return{...e,listLoadingStatus:St.LOADING,error:null};case ft.FETCH_INSIGHTS_SUCCESS:return{...e,list:t.payload,listLoadingStatus:St.LOADED,error:null};case ft.GET_INSIGHT_SUCCESS:return{...e,activeInsight:t.payload,activeInsightLoadingStatus:St.LOADED,error:null};case ft.CREATE_INSIGHT_SUCCESS:return{...e,list:[...e.list,t.payload],listLoadingStatus:St.LOADED,activeInsightLoadingStatus:St.LOADED,error:null};case ft.UPDATE_INSIGHT_SUCCESS:return{...e,list:e.list.map(s=>s.id===t.payload.id?t.payload:s),activeInsight:((n=e.activeInsight)==null?void 0:n.id)===t.payload.id?t.payload:e.activeInsight,listLoadingStatus:St.LOADED,error:null};case ft.DELETE_INSIGHT_SUCCESS:return{...e,list:e.list.filter(s=>s.id!==t.payload),activeInsight:((r=e.activeInsight)==null?void 0:r.id)===t.payload?null:e.activeInsight,listLoadingStatus:St.LOADED,error:null};case ft.FETCH_INSIGHTS_ERROR:return{...e,listLoadingStatus:St.ERROR,error:t.payload};case ft.GET_INSIGHT_ERROR:return{...e,activeInsightLoadingStatus:St.ERROR,error:t.payload};case ft.CREATE_INSIGHT_ERROR:return{...e,listLoadingStatus:St.ERROR,activeInsightLoadingStatus:St.ERROR,error:t.payload};case ft.UPDATE_INSIGHT_ERROR:case ft.DELETE_INSIGHT_ERROR:return{...e,listLoadingStatus:St.ERROR,error:t.payload};case ft.RUN_INSIGHT_START:return{...e,executionStatus:St.LOADING,error:null};case ft.RUN_INSIGHT_STARTED:return{...e,executionTriggerId:t.payload.triggerId,error:null};case ft.RUN_INSIGHT_SUCCESS:return{...e,executionStatus:St.LOADED,executionTriggerId:null,error:null};case ft.CLEAR_ERROR:return{...e,error:null};default:return e}}function PM({children:e,initialState:t}){const[n,r]=h.useReducer(afe,t??Qde);return a.jsx(kM.Provider,{value:{state:n,dispatch:r},children:e})}function sfe(){return a.jsx(PM,{children:a.jsx(Xb,{})})}function ofe({status:e}){switch(e){case qn.RUNNING:return a.jsx(Nr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case qn.SUCCESS:return a.jsx(Nr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case qn.FAILED:return a.jsx(Nr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case qn.CANCELLED:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case qn.INTERRUPTED:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case qn.PENDING:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return a.jsx(Nr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var sa=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(sa||{}),Ds=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(Ds||{});const AN=(e,t,n=!1)=>{var c,u,f,m;const r=e.split(`
|
|
833
|
-
`).filter(y=>y.trim()!=="");if(r.length>=3){const y=r[0],g=r[1],x=r.slice(2).join(`
|
|
834
|
-
`);if(y.includes("T")&&y.includes("Z")){const v=v1(x);return{id:`log-${t.toString()}`,timestamp:Su(y),level:n?sa.ERROR:sa.INFO,message:v.message,metadata:{at:(c=v.metadata)!=null&&c.at?Su(v.metadata.at):Su(y),type:((u=v.metadata)==null?void 0:u.type)??(g!=="unknown"?g:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const y=v1(s[3]);return{id:`log-${t.toString()}`,timestamp:Su(s[1]),level:n?sa.ERROR:s[2],message:y.message,metadata:(f=y.metadata)!=null&&f.at?{...y.metadata,at:Su(y.metadata.at)}:y.metadata}}const i=v1(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?sa.ERROR:sa.INFO,message:i.message,metadata:(m=i.metadata)!=null&&m.at?{...i.metadata,at:Su(i.metadata.at)}:i.metadata}},v1=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 i=s[0],c=r[i];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}},UM=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},ife=(e,t)=>{var i,c;let n="",r="";switch(e.type){case Pr.CONNECTOR:n=t??"",r="connector";break;case Pr.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Pr.GOOGLE_SHEETS_EXPORT:case Pr.EMAIL:case Pr.SLACK:case Pr.MS_TEAMS:case Pr.GOOGLE_CHAT:n=((i=e.reportDefinition)==null?void 0:i.title)??"",r="report";break;case Pr.INSIGHT:n=((c=e.insightDefinition)==null?void 0:c.title)??"",r="insight";break}return[nJ(`${e.triggerType} ${r} run`.trim()),n]},lfe=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)},cfe=e=>{const t=e.startedAt??e.createdAt;return _y(t.toISOString())},ufe=e=>{const t=DN(e.startedAt),n=DN(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=eJ(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},DN=e=>e?_y(e.toISOString()):"N/A";function dfe({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:i,dataMartId:c}){const u=y=>{y.stopPropagation()},f=async y=>{if(y.stopPropagation(),c)try{await i(c,s.id),Dn.success("Data mart run cancelled successfully")}catch(g){Dn.error(g instanceof Error?g.message:"Failed to cancel data mart run")}},m=y=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${y?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return a.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ds.STRUCTURED)},className:`${m(e===Ds.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ds.RAW)},className:`${m(e===Ds.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:y=>{y.stopPropagation(),t(Ds.CONFIGURATION)},className:`${m(e===Ds.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==Ds.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(jc,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),a.jsx(It,{type:"text",placeholder:"Search logs...",value:n,onChange:y=>{r(y.target.value)},onClick:u,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"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[s.status===qn.RUNNING&&a.jsxs(we,{variant:"destructive",size:"sm",onClick:y=>void f(y),children:[a.jsx(uc,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(we,{variant:"outline",size:"sm",onClick:y=>{y.stopPropagation(),lfe(s)},className:"flex items-center gap-2",children:[a.jsx(tU,{className:"h-4 w-4"}),"JSON"]})]})]})}function ffe(e){switch(e){case sa.INFO:return a.jsx(Fr,{className:"h-3 w-3 text-blue-500"});case sa.WARNING:return a.jsx(bh,{className:"h-3 w-3 text-yellow-500"});case sa.ERROR:return a.jsx(rg,{className:"h-3 w-3 text-red-500"});case sa.SYSTEM:return a.jsx(xh,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(Fr,{className:"text-muted-foreground h-3 w-3"})}}function hfe(e){switch(e){case sa.INFO:return"text-blue-600 dark:text-blue-400";case sa.WARNING:return"text-yellow-600 dark:text-yellow-400";case sa.ERROR:return"text-red-600 dark:text-red-400";case sa.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function mfe(e){return e===e5.SCHEDULED?a.jsx(nS,{size:18}):a.jsx(IA,{size:18})}function pfe({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?a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"text-muted-foreground p-8 text-center text-sm",children:"No logs found"})}):a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,s)=>a.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-xs ${s===e.length-1?"border-b-0":""}`,onClick:t,children:[a.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),a.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[ffe(r.level),a.jsx("span",{className:`text-xs font-medium ${hfe(r.level)}`,children:UM(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===sa.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
835
|
-
`)?a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):a.jsx("span",{children:r.message})})]},r.id))})})}var Fg=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Fg||{});function Hg({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,iconOnly:i=!1}){const c=n==="error",u=r===t,f="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 a.jsx("button",{onClick:y=>{s(e,t),y.stopPropagation()},className:`${f} ${m}`,title:`Copy ${t} to clipboard`,children:i?a.jsx(a.Fragment,{children:u?a.jsx(oa,{className:"h-3 w-3"}):a.jsx(Yu,{className:"h-3 w-3"})}):u?a.jsxs(a.Fragment,{children:[a.jsx(oa,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(Yu,{className:"h-3 w-3"}),"Copy"]})})}function tx(){const[e,t]=h.useState(null),n=async(s,i)=>{if(!s)return!1;try{return await navigator.clipboard.writeText(s),t(i),setTimeout(()=>{t(null)},2e3),!0}catch(c){return console.error("Failed to copy text: ",c),!1}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,i)=>{n(s,i)}}}function gfe({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=tx(),s=i=>{i.stopPropagation()};return a.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[a.jsx(xh,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx(Hg,{text:t.join(`
|
|
836
|
-
`),section:"errors",variant:Fg.ERROR,copiedSection:n,onCopy:r})]}),a.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((i,c)=>a.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:i},c))})]}),e.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[a.jsx(Fr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx(Hg,{text:e.join(`
|
|
837
|
-
`),section:"logs",variant:Fg.DEFAULT,copiedSection:n,onCopy:r})]}),a.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((i,c)=>a.jsx("div",{className:"mb-1 leading-relaxed",children:i},c))})]})]})}function yfe({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:s}=tx(),i=c=>{c.stopPropagation()};return a.jsx("div",{className:"border-border rounded-lg border",onClick:i,children:e!=null?a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),a.jsx(Hg,{text:JSON.stringify(e,null,2),section:"configuration",variant:Fg.DEFAULT,copiedSection:r,onCopy:s})]}),a.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)}),t&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Report definition:"}),a.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(t,null,2)})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Insight definition:"}),a.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(n,null,2)})]})]}):a.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}const ao=18;function xfe({type:e,base64Icon:t}){switch(e){case Pr.CONNECTOR:return t?a.jsx(Ac,{base64:t,size:ao}):a.jsx(cc,{className:"text-muted-foreground",size:ao});case Pr.GOOGLE_SHEETS_EXPORT:{const n=aa.getInfo(Ae.GOOGLE_SHEETS).icon;return a.jsx(n,{size:ao})}case Pr.LOOKER_STUDIO:{const n=aa.getInfo(Ae.LOOKER_STUDIO).icon;return a.jsx(n,{size:ao})}case Pr.EMAIL:{const n=aa.getInfo(Ae.EMAIL).icon;return a.jsx(n,{size:ao})}case Pr.SLACK:{const n=aa.getInfo(Ae.SLACK).icon;return a.jsx(n,{size:ao})}case Pr.MS_TEAMS:{const n=aa.getInfo(Ae.MS_TEAMS).icon;return a.jsx(n,{size:ao})}case Pr.GOOGLE_CHAT:{const n=aa.getInfo(Ae.GOOGLE_CHAT).icon;return a.jsx(n,{size:ao})}case Pr.INSIGHT:return a.jsx(Ji,{className:"text-brand-blue-500",size:ao});default:return a.jsx(cc,{className:"text-muted-foreground",size:ao})}}function vfe({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,cancelDataMartRun:u,dataMartId:f,dataMartConnectorInfo:m}){const{copiedSection:y,handleCopy:g}=tx(),x=h.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const j=e.logs.map((A,D)=>AN(A,D)),_=e.errors.map((A,D)=>AN(A,e.logs.length+D,!0));return[...j,..._].filter(A=>{const D=UM(A);return i===""||A.message.toLowerCase().includes(i.toLowerCase())||D.toLowerCase().includes(i.toLowerCase())})},[e.logs,e.errors,i]),v=h.useCallback(()=>r===Ds.STRUCTURED?a.jsx(pfe,{logs:x}):r===Ds.RAW?a.jsx(gfe,{logs:e.logs,errors:e.errors}):a.jsx(yfe,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,x,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),C=cfe(e),S=ufe(e),[w,R]=ife(e,m==null?void 0:m.displayName);return a.jsxs("div",{className:"dm-card-block",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{children:a.jsx(xfe,{type:e.type,base64Icon:m==null?void 0:m.logoBase64})}),a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{className:"text-foreground align-center mr-12 flex items-center font-mono text-sm font-medium",children:C})}),a.jsx(jt,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{children:["Started At: ",S.startedAt]}),a.jsxs("div",{children:["Finished At: ",S.finishedAt]}),S.duration&&a.jsxs("div",{children:["Duration: ",S.duration]})]})})]}),a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[mfe(e.triggerType),a.jsxs("span",{className:"inline-flex items-center",children:[w,e.createdByUser&&a.jsxs(a.Fragment,{children:[" by ",a.jsx(cO,{userProjection:e.createdByUser})]}),R&&a.jsxs(a.Fragment,{children:[" • ",R]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ofe,{status:e.status}),a.jsx(_a,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&a.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),a.jsx(Hg,{text:e.id,section:"run-id",onCopy:g,copiedSection:y,iconOnly:!0})]}),a.jsx(dfe,{logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,run:e,cancelDataMartRun:u,dataMartId:f}),v()]})]})}function bfe(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:i=[],isLoading:c}=bs(),[u,f]=h.useState(!1),[m,y]=h.useState(!0),[g,x]=h.useState(0),[v,C]=h.useState(null),[S,w]=h.useState(Ds.STRUCTURED),[R,j]=h.useState(""),_=h.useCallback(async()=>{if(!(t!=null&&t.id))return;const T=await n(t.id,20,0);x(T.length),y(T.length===20)},[t==null?void 0:t.id,n,20]),O=h.useCallback(async()=>{if(!(t!=null&&t.id)||u)return;f(!0);const T=await r(t.id,g,20);x(I=>I+T.length),y(T.length===20),f(!1)},[t==null?void 0:t.id,r,g,u,20]);h.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=h.useMemo(()=>(t==null?void 0:t.definitionType)===$e.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),D=T=>{C(v===T?null:T)};return c?a.jsx(MM,{}):a.jsx("div",{className:"flex flex-col gap-4 pb-4",children:i.length===0?a.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):a.jsxs("div",{className:"space-y-2",children:[i.map(T=>a.jsx(vfe,{run:T,isExpanded:v===T.id,onToggle:D,logViewType:S,setLogViewType:w,searchTerm:R,setSearchTerm:j,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:A},T.id)),m&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(Vu,{variant:"outline",size:"sm",onClick:()=>void O(),disabled:u,className:"flex items-center gap-2",children:u?a.jsxs(a.Fragment,{children:[a.jsx(fz,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const Sfe=5e3,Cfe=20;function wfe(){const{dataMart:e,getDataMartRuns:t}=ws();return wC({enabled:!!(e!=null&&e.id),intervalMs:Sfe,onTick:()=>{e!=null&&e.id&&t(e.id,Cfe,0,{silent:!0})}}),a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(ul,{collapsible:!1,name:"run-history",children:[a.jsx(go,{children:a.jsx(po,{icon:DU,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(yo,{children:a.jsx(bfe,{})})]})})}function Efe(){const e=zI(),{navigate:t}=mi(),n=r=>{const s=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(s)};return a.jsx("div",{className:"flex h-full w-full items-center justify-center",children:a.jsx("div",{className:"m-auto w-lg",children:a.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:[a.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),a.jsx(j2,{children:a.jsx(pO,{children:a.jsx(hre,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function zM({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:i,clearCurrentDataStorage:c}=$y();h.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const u=()=>{c(),t()};return a.jsx(c2,{open:e,onOpenChange:f=>{f||u()},children:a.jsxs(u2,{children:[a.jsxs(d2,{children:[a.jsx(f2,{children:"Storage Details"}),a.jsx(h2,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(BX,{dataStorage:s,isLoading:i})})]})})}const Rfe=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,i]=h.useState(!1);return a.jsx("div",{className:"text-right",children:a.jsxs(Cr,{open:s,onOpenChange:i,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{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:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(vt,{onClick:()=>t==null?void 0:t(e),children:[a.jsx(jA,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"View details"})]}),a.jsxs(vt,{onClick:()=>void(n==null?void 0:n(e)),children:[a.jsx(od,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),a.jsx(la,{}),a.jsxs(vt,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})},jfe=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(xr,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return a.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(xr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=Sl.getInfo(s);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),i]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(xr,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return a.jsx("div",{className:"text-muted-foreground",children:i})}},{id:"actions",size:80,header:({table:r})=>a.jsx(xd,{table:r}),cell:({row:r})=>a.jsx(Rfe,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function Tfe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(EA,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Storage"]})]})}function _fe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Oc({columns:e,storageKeyPrefix:"data-storage-list"}),[f,m]=h.useState([]),[y,g]=h.useState({}),[x,v]=h.useState(!1),[C]=h.useState(null),S=wl({data:t,columns:[...e],getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:i,getSortedRowModel:Dc(),onColumnFiltersChange:m,getFilteredRowModel:yd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),w=(j,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(j)};return t.length?a.jsxs("div",{children:[C&&a.jsx(zM,{isOpen:x,onClose:()=>{v(!1)},id:C.id}),a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(R=S.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:j=>{var _;return(_=S.getColumn("title"))==null?void 0:_.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ma,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:S.getHeaderGroups().map(j=>a.jsx(Hn,{className:"dm-card-table-header-row",children:j.headers.map(_=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.getSize())}%`},children:_.isPlaceholder?null:nd(_.column.columnDef.header,_.getContext())},_.id))},j.id))}),a.jsx(jl,{className:"dm-card-table-body",children:S.getRowModel().rows.length?S.getRowModel().rows.map(j=>a.jsx(Hn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const O=j.original.id;w(O,_)},children:j.getVisibleCells().map(_=>a.jsx($r,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${_.column.id==="actions"?"actions-cell":""} ${_.column.id==="createdAt"?"whitespace-nowrap":""}`,style:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:nd(_.column.columnDef.cell,_.getContext())},_.id))},j.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{S.previousPage()},disabled:!S.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{S.nextPage()},disabled:!S.getCanNextPage(),children:"Next"})]})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(Tfe,{onOpenTypeDialog:r})})}const Nfe=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=h.useState(e),[s,i]=h.useState(!1),{dataStorages:c,currentDataStorage:u,clearCurrentDataStorage:f,fetchDataStorages:m,getDataStorageById:y,deleteDataStorage:g,createDataStorage:x}=$y();h.useEffect(()=>{m()},[m]),h.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[C,S]=h.useState(!1),[w,R]=h.useState(!1),[j,_]=h.useState(null),[O,A]=h.useState(!1),[D,T]=h.useState(null),I=async $=>{i(!0);try{const oe=await x($);v(),oe!=null&&oe.id&&(await y(oe.id),S(!0),i(!1))}catch(oe){console.error("Failed to create storage:",oe)}},k=$=>{T($),A(!0)},F=()=>{A(!1),T(null)},G=async $=>{await y($),S(!0)},Y=$=>{_($),R(!0)},B=async()=>{if(j)try{await g(j),await m()}catch($){console.error("Failed to delete storage:",$)}finally{R(!1),_(null)}},Z=async()=>{try{S(!1),await m()}catch($){console.error("Failed to save storage:",$)}},H=()=>{S(!1),f()},M=c.map($=>({id:$.id,title:$.title,type:$.type,createdAt:$.createdAt,modifiedAt:$.modifiedAt})),V=jfe({onViewDetails:k,onEdit:G,onDelete:Y});return a.jsxs("div",{children:[a.jsx(_fe,{columns:V,data:M,onEdit:G,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(zM,{isOpen:O,onClose:F,id:D??""}),a.jsx(h6,{isOpen:n,onClose:v,onSelect:I,isCreatingDataStorage:s}),a.jsx(wI,{isOpen:C,onClose:H,dataStorage:u,onSaveSuccess:()=>void Z()}),a.jsx(br,{open:w,onOpenChange:R,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{B()},onCancel:()=>{_(null)},variant:"destructive"})]})},Afe=()=>{const[e,t]=h.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(j2,{children:a.jsx(Nfe,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Dfe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(tS,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),a.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."}),a.jsxs(we,{variant:"outline",onClick:e,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Destination"]})]})}function Ofe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var C;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Oc({columns:e,storageKeyPrefix:"data-destination-list"}),[f,m]=h.useState([]),[y,g]=h.useState({}),x=wl({data:t,columns:[...e],getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:i,getSortedRowModel:Dc(),onColumnFiltersChange:m,getFilteredRowModel:yd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:y},enableRowSelection:!0}),v=(S,w)=>{w.target instanceof HTMLElement&&(w.target.closest('[role="checkbox"]')||w.target.closest(".actions-cell")||w.target.closest('[role="menuitem"]'))||n==null||n(S)};return t.length?a.jsx("div",{children:a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(jc,{className:"dm-card-toolbar-search-icon"}),a.jsx(It,{placeholder:"Search by title",value:(C=x.getColumn("title"))==null?void 0:C.getFilterValue(),onChange:S=>{var w;return(w=x.getColumn("title"))==null?void 0:w.setFilterValue(S.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(ma,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(Rl,{className:"dm-card-table-header",children:x.getHeaderGroups().map(S=>a.jsx(Hn,{className:"dm-card-table-header-row",children:S.headers.map(w=>a.jsx(Tl,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.getSize())}%`},children:w.isPlaceholder?null:nd(w.column.columnDef.header,w.getContext())},w.id))},S.id))}),a.jsx(jl,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(S=>a.jsx(Hn,{"data-state":S.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:w=>{const R=S.original.id;v(R,w)},children:S.getVisibleCells().map(w=>a.jsx($r,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${w.column.id==="actions"?"actions-cell":""} ${w.column.id==="createdAt"?"whitespace-nowrap":""}`,style:w.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(w.column.getSize())}%`},children:nd(w.column.columnDef.cell,w.getContext())},w.id))},S.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(Dfe,{onOpenTypeDialog:r})})}const Ife=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:i})=>{const[c,u]=h.useState(!1),f=()=>{if(n&&CC(n)){const g=WS(n);navigator.clipboard.writeText(g),_t.success("JSON Config copied to clipboard")}},m=t===Ae.LOOKER_STUDIO,y=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return a.jsx(a.Fragment,{children:a.jsx("div",{className:"text-right",children:a.jsxs(Cr,{open:c,onOpenChange:u,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{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:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(Er,{align:"end",children:[a.jsxs(vt,{onClick:()=>void(r==null?void 0:r(e)),children:[a.jsx(od,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),m&&y&&a.jsxs(a.Fragment,{children:[a.jsx(la,{}),a.jsxs(vt,{onClick:f,children:[a.jsx(Yu,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Copy JSON Config"})]}),a.jsxs(vt,{onClick:()=>{i==null||i(e)},children:[a.jsx(O1,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(la,{}),a.jsxs(vt,{onClick:()=>s==null?void 0:s(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})},Mfe=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(xr,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return a.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(xr,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=aa.getInfo(s);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),i]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(xr,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),i=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return a.jsx("div",{className:"text-muted-foreground",children:i})}},{id:"actions",size:80,header:({table:r})=>a.jsx(xd,{table:r}),cell:({row:r})=>a.jsx(Ife,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}],kfe=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:i,getDataDestinationById:c,deleteDataDestination:u,rotateSecretKey:f}=Fh(),m=h.useCallback(()=>{s(),g(!0),t==null||t()},[s,t]),[y,g]=h.useState(!1),[x,v]=h.useState(!1),[C,S]=h.useState(!1),[w,R]=h.useState(null),[j,_]=h.useState(null);h.useEffect(()=>{i()},[i]),h.useEffect(()=>{e&&m()},[e,m]);const O=async B=>{await c(B),g(!0)},A=B=>{R(B),v(!0)},D=B=>{_(B),S(!0)},T=async()=>{if(j)try{const B=await f(j);if(CC(B.credentials)){_t.success("New JSON Config copied to clipboard");const Z=WS(B.credentials);navigator.clipboard.writeText(Z)}await i()}catch(B){console.error("Failed to rotate secret key:",B)}finally{S(!1),_(null)}},I=async()=>{if(w)try{await u(w),await i()}catch(B){console.error("Failed to delete destination:",B)}finally{v(!1),R(null)}},k=async()=>{try{g(!1),await i()}catch(B){console.error("Failed to save destination:",B)}},F=()=>{g(!1),s()},G=n.map(B=>({id:B.id,title:B.title,type:B.type,createdAt:B.createdAt,modifiedAt:B.modifiedAt,credentials:B.credentials})),Y=Mfe({onEdit:O,onDelete:A,onRotateSecretKey:D});return a.jsxs("div",{children:[a.jsx(Ofe,{columns:Y,data:G,onEdit:O,onDelete:A,onRotateSecretKey:D,onOpenTypeDialog:m}),a.jsx(DM,{isOpen:y,onClose:F,dataDestination:r,onSaveSuccess:()=>void k()}),a.jsx(br,{open:x,onOpenChange:v,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{I()},onCancel:()=>{R(null)},variant:"destructive"}),a.jsx(br,{open:C,onOpenChange:S,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void T(),onCancel:()=>{S(!1)},variant:"destructive",children:a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),a.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[a.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),a.jsx("li",{children:"Go to your Looker Studio Connector"}),a.jsx("li",{children:"Update the configuration with the new JSON Config"}),a.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),a.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},Lfe=()=>{const[e,t]=h.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(zh,{children:a.jsx(kfe,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Ub({className:e,...t}){return a.jsx("div",{"data-slot":"empty",className:se("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",e),...t})}function zb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-header",className:se("flex max-w-sm flex-col items-center gap-2 text-center",e),...t})}const Pfe=Ec("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-muted-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6 [&_svg]:stroke-[1.5]"}},defaultVariants:{variant:"default"}});function Fb({className:e,variant:t="default",...n}){return a.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:se(Pfe({variant:t,className:e})),...n})}function Hb({className:e,...t}){return a.jsx("div",{"data-slot":"empty-title",className:se("text-muted-foreground text-lg font-medium tracking-tight",e),...t})}function $b({className:e,...t}){return a.jsx("div",{"data-slot":"empty-description",className:se("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Ufe({className:e,...t}){return a.jsx("div",{"data-slot":"empty-content",className:se("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),...t})}const zfe=()=>{const e=wc(),{createInsight:t,insightLoading:n}=EC(),r=()=>{(async()=>{const s=await t({title:"Untitled insight"});s&&e(s.id)})()};return a.jsxs(Ub,{children:[a.jsxs(zb,{children:[a.jsx(Fb,{variant:"icon",children:a.jsx(Ji,{})}),a.jsx(Hb,{children:"Create your first Insight"}),a.jsx($b,{children:"Create an Insight to prompt your Data Mart and discover the story behind your data."})]}),a.jsx(Ufe,{children:a.jsxs(we,{variant:"outline",onClick:r,disabled:n,children:[a.jsx(ma,{className:"h-4 w-4"}),"New Insight"]})})]})};function Ffe({id:e,onDelete:t}){const[n,r]=h.useState(!1);return a.jsx("div",{className:"text-right",onClick:s=>{s.stopPropagation()},children:a.jsxs(Cr,{open:n,onOpenChange:r,children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${n?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(qs,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(Er,{align:"end",children:a.jsxs(vt,{className:"text-destructive",onClick:()=>t==null?void 0:t(e),children:[a.jsx(es,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})}const Hfe=({onDelete:e}={})=>[{accessorKey:"title",size:50,header:({column:t})=>a.jsx(xr,{column:t,children:"Title"}),cell:({row:t})=>{const n=t.getValue("title");return a.jsx("div",{className:"overflow-hidden text-ellipsis",children:n})},meta:{title:"Title"}},{accessorKey:"lastRun",size:50,sortDescFirst:!0,header:({column:t})=>a.jsx(xr,{column:t,children:"Last run"}),cell:({row:t})=>{const n=t.getValue("lastRun");return a.jsx("div",{className:"text-muted-foreground",children:v5(n)})},meta:{title:"Last run"}},{id:"actions",size:80,header:({table:t})=>a.jsx(xd,{table:t}),cell:({row:t})=>a.jsx(Ffe,{id:t.original.id,onDelete:e}),meta:{title:"Actions"}}];function $fe({items:e,onRowClick:t,onDelete:n}){const r=h.useMemo(()=>Hfe({onDelete:n}),[n]),{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Oc({columns:r,storageKeyPrefix:"data-mart-insights",defaultSortingColumn:"lastRun"}),f=wl({data:e,columns:r,getCoreRowModel:Cl(),getPaginationRowModel:Hh(),onSortingChange:i,getSortedRowModel:Dc(),getFilteredRowModel:yd(),state:{sorting:s,columnVisibility:c},onColumnVisibilityChange:u,enableGlobalFilter:!0,enableColumnResizing:!1}),m=h.useCallback(()=>{f.previousPage()},[f]),y=h.useCallback(()=>{f.nextPage()},[f]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(El,{id:"insights-table",className:"dm-card-table",role:"table","aria-label":"Insights",children:[a.jsx(Rl,{className:"dm-card-table-header",children:f.getHeaderGroups().map(x=>a.jsx(Hn,{className:"dm-card-table-header-row",children:x.headers.map(v=>a.jsx(Tl,{scope:"col",style:v.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(v.getSize())}%`},children:v.isPlaceholder?null:typeof v.column.columnDef.header=="function"?v.column.columnDef.header(v.getContext()):v.column.columnDef.header},v.id))},x.id))}),a.jsx(jl,{className:"dm-card-table-body",children:f.getRowModel().rows.length?f.getRowModel().rows.map((x,v)=>a.jsx(Hn,{onClick:()=>{t(x.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:x.getVisibleCells().map((C,S)=>a.jsx($r,{className:`px-6 whitespace-normal ${C.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":S+1,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},children:typeof C.column.columnDef.cell=="function"?C.column.columnDef.cell(C.getContext()):C.column.columnDef.cell},C.id))},x.id)):a.jsx(Hn,{children:a.jsx($r,{colSpan:r.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No insights found."})})})})]})}),a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(we,{variant:"outline",size:"sm",onClick:m,disabled:!f.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:y,disabled:!f.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})]})}function Vfe(){const e=wc(),{fetchInsights:t,deleteInsight:n,createInsight:r,insightLoading:s}=EC(),{insights:i,isLoading:c,error:u,hasInsights:f}=rfe(),[m,y]=h.useState(null);h.useEffect(()=>{t()},[t]);const g=C=>{e(C)},x=()=>{(async()=>{const C=await r({title:"Untitled insight"});C&&e(C.id)})()},v=()=>{(async()=>{if(m)try{await n(m)}finally{y(null)}})()};return a.jsxs(ul,{children:[a.jsxs(go,{children:[a.jsx(po,{tooltip:"Manage and review your insights",icon:Ji,children:"Insights"}),f&&a.jsx(Xh,{children:a.jsxs(we,{variant:"outline","aria-label":"Add new insight",disabled:s,onClick:x,children:[a.jsx(ma,{className:"h-4 w-4","aria-hidden":"true"}),"New insight"]})})]}),a.jsxs(yo,{children:[c&&!f?a.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading insights…"}):u?a.jsx("div",{className:"text-destructive p-4 text-sm",children:"Failed to load insights"}):f?a.jsx($fe,{items:i.map(C=>({id:C.id,title:C.title,lastRun:C.outputUpdatedAt})),onRowClick:g,onDelete:C=>{y(C)}}):a.jsx(zfe,{}),a.jsx(br,{open:!!m,onOpenChange:C=>{C||y(null)},title:"Delete Insight",description:"Are you sure you want to delete this insight? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:v})]}),a.jsx(ri,{})]})}function Gfe(){return a.jsx(PM,{children:a.jsx(Vfe,{})})}const nx=h.createContext(null);nx.displayName="PanelGroupContext";const Qn={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},RC=10,lc=h.useLayoutEffect,ON=fh.useId,Bfe=typeof ON=="function"?ON:()=>null;let qfe=0;function jC(e=null){const t=Bfe(),n=h.useRef(e||t||null);return n.current===null&&(n.current=""+qfe++),e??n.current}function FM({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:c,maxSize:u,minSize:f,onCollapse:m,onExpand:y,onResize:g,order:x,style:v,tagName:C="div",...S}){const w=h.useContext(nx);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:R,expandPanel:j,getPanelSize:_,getPanelStyle:O,groupId:A,isPanelCollapsed:D,reevaluatePanelConstraints:T,registerPanel:I,resizePanel:k,unregisterPanel:F}=w,G=jC(c),Y=h.useRef({callbacks:{onCollapse:m,onExpand:y,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:f},id:G,idIsFromProps:c!==void 0,order:x});h.useRef({didLogMissingDefaultSizeWarning:!1}),lc(()=>{const{callbacks:Z,constraints:H}=Y.current,M={...H};Y.current.id=G,Y.current.idIsFromProps=c!==void 0,Y.current.order=x,Z.onCollapse=m,Z.onExpand=y,Z.onResize=g,H.collapsedSize=n,H.collapsible=r,H.defaultSize=s,H.maxSize=u,H.minSize=f,(M.collapsedSize!==H.collapsedSize||M.collapsible!==H.collapsible||M.maxSize!==H.maxSize||M.minSize!==H.minSize)&&T(Y.current,M)}),lc(()=>{const Z=Y.current;return I(Z),()=>{F(Z)}},[x,G,I,F]),h.useImperativeHandle(i,()=>({collapse:()=>{R(Y.current)},expand:Z=>{j(Y.current,Z)},getId(){return G},getSize(){return _(Y.current)},isCollapsed(){return D(Y.current)},isExpanded(){return!D(Y.current)},resize:Z=>{k(Y.current,Z)}}),[R,j,_,D,G,k]);const B=O(Y.current,s);return h.createElement(C,{...S,children:e,className:t,id:G,style:{...B,...v},[Qn.groupId]:A,[Qn.panel]:"",[Qn.panelCollapsible]:r||void 0,[Qn.panelId]:G,[Qn.panelSize]:parseFloat(""+B.flexGrow).toFixed(1)})}const HM=h.forwardRef((e,t)=>h.createElement(FM,{...e,forwardedRef:t}));FM.displayName="Panel";HM.displayName="forwardRef(Panel)";let Vb=null,Qp=-1,Wi=null;function Kfe(e,t,n){const r=(t&qM)!==0,s=(t&KM)!==0,i=(t&ZM)!==0,c=(t&YM)!==0;if(t){if(r)return i?"se-resize":c?"ne-resize":"e-resize";if(s)return i?"sw-resize":c?"nw-resize":"w-resize";if(i)return"s-resize";if(c)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Zfe(){Wi!==null&&(document.head.removeChild(Wi),Vb=null,Wi=null,Qp=-1)}function b1(e,t,n){var r,s;const i=Kfe(e,t);if(Vb!==i){if(Vb=i,Wi===null&&(Wi=document.createElement("style"),document.head.appendChild(Wi)),Qp>=0){var c;(c=Wi.sheet)===null||c===void 0||c.removeRule(Qp)}Qp=(r=(s=Wi.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${i} !important;}`))!==null&&r!==void 0?r:-1}}function $M(e){return e.type==="keydown"}function VM(e){return e.type.startsWith("pointer")}function GM(e){return e.type.startsWith("mouse")}function rx(e){if(VM(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(GM(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Yfe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Wfe(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Xfe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:kN(e),b:kN(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ot(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:MN(IN(n.a)),b:MN(IN(n.b))};if(s.a===s.b){const i=r.childNodes,c={a:n.a.at(-1),b:n.b.at(-1)};let u=i.length;for(;u--;){const f=i[u];if(f===c.a)return 1;if(f===c.b)return-1}}return Math.sign(s.a-s.b)}const Qfe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Jfe(e){var t;const n=getComputedStyle((t=BM(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function ehe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Jfe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||Qfe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function IN(e){let t=e.length;for(;t--;){const n=e[t];if(Ot(n,"Missing node"),ehe(n))return n}return null}function MN(e){return e&&Number(getComputedStyle(e).zIndex)||0}function kN(e){const t=[];for(;e;)t.push(e),e=BM(e);return t}function BM(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const qM=1,KM=2,ZM=4,YM=8,the=Yfe()==="coarse";let zs=[],Ku=!1,Xi=new Map,ax=new Map;const uh=new Set;function nhe(e,t,n,r,s){var i;const{ownerDocument:c}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},f=(i=Xi.get(c))!==null&&i!==void 0?i:0;return Xi.set(c,f+1),uh.add(u),$g(),function(){var y;ax.delete(e),uh.delete(u);const g=(y=Xi.get(c))!==null&&y!==void 0?y:1;if(Xi.set(c,g-1),$g(),g===1&&Xi.delete(c),zs.includes(u)){const x=zs.indexOf(u);x>=0&&zs.splice(x,1),sx(),s("up",!0,null)}}}function rhe(e){const{target:t}=e,{x:n,y:r}=rx(e);Ku=!0,TC({target:t,x:n,y:r}),$g(),zs.length>0&&(Vg("down",e),sx(),e.preventDefault(),WM(t)||e.stopImmediatePropagation())}function S1(e){const{x:t,y:n}=rx(e);if(Ku&&e.type!=="pointerleave"&&e.buttons===0&&(Ku=!1,Vg("up",e)),!Ku){const{target:r}=e;TC({target:r,x:t,y:n})}Vg("move",e),sx(),zs.length>0&&e.preventDefault()}function C1(e){const{target:t}=e,{x:n,y:r}=rx(e);ax.clear(),Ku=!1,zs.length>0&&(e.preventDefault(),WM(t)||e.stopImmediatePropagation()),Vg("up",e),TC({target:t,x:n,y:r}),sx(),$g()}function WM(e){let t=e;for(;t;){if(t.hasAttribute(Qn.resizeHandle))return!0;t=t.parentElement}return!1}function TC({target:e,x:t,y:n}){zs.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),uh.forEach(s=>{const{element:i,hitAreaMargins:c}=s,u=i.getBoundingClientRect(),{bottom:f,left:m,right:y,top:g}=u,x=the?c.coarse:c.fine;if(t>=m-x&&t<=y+x&&n>=g-x&&n<=f+x){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&Xfe(r,i)>0){let C=r,S=!1;for(;C&&!C.contains(i);){if(Wfe(C.getBoundingClientRect(),u)){S=!0;break}C=C.parentElement}if(S)return}zs.push(s)}})}function w1(e,t){ax.set(e,t)}function sx(){let e=!1,t=!1;zs.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;ax.forEach(r=>{n|=r}),e&&t?b1("intersection",n):e?b1("horizontal",n):t?b1("vertical",n):Zfe()}let E1;function $g(){var e;(e=E1)===null||e===void 0||e.abort(),E1=new AbortController;const t={capture:!0,signal:E1.signal};uh.size&&(Ku?(zs.length>0&&Xi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("contextmenu",C1,t),s.addEventListener("pointerleave",S1,t),s.addEventListener("pointermove",S1,t))}),Xi.forEach((n,r)=>{const{body:s}=r;s.addEventListener("pointerup",C1,t),s.addEventListener("pointercancel",C1,t)})):Xi.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("pointerdown",rhe,t),s.addEventListener("pointermove",S1,t))}))}function Vg(e,t){uh.forEach(n=>{const{setResizeHandlerState:r}=n,s=zs.includes(n);r(e,s,t)})}function ahe(){const[e,t]=h.useState(0);return h.useCallback(()=>t(n=>n+1),[])}function Ot(e,t){if(!e)throw console.error(t),Error(t)}function Sc(e,t,n=RC){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Qo(e,t,n=RC){return Sc(e,t,n)===0}function $a(e,t,n){return Sc(e,t,n)===0}function she(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],i=t[r];if(!$a(s,i,n))return!1}return!0}function Lu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Ot(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:c=100,minSize:u=0}=r;if(Sc(n,u)<0)if(i){const f=(s+u)/2;Sc(n,f)<0?n=s:n=u}else n=u;return n=Math.min(c,n),n=parseFloat(n.toFixed(RC)),n}function Lf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if($a(e,0))return t;const c=[...t],[u,f]=r;Ot(u!=null,"Invalid first pivot index"),Ot(f!=null,"Invalid second pivot index");let m=0;if(i==="keyboard"){{const g=e<0?f:u,x=n[g];Ot(x,`Panel constraints not found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:S=0}=x;if(C){const w=t[g];if(Ot(w!=null,`Previous layout not found for panel index ${g}`),$a(w,v)){const R=S-w;Sc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}{const g=e<0?u:f,x=n[g];Ot(x,`No panel constraints found for index ${g}`);const{collapsedSize:v=0,collapsible:C,minSize:S=0}=x;if(C){const w=t[g];if(Ot(w!=null,`Previous layout not found for panel index ${g}`),$a(w,S)){const R=w-v;Sc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}}{const g=e<0?1:-1;let x=e<0?f:u,v=0;for(;;){const S=t[x];Ot(S!=null,`Previous layout not found for panel index ${x}`);const R=Lu({panelConstraints:n,panelIndex:x,size:100})-S;if(v+=R,x+=g,x<0||x>=n.length)break}const C=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-C:C}{let x=e<0?u:f;for(;x>=0&&x<n.length;){const v=Math.abs(e)-Math.abs(m),C=t[x];Ot(C!=null,`Previous layout not found for panel index ${x}`);const S=C-v,w=Lu({panelConstraints:n,panelIndex:x,size:S});if(!$a(C,w)&&(m+=C-w,c[x]=w,m.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?x--:x++}}if(she(s,c))return s;{const g=e<0?f:u,x=t[g];Ot(x!=null,`Previous layout not found for panel index ${g}`);const v=x+m,C=Lu({panelConstraints:n,panelIndex:g,size:v});if(c[g]=C,!$a(C,v)){let S=v-C,R=e<0?f:u;for(;R>=0&&R<n.length;){const j=c[R];Ot(j!=null,`Previous layout not found for panel index ${R}`);const _=j+S,O=Lu({panelConstraints:n,panelIndex:R,size:_});if($a(j,O)||(S-=O-j,c[R]=O),$a(S,0))break;e>0?R--:R++}}}const y=c.reduce((g,x)=>x+g,0);return $a(y,100)?c:s}function ohe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,c=0;const u=n[0];Ot(u!=null,"No pivot index found"),t.forEach((g,x)=>{const{constraints:v}=g,{maxSize:C=100,minSize:S=0}=v;x===u?(r=S,s=C):(i+=S,c+=C)});const f=Math.min(s,100-i),m=Math.max(r,100-c),y=e[u];return{valueMax:f,valueMin:m,valueNow:y}}function dh(e,t=document){return Array.from(t.querySelectorAll(`[${Qn.resizeHandleId}][data-panel-group-id="${e}"]`))}function XM(e,t,n=document){const s=dh(e,n).findIndex(i=>i.getAttribute(Qn.resizeHandleId)===t);return s??null}function QM(e,t,n){const r=XM(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function ihe(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function JM(e,t=document){if(ihe(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function ox(e,t=document){const n=t.querySelector(`[${Qn.resizeHandleId}="${e}"]`);return n||null}function lhe(e,t,n,r=document){var s,i,c,u;const f=ox(t,r),m=dh(e,r),y=f?m.indexOf(f):-1,g=(s=(i=n[y])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,x=(c=(u=n[y+1])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null;return[g,x]}function che({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:c}){h.useRef({didWarnAboutMissingResizeHandle:!1}),lc(()=>{if(!i)return;const u=dh(n,i);for(let f=0;f<s.length-1;f++){const{valueMax:m,valueMin:y,valueNow:g}=ohe({layout:r,panelsArray:s,pivotIndices:[f,f+1]}),x=u[f];if(x!=null){const v=s[f];Ot(v,`No panel data found for index "${f}"`),x.setAttribute("aria-controls",v.id),x.setAttribute("aria-valuemax",""+Math.round(m)),x.setAttribute("aria-valuemin",""+Math.round(y)),x.setAttribute("aria-valuenow",g!=null?""+Math.round(g):"")}}return()=>{u.forEach((f,m)=>{f.removeAttribute("aria-controls"),f.removeAttribute("aria-valuemax"),f.removeAttribute("aria-valuemin"),f.removeAttribute("aria-valuenow")})}},[n,r,s,i]),h.useEffect(()=>{if(!i)return;const u=t.current;Ot(u,"Eager values not found");const{panelDataArray:f}=u,m=JM(n,i);Ot(m!=null,`No group found for id "${n}"`);const y=dh(n,i);Ot(y,`No resize handles found for group id "${n}"`);const g=y.map(x=>{const v=x.getAttribute(Qn.resizeHandleId);Ot(v,"Resize handle element has no handle id attribute");const[C,S]=lhe(n,v,f,i);if(C==null||S==null)return()=>{};const w=R=>{if(!R.defaultPrevented)switch(R.key){case"Enter":{R.preventDefault();const j=f.findIndex(_=>_.id===C);if(j>=0){const _=f[j];Ot(_,`No panel data found for index ${j}`);const O=r[j],{collapsedSize:A=0,collapsible:D,minSize:T=0}=_.constraints;if(O!=null&&D){const I=Lf({delta:$a(O,A)?T-A:A-O,initialLayout:r,panelConstraints:f.map(k=>k.constraints),pivotIndices:QM(n,v,i),prevLayout:r,trigger:"keyboard"});r!==I&&c(I)}}break}}};return x.addEventListener("keydown",w),()=>{x.removeEventListener("keydown",w)}});return()=>{g.forEach(x=>x())}},[i,e,t,n,r,s,c])}function LN(e,t){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 e8(e,t){const n=e==="horizontal",{x:r,y:s}=rx(t);return n?r:s}function uhe(e,t,n,r,s){const i=n==="horizontal",c=ox(t,s);Ot(c,`No resize handle element found for id "${t}"`);const u=c.getAttribute(Qn.groupId);Ot(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const m=e8(n,e),y=JM(u,s);Ot(y,`No group element found for id "${u}"`);const g=y.getBoundingClientRect(),x=i?g.width:g.height;return(m-f)/x*100}function dhe(e,t,n,r,s,i){if($M(e)){const c=n==="horizontal";let u=0;e.shiftKey?u=100:s!=null?u=s:u=10;let f=0;switch(e.key){case"ArrowDown":f=c?0:u;break;case"ArrowLeft":f=c?-u:0;break;case"ArrowRight":f=c?u:0;break;case"ArrowUp":f=c?0:-u;break;case"End":f=100;break;case"Home":f=-100;break}return f}else return r==null?0:uhe(e,t,n,r,i)}function fhe({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,s=100;for(let i=0;i<e.length;i++){const c=n[i];Ot(c,`Panel constraints not found for index ${i}`);const{defaultSize:u}=c;u!=null&&(r++,t[i]=u,s-=u)}for(let i=0;i<e.length;i++){const c=n[i];Ot(c,`Panel constraints not found for index ${i}`);const{defaultSize:u}=c;if(u!=null)continue;const f=e.length-r,m=s/f;r++,t[i]=m,s-=m}return t}function Ru(e,t,n){t.forEach((r,s)=>{const i=e[s];Ot(i,`Panel data not found for index ${s}`);const{callbacks:c,constraints:u,id:f}=i,{collapsedSize:m=0,collapsible:y}=u,g=n[f];if(g==null||r!==g){n[f]=r;const{onCollapse:x,onExpand:v,onResize:C}=c;C&&C(r,g),y&&(x||v)&&(v&&(g==null||Qo(g,m))&&!Qo(r,m)&&v(),x&&(g==null||!Qo(g,m))&&Qo(r,m)&&x())}})}function Up(e,t){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 hhe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:s,precision:i=3}){const c=n[s];let u;return c==null?u=e!=null?e.toFixed(i):"1":r.length===1?u="1":u=c.toFixed(i),{flexBasis:0,flexGrow:u,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function mhe(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function PN(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function t8(e){return`react-resizable-panels:${e}`}function n8(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=t;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function r8(e,t){try{const n=t8(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function phe(e,t,n){var r,s;const i=(r=r8(e,n))!==null&&r!==void 0?r:{},c=n8(t);return(s=i[c])!==null&&s!==void 0?s:null}function ghe(e,t,n,r,s){var i;const c=t8(e),u=n8(t),f=(i=r8(e,s))!==null&&i!==void 0?i:{};f[u]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(c,JSON.stringify(f))}catch(m){console.error(m)}}function UN({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,c)=>i+c,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!$a(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=100/r*c;n[i]=u}let s=0;for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=Lu({panelConstraints:t,panelIndex:i,size:c});c!=u&&(s+=c-u,n[i]=u)}if(!$a(s,0))for(let i=0;i<t.length;i++){const c=n[i];Ot(c!=null,`No layout data found for index ${i}`);const u=c+s,f=Lu({panelConstraints:t,panelIndex:i,size:u});if(c!==f&&(s-=f-c,n[i]=f,$a(s,0)))break}return n}const yhe=100,Pf={getItem:e=>(PN(Pf),Pf.getItem(e)),setItem:(e,t)=>{PN(Pf),Pf.setItem(e,t)}},zN={};function a8({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=Pf,style:m,tagName:y="div",...g}){const x=jC(i),v=h.useRef(null),[C,S]=h.useState(null),[w,R]=h.useState([]),j=ahe(),_=h.useRef({}),O=h.useRef(new Map),A=h.useRef(0),D=h.useRef({autoSaveId:e,direction:r,dragState:C,id:x,keyboardResizeBy:u,onLayout:c,storage:f}),T=h.useRef({layout:w,panelDataArray:[],panelDataArrayChanged:!1});h.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),h.useImperativeHandle(s,()=>({getId:()=>D.current.id,getLayout:()=>{const{layout:z}=T.current;return z},setLayout:z=>{const{onLayout:X}=D.current,{layout:W,panelDataArray:ae}=T.current,J=UN({layout:z,panelConstraints:ae.map(le=>le.constraints)});LN(W,J)||(R(J),T.current.layout=J,X&&X(J),Ru(ae,J,_.current))}}),[]),lc(()=>{D.current.autoSaveId=e,D.current.direction=r,D.current.dragState=C,D.current.id=x,D.current.onLayout=c,D.current.storage=f}),che({committedValuesRef:D,eagerValuesRef:T,groupId:x,layout:w,panelDataArray:T.current.panelDataArray,setLayout:R,panelGroupElement:v.current}),h.useEffect(()=>{const{panelDataArray:z}=T.current;if(e){if(w.length===0||w.length!==z.length)return;let X=zN[e];X==null&&(X=mhe(ghe,yhe),zN[e]=X);const W=[...z],ae=new Map(O.current);X(e,W,ae,w,f)}},[e,w,f]),h.useEffect(()=>{});const I=h.useCallback(z=>{const{onLayout:X}=D.current,{layout:W,panelDataArray:ae}=T.current;if(z.constraints.collapsible){const J=ae.map(Ve=>Ve.constraints),{collapsedSize:le=0,panelSize:ye,pivotIndices:Ce}=Ql(ae,z,W);if(Ot(ye!=null,`Panel size not found for panel "${z.id}"`),!Qo(ye,le)){O.current.set(z.id,ye);const De=Iu(ae,z)===ae.length-1?ye-le:le-ye,et=Lf({delta:De,initialLayout:W,panelConstraints:J,pivotIndices:Ce,prevLayout:W,trigger:"imperative-api"});Up(W,et)||(R(et),T.current.layout=et,X&&X(et),Ru(ae,et,_.current))}}},[]),k=h.useCallback((z,X)=>{const{onLayout:W}=D.current,{layout:ae,panelDataArray:J}=T.current;if(z.constraints.collapsible){const le=J.map(rt=>rt.constraints),{collapsedSize:ye=0,panelSize:Ce=0,minSize:Ve=0,pivotIndices:De}=Ql(J,z,ae),et=X??Ve;if(Qo(Ce,ye)){const rt=O.current.get(z.id),dn=rt!=null&&rt>=et?rt:et,On=Iu(J,z)===J.length-1?Ce-dn:dn-Ce,yn=Lf({delta:On,initialLayout:ae,panelConstraints:le,pivotIndices:De,prevLayout:ae,trigger:"imperative-api"});Up(ae,yn)||(R(yn),T.current.layout=yn,W&&W(yn),Ru(J,yn,_.current))}}},[]),F=h.useCallback(z=>{const{layout:X,panelDataArray:W}=T.current,{panelSize:ae}=Ql(W,z,X);return Ot(ae!=null,`Panel size not found for panel "${z.id}"`),ae},[]),G=h.useCallback((z,X)=>{const{panelDataArray:W}=T.current,ae=Iu(W,z);return hhe({defaultSize:X,dragState:C,layout:w,panelData:W,panelIndex:ae})},[C,w]),Y=h.useCallback(z=>{const{layout:X,panelDataArray:W}=T.current,{collapsedSize:ae=0,collapsible:J,panelSize:le}=Ql(W,z,X);return Ot(le!=null,`Panel size not found for panel "${z.id}"`),J===!0&&Qo(le,ae)},[]),B=h.useCallback(z=>{const{layout:X,panelDataArray:W}=T.current,{collapsedSize:ae=0,collapsible:J,panelSize:le}=Ql(W,z,X);return Ot(le!=null,`Panel size not found for panel "${z.id}"`),!J||Sc(le,ae)>0},[]),Z=h.useCallback(z=>{const{panelDataArray:X}=T.current;X.push(z),X.sort((W,ae)=>{const J=W.order,le=ae.order;return J==null&&le==null?0:J==null?-1:le==null?1:J-le}),T.current.panelDataArrayChanged=!0,j()},[j]);lc(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:z,onLayout:X,storage:W}=D.current,{layout:ae,panelDataArray:J}=T.current;let le=null;if(z){const Ce=phe(z,J,W);Ce&&(O.current=new Map(Object.entries(Ce.expandToSizes)),le=Ce.layout)}le==null&&(le=fhe({panelDataArray:J}));const ye=UN({layout:le,panelConstraints:J.map(Ce=>Ce.constraints)});LN(ae,ye)||(R(ye),T.current.layout=ye,X&&X(ye),Ru(J,ye,_.current))}}),lc(()=>{const z=T.current;return()=>{z.layout=[]}},[]);const H=h.useCallback(z=>{let X=!1;const W=v.current;return W&&window.getComputedStyle(W,null).getPropertyValue("direction")==="rtl"&&(X=!0),function(J){J.preventDefault();const le=v.current;if(!le)return()=>null;const{direction:ye,dragState:Ce,id:Ve,keyboardResizeBy:De,onLayout:et}=D.current,{layout:rt,panelDataArray:dn}=T.current,{initialLayout:zt}=Ce??{},On=QM(Ve,z,le);let yn=dhe(J,z,ye,Ce,De,le);const Me=ye==="horizontal";Me&&X&&(yn=-yn);const q=dn.map(Oe=>Oe.constraints),ne=Lf({delta:yn,initialLayout:zt??rt,panelConstraints:q,pivotIndices:On,prevLayout:rt,trigger:$M(J)?"keyboard":"mouse-or-touch"}),ce=!Up(rt,ne);(VM(J)||GM(J))&&A.current!=yn&&(A.current=yn,!ce&&yn!==0?Me?w1(z,yn<0?qM:KM):w1(z,yn<0?ZM:YM):w1(z,0)),ce&&(R(ne),T.current.layout=ne,et&&et(ne),Ru(dn,ne,_.current))}},[]),M=h.useCallback((z,X)=>{const{onLayout:W}=D.current,{layout:ae,panelDataArray:J}=T.current,le=J.map(rt=>rt.constraints),{panelSize:ye,pivotIndices:Ce}=Ql(J,z,ae);Ot(ye!=null,`Panel size not found for panel "${z.id}"`);const De=Iu(J,z)===J.length-1?ye-X:X-ye,et=Lf({delta:De,initialLayout:ae,panelConstraints:le,pivotIndices:Ce,prevLayout:ae,trigger:"imperative-api"});Up(ae,et)||(R(et),T.current.layout=et,W&&W(et),Ru(J,et,_.current))},[]),V=h.useCallback((z,X)=>{const{layout:W,panelDataArray:ae}=T.current,{collapsedSize:J=0,collapsible:le}=X,{collapsedSize:ye=0,collapsible:Ce,maxSize:Ve=100,minSize:De=0}=z.constraints,{panelSize:et}=Ql(ae,z,W);et!=null&&(le&&Ce&&Qo(et,J)?Qo(J,ye)||M(z,ye):et<De?M(z,De):et>Ve&&M(z,Ve))},[M]),$=h.useCallback((z,X)=>{const{direction:W}=D.current,{layout:ae}=T.current;if(!v.current)return;const J=ox(z,v.current);Ot(J,`Drag handle element not found for id "${z}"`);const le=e8(W,X);S({dragHandleId:z,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:le,initialLayout:ae})},[]),oe=h.useCallback(()=>{S(null)},[]),ge=h.useCallback(z=>{const{panelDataArray:X}=T.current,W=Iu(X,z);W>=0&&(X.splice(W,1),delete _.current[z.id],T.current.panelDataArrayChanged=!0,j())},[j]),P=h.useMemo(()=>({collapsePanel:I,direction:r,dragState:C,expandPanel:k,getPanelSize:F,getPanelStyle:G,groupId:x,isPanelCollapsed:Y,isPanelExpanded:B,reevaluatePanelConstraints:V,registerPanel:Z,registerResizeHandle:H,resizePanel:M,startDragging:$,stopDragging:oe,unregisterPanel:ge,panelGroupElement:v.current}),[I,C,r,k,F,G,x,Y,B,V,Z,H,M,$,oe,ge]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return h.createElement(nx.Provider,{value:P},h.createElement(y,{...g,children:t,className:n,id:i,ref:v,style:{...U,...m},[Qn.group]:"",[Qn.groupDirection]:r,[Qn.groupId]:x}))}const s8=h.forwardRef((e,t)=>h.createElement(a8,{...e,forwardedRef:t}));a8.displayName="PanelGroup";s8.displayName="forwardRef(PanelGroup)";function Iu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Ql(e,t,n){const r=Iu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],c=n[r];return{...t.constraints,panelSize:c,pivotIndices:i}}function xhe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){h.useEffect(()=>{if(e||n==null||r==null)return;const s=ox(t,r);if(s==null)return;const i=c=>{if(!c.defaultPrevented)switch(c.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{c.preventDefault(),n(c);break}case"F6":{c.preventDefault();const u=s.getAttribute(Qn.groupId);Ot(u,`No group element found for id "${u}"`);const f=dh(u,r),m=XM(u,t,r);Ot(m!==null,`No resize element found for id "${t}"`);const y=c.shiftKey?m>0?m-1:f.length-1:m+1<f.length?m+1:0;f[y].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function o8({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onClick:c,onDragging:u,onFocus:f,onPointerDown:m,onPointerUp:y,style:g={},tabIndex:x=0,tagName:v="div",...C}){var S,w;const R=h.useRef(null),j=h.useRef({onClick:c,onDragging:u,onPointerDown:m,onPointerUp:y});h.useEffect(()=>{j.current.onClick=c,j.current.onDragging=u,j.current.onPointerDown=m,j.current.onPointerUp=y});const _=h.useContext(nx);if(_===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:O,groupId:A,registerResizeHandle:D,startDragging:T,stopDragging:I,panelGroupElement:k}=_,F=jC(s),[G,Y]=h.useState("inactive"),[B,Z]=h.useState(!1),[H,M]=h.useState(null),V=h.useRef({state:G});lc(()=>{V.current.state=G}),h.useEffect(()=>{if(n)M(null);else{const P=D(F);M(()=>P)}},[n,F,D]);const $=(S=r==null?void 0:r.coarse)!==null&&S!==void 0?S:15,oe=(w=r==null?void 0:r.fine)!==null&&w!==void 0?w:5;h.useEffect(()=>{if(n||H==null)return;const P=R.current;Ot(P,"Element ref not attached");let U=!1;return nhe(F,P,O,{coarse:$,fine:oe},(X,W,ae)=>{if(!W){Y("inactive");return}switch(X){case"down":{Y("drag"),U=!1,Ot(ae,'Expected event to be defined for "down" action'),T(F,ae);const{onDragging:J,onPointerDown:le}=j.current;J==null||J(!0),le==null||le();break}case"move":{const{state:J}=V.current;U=!0,J!=="drag"&&Y("hover"),Ot(ae,'Expected event to be defined for "move" action'),H(ae);break}case"up":{Y("hover"),I();const{onClick:J,onDragging:le,onPointerUp:ye}=j.current;le==null||le(!1),ye==null||ye(),U||J==null||J();break}}})},[$,O,n,oe,D,F,H,T,I]),xhe({disabled:n,handleId:F,resizeHandler:H,panelGroupElement:k});const ge={touchAction:"none",userSelect:"none"};return h.createElement(v,{...C,children:e,className:t,id:s,onBlur:()=>{Z(!1),i==null||i()},onFocus:()=>{Z(!0),f==null||f()},ref:R,role:"separator",style:{...ge,...g},tabIndex:x,[Qn.groupDirection]:O,[Qn.groupId]:A,[Qn.resizeHandle]:"",[Qn.resizeHandleActive]:G==="drag"?"pointer":B?"keyboard":void 0,[Qn.resizeHandleEnabled]:!n,[Qn.resizeHandleId]:F,[Qn.resizeHandleState]:G})}o8.displayName="PanelResizeHandle";function vhe({className:e,...t}){return a.jsx(s8,{"data-slot":"resizable-panel-group",className:se("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function FN({...e}){return a.jsx(HM,{"data-slot":"resizable-panel",...e})}function bhe({withHandle:e,className:t,...n}){return a.jsx(o8,{"data-slot":"resizable-handle",className:se("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&a.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:a.jsx(TA,{className:"size-2.5"})})})}function She({storageKey:e,left:t,right:n,initialRatio:r=.5,minWidth:s=240,className:i}){const c=h.useMemo(()=>{const x=ps.get(e);if(x!==null){const v=Number(x);if(!Number.isNaN(v))return R1(v,.1,.9)}return R1(r,.1,.9)},[e,r]),u=Math.round(c*100),f=100-u,y=Math.min(45,Math.max(5,Math.round(s/1200*100)));function g(x){const v=x[0],C=R1(v/100,.1,.9);ps.set(e,C)}return a.jsxs(vhe,{direction:"horizontal",onLayout:g,className:se("relative flex h-full w-full items-stretch overflow-hidden",i),children:[a.jsx(FN,{defaultSize:u,minSize:y,className:"overflow-auto",children:t}),a.jsx(bhe,{withHandle:!0}),a.jsx(FN,{defaultSize:f,minSize:y,className:"overflow-auto",children:n})]})}function R1(e,t,n){return Math.max(t,Math.min(n,e))}const Che=[{label:"prompt",insertText:`{{#prompt}}
|
|
838
|
-
$0
|
|
839
|
-
{{/prompt}}`,documentation:"Insert a {{#prompt}} template for generative queries"}],HN=new Set;function whe(e,t){HN.has(t)||(e.languages.registerCompletionItemProvider(t,{triggerCharacters:["/"],provideCompletionItems:(n,r)=>{const s=r.lineNumber,i=r.column,c=n.getValueInRange({startLineNumber:s,startColumn:1,endLineNumber:s,endColumn:i}),u=c.lastIndexOf("/");if(u!==-1){const f=c.substring(u+1),m={startLineNumber:s,endLineNumber:s,startColumn:u+2,endColumn:i},y=[];return Che.forEach(g=>{g.label.startsWith(f)&&y.push({label:g.label,insertText:g.insertText,documentation:{value:g.documentation,isTrusted:!0},detail:g.documentation,kind:e.languages.CompletionItemKind.Field,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:m,additionalTextEdits:[{range:{startLineNumber:s,endLineNumber:s,startColumn:u+1,endColumn:u+2},text:""}]})}),{suggestions:y}}return{suggestions:[]}}}),HN.add(t))}const Ehe=(e,t)=>{whe(t,"markdown")};function $N({value:e,onChange:t,height:n="60vh",className:r,readOnly:s}){const{resolvedTheme:i}=gd();return a.jsx("div",{className:r,children:a.jsx(H2,{height:n,language:"markdown",theme:i==="dark"?"vs-dark":"light",className:"overflow-hidden rounded-tl-md",value:e,onChange:c=>{t(c??"")},onMount:Ehe,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",overviewRulerBorder:!1,automaticLayout:!0,overviewRulerLanes:0,placeholder:"Press '/' for commands",readOnly:!!s}})})}function Rhe({...e}){return a.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function jhe({className:e,...t}){return a.jsx("ol",{"data-slot":"breadcrumb-list",className:se("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function VN({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:se("inline-flex items-center gap-1.5",e),...t})}function The({asChild:e,className:t,...n}){const r=e?yh:"a";return a.jsx(r,{"data-slot":"breadcrumb-link",className:se("hover:text-foreground transition-colors",t),...n})}function _he({children:e,className:t,...n}){return a.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:se("[&>svg]:size-3.5",t),...n,children:e??a.jsx(_a,{})})}function Nhe({dataMartId:e,triggerId:t,insightId:n,onRunFinished:r,onError:s}){const i=h.useCallback(async c=>{if(!(!e||!t))try{const u=await Zo.checkInsightExecutionStatus(e,t,n,{skipLoadingIndicator:!0,signal:c});[Xa.SUCCESS,Xa.ERROR,Xa.CANCELLED].includes(u.status)&&r()}catch(u){s(u)}},[e,t,n,r,s]);wC({enabled:!!(e&&t),intervalMs:2500,onlyWhenVisible:!0,onTick:i})}const Ahe=rn({title:Dt().min(1,"Title cannot be empty"),template:Dt().optional()}),Dhe=(e,t,n)=>{const{register:r,watch:s,handleSubmit:i,reset:c,resetField:u,setValue:f,formState:{isSubmitting:m,dirtyFields:y}}=Ro({resolver:yi(Ahe),defaultValues:{title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""}}),g=s("title"),x=s("template"),v=!!y.template;h.useEffect(()=>{c({title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""})},[e==null?void 0:e.id,e==null?void 0:e.title,e==null?void 0:e.template,c]);const C=h.useCallback(async w=>{if(!e)return;const R=w.trim();f("title",R,{shouldDirty:!0,shouldValidate:!0}),await n(e.id,R),u("title",{defaultValue:R})},[e,u,f,n]),S=h.useCallback(async w=>{if(!e)return;const R={title:w.title.trim(),template:w.template&&w.template.trim().length>0?w.template:null},j=await t(e.id,R);j&&c({title:j.title,template:j.template??""})},[e,c,t]);return{register:r,handleSubmit:i,setValue:f,isTemplateDirty:v,isSubmitting:m,titleValue:g,templateValue:x,handleTitleUpdate:C,onSubmit:S}},j1=[{icon:Ji,text:"Initializing intelligence..."},{icon:EA,text:"Connecting to data sources..."},{icon:JU,text:"Mapping data relationships..."},{icon:yU,text:"Exploring dataset structure..."},{icon:Cz,text:"Scanning available fields..."},{icon:Nz,text:"Analyzing data patterns..."},{icon:gz,text:"Selecting optimal insight path..."},{icon:kA,text:"Preparing aggregated tables..."},{icon:kU,text:"Building visual model..."},{icon:cU,text:"Finalizing insight output..."},{icon:kz,text:"Validating field consistency..."},{icon:bz,text:"Checking for missing values..."},{icon:pU,text:"Detecting anomalies in data..."},{icon:PU,text:"Cross-referencing data sources..."},{icon:Dz,text:"Verifying aggregation results..."},{icon:NU,text:"Ensuring data relationships are correct..."},{icon:RP,text:"Refining visual model parameters..."},{icon:EU,text:"Confirming data integrity..."},{icon:dU,text:"Preparing final output for insights..."},{icon:bU,text:"Performing final quality checks..."}],Ohe=()=>{const[e,t]=h.useState(0);h.useEffect(()=>{const r=setInterval(()=>{t(s=>(s+1)%j1.length)},5e3);return()=>{clearInterval(r)}},[]);const n=j1[e].icon;return a.jsx("div",{className:"bg-muted h-full w-full rounded-tr-md rounded-br-md dark:bg-transparent",children:a.jsxs("div",{className:"flex h-full w-full animate-pulse flex-col items-center justify-center gap-4 p-4 text-center select-none",children:[a.jsx("div",{className:"text-muted-foreground animate-fade-slide-in-out",children:a.jsx(n,{className:"h-8 w-8",strokeWidth:1})},`${String(e)}-icon`),a.jsx("h3",{className:"text-muted-foreground animate-fade-slide-in-out text-sm",children:j1[e].text},`${String(e)}-text`)]})})};function Ihe(){const e=wc(),{insightId:t}=Yg(),n=h.useMemo(()=>"insight_details_split",[]),[r,s]=h.useState(!1),{dataMart:i}=ws(),{activeInsight:c,insightLoading:u,isRunning:f,triggerId:m,updateInsight:y,updateInsightTitle:g,getInsight:x,runInsight:v,deleteInsight:C,resetTriggerId:S,ensureActiveRunPolling:w}=EC(),{handleSubmit:R,setValue:j,isTemplateDirty:_,isSubmitting:O,titleValue:A,templateValue:D,handleTitleUpdate:T,onSubmit:I}=Dhe(c,y,g),k=_M({markdown:(c==null?void 0:c.output)??"",enabled:!!(c!=null&&c.output),debounceMs:0}),[F,G]=h.useState(!1),[Y,B]=h.useState(!1),{copyToClipboard:Z}=tx(),H=h.useCallback(async()=>{const ge=(c==null?void 0:c.output)??"";if(!ge)return;await Z(ge,"insight-output")?_t.success("Markdown copied to clipboard"):_t.error("Failed to copy to clipboard")},[c==null?void 0:c.output,Z]);h.useEffect(()=>{const ge=P=>{(P.metaKey||P.ctrlKey)&&P.shiftKey&&(P.key==="M"||P.key==="m")&&(P.preventDefault(),G(z=>!z))};return window.addEventListener("keydown",ge),()=>{window.removeEventListener("keydown",ge)}},[]);const M=h.useCallback(async()=>{c&&(await C(c.id),e(".."))},[c,C,e]),V=!u&&!(c!=null&&c.output);h.useEffect(()=>{t&&x(t)},[t,x]),h.useEffect(()=>{c!=null&&c.id&&w()},[c==null?void 0:c.id,w]),Nhe({triggerId:m,dataMartId:(i==null?void 0:i.id)??"",insightId:(c==null?void 0:c.id)??"",onRunFinished:h.useCallback(()=>{S(),c!=null&&c.id&&x(c.id)},[c==null?void 0:c.id,x,S]),onError:h.useCallback(()=>{S()},[S])});const $=h.useCallback(async()=>{if(!(c!=null&&c.id)){console.error("Insight ID is not available");return}try{await v(c.id)}catch(ge){throw console.error("Failed to run insight"),ge}},[c==null?void 0:c.id,v]),oe=h.useCallback(()=>R(async ge=>{if(await I(ge),!(c!=null&&c.id)){console.error("Insight ID is not available");return}try{await v(c.id)}catch(P){throw console.error("Failed to run insight"),P}})(),[R,c==null?void 0:c.id,I,v]);return u?a.jsx("div",{className:"text-muted-foreground flex flex-col gap-2 text-sm",children:"Loading..."}):!c||!i?a.jsxs(Ub,{children:[a.jsx(zb,{children:a.jsx(Fb,{variant:"icon",children:a.jsx(Ji,{})})}),a.jsx(Hb,{children:"Insight not found"}),a.jsx($b,{children:"The insight you're looking for doesn't exist or couldn't be loaded"})]}):a.jsxs("div",{className:"flex h-full w-full flex-col gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Rhe,{children:a.jsxs(jhe,{children:[a.jsx(VN,{children:a.jsx(The,{asChild:!0,children:a.jsx(Wr,{to:"..",children:"Insights"})})}),a.jsx(_he,{}),a.jsx(VN,{children:a.jsx("span",{"aria-current":"page",className:"block max-w-[480px] truncate",children:a.jsx(m6,{title:A||"Untitled insight",onUpdate:T,className:"font-medium",errorMessage:"Title cannot be empty",minWidth:"200px"})})})]})}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(Cr,{children:[a.jsx(wr,{asChild:!0,children:a.jsx(we,{variant:"ghost",size:"icon","aria-label":"Insight actions",children:a.jsx(RA,{className:"h-4 w-4"})})}),a.jsx(Er,{align:"end",children:a.jsxs(vt,{onClick:()=>{s(!0)},className:"text-destructive",children:[a.jsx(es,{className:"h-4 w-4 text-red-600"})," ",a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})]}),a.jsx("div",{className:"bg-background flex-1 rounded-md border",children:a.jsx(She,{storageKey:n,initialRatio:.5,left:a.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:a.jsx($N,{value:D??"",onChange:ge=>{j("template",ge,{shouldDirty:!0})},height:"calc(100vh - 275px)",placeholder:"Type / to view available commands...",readOnly:f})}),a.jsxs("div",{className:"flex items-center justify-between gap-4 border-t px-4 py-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(we,{variant:"default",size:"default",disabled:O||f,onClick:()=>void(_?oe():$()),children:f?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Rc,{className:"h-3 w-3 animate-spin"})," Running…"]}):_?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Ji,{})," Save & Run Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Ji,{})," Run Insight"]})}),a.jsxs(Et,{delayDuration:1500,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs(we,{variant:"outline",size:"default",onClick:()=>{B(!0)},className:"gap-2",children:[a.jsx(Rz,{className:"text-muted-foreground h-4 w-4"}),"Send & Schedule ..."]})}),a.jsx(jt,{side:"top",children:a.jsx("p",{children:"You can schedule this insight to run at a specific time or send it to a recipient"})})]})]}),c.outputUpdatedAt&&a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground/75 text-sm",children:a.jsx(Vs,{date:c.outputUpdatedAt})})}),a.jsx(jt,{side:"top",children:a.jsxs("p",{children:["Last run: ",v5(c.outputUpdatedAt)]})})]})})]})]}),right:a.jsx("div",{className:"h-full",children:f?a.jsx(Ohe,{}):V?a.jsx(Ub,{className:"h-full",children:a.jsxs(zb,{children:[a.jsx(Fb,{variant:"icon",children:a.jsx(Ji,{})}),a.jsx(Hb,{children:"Even data needs a little spark"}),a.jsx($b,{children:"Write prompt to uncover the story behind your data!"})]})}):a.jsx("div",{className:"flex h-full min-h-0 flex-col gap-2",children:a.jsx("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:F?a.jsx($N,{value:c.output??"",onChange:()=>{},height:"100%",className:"h-full",readOnly:!0}):k.error?a.jsx("div",{className:"text-destructive",children:k.error}):a.jsxs(a.Fragment,{children:[a.jsx(TM,{html:k.html,loading:k.loading,error:k.error,height:"100%"}),!!c.output&&!k.loading&&!k.error&&a.jsx("div",{className:"absolute top-2 right-2 z-10",children:a.jsx(Ya,{children:a.jsxs(Et,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(we,{variant:"outline",size:"icon",className:"h-8 w-8","aria-label":"Copy markdown to clipboard",onClick:()=>void H(),children:a.jsx(Yu,{className:"h-4 w-4"})})}),a.jsx(jt,{side:"left",children:a.jsx("p",{children:"Copy markdown to clipboard"})})]})})})]})})})})})}),a.jsx(br,{open:r,onOpenChange:s,title:"Delete Insight",description:"Are you sure you want to delete this insight? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{M()}}),a.jsx(ZS,{children:a.jsx(IM,{isOpen:Y,onClose:()=>{B(!1)},mode:_n.CREATE,preSelectedDestination:null,prefill:{title:c.title||A||"New report",subject:`Insight: ${c.title||A||""}`.trim(),messageTemplate:D??""},allowedDestinationTypes:[Ae.EMAIL,Ae.SLACK,Ae.MS_TEAMS,Ae.GOOGLE_CHAT]})})]})}const Mhe=[{path:"overview",element:a.jsx(NN,{})},{path:"data-setup",element:a.jsx(Nue,{})},{path:"insights",element:a.jsx(sfe,{}),children:[{index:!0,element:a.jsx(Gfe,{})},{path:":insightId",element:a.jsx(Ihe,{})}]},{path:"reports",element:a.jsx(Wde,{})},{path:"triggers",element:a.jsx(Xde,{})},{path:"run-history",element:a.jsx(wfe,{})},{index:!0,element:a.jsx(NN,{})}];function khe({to:e="/data-marts"}){const{user:t,status:n}=hi();if(n===Zr.LOADING)return a.jsx(Fu,{fullScreen:!0,message:"Loading..."});if(n===Zr.UNAUTHENTICATED||!t)return a.jsx(Fu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=hg(t.projectId,e);return a.jsx(yL,{to:r,replace:!0})}return a.jsx(Fu,{fullScreen:!0,message:"Project not found"})}const Lhe=[{index:!0,path:"/",element:a.jsx(khe,{})},{path:"/ui/:projectId",element:a.jsx(jX,{}),children:[{path:"about",element:a.jsx(TX,{})},{index:!0,element:a.jsx(R_,{})},{path:"data-marts",element:a.jsx(R_,{})},{path:"data-marts/create",element:a.jsx(Efe,{})},{path:"data-marts/:id",element:a.jsx(Cue,{}),children:Mhe},{path:"data-storages",element:a.jsx(Afe,{})},{path:"data-destinations",element:a.jsx(Lfe,{})},{path:"*",element:a.jsx(v_,{})}]},{path:"*",element:a.jsx(v_,{})}],i8="gtm-script",l8="gtm-noscript",Phe="GOOGLE_TAG_MANAGER_CONTAINER_ID";function Uhe(){return!!document.getElementById(i8)}function zhe(e){const t=document.createElement("script");return t.id=i8,t.innerHTML=`
|
|
840
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
841
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
842
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
843
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
844
|
-
})(window,document,'script','dataLayer','${e}');
|
|
845
|
-
`,t}function Fhe(e){const t=document.createElement("noscript");return t.id=l8,t.innerHTML=`
|
|
846
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
847
|
-
height="0"
|
|
848
|
-
width="0"
|
|
849
|
-
style="display:none;visibility:hidden">
|
|
850
|
-
</iframe>
|
|
851
|
-
`,t}function Hhe(e){if(Uhe())return;const t=zhe(e);document.head.prepend(t)}function $he(e){if(document.getElementById(l8))return;const t=Fhe(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function Vhe(e){try{Hhe(e),$he(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function Ghe(e){return(e[Phe]??"").trim()}function Bhe(){const{flags:e,callState:t}=hd();return h.useEffect(()=>{if(t!==St.LOADED||!e)return;const n=Ghe(e);n&&Vhe(n)},[e,t]),null}const qhe="INTERCOM_APP_ID",c8="intercom-widget-script";function Khe(){return!!document.getElementById(c8)}function Zhe(e,t){if(Khe()){t();return}const n=document.createElement("script");n.id=c8,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Yhe(){try{return(await Ea.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function Whe(e,t){const n={app_id:e,user_id:t.id,hide_default_launcher:!0};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function Xhe(e,t){if(!t)return;const n=Whe(e,t),r=await Yhe();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function Qhe(){const{flags:e,callState:t}=hd(),{user:n}=hi(),r=h.useRef(!1);return h.useEffect(()=>{if(r.current||t!==St.LOADED||!e)return;const s=e[qhe],i=(typeof s=="string"?s:"").trim();i&&Zhe(i,()=>{Xhe(i,n).then(()=>{r.current=!0,ob()})})},[e,t,n]),null}function Jhe({initialState:e,reducer:t,children:n}){const[r,s]=h.useReducer(t,e),i=h.useMemo(()=>s,[s]);return a.jsx(K3.Provider,{value:r,children:a.jsx(Z3.Provider,{value:i,children:n})})}function eme(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(s=>{const i=e[s],c=t[s],u=i(c,n);u!==c&&(r[s]=u)}),r}}const GN={id:null,title:null},u8="project/SET_PROJECT",tme="project/CLEAR_PROJECT";function nme(e){return{type:u8,payload:e}}function rme(e=GN,t){switch(t.type){case u8:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case tme:return{...GN};default:return e}}class ame extends bl{getFlags(){return this.get("/flags")}}const sme=new ame(""),d8={LICENSED_APP_EDITION:"COMMUNITY",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"},ome={data:{...d8},callState:St.IDLE},f8="settings/LOAD_FLAGS",h8="settings/LOAD_FLAGS_SUCCESS",m8="settings/LOAD_FLAGS_ERROR";function ime(){return{type:f8}}function lme(e){return{type:h8,payload:e}}function cme(e){return{type:m8,payload:e}}function ume(e=ome,t){switch(t.type){case f8:return{...e,callState:St.LOADING,error:void 0};case h8:return{...e,callState:St.LOADED,data:{...d8,...t.payload}};case m8:return{...e,callState:St.ERROR,error:t.payload};default:return e}}async function dme(e){try{e(ime());const t=await sme.getFlags();e(lme(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(cme(n))}}const p8="app/SET_READY";function fme(e={ready:!1},t){switch(t.type){case p8:return{...e,ready:!!t.payload};default:return e}}const hme=eme({project:rme,flags:ume,contentPopovers:zW,app:fme});function mme({children:e}){return a.jsx(Jhe,{reducer:hme,initialState:{project:{id:null,title:null},flags:{data:null,callState:St.IDLE},contentPopovers:ZD,app:{ready:!1}},children:e})}function pme({children:e}){const t=Y3(),{user:n,status:r}=hi(),s=th(f=>f.flags),i=s.callState,c=th(f=>f.app.ready);h.useEffect(()=>{r===Zr.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(nme({id:n.projectId,title:n.projectTitle??null})),i===St.IDLE&&dme(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,i,t]),h.useEffect(()=>{const f=r===Zr.AUTHENTICATED&&!!(n!=null&&n.projectId)&&i===St.LOADED;t({type:p8,payload:f})},[r,n==null?void 0:n.projectId,i,t]);const u=h.useMemo(()=>a.jsx(Fu,{fullScreen:!0,message:"Loading application..."}),[]);return c?a.jsx(a.Fragment,{children:e}):i===St.ERROR?a.jsx(Fu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):u}const gme={center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","bottom-left":"bottom-4 left-4","bottom-right":"bottom-4 right-4","top-left":"top-4 left-4","top-right":"top-4 right-4"};function yme({width:e=500,height:t=500,position:n="center",children:r}){return a.jsx("div",{className:se("fixed z-[999] rounded-2xl border bg-white dark:bg-neutral-900","border-neutral-200 dark:border-neutral-800","hover:shadow-3xl transform shadow-2xl transition-all duration-200 ease-out",gme[n]),style:{width:e,height:t},"data-slot":"floating-popover",children:a.jsx("div",{className:"flex h-full flex-col",children:r})})}function xme({children:e,onClose:t,...n}){return a.jsxs("div",{className:"relative flex items-center justify-between rounded-tl-2xl rounded-tr-2xl border-b bg-neutral-50 px-4 py-3 dark:bg-neutral-800/40","data-slot":"floating-popover-header",...n,children:[e,t&&a.jsx("button",{onClick:t,className:se("ml-2 rounded-sm p-1.5 transition-all","text-muted-foreground hover:text-foreground hover:bg-neutral-100 dark:hover:bg-neutral-800","focus:ring-brand-blue-500 focus:ring-2 focus:outline-none active:scale-95"),"aria-label":"Close popover",children:a.jsx(uc,{className:"size-4"})})]})}function vme({children:e}){return a.jsx("h2",{className:"text-md font-semibold","data-slot":"floating-popover-title",children:e})}function bme({children:e}){return a.jsx("div",{className:"flex-1 space-y-4 overflow-auto px-4 py-3","data-slot":"floating-popover-content",children:e})}function Sme(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/d2d9d913-a6fc-4949-a8e8-d697abd1631a",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}function Cme(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/95e499eb-0a36-4180-846b-a829294e1afe",controls:!0,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full rounded-md",children:"Your browser does not support the video tag."})})}const wme={"video-1-google-sheets":{width:500,height:410,position:"bottom-left",title:"SQL to Google Sheets in Minutes",content:Sme},"video-2-looker":{width:500,height:410,position:"bottom-left",title:"Looker Studio Setup",content:Cme}};function Eme(){const{activePopoverId:e,isOpen:t,close:n}=BS();if(!t||!e)return null;const r=wme[e],{width:s=500,height:i=400,position:c="center",title:u,content:f}=r;return a.jsxs(yme,{width:s,height:i,position:c,onClose:n,children:[a.jsx(xme,{onClose:n,children:u&&a.jsx(vme,{children:u})}),a.jsx(bme,{children:a.jsx(f,{onClose:n})})]})}function Rme(){const e=$L(Lhe);return a.jsx(dZ,{children:a.jsx(mme,{children:a.jsxs(pme,{children:[a.jsx(Bhe,{}),a.jsx(Qhe,{}),a.jsx(Eme,{}),a.jsx(eP,{router:e})]})})})}const g8=document.getElementById("root");if(!g8)throw new Error("Root element not found");M9.createRoot(g8).render(a.jsx(h.StrictMode,{children:a.jsx(Rme,{})}));
|