@owox/web 0.16.0-next-20251217123453 → 0.16.0-next-20251218083513

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,859 @@
1
+ var P9=Object.defineProperty;var U9=(e,t,n)=>t in e?P9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ro=(e,t,n)=>U9(e,typeof t!="symbol"?t+"":t,n);function z9(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 nA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var O0={exports:{}},vf={};/**
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 Ej;function F9(){if(Ej)return vf;Ej=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 vf.Fragment=t,vf.jsx=n,vf.jsxs=n,vf}var wj;function H9(){return wj||(wj=1,O0.exports=F9()),O0.exports}var a=H9(),I0={exports:{}},Et={};/**
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 Rj;function V9(){if(Rj)return Et;Rj=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"),x=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function v(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,E={};function R(U,F,H){this.props=U,this.context=F,this.refs=E,this.updater=H||S}R.prototype.isReactComponent={},R.prototype.setState=function(U,F){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,F,"setState")},R.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function j(){}j.prototype=R.prototype;function _(U,F,H){this.props=U,this.context=F,this.refs=E,this.updater=H||S}var D=_.prototype=new j;D.constructor=_,b(D,R.prototype),D.isPureReactComponent=!0;var O=Array.isArray;function A(){}var T={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function k(U,F,H){var W=H.ref;return{$$typeof:e,type:U,key:F,ref:W!==void 0?W:null,props:H}}function z(U,F){return k(U.type,F,U.props)}function L(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function G(U){var F={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(H){return F[H]})}var B=/\/+/g;function q(U,F){return typeof U=="object"&&U!==null&&U.key!=null?G(""+U.key):F.toString(36)}function V(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(A,A):(U.status="pending",U.then(function(F){U.status==="pending"&&(U.status="fulfilled",U.value=F)},function(F){U.status==="pending"&&(U.status="rejected",U.reason=F)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function I(U,F,H,W,Q){var le=typeof U;(le==="undefined"||le==="boolean")&&(U=null);var J=!1;if(U===null)J=!0;else switch(le){case"bigint":case"string":case"number":J=!0;break;case"object":switch(U.$$typeof){case e:case t:J=!0;break;case x:return J=U._init,I(J(U._payload),F,H,W,Q)}}if(J)return Q=Q(U),J=W===""?"."+q(U,0):W,O(Q)?(H="",J!=null&&(H=J.replace(B,"$&/")+"/"),I(Q,F,H,"",function(Ee){return Ee})):Q!=null&&(L(Q)&&(Q=z(Q,H+(Q.key==null||U&&U.key===Q.key?"":(""+Q.key).replace(B,"$&/")+"/")+J)),F.push(Q)),1;J=0;var ie=W===""?".":W+":";if(O(U))for(var ye=0;ye<U.length;ye++)W=U[ye],le=ie+q(W,ye),J+=I(W,F,H,le,Q);else if(ye=v(U),typeof ye=="function")for(U=ye.call(U),ye=0;!(W=U.next()).done;)W=W.value,le=ie+q(W,ye++),J+=I(W,F,H,le,Q);else if(le==="object"){if(typeof U.then=="function")return I(V(U),F,H,W,Q);throw F=String(U),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return J}function K(U,F,H){if(U==null)return U;var W=[],Q=0;return I(U,W,"","",function(le){return F.call(H,le,Q++)}),W}function $(U){if(U._status===-1){var F=U._result;F=F(),F.then(function(H){(U._status===0||U._status===-1)&&(U._status=1,U._result=H)},function(H){(U._status===0||U._status===-1)&&(U._status=2,U._result=H)}),U._status===-1&&(U._status=0,U._result=F)}if(U._status===1)return U._result.default;throw U._result}var ee=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},me={map:K,forEach:function(U,F,H){K(U,function(){F.apply(this,arguments)},H)},count:function(U){var F=0;return K(U,function(){F++}),F},toArray:function(U){return K(U,function(F){return F})||[]},only:function(U){if(!L(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Et.Activity=g,Et.Children=me,Et.Component=R,Et.Fragment=n,Et.Profiler=s,Et.PureComponent=_,Et.StrictMode=r,Et.Suspense=f,Et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Et.__COMPILER_RUNTIME={__proto__:null,c:function(U){return T.H.useMemoCache(U)}},Et.cache=function(U){return function(){return U.apply(null,arguments)}},Et.cacheSignal=function(){return null},Et.cloneElement=function(U,F,H){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var W=b({},U.props),Q=U.key;if(F!=null)for(le in F.key!==void 0&&(Q=""+F.key),F)!M.call(F,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&F.ref===void 0||(W[le]=F[le]);var le=arguments.length-2;if(le===1)W.children=H;else if(1<le){for(var J=Array(le),ie=0;ie<le;ie++)J[ie]=arguments[ie+2];W.children=J}return k(U.type,Q,W)},Et.createContext=function(U){return U={$$typeof:c,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:i,_context:U},U},Et.createElement=function(U,F,H){var W,Q={},le=null;if(F!=null)for(W in F.key!==void 0&&(le=""+F.key),F)M.call(F,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(Q[W]=F[W]);var J=arguments.length-2;if(J===1)Q.children=H;else if(1<J){for(var ie=Array(J),ye=0;ye<J;ye++)ie[ye]=arguments[ye+2];Q.children=ie}if(U&&U.defaultProps)for(W in J=U.defaultProps,J)Q[W]===void 0&&(Q[W]=J[W]);return k(U,le,Q)},Et.createRef=function(){return{current:null}},Et.forwardRef=function(U){return{$$typeof:u,render:U}},Et.isValidElement=L,Et.lazy=function(U){return{$$typeof:x,_payload:{_status:-1,_result:U},_init:$}},Et.memo=function(U,F){return{$$typeof:m,type:U,compare:F===void 0?null:F}},Et.startTransition=function(U){var F=T.T,H={};T.T=H;try{var W=U(),Q=T.S;Q!==null&&Q(H,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(A,ee)}catch(le){ee(le)}finally{F!==null&&H.types!==null&&(F.types=H.types),T.T=F}},Et.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Et.use=function(U){return T.H.use(U)},Et.useActionState=function(U,F,H){return T.H.useActionState(U,F,H)},Et.useCallback=function(U,F){return T.H.useCallback(U,F)},Et.useContext=function(U){return T.H.useContext(U)},Et.useDebugValue=function(){},Et.useDeferredValue=function(U,F){return T.H.useDeferredValue(U,F)},Et.useEffect=function(U,F){return T.H.useEffect(U,F)},Et.useEffectEvent=function(U){return T.H.useEffectEvent(U)},Et.useId=function(){return T.H.useId()},Et.useImperativeHandle=function(U,F,H){return T.H.useImperativeHandle(U,F,H)},Et.useInsertionEffect=function(U,F){return T.H.useInsertionEffect(U,F)},Et.useLayoutEffect=function(U,F){return T.H.useLayoutEffect(U,F)},Et.useMemo=function(U,F){return T.H.useMemo(U,F)},Et.useOptimistic=function(U,F){return T.H.useOptimistic(U,F)},Et.useReducer=function(U,F,H){return T.H.useReducer(U,F,H)},Et.useRef=function(U){return T.H.useRef(U)},Et.useState=function(U){return T.H.useState(U)},Et.useSyncExternalStore=function(U,F,H){return T.H.useSyncExternalStore(U,F,H)},Et.useTransition=function(){return T.H.useTransition()},Et.version="19.2.1",Et}var jj;function dS(){return jj||(jj=1,I0.exports=V9()),I0.exports}var h=dS();const ae=nA(h),ph=z9({__proto__:null,default:ae},[h]);var M0={exports:{}},bf={},k0={exports:{}},L0={};/**
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 Tj;function $9(){return Tj||(Tj=1,(function(e){function t(I,K){var $=I.length;I.push(K);e:for(;0<$;){var ee=$-1>>>1,me=I[ee];if(0<s(me,K))I[ee]=K,I[$]=me,$=ee;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var K=I[0],$=I.pop();if($!==K){I[0]=$;e:for(var ee=0,me=I.length,U=me>>>1;ee<U;){var F=2*(ee+1)-1,H=I[F],W=F+1,Q=I[W];if(0>s(H,$))W<me&&0>s(Q,H)?(I[ee]=Q,I[W]=$,ee=W):(I[ee]=H,I[F]=$,ee=F);else if(W<me&&0>s(Q,$))I[ee]=Q,I[W]=$,ee=W;else break e}}return K}function s(I,K){var $=I.sortIndex-K.sortIndex;return $!==0?$:I.id-K.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=[],x=1,g=null,y=3,v=!1,S=!1,b=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function D(I){for(var K=n(m);K!==null;){if(K.callback===null)r(m);else if(K.startTime<=I)r(m),K.sortIndex=K.expirationTime,t(f,K);else break;K=n(m)}}function O(I){if(b=!1,D(I),!S)if(n(f)!==null)S=!0,A||(A=!0,G());else{var K=n(m);K!==null&&V(O,K.startTime-I)}}var A=!1,T=-1,M=5,k=-1;function z(){return E?!0:!(e.unstable_now()-k<M)}function L(){if(E=!1,A){var I=e.unstable_now();k=I;var K=!0;try{e:{S=!1,b&&(b=!1,j(T),T=-1),v=!0;var $=y;try{t:{for(D(I),g=n(f);g!==null&&!(g.expirationTime>I&&z());){var ee=g.callback;if(typeof ee=="function"){g.callback=null,y=g.priorityLevel;var me=ee(g.expirationTime<=I);if(I=e.unstable_now(),typeof me=="function"){g.callback=me,D(I),K=!0;break t}g===n(f)&&r(f),D(I)}else r(f);g=n(f)}if(g!==null)K=!0;else{var U=n(m);U!==null&&V(O,U.startTime-I),K=!1}}break e}finally{g=null,y=$,v=!1}K=void 0}}finally{K?G():A=!1}}}var G;if(typeof _=="function")G=function(){_(L)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,q=B.port2;B.port1.onmessage=L,G=function(){q.postMessage(null)}}else G=function(){R(L,0)};function V(I,K){T=R(function(){I(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(I){switch(y){case 1:case 2:case 3:var K=3;break;default:K=y}var $=y;y=K;try{return I()}finally{y=$}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(I,K){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var $=y;y=I;try{return K()}finally{y=$}},e.unstable_scheduleCallback=function(I,K,$){var ee=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ee+$:ee):$=ee,I){case 1:var me=-1;break;case 2:me=250;break;case 5:me=1073741823;break;case 4:me=1e4;break;default:me=5e3}return me=$+me,I={id:x++,callback:K,priorityLevel:I,startTime:$,expirationTime:me,sortIndex:-1},$>ee?(I.sortIndex=$,t(m,I),n(f)===null&&I===n(m)&&(b?(j(T),T=-1):b=!0,V(O,$-ee))):(I.sortIndex=me,t(f,I),S||v||(S=!0,A||(A=!0,G()))),I},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(I){var K=y;return function(){var $=y;y=K;try{return I.apply(this,arguments)}finally{y=$}}}})(L0)),L0}var _j;function B9(){return _j||(_j=1,k0.exports=$9()),k0.exports}var P0={exports:{}},Kr={};/**
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 Nj;function G9(){if(Nj)return Kr;Nj=1;var e=dS();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)m+="&args[]="+encodeURIComponent(arguments[x])}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,x){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:x}}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 Kr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Kr.createPortal=function(f,m){var x=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,x)},Kr.flushSync=function(f){var m=c.T,x=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=x,r.d.f()}},Kr.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))},Kr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Kr.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var x=m.as,g=u(x,m.crossOrigin),y=typeof m.integrity=="string"?m.integrity:void 0,v=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;x==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:v}):x==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:v,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Kr.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var x=u(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:x,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)},Kr.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var x=m.as,g=u(x,m.crossOrigin);r.d.L(f,x,{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})}},Kr.preloadModule=function(f,m){if(typeof f=="string")if(m){var x=u(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},Kr.requestFormReset=function(f){r.d.r(f)},Kr.unstable_batchedUpdates=function(f,m){return f(m)},Kr.useFormState=function(f,m,x){return c.H.useFormState(f,m,x)},Kr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Kr.version="19.2.1",Kr}var Aj;function rA(){if(Aj)return P0.exports;Aj=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(),P0.exports=G9(),P0.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 Dj;function q9(){if(Dj)return bf;Dj=1;var e=B9(),t=dS(),n=rA();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 C=d.return;if(C===null)break;var w=C.alternate;if(w===null){if(p=C.return,p!==null){d=p;continue}break}if(C.child===w.child){for(w=C.child;w;){if(w===d)return f(C),o;if(w===p)return f(C),l;w=w.sibling}throw Error(r(188))}if(d.return!==p.return)d=C,p=w;else{for(var N=!1,P=C.child;P;){if(P===d){N=!0,d=C,p=w;break}if(P===p){N=!0,p=C,d=w;break}P=P.sibling}if(!N){for(P=w.child;P;){if(P===d){N=!0,d=w,p=C;break}if(P===p){N=!0,p=w,d=C;break}P=P.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 x(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=x(o),l!==null)return l;o=o.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function G(o){return o===null||typeof o!="object"?null:(o=L&&o[L]||o["@@iterator"],typeof o=="function"?o:null)}var B=Symbol.for("react.client.reference");function q(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 b:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case k:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case S:return"Portal";case _:return o.displayName||"Context";case j:return(o._context.displayName||"Context")+".Consumer";case D: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:q(o.type)||"Memo";case M:l=o._payload,o=o._init;try{return q(o(l))}catch{}}return null}var V=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},ee=[],me=-1;function U(o){return{current:o}}function F(o){0>me||(o.current=ee[me],ee[me]=null,me--)}function H(o,l){me++,ee[me]=o.current,o.current=l}var W=U(null),Q=U(null),le=U(null),J=U(null);function ie(o,l){switch(H(le,l),H(Q,o),H(W,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?qR(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=qR(l),o=KR(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}F(W),H(W,o)}function ye(){F(W),F(Q),F(le)}function Ee(o){o.memoizedState!==null&&H(J,o);var l=W.current,d=KR(l,o.type);l!==d&&(H(Q,o),H(W,d))}function He(o){Q.current===o&&(F(W),F(Q)),J.current===o&&(F(J),pf._currentValue=$)}var Re,Ke;function nt(o){if(Re===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Re=l&&l[1]||"",Ke=-1<d.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Re+o+Ke}var Gt=!1;function Ft(o,l){if(!o||Gt)return"";Gt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ge){var he=ge}Reflect.construct(o,[],Se)}else{try{Se.call()}catch(ge){he=ge}o.call(Se.prototype)}}else{try{throw Error()}catch(ge){he=ge}(Se=o())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ge){if(ge&&he&&typeof ge.stack=="string")return[ge.stack,he.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),N=w[0],P=w[1];if(N&&P){var X=N.split(`
44
+ `),de=P.split(`
45
+ `);for(C=p=0;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;for(;C<de.length&&!de[C].includes("DetermineComponentFrameRoot");)C++;if(p===X.length||C===de.length)for(p=X.length-1,C=de.length-1;1<=p&&0<=C&&X[p]!==de[C];)C--;for(;1<=p&&0<=C;p--,C--)if(X[p]!==de[C]){if(p!==1||C!==1)do if(p--,C--,0>C||X[p]!==de[C]){var ve=`
46
+ `+X[p].replace(" at new "," at ");return o.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",o.displayName)),ve}while(1<=p&&0<=C);break}}}finally{Gt=!1,Error.prepareStackTrace=d}return(d=o?o.displayName||o.name:"")?nt(d):""}function On(o,l){switch(o.tag){case 26:case 27:case 5:return nt(o.type);case 16:return nt("Lazy");case 13:return o.child!==l&&l!==null?nt("Suspense Fallback"):nt("Suspense");case 19:return nt("SuspenseList");case 0:case 15:return Ft(o.type,!1);case 11:return Ft(o.type.render,!1);case 1:return Ft(o.type,!0);case 31:return nt("Activity");default:return""}}function vn(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 ke=Object.prototype.hasOwnProperty,Y=e.unstable_scheduleCallback,re=e.unstable_cancelCallback,ce=e.unstable_shouldYield,Ie=e.unstable_requestPaint,je=e.unstable_now,Te=e.unstable_getCurrentPriorityLevel,Ve=e.unstable_ImmediatePriority,bt=e.unstable_UserBlockingPriority,st=e.unstable_NormalPriority,tn=e.unstable_LowPriority,or=e.unstable_IdlePriority,Vn=e.log,Lr=e.unstable_setDisableYieldValue,ea=null,pn=null;function ir(o){if(typeof Vn=="function"&&Lr(o),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(ea,o)}catch{}}var kn=Math.clz32?Math.clz32:ta,Qs=Math.log,Ia=Math.LN2;function ta(o){return o>>>=0,o===0?32:31-(Qs(o)/Ia|0)|0}var Ma=256,js=262144,En=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 Ze(o,l,d){var p=o.pendingLanes;if(p===0)return 0;var C=0,w=o.suspendedLanes,N=o.pingedLanes;o=o.warmLanes;var P=p&134217727;return P!==0?(p=P&~w,p!==0?C=In(p):(N&=P,N!==0?C=In(N):d||(d=P&~o,d!==0&&(C=In(d))))):(P=p&~w,P!==0?C=In(P):N!==0?C=In(N):d||(d=p&~o,d!==0&&(C=In(d)))),C===0?0:l!==0&&l!==C&&(l&w)===0&&(w=C&-C,d=l&-l,w>=d||w===32&&(d&4194048)!==0)?l:C}function Zt(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function nn(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 Xt(){var o=En;return En<<=1,(En&62914560)===0&&(En=4194304),o}function $n(o){for(var l=[],d=0;31>d;d++)l.push(o);return l}function an(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function rn(o,l,d,p,C,w){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 P=o.entanglements,X=o.expirationTimes,de=o.hiddenUpdates;for(d=N&~d;0<d;){var ve=31-kn(d),Se=1<<ve;P[ve]=0,X[ve]=-1;var he=de[ve];if(he!==null)for(de[ve]=null,ve=0;ve<he.length;ve++){var ge=he[ve];ge!==null&&(ge.lane&=-536870913)}d&=~Se}p!==0&&Tr(o,p,0),w!==0&&C===0&&o.tag!==0&&(o.suspendedLanes|=w&~(N&~l))}function Tr(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 Z(o,l){var d=o.entangledLanes|=l;for(o=o.entanglements;d;){var p=31-kn(d),C=1<<p;C&l|o[p]&l&&(o[p]|=l),d&=~C}}function te(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 Ce(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ae(){var o=K.p;return o!==0?o:(o=window.event,o===void 0?32:gj(o.type))}function Ge(o,l){var d=K.p;try{return K.p=o,l()}finally{K.p=d}}var Fe=Math.random().toString(36).slice(2),Le="__reactFiber$"+Fe,ze="__reactProps$"+Fe,Qe="__reactContainer$"+Fe,at="__reactEvents$"+Fe,tt="__reactListeners$"+Fe,Ct="__reactHandles$"+Fe,gn="__reactResources$"+Fe,Ln="__reactMarker$"+Fe;function Wn(o){delete o[Le],delete o[ze],delete o[at],delete o[tt],delete o[Ct]}function cn(o){var l=o[Le];if(l)return l;for(var d=o.parentNode;d;){if(l=d[Qe]||d[Le]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(o=ej(o);o!==null;){if(d=o[Le])return d;o=ej(o)}return l}o=d,d=o.parentNode}return null}function un(o){if(o=o[Le]||o[Qe]){var l=o.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return o}return null}function ka(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function rs(o){var l=o[gn];return l||(l=o[gn]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function An(o){o[Ln]=!0}var La=new Set,Fc={};function Pa(o,l){xa(o,l),xa(o+"Capture",l)}function xa(o,l){for(Fc[o]=l,o=0;o<l.length;o++)La.add(l[o])}var Hc=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]*$"),Pl={},qt={};function _r(o){return ke.call(qt,o)?!0:ke.call(Pl,o)?!1:Hc.test(o)?qt[o]=!0:(Pl[o]=!0,!1)}function Ts(o,l,d){if(_r(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 as(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 dn(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 Pr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ad(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function wy(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 C=p.get,w=p.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return C.call(this)},set:function(N){d=""+N,w.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 Ry(o){if(!o._valueTracker){var l=Ad(o)?"checked":"value";o._valueTracker=wy(o,l,""+o[l])}}function zC(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var d=l.getValue(),p="";return o&&(p=Ad(o)?o.checked?"true":"false":o.value),o=p,o!==d?(l.setValue(o),!0):!1}function tm(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 D8=/[\n"\\]/g;function ss(o){return o.replace(D8,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function jy(o,l,d,p,C,w,N,P){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=""+Pr(l)):o.value!==""+Pr(l)&&(o.value=""+Pr(l)):N!=="submit"&&N!=="reset"||o.removeAttribute("value"),l!=null?Ty(o,N,Pr(l)):d!=null?Ty(o,N,Pr(d)):p!=null&&o.removeAttribute("value"),C==null&&w!=null&&(o.defaultChecked=!!w),C!=null&&(o.checked=C&&typeof C!="function"&&typeof C!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?o.name=""+Pr(P):o.removeAttribute("name")}function FC(o,l,d,p,C,w,N,P){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(o.type=w),l!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||l!=null)){Ry(o);return}d=d!=null?""+Pr(d):"",l=l!=null?""+Pr(l):d,P||l===o.value||(o.value=l),o.defaultValue=l}p=p??C,p=typeof p!="function"&&typeof p!="symbol"&&!!p,o.checked=P?o.checked:!!p,o.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.name=N),Ry(o)}function Ty(o,l,d){l==="number"&&tm(o.ownerDocument)===o||o.defaultValue===""+d||(o.defaultValue=""+d)}function Vc(o,l,d,p){if(o=o.options,l){l={};for(var C=0;C<d.length;C++)l["$"+d[C]]=!0;for(d=0;d<o.length;d++)C=l.hasOwnProperty("$"+o[d].value),o[d].selected!==C&&(o[d].selected=C),C&&p&&(o[d].defaultSelected=!0)}else{for(d=""+Pr(d),l=null,C=0;C<o.length;C++){if(o[C].value===d){o[C].selected=!0,p&&(o[C].defaultSelected=!0);return}l!==null||o[C].disabled||(l=o[C])}l!==null&&(l.selected=!0)}}function HC(o,l,d){if(l!=null&&(l=""+Pr(l),l!==o.value&&(o.value=l),d==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=d!=null?""+Pr(d):""}function VC(o,l,d,p){if(l==null){if(p!=null){if(d!=null)throw Error(r(92));if(V(p)){if(1<p.length)throw Error(r(93));p=p[0]}d=p}d==null&&(d=""),l=d}d=Pr(l),o.defaultValue=d,p=o.textContent,p===d&&p!==""&&p!==null&&(o.value=p),Ry(o)}function $c(o,l){if(l){var d=o.firstChild;if(d&&d===o.lastChild&&d.nodeType===3){d.nodeValue=l;return}}o.textContent=l}var O8=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 $C(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||O8.has(l)?l==="float"?o.cssFloat=d:o[l]=(""+d).trim():o[l]=d+"px"}function BC(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 C in l)p=l[C],l.hasOwnProperty(C)&&d[C]!==p&&$C(o,C,p)}else for(var w in l)l.hasOwnProperty(w)&&$C(o,w,l[w])}function _y(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 I8=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"]]),M8=/^[\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 nm(o){return M8.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function Oo(){}var Ny=null;function Ay(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Bc=null,Gc=null;function GC(o){var l=un(o);if(l&&(o=l.stateNode)){var d=o[ze]||null;e:switch(o=l.stateNode,l.type){case"input":if(jy(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="'+ss(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var p=d[l];if(p!==o&&p.form===o.form){var C=p[ze]||null;if(!C)throw Error(r(90));jy(p,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(l=0;l<d.length;l++)p=d[l],p.form===o.form&&zC(p)}break e;case"textarea":HC(o,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&Vc(o,!!d.multiple,l,!1)}}}var Dy=!1;function qC(o,l,d){if(Dy)return o(l,d);Dy=!0;try{var p=o(l);return p}finally{if(Dy=!1,(Bc!==null||Gc!==null)&&($m(),Bc&&(l=Bc,o=Gc,Gc=Bc=null,GC(l),o)))for(l=0;l<o.length;l++)GC(o[l])}}function Dd(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 Io=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oy=!1;if(Io)try{var Od={};Object.defineProperty(Od,"passive",{get:function(){Oy=!0}}),window.addEventListener("test",Od,Od),window.removeEventListener("test",Od,Od)}catch{Oy=!1}var Ei=null,Iy=null,rm=null;function KC(){if(rm)return rm;var o,l=Iy,d=l.length,p,C="value"in Ei?Ei.value:Ei.textContent,w=C.length;for(o=0;o<d&&l[o]===C[o];o++);var N=d-o;for(p=1;p<=N&&l[d-p]===C[w-p];p++);return rm=C.slice(o,1<p?1-p:void 0)}function am(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 sm(){return!0}function WC(){return!1}function ya(o){function l(d,p,C,w,N){this._reactName=d,this._targetInst=C,this.type=p,this.nativeEvent=w,this.target=N,this.currentTarget=null;for(var P in o)o.hasOwnProperty(P)&&(d=o[P],this[P]=d?d(w):w[P]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?sm:WC,this.isPropagationStopped=WC,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=sm)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=sm)},persist:function(){},isPersistent:sm}),l}var Ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},om=ya(Ul),Id=g({},Ul,{view:0,detail:0}),k8=ya(Id),My,ky,Md,im=g({},Id,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Py,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!==Md&&(Md&&o.type==="mousemove"?(My=o.screenX-Md.screenX,ky=o.screenY-Md.screenY):ky=My=0,Md=o),My)},movementY:function(o){return"movementY"in o?o.movementY:ky}}),YC=ya(im),L8=g({},im,{dataTransfer:0}),P8=ya(L8),U8=g({},Id,{relatedTarget:0}),Ly=ya(U8),z8=g({},Ul,{animationName:0,elapsedTime:0,pseudoElement:0}),F8=ya(z8),H8=g({},Ul,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),V8=ya(H8),$8=g({},Ul,{data:0}),ZC=ya($8),B8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G8={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"},q8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K8(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=q8[o])?!!l[o]:!1}function Py(){return K8}var W8=g({},Id,{key:function(o){if(o.key){var l=B8[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=am(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?G8[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Py,charCode:function(o){return o.type==="keypress"?am(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?am(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),Y8=ya(W8),Z8=g({},im,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),XC=ya(Z8),X8=g({},Id,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Py}),Q8=ya(X8),J8=g({},Ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),ek=ya(J8),tk=g({},im,{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}),nk=ya(tk),rk=g({},Ul,{newState:0,oldState:0}),ak=ya(rk),sk=[9,13,27,32],Uy=Io&&"CompositionEvent"in window,kd=null;Io&&"documentMode"in document&&(kd=document.documentMode);var ok=Io&&"TextEvent"in window&&!kd,QC=Io&&(!Uy||kd&&8<kd&&11>=kd),JC=" ",eE=!1;function tE(o,l){switch(o){case"keyup":return sk.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nE(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var qc=!1;function ik(o,l){switch(o){case"compositionend":return nE(l);case"keypress":return l.which!==32?null:(eE=!0,JC);case"textInput":return o=l.data,o===JC&&eE?null:o;default:return null}}function lk(o,l){if(qc)return o==="compositionend"||!Uy&&tE(o,l)?(o=KC(),rm=Iy=Ei=null,qc=!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 QC&&l.locale!=="ko"?null:l.data;default:return null}}var ck={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 rE(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!ck[o.type]:l==="textarea"}function aE(o,l,d,p){Bc?Gc?Gc.push(p):Gc=[p]:Bc=p,l=Zm(l,"onChange"),0<l.length&&(d=new om("onChange","change",null,d,p),o.push({event:d,listeners:l}))}var Ld=null,Pd=null;function uk(o){FR(o,0)}function lm(o){var l=ka(o);if(zC(l))return o}function sE(o,l){if(o==="change")return l}var oE=!1;if(Io){var zy;if(Io){var Fy="oninput"in document;if(!Fy){var iE=document.createElement("div");iE.setAttribute("oninput","return;"),Fy=typeof iE.oninput=="function"}zy=Fy}else zy=!1;oE=zy&&(!document.documentMode||9<document.documentMode)}function lE(){Ld&&(Ld.detachEvent("onpropertychange",cE),Pd=Ld=null)}function cE(o){if(o.propertyName==="value"&&lm(Pd)){var l=[];aE(l,Pd,o,Ay(o)),qC(uk,l)}}function dk(o,l,d){o==="focusin"?(lE(),Ld=l,Pd=d,Ld.attachEvent("onpropertychange",cE)):o==="focusout"&&lE()}function fk(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return lm(Pd)}function hk(o,l){if(o==="click")return lm(l)}function mk(o,l){if(o==="input"||o==="change")return lm(l)}function pk(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Ua=typeof Object.is=="function"?Object.is:pk;function Ud(o,l){if(Ua(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 C=d[p];if(!ke.call(l,C)||!Ua(o[C],l[C]))return!1}return!0}function uE(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function dE(o,l){var d=uE(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=uE(d)}}function fE(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?fE(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function hE(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=tm(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=tm(o.document)}return l}function Hy(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 gk=Io&&"documentMode"in document&&11>=document.documentMode,Kc=null,Vy=null,zd=null,$y=!1;function mE(o,l,d){var p=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;$y||Kc==null||Kc!==tm(p)||(p=Kc,"selectionStart"in p&&Hy(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}),zd&&Ud(zd,p)||(zd=p,p=Zm(Vy,"onSelect"),0<p.length&&(l=new om("onSelect","select",null,l,d),o.push({event:l,listeners:p}),l.target=Kc)))}function zl(o,l){var d={};return d[o.toLowerCase()]=l.toLowerCase(),d["Webkit"+o]="webkit"+l,d["Moz"+o]="moz"+l,d}var Wc={animationend:zl("Animation","AnimationEnd"),animationiteration:zl("Animation","AnimationIteration"),animationstart:zl("Animation","AnimationStart"),transitionrun:zl("Transition","TransitionRun"),transitionstart:zl("Transition","TransitionStart"),transitioncancel:zl("Transition","TransitionCancel"),transitionend:zl("Transition","TransitionEnd")},By={},pE={};Io&&(pE=document.createElement("div").style,"AnimationEvent"in window||(delete Wc.animationend.animation,delete Wc.animationiteration.animation,delete Wc.animationstart.animation),"TransitionEvent"in window||delete Wc.transitionend.transition);function Fl(o){if(By[o])return By[o];if(!Wc[o])return o;var l=Wc[o],d;for(d in l)if(l.hasOwnProperty(d)&&d in pE)return By[o]=l[d];return o}var gE=Fl("animationend"),xE=Fl("animationiteration"),yE=Fl("animationstart"),xk=Fl("transitionrun"),yk=Fl("transitionstart"),vk=Fl("transitioncancel"),vE=Fl("transitionend"),bE=new Map,Gy="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(" ");Gy.push("scrollEnd");function _s(o,l){bE.set(o,l),Pa(l,[o])}var cm=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)},os=[],Yc=0,qy=0;function um(){for(var o=Yc,l=qy=Yc=0;l<o;){var d=os[l];os[l++]=null;var p=os[l];os[l++]=null;var C=os[l];os[l++]=null;var w=os[l];if(os[l++]=null,p!==null&&C!==null){var N=p.pending;N===null?C.next=C:(C.next=N.next,N.next=C),p.pending=C}w!==0&&SE(d,C,w)}}function dm(o,l,d,p){os[Yc++]=o,os[Yc++]=l,os[Yc++]=d,os[Yc++]=p,qy|=p,o.lanes|=p,o=o.alternate,o!==null&&(o.lanes|=p)}function Ky(o,l,d,p){return dm(o,l,d,p),fm(o)}function Hl(o,l){return dm(o,null,null,l),fm(o)}function SE(o,l,d){o.lanes|=d;var p=o.alternate;p!==null&&(p.lanes|=d);for(var C=!1,w=o.return;w!==null;)w.childLanes|=d,p=w.alternate,p!==null&&(p.childLanes|=d),w.tag===22&&(o=w.stateNode,o===null||o._visibility&1||(C=!0)),o=w,w=w.return;return o.tag===3?(w=o.stateNode,C&&l!==null&&(C=31-kn(d),o=w.hiddenUpdates,p=o[C],p===null?o[C]=[l]:p.push(l),l.lane=d|536870912),w):null}function fm(o){if(50<lf)throw lf=0,n0=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var Zc={};function bk(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 za(o,l,d,p){return new bk(o,l,d,p)}function Wy(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Mo(o,l){var d=o.alternate;return d===null?(d=za(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 CE(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 hm(o,l,d,p,C,w){var N=0;if(p=o,typeof o=="function")Wy(o)&&(N=1);else if(typeof o=="string")N=R9(o,d,W.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case k:return o=za(31,d,l,C),o.elementType=k,o.lanes=w,o;case b:return Vl(d.children,C,w,l);case E:N=8,C|=24;break;case R:return o=za(12,d,l,C|2),o.elementType=R,o.lanes=w,o;case O:return o=za(13,d,l,C),o.elementType=O,o.lanes=w,o;case A:return o=za(19,d,l,C),o.elementType=A,o.lanes=w,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case _:N=10;break e;case j:N=9;break e;case D:N=11;break e;case T:N=14;break e;case M:N=16,p=null;break e}N=29,d=Error(r(130,o===null?"null":typeof o,"")),p=null}return l=za(N,d,l,C),l.elementType=o,l.type=p,l.lanes=w,l}function Vl(o,l,d,p){return o=za(7,o,p,l),o.lanes=d,o}function Yy(o,l,d){return o=za(6,o,null,l),o.lanes=d,o}function EE(o){var l=za(18,null,null,0);return l.stateNode=o,l}function Zy(o,l,d){return l=za(4,o.children!==null?o.children:[],o.key,l),l.lanes=d,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var wE=new WeakMap;function is(o,l){if(typeof o=="object"&&o!==null){var d=wE.get(o);return d!==void 0?d:(l={value:o,source:l,stack:vn(l)},wE.set(o,l),l)}return{value:o,source:l,stack:vn(l)}}var Xc=[],Qc=0,mm=null,Fd=0,ls=[],cs=0,wi=null,Js=1,eo="";function ko(o,l){Xc[Qc++]=Fd,Xc[Qc++]=mm,mm=o,Fd=l}function RE(o,l,d){ls[cs++]=Js,ls[cs++]=eo,ls[cs++]=wi,wi=o;var p=Js;o=eo;var C=32-kn(p)-1;p&=~(1<<C),d+=1;var w=32-kn(l)+C;if(30<w){var N=C-C%5;w=(p&(1<<N)-1).toString(32),p>>=N,C-=N,Js=1<<32-kn(l)+C|d<<C|p,eo=w+o}else Js=1<<w|d<<C|p,eo=o}function Xy(o){o.return!==null&&(ko(o,1),RE(o,1,0))}function Qy(o){for(;o===mm;)mm=Xc[--Qc],Xc[Qc]=null,Fd=Xc[--Qc],Xc[Qc]=null;for(;o===wi;)wi=ls[--cs],ls[cs]=null,eo=ls[--cs],ls[cs]=null,Js=ls[--cs],ls[cs]=null}function jE(o,l){ls[cs++]=Js,ls[cs++]=eo,ls[cs++]=wi,Js=l.id,eo=l.overflow,wi=o}var Ur=null,Pn=null,Qt=!1,Ri=null,us=!1,Jy=Error(r(519));function ji(o){var l=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hd(is(l,o)),Jy}function TE(o){var l=o.stateNode,d=o.type,p=o.memoizedProps;switch(l[Le]=o,l[ze]=p,d){case"dialog":Vt("cancel",l),Vt("close",l);break;case"iframe":case"object":case"embed":Vt("load",l);break;case"video":case"audio":for(d=0;d<uf.length;d++)Vt(uf[d],l);break;case"source":Vt("error",l);break;case"img":case"image":case"link":Vt("error",l),Vt("load",l);break;case"details":Vt("toggle",l);break;case"input":Vt("invalid",l),FC(l,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Vt("invalid",l);break;case"textarea":Vt("invalid",l),VC(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||BR(l.textContent,d)?(p.popover!=null&&(Vt("beforetoggle",l),Vt("toggle",l)),p.onScroll!=null&&Vt("scroll",l),p.onScrollEnd!=null&&Vt("scrollend",l),p.onClick!=null&&(l.onclick=Oo),l=!0):l=!1,l||ji(o,!0)}function _E(o){for(Ur=o.return;Ur;)switch(Ur.tag){case 5:case 31:case 13:us=!1;return;case 27:case 3:us=!0;return;default:Ur=Ur.return}}function Jc(o){if(o!==Ur)return!1;if(!Qt)return _E(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")||x0(o.type,o.memoizedProps)),d=!d),d&&Pn&&ji(o),_E(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=JR(o)}else if(l===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));Pn=JR(o)}else l===27?(l=Pn,Fi(o.type)?(o=C0,C0=null,Pn=o):Pn=l):Pn=Ur?fs(o.stateNode.nextSibling):null;return!0}function $l(){Pn=Ur=null,Qt=!1}function ev(){var o=Ri;return o!==null&&(Ca===null?Ca=o:Ca.push.apply(Ca,o),Ri=null),o}function Hd(o){Ri===null?Ri=[o]:Ri.push(o)}var tv=U(null),Bl=null,Lo=null;function Ti(o,l,d){H(tv,l._currentValue),l._currentValue=d}function Po(o){o._currentValue=tv.current,F(tv)}function nv(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 rv(o,l,d,p){var C=o.child;for(C!==null&&(C.return=o);C!==null;){var w=C.dependencies;if(w!==null){var N=C.child;w=w.firstContext;e:for(;w!==null;){var P=w;w=C;for(var X=0;X<l.length;X++)if(P.context===l[X]){w.lanes|=d,P=w.alternate,P!==null&&(P.lanes|=d),nv(w.return,d,o),p||(N=null);break e}w=P.next}}else if(C.tag===18){if(N=C.return,N===null)throw Error(r(341));N.lanes|=d,w=N.alternate,w!==null&&(w.lanes|=d),nv(N,d,o),N=null}else N=C.child;if(N!==null)N.return=C;else for(N=C;N!==null;){if(N===o){N=null;break}if(C=N.sibling,C!==null){C.return=N.return,N=C;break}N=N.return}C=N}}function eu(o,l,d,p){o=null;for(var C=l,w=!1;C!==null;){if(!w){if((C.flags&524288)!==0)w=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var N=C.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var P=C.type;Ua(C.pendingProps.value,N.value)||(o!==null?o.push(P):o=[P])}}else if(C===J.current){if(N=C.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(o!==null?o.push(pf):o=[pf])}C=C.return}o!==null&&rv(l,o,d,p),l.flags|=262144}function pm(o){for(o=o.firstContext;o!==null;){if(!Ua(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function Gl(o){Bl=o,Lo=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function zr(o){return NE(Bl,o)}function gm(o,l){return Bl===null&&Gl(o),NE(o,l)}function NE(o,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},Lo===null){if(o===null)throw Error(r(308));Lo=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Lo=Lo.next=l;return d}var Sk=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()})}},Ck=e.unstable_scheduleCallback,Ek=e.unstable_NormalPriority,lr={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function av(){return{controller:new Sk,data:new Map,refCount:0}}function Vd(o){o.refCount--,o.refCount===0&&Ck(Ek,function(){o.controller.abort()})}var $d=null,sv=0,tu=0,nu=null;function wk(o,l){if($d===null){var d=$d=[];sv=0,tu=l0(),nu={status:"pending",value:void 0,then:function(p){d.push(p)}}}return sv++,l.then(AE,AE),l}function AE(){if(--sv===0&&$d!==null){nu!==null&&(nu.status="fulfilled");var o=$d;$d=null,tu=0,nu=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function Rk(o,l){var d=[],p={status:"pending",value:null,reason:null,then:function(C){d.push(C)}};return o.then(function(){p.status="fulfilled",p.value=l;for(var C=0;C<d.length;C++)(0,d[C])(l)},function(C){for(p.status="rejected",p.reason=C,C=0;C<d.length;C++)(0,d[C])(void 0)}),p}var DE=I.S;I.S=function(o,l){mR=je(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&wk(o,l),DE!==null&&DE(o,l)};var ql=U(null);function ov(){var o=ql.current;return o!==null?o:Dn.pooledCache}function xm(o,l){l===null?H(ql,ql.current):H(ql,l.pool)}function OE(){var o=ov();return o===null?null:{parent:lr._currentValue,pool:o}}var ru=Error(r(460)),iv=Error(r(474)),ym=Error(r(542)),vm={then:function(){}};function IE(o){return o=o.status,o==="fulfilled"||o==="rejected"}function ME(o,l,d){switch(d=o[d],d===void 0?o.push(l):d!==l&&(l.then(Oo,Oo),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,LE(o),o;default:if(typeof l.status=="string")l.then(Oo,Oo);else{if(o=Dn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(p){if(l.status==="pending"){var C=l;C.status="fulfilled",C.value=p}},function(p){if(l.status==="pending"){var C=l;C.status="rejected",C.reason=p}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,LE(o),o}throw Wl=l,ru}}function Kl(o){try{var l=o._init;return l(o._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(Wl=d,ru):d}}var Wl=null;function kE(){if(Wl===null)throw Error(r(459));var o=Wl;return Wl=null,o}function LE(o){if(o===ru||o===ym)throw Error(r(483))}var au=null,Bd=0;function bm(o){var l=Bd;return Bd+=1,au===null&&(au=[]),ME(au,o,l)}function Gd(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Sm(o,l){throw l.$$typeof===y?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function PE(o){function l(oe,ne){if(o){var ue=oe.deletions;ue===null?(oe.deletions=[ne],oe.flags|=16):ue.push(ne)}}function d(oe,ne){if(!o)return null;for(;ne!==null;)l(oe,ne),ne=ne.sibling;return null}function p(oe){for(var ne=new Map;oe!==null;)oe.key!==null?ne.set(oe.key,oe):ne.set(oe.index,oe),oe=oe.sibling;return ne}function C(oe,ne){return oe=Mo(oe,ne),oe.index=0,oe.sibling=null,oe}function w(oe,ne,ue){return oe.index=ue,o?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<ne?(oe.flags|=67108866,ne):ue):(oe.flags|=67108866,ne)):(oe.flags|=1048576,ne)}function N(oe){return o&&oe.alternate===null&&(oe.flags|=67108866),oe}function P(oe,ne,ue,be){return ne===null||ne.tag!==6?(ne=Yy(ue,oe.mode,be),ne.return=oe,ne):(ne=C(ne,ue),ne.return=oe,ne)}function X(oe,ne,ue,be){var rt=ue.type;return rt===b?ve(oe,ne,ue.props.children,be,ue.key):ne!==null&&(ne.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===M&&Kl(rt)===ne.type)?(ne=C(ne,ue.props),Gd(ne,ue),ne.return=oe,ne):(ne=hm(ue.type,ue.key,ue.props,null,oe.mode,be),Gd(ne,ue),ne.return=oe,ne)}function de(oe,ne,ue,be){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ue.containerInfo||ne.stateNode.implementation!==ue.implementation?(ne=Zy(ue,oe.mode,be),ne.return=oe,ne):(ne=C(ne,ue.children||[]),ne.return=oe,ne)}function ve(oe,ne,ue,be,rt){return ne===null||ne.tag!==7?(ne=Vl(ue,oe.mode,be,rt),ne.return=oe,ne):(ne=C(ne,ue),ne.return=oe,ne)}function Se(oe,ne,ue){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Yy(""+ne,oe.mode,ue),ne.return=oe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ue=hm(ne.type,ne.key,ne.props,null,oe.mode,ue),Gd(ue,ne),ue.return=oe,ue;case S:return ne=Zy(ne,oe.mode,ue),ne.return=oe,ne;case M:return ne=Kl(ne),Se(oe,ne,ue)}if(V(ne)||G(ne))return ne=Vl(ne,oe.mode,ue,null),ne.return=oe,ne;if(typeof ne.then=="function")return Se(oe,bm(ne),ue);if(ne.$$typeof===_)return Se(oe,gm(oe,ne),ue);Sm(oe,ne)}return null}function he(oe,ne,ue,be){var rt=ne!==null?ne.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return rt!==null?null:P(oe,ne,""+ue,be);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===rt?X(oe,ne,ue,be):null;case S:return ue.key===rt?de(oe,ne,ue,be):null;case M:return ue=Kl(ue),he(oe,ne,ue,be)}if(V(ue)||G(ue))return rt!==null?null:ve(oe,ne,ue,be,null);if(typeof ue.then=="function")return he(oe,ne,bm(ue),be);if(ue.$$typeof===_)return he(oe,ne,gm(oe,ue),be);Sm(oe,ue)}return null}function ge(oe,ne,ue,be,rt){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return oe=oe.get(ue)||null,P(ne,oe,""+be,rt);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case v:return oe=oe.get(be.key===null?ue:be.key)||null,X(ne,oe,be,rt);case S:return oe=oe.get(be.key===null?ue:be.key)||null,de(ne,oe,be,rt);case M:return be=Kl(be),ge(oe,ne,ue,be,rt)}if(V(be)||G(be))return oe=oe.get(ue)||null,ve(ne,oe,be,rt,null);if(typeof be.then=="function")return ge(oe,ne,ue,bm(be),rt);if(be.$$typeof===_)return ge(oe,ne,ue,gm(ne,be),rt);Sm(ne,be)}return null}function qe(oe,ne,ue,be){for(var rt=null,fn=null,Xe=ne,Mt=ne=0,Wt=null;Xe!==null&&Mt<ue.length;Mt++){Xe.index>Mt?(Wt=Xe,Xe=null):Wt=Xe.sibling;var hn=he(oe,Xe,ue[Mt],be);if(hn===null){Xe===null&&(Xe=Wt);break}o&&Xe&&hn.alternate===null&&l(oe,Xe),ne=w(hn,ne,Mt),fn===null?rt=hn:fn.sibling=hn,fn=hn,Xe=Wt}if(Mt===ue.length)return d(oe,Xe),Qt&&ko(oe,Mt),rt;if(Xe===null){for(;Mt<ue.length;Mt++)Xe=Se(oe,ue[Mt],be),Xe!==null&&(ne=w(Xe,ne,Mt),fn===null?rt=Xe:fn.sibling=Xe,fn=Xe);return Qt&&ko(oe,Mt),rt}for(Xe=p(Xe);Mt<ue.length;Mt++)Wt=ge(Xe,oe,Mt,ue[Mt],be),Wt!==null&&(o&&Wt.alternate!==null&&Xe.delete(Wt.key===null?Mt:Wt.key),ne=w(Wt,ne,Mt),fn===null?rt=Wt:fn.sibling=Wt,fn=Wt);return o&&Xe.forEach(function(Gi){return l(oe,Gi)}),Qt&&ko(oe,Mt),rt}function ot(oe,ne,ue,be){if(ue==null)throw Error(r(151));for(var rt=null,fn=null,Xe=ne,Mt=ne=0,Wt=null,hn=ue.next();Xe!==null&&!hn.done;Mt++,hn=ue.next()){Xe.index>Mt?(Wt=Xe,Xe=null):Wt=Xe.sibling;var Gi=he(oe,Xe,hn.value,be);if(Gi===null){Xe===null&&(Xe=Wt);break}o&&Xe&&Gi.alternate===null&&l(oe,Xe),ne=w(Gi,ne,Mt),fn===null?rt=Gi:fn.sibling=Gi,fn=Gi,Xe=Wt}if(hn.done)return d(oe,Xe),Qt&&ko(oe,Mt),rt;if(Xe===null){for(;!hn.done;Mt++,hn=ue.next())hn=Se(oe,hn.value,be),hn!==null&&(ne=w(hn,ne,Mt),fn===null?rt=hn:fn.sibling=hn,fn=hn);return Qt&&ko(oe,Mt),rt}for(Xe=p(Xe);!hn.done;Mt++,hn=ue.next())hn=ge(Xe,oe,Mt,hn.value,be),hn!==null&&(o&&hn.alternate!==null&&Xe.delete(hn.key===null?Mt:hn.key),ne=w(hn,ne,Mt),fn===null?rt=hn:fn.sibling=hn,fn=hn);return o&&Xe.forEach(function(L9){return l(oe,L9)}),Qt&&ko(oe,Mt),rt}function jn(oe,ne,ue,be){if(typeof ue=="object"&&ue!==null&&ue.type===b&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var rt=ue.key;ne!==null;){if(ne.key===rt){if(rt=ue.type,rt===b){if(ne.tag===7){d(oe,ne.sibling),be=C(ne,ue.props.children),be.return=oe,oe=be;break e}}else if(ne.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===M&&Kl(rt)===ne.type){d(oe,ne.sibling),be=C(ne,ue.props),Gd(be,ue),be.return=oe,oe=be;break e}d(oe,ne);break}else l(oe,ne);ne=ne.sibling}ue.type===b?(be=Vl(ue.props.children,oe.mode,be,ue.key),be.return=oe,oe=be):(be=hm(ue.type,ue.key,ue.props,null,oe.mode,be),Gd(be,ue),be.return=oe,oe=be)}return N(oe);case S:e:{for(rt=ue.key;ne!==null;){if(ne.key===rt)if(ne.tag===4&&ne.stateNode.containerInfo===ue.containerInfo&&ne.stateNode.implementation===ue.implementation){d(oe,ne.sibling),be=C(ne,ue.children||[]),be.return=oe,oe=be;break e}else{d(oe,ne);break}else l(oe,ne);ne=ne.sibling}be=Zy(ue,oe.mode,be),be.return=oe,oe=be}return N(oe);case M:return ue=Kl(ue),jn(oe,ne,ue,be)}if(V(ue))return qe(oe,ne,ue,be);if(G(ue)){if(rt=G(ue),typeof rt!="function")throw Error(r(150));return ue=rt.call(ue),ot(oe,ne,ue,be)}if(typeof ue.then=="function")return jn(oe,ne,bm(ue),be);if(ue.$$typeof===_)return jn(oe,ne,gm(oe,ue),be);Sm(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ne!==null&&ne.tag===6?(d(oe,ne.sibling),be=C(ne,ue),be.return=oe,oe=be):(d(oe,ne),be=Yy(ue,oe.mode,be),be.return=oe,oe=be),N(oe)):d(oe,ne)}return function(oe,ne,ue,be){try{Bd=0;var rt=jn(oe,ne,ue,be);return au=null,rt}catch(Xe){if(Xe===ru||Xe===ym)throw Xe;var fn=za(29,Xe,null,oe.mode);return fn.lanes=be,fn.return=oe,fn}finally{}}}var Yl=PE(!0),UE=PE(!1),_i=!1;function lv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cv(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 Ni(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function Ai(o,l,d){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(xn&2)!==0){var C=p.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),p.pending=l,l=fm(o),SE(o,null,d),l}return dm(o,p,l,d),fm(o)}function qd(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,Z(o,d)}}function uv(o,l){var d=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,d===p)){var C=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var N={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?C=w=N:w=w.next=N,d=d.next}while(d!==null);w===null?C=w=l:w=w.next=l}else C=w=l;d={baseState:p.baseState,firstBaseUpdate:C,lastBaseUpdate:w,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 dv=!1;function Kd(){if(dv){var o=nu;if(o!==null)throw o}}function Wd(o,l,d,p){dv=!1;var C=o.updateQueue;_i=!1;var w=C.firstBaseUpdate,N=C.lastBaseUpdate,P=C.shared.pending;if(P!==null){C.shared.pending=null;var X=P,de=X.next;X.next=null,N===null?w=de:N.next=de,N=X;var ve=o.alternate;ve!==null&&(ve=ve.updateQueue,P=ve.lastBaseUpdate,P!==N&&(P===null?ve.firstBaseUpdate=de:P.next=de,ve.lastBaseUpdate=X))}if(w!==null){var Se=C.baseState;N=0,ve=de=X=null,P=w;do{var he=P.lane&-536870913,ge=he!==P.lane;if(ge?(Kt&he)===he:(p&he)===he){he!==0&&he===tu&&(dv=!0),ve!==null&&(ve=ve.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var qe=o,ot=P;he=l;var jn=d;switch(ot.tag){case 1:if(qe=ot.payload,typeof qe=="function"){Se=qe.call(jn,Se,he);break e}Se=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=ot.payload,he=typeof qe=="function"?qe.call(jn,Se,he):qe,he==null)break e;Se=g({},Se,he);break e;case 2:_i=!0}}he=P.callback,he!==null&&(o.flags|=64,ge&&(o.flags|=8192),ge=C.callbacks,ge===null?C.callbacks=[he]:ge.push(he))}else ge={lane:he,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ve===null?(de=ve=ge,X=Se):ve=ve.next=ge,N|=he;if(P=P.next,P===null){if(P=C.shared.pending,P===null)break;ge=P,P=ge.next,ge.next=null,C.lastBaseUpdate=ge,C.shared.pending=null}}while(!0);ve===null&&(X=Se),C.baseState=X,C.firstBaseUpdate=de,C.lastBaseUpdate=ve,w===null&&(C.shared.lanes=0),ki|=N,o.lanes=N,o.memoizedState=Se}}function zE(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function FE(o,l){var d=o.callbacks;if(d!==null)for(o.callbacks=null,o=0;o<d.length;o++)zE(d[o],l)}var su=U(null),Cm=U(0);function HE(o,l){o=qo,H(Cm,o),H(su,l),qo=o|l.baseLanes}function fv(){H(Cm,qo),H(su,su.current)}function hv(){qo=Cm.current,F(su),F(Cm)}var Fa=U(null),ds=null;function Di(o){var l=o.alternate;H(nr,nr.current&1),H(Fa,o),ds===null&&(l===null||su.current!==null||l.memoizedState!==null)&&(ds=o)}function mv(o){H(nr,nr.current),H(Fa,o),ds===null&&(ds=o)}function VE(o){o.tag===22?(H(nr,nr.current),H(Fa,o),ds===null&&(ds=o)):Oi()}function Oi(){H(nr,nr.current),H(Fa,Fa.current)}function Ha(o){F(Fa),ds===o&&(ds=null),F(nr)}var nr=U(0);function Em(o){for(var l=o;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||b0(d)||S0(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 Uo=0,Dt=null,wn=null,cr=null,wm=!1,ou=!1,Zl=!1,Rm=0,Yd=0,iu=null,jk=0;function Yn(){throw Error(r(321))}function pv(o,l){if(l===null)return!1;for(var d=0;d<l.length&&d<o.length;d++)if(!Ua(o[d],l[d]))return!1;return!0}function gv(o,l,d,p,C,w){return Uo=w,Dt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,I.H=o===null||o.memoizedState===null?Rw:Dv,Zl=!1,w=d(p,C),Zl=!1,ou&&(w=BE(l,d,p,C)),$E(o),w}function $E(o){I.H=Qd;var l=wn!==null&&wn.next!==null;if(Uo=0,cr=wn=Dt=null,wm=!1,Yd=0,iu=null,l)throw Error(r(300));o===null||ur||(o=o.dependencies,o!==null&&pm(o)&&(ur=!0))}function BE(o,l,d,p){Dt=o;var C=0;do{if(ou&&(iu=null),Yd=0,ou=!1,25<=C)throw Error(r(301));if(C+=1,cr=wn=null,o.updateQueue!=null){var w=o.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}I.H=jw,w=l(d,p)}while(ou);return w}function Tk(){var o=I.H,l=o.useState()[0];return l=typeof l.then=="function"?Zd(l):l,o=o.useState()[0],(wn!==null?wn.memoizedState:null)!==o&&(Dt.flags|=1024),l}function xv(){var o=Rm!==0;return Rm=0,o}function yv(o,l,d){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~d}function vv(o){if(wm){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}wm=!1}Uo=0,cr=wn=Dt=null,ou=!1,Yd=Rm=0,iu=null}function na(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return cr===null?Dt.memoizedState=cr=o:cr=cr.next=o,cr}function rr(){if(wn===null){var o=Dt.alternate;o=o!==null?o.memoizedState:null}else o=wn.next;var l=cr===null?Dt.memoizedState:cr.next;if(l!==null)cr=l,wn=o;else{if(o===null)throw Dt.alternate===null?Error(r(467)):Error(r(310));wn=o,o={memoizedState:wn.memoizedState,baseState:wn.baseState,baseQueue:wn.baseQueue,queue:wn.queue,next:null},cr===null?Dt.memoizedState=cr=o:cr=cr.next=o}return cr}function jm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zd(o){var l=Yd;return Yd+=1,iu===null&&(iu=[]),o=ME(iu,o,l),l=Dt,(cr===null?l.memoizedState:cr.next)===null&&(l=l.alternate,I.H=l===null||l.memoizedState===null?Rw:Dv),o}function Tm(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return Zd(o);if(o.$$typeof===_)return zr(o)}throw Error(r(438,String(o)))}function bv(o){var l=null,d=Dt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var p=Dt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(l={data:p.data.map(function(C){return C.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=jm(),Dt.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]=z;return l.index++,d}function zo(o,l){return typeof l=="function"?l(o):l}function _m(o){var l=rr();return Sv(l,wn,o)}function Sv(o,l,d){var p=o.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=d;var C=o.baseQueue,w=p.pending;if(w!==null){if(C!==null){var N=C.next;C.next=w.next,w.next=N}l.baseQueue=C=w,p.pending=null}if(w=o.baseState,C===null)o.memoizedState=w;else{l=C.next;var P=N=null,X=null,de=l,ve=!1;do{var Se=de.lane&-536870913;if(Se!==de.lane?(Kt&Se)===Se:(Uo&Se)===Se){var he=de.revertLane;if(he===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),Se===tu&&(ve=!0);else if((Uo&he)===he){de=de.next,he===tu&&(ve=!0);continue}else Se={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},X===null?(P=X=Se,N=w):X=X.next=Se,Dt.lanes|=he,ki|=he;Se=de.action,Zl&&d(w,Se),w=de.hasEagerState?de.eagerState:d(w,Se)}else he={lane:Se,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},X===null?(P=X=he,N=w):X=X.next=he,Dt.lanes|=Se,ki|=Se;de=de.next}while(de!==null&&de!==l);if(X===null?N=w:X.next=P,!Ua(w,o.memoizedState)&&(ur=!0,ve&&(d=nu,d!==null)))throw d;o.memoizedState=w,o.baseState=N,o.baseQueue=X,p.lastRenderedState=w}return C===null&&(p.lanes=0),[o.memoizedState,p.dispatch]}function Cv(o){var l=rr(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=o;var p=d.dispatch,C=d.pending,w=l.memoizedState;if(C!==null){d.pending=null;var N=C=C.next;do w=o(w,N.action),N=N.next;while(N!==C);Ua(w,l.memoizedState)||(ur=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,p]}function GE(o,l,d){var p=Dt,C=rr(),w=Qt;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var N=!Ua((wn||C).memoizedState,d);if(N&&(C.memoizedState=d,ur=!0),C=C.queue,Rv(WE.bind(null,p,C,o),[o]),C.getSnapshot!==l||N||cr!==null&&cr.memoizedState.tag&1){if(p.flags|=2048,lu(9,{destroy:void 0},KE.bind(null,p,C,d,l),null),Dn===null)throw Error(r(349));w||(Uo&127)!==0||qE(p,l,d)}return d}function qE(o,l,d){o.flags|=16384,o={getSnapshot:l,value:d},l=Dt.updateQueue,l===null?(l=jm(),Dt.updateQueue=l,l.stores=[o]):(d=l.stores,d===null?l.stores=[o]:d.push(o))}function KE(o,l,d,p){l.value=d,l.getSnapshot=p,YE(l)&&ZE(o)}function WE(o,l,d){return d(function(){YE(l)&&ZE(o)})}function YE(o){var l=o.getSnapshot;o=o.value;try{var d=l();return!Ua(o,d)}catch{return!0}}function ZE(o){var l=Hl(o,2);l!==null&&Ea(l,o,2)}function Ev(o){var l=na();if(typeof o=="function"){var d=o;if(o=d(),Zl){ir(!0);try{d()}finally{ir(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:o},l}function XE(o,l,d,p){return o.baseState=d,Sv(o,wn,typeof p=="function"?p:zo)}function _k(o,l,d,p,C){if(Dm(o))throw Error(r(485));if(o=l.action,o!==null){var w={payload:C,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){w.listeners.push(N)}};I.T!==null?d(!0):w.isTransition=!1,p(w),d=l.pending,d===null?(w.next=l.pending=w,QE(l,w)):(w.next=d.next,l.pending=d.next=w)}}function QE(o,l){var d=l.action,p=l.payload,C=o.state;if(l.isTransition){var w=I.T,N={};I.T=N;try{var P=d(C,p),X=I.S;X!==null&&X(N,P),JE(o,l,P)}catch(de){wv(o,l,de)}finally{w!==null&&N.types!==null&&(w.types=N.types),I.T=w}}else try{w=d(C,p),JE(o,l,w)}catch(de){wv(o,l,de)}}function JE(o,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(p){ew(o,l,p)},function(p){return wv(o,l,p)}):ew(o,l,d)}function ew(o,l,d){l.status="fulfilled",l.value=d,tw(l),o.state=d,l=o.pending,l!==null&&(d=l.next,d===l?o.pending=null:(d=d.next,l.next=d,QE(o,d)))}function wv(o,l,d){var p=o.pending;if(o.pending=null,p!==null){p=p.next;do l.status="rejected",l.reason=d,tw(l),l=l.next;while(l!==p)}o.action=null}function tw(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function nw(o,l){return l}function rw(o,l){if(Qt){var d=Dn.formState;if(d!==null){e:{var p=Dt;if(Qt){if(Pn){t:{for(var C=Pn,w=us;C.nodeType!==8;){if(!w){C=null;break t}if(C=fs(C.nextSibling),C===null){C=null;break t}}w=C.data,C=w==="F!"||w==="F"?C:null}if(C){Pn=fs(C.nextSibling),p=C.data==="F!";break e}}ji(p)}p=!1}p&&(l=d[0])}}return d=na(),d.memoizedState=d.baseState=l,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nw,lastRenderedState:l},d.queue=p,d=Cw.bind(null,Dt,p),p.dispatch=d,p=Ev(!1),w=Av.bind(null,Dt,!1,p.queue),p=na(),C={state:l,dispatch:null,action:o,pending:null},p.queue=C,d=_k.bind(null,Dt,C,w,d),C.dispatch=d,p.memoizedState=o,[l,d,!1]}function aw(o){var l=rr();return sw(l,wn,o)}function sw(o,l,d){if(l=Sv(o,l,nw)[0],o=_m(zo)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var p=Zd(l)}catch(N){throw N===ru?ym:N}else p=l;l=rr();var C=l.queue,w=C.dispatch;return d!==l.memoizedState&&(Dt.flags|=2048,lu(9,{destroy:void 0},Nk.bind(null,C,d),null)),[p,w,o]}function Nk(o,l){o.action=l}function ow(o){var l=rr(),d=wn;if(d!==null)return sw(l,d,o);rr(),l=l.memoizedState,d=rr();var p=d.queue.dispatch;return d.memoizedState=o,[l,p,!1]}function lu(o,l,d,p){return o={tag:o,create:d,deps:p,inst:l,next:null},l=Dt.updateQueue,l===null&&(l=jm(),Dt.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 iw(){return rr().memoizedState}function Nm(o,l,d,p){var C=na();Dt.flags|=o,C.memoizedState=lu(1|l,{destroy:void 0},d,p===void 0?null:p)}function Am(o,l,d,p){var C=rr();p=p===void 0?null:p;var w=C.memoizedState.inst;wn!==null&&p!==null&&pv(p,wn.memoizedState.deps)?C.memoizedState=lu(l,w,d,p):(Dt.flags|=o,C.memoizedState=lu(1|l,w,d,p))}function lw(o,l){Nm(8390656,8,o,l)}function Rv(o,l){Am(2048,8,o,l)}function Ak(o){Dt.flags|=4;var l=Dt.updateQueue;if(l===null)l=jm(),Dt.updateQueue=l,l.events=[o];else{var d=l.events;d===null?l.events=[o]:d.push(o)}}function cw(o){var l=rr().memoizedState;return Ak({ref:l,nextImpl:o}),function(){if((xn&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}function uw(o,l){return Am(4,2,o,l)}function dw(o,l){return Am(4,4,o,l)}function fw(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 hw(o,l,d){d=d!=null?d.concat([o]):null,Am(4,4,fw.bind(null,l,o),d)}function jv(){}function mw(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;return l!==null&&pv(l,p[1])?p[0]:(d.memoizedState=[o,l],o)}function pw(o,l){var d=rr();l=l===void 0?null:l;var p=d.memoizedState;if(l!==null&&pv(l,p[1]))return p[0];if(p=o(),Zl){ir(!0);try{o()}finally{ir(!1)}}return d.memoizedState=[p,l],p}function Tv(o,l,d){return d===void 0||(Uo&1073741824)!==0&&(Kt&261930)===0?o.memoizedState=l:(o.memoizedState=d,o=gR(),Dt.lanes|=o,ki|=o,d)}function gw(o,l,d,p){return Ua(d,l)?d:su.current!==null?(o=Tv(o,d,p),Ua(o,l)||(ur=!0),o):(Uo&42)===0||(Uo&1073741824)!==0&&(Kt&261930)===0?(ur=!0,o.memoizedState=d):(o=gR(),Dt.lanes|=o,ki|=o,l)}function xw(o,l,d,p,C){var w=K.p;K.p=w!==0&&8>w?w:8;var N=I.T,P={};I.T=P,Av(o,!1,l,d);try{var X=C(),de=I.S;if(de!==null&&de(P,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ve=Rk(X,p);Xd(o,l,ve,Ba(o))}else Xd(o,l,p,Ba(o))}catch(Se){Xd(o,l,{then:function(){},status:"rejected",reason:Se},Ba())}finally{K.p=w,N!==null&&P.types!==null&&(N.types=P.types),I.T=N}}function Dk(){}function _v(o,l,d,p){if(o.tag!==5)throw Error(r(476));var C=yw(o).queue;xw(o,C,l,$,d===null?Dk:function(){return vw(o),d(p)})}function yw(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:$},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:d},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function vw(o){var l=yw(o);l.next===null&&(l=o.alternate.memoizedState),Xd(o,l.next.queue,{},Ba())}function Nv(){return zr(pf)}function bw(){return rr().memoizedState}function Sw(){return rr().memoizedState}function Ok(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var d=Ba();o=Ni(d);var p=Ai(l,o,d);p!==null&&(Ea(p,l,d),qd(p,l,d)),l={cache:av()},o.payload=l;return}l=l.return}}function Ik(o,l,d){var p=Ba();d={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Dm(o)?Ew(l,d):(d=Ky(o,l,d,p),d!==null&&(Ea(d,o,p),ww(d,l,p)))}function Cw(o,l,d){var p=Ba();Xd(o,l,d,p)}function Xd(o,l,d,p){var C={lane:p,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(Dm(o))Ew(l,C);else{var w=o.alternate;if(o.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var N=l.lastRenderedState,P=w(N,d);if(C.hasEagerState=!0,C.eagerState=P,Ua(P,N))return dm(o,l,C,0),Dn===null&&um(),!1}catch{}finally{}if(d=Ky(o,l,C,p),d!==null)return Ea(d,o,p),ww(d,l,p),!0}return!1}function Av(o,l,d,p){if(p={lane:2,revertLane:l0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Dm(o)){if(l)throw Error(r(479))}else l=Ky(o,d,p,2),l!==null&&Ea(l,o,2)}function Dm(o){var l=o.alternate;return o===Dt||l!==null&&l===Dt}function Ew(o,l){ou=wm=!0;var d=o.pending;d===null?l.next=l:(l.next=d.next,d.next=l),o.pending=l}function ww(o,l,d){if((d&4194048)!==0){var p=l.lanes;p&=o.pendingLanes,d|=p,l.lanes=d,Z(o,d)}}var Qd={readContext:zr,use:Tm,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};Qd.useEffectEvent=Yn;var Rw={readContext:zr,use:Tm,useCallback:function(o,l){return na().memoizedState=[o,l===void 0?null:l],o},useContext:zr,useEffect:lw,useImperativeHandle:function(o,l,d){d=d!=null?d.concat([o]):null,Nm(4194308,4,fw.bind(null,l,o),d)},useLayoutEffect:function(o,l){return Nm(4194308,4,o,l)},useInsertionEffect:function(o,l){Nm(4,2,o,l)},useMemo:function(o,l){var d=na();l=l===void 0?null:l;var p=o();if(Zl){ir(!0);try{o()}finally{ir(!1)}}return d.memoizedState=[p,l],p},useReducer:function(o,l,d){var p=na();if(d!==void 0){var C=d(l);if(Zl){ir(!0);try{d(l)}finally{ir(!1)}}}else C=l;return p.memoizedState=p.baseState=C,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:C},p.queue=o,o=o.dispatch=Ik.bind(null,Dt,o),[p.memoizedState,o]},useRef:function(o){var l=na();return o={current:o},l.memoizedState=o},useState:function(o){o=Ev(o);var l=o.queue,d=Cw.bind(null,Dt,l);return l.dispatch=d,[o.memoizedState,d]},useDebugValue:jv,useDeferredValue:function(o,l){var d=na();return Tv(d,o,l)},useTransition:function(){var o=Ev(!1);return o=xw.bind(null,Dt,o.queue,!0,!1),na().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,d){var p=Dt,C=na();if(Qt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),Dn===null)throw Error(r(349));(Kt&127)!==0||qE(p,l,d)}C.memoizedState=d;var w={value:d,getSnapshot:l};return C.queue=w,lw(WE.bind(null,p,w,o),[o]),p.flags|=2048,lu(9,{destroy:void 0},KE.bind(null,p,w,d,l),null),d},useId:function(){var o=na(),l=Dn.identifierPrefix;if(Qt){var d=eo,p=Js;d=(p&~(1<<32-kn(p)-1)).toString(32)+d,l="_"+l+"R_"+d,d=Rm++,0<d&&(l+="H"+d.toString(32)),l+="_"}else d=jk++,l="_"+l+"r_"+d.toString(32)+"_";return o.memoizedState=l},useHostTransitionStatus:Nv,useFormState:rw,useActionState:rw,useOptimistic:function(o){var l=na();l.memoizedState=l.baseState=o;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=Av.bind(null,Dt,!0,d),d.dispatch=l,[o,l]},useMemoCache:bv,useCacheRefresh:function(){return na().memoizedState=Ok.bind(null,Dt)},useEffectEvent:function(o){var l=na(),d={impl:o};return l.memoizedState=d,function(){if((xn&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Dv={readContext:zr,use:Tm,useCallback:mw,useContext:zr,useEffect:Rv,useImperativeHandle:hw,useInsertionEffect:uw,useLayoutEffect:dw,useMemo:pw,useReducer:_m,useRef:iw,useState:function(){return _m(zo)},useDebugValue:jv,useDeferredValue:function(o,l){var d=rr();return gw(d,wn.memoizedState,o,l)},useTransition:function(){var o=_m(zo)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Zd(o),l]},useSyncExternalStore:GE,useId:bw,useHostTransitionStatus:Nv,useFormState:aw,useActionState:aw,useOptimistic:function(o,l){var d=rr();return XE(d,wn,o,l)},useMemoCache:bv,useCacheRefresh:Sw};Dv.useEffectEvent=cw;var jw={readContext:zr,use:Tm,useCallback:mw,useContext:zr,useEffect:Rv,useImperativeHandle:hw,useInsertionEffect:uw,useLayoutEffect:dw,useMemo:pw,useReducer:Cv,useRef:iw,useState:function(){return Cv(zo)},useDebugValue:jv,useDeferredValue:function(o,l){var d=rr();return wn===null?Tv(d,o,l):gw(d,wn.memoizedState,o,l)},useTransition:function(){var o=Cv(zo)[0],l=rr().memoizedState;return[typeof o=="boolean"?o:Zd(o),l]},useSyncExternalStore:GE,useId:bw,useHostTransitionStatus:Nv,useFormState:ow,useActionState:ow,useOptimistic:function(o,l){var d=rr();return wn!==null?XE(d,wn,o,l):(d.baseState=o,[o,d.queue.dispatch])},useMemoCache:bv,useCacheRefresh:Sw};jw.useEffectEvent=cw;function Ov(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 Iv={enqueueSetState:function(o,l,d){o=o._reactInternals;var p=Ba(),C=Ni(p);C.payload=l,d!=null&&(C.callback=d),l=Ai(o,C,p),l!==null&&(Ea(l,o,p),qd(l,o,p))},enqueueReplaceState:function(o,l,d){o=o._reactInternals;var p=Ba(),C=Ni(p);C.tag=1,C.payload=l,d!=null&&(C.callback=d),l=Ai(o,C,p),l!==null&&(Ea(l,o,p),qd(l,o,p))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var d=Ba(),p=Ni(d);p.tag=2,l!=null&&(p.callback=l),l=Ai(o,p,d),l!==null&&(Ea(l,o,d),qd(l,o,d))}};function Tw(o,l,d,p,C,w,N){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(p,w,N):l.prototype&&l.prototype.isPureReactComponent?!Ud(d,p)||!Ud(C,w):!0}function _w(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&&Iv.enqueueReplaceState(l,l.state,null)}function Xl(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 C in o)d[C]===void 0&&(d[C]=o[C])}return d}function Nw(o){cm(o)}function Aw(o){console.error(o)}function Dw(o){cm(o)}function Om(o,l){try{var d=o.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(p){setTimeout(function(){throw p})}}function Ow(o,l,d){try{var p=o.onCaughtError;p(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function Mv(o,l,d){return d=Ni(d),d.tag=3,d.payload={element:null},d.callback=function(){Om(o,l)},d}function Iw(o){return o=Ni(o),o.tag=3,o}function Mw(o,l,d,p){var C=d.type.getDerivedStateFromError;if(typeof C=="function"){var w=p.value;o.payload=function(){return C(w)},o.callback=function(){Ow(l,d,p)}}var N=d.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(o.callback=function(){Ow(l,d,p),typeof C!="function"&&(Li===null?Li=new Set([this]):Li.add(this));var P=p.stack;this.componentDidCatch(p.value,{componentStack:P!==null?P:""})})}function Mk(o,l,d,p,C){if(d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(l=d.alternate,l!==null&&eu(l,d,C,!0),d=Fa.current,d!==null){switch(d.tag){case 31:case 13:return ds===null?Bm():d.alternate===null&&Zn===0&&(Zn=3),d.flags&=-257,d.flags|=65536,d.lanes=C,p===vm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([p]):l.add(p),s0(o,p,C)),!1;case 22:return d.flags|=65536,p===vm?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)),s0(o,p,C)),!1}throw Error(r(435,d.tag))}return s0(o,p,C),Bm(),!1}if(Qt)return l=Fa.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=C,p!==Jy&&(o=Error(r(422),{cause:p}),Hd(is(o,d)))):(p!==Jy&&(l=Error(r(423),{cause:p}),Hd(is(l,d))),o=o.current.alternate,o.flags|=65536,C&=-C,o.lanes|=C,p=is(p,d),C=Mv(o.stateNode,p,C),uv(o,C),Zn!==4&&(Zn=2)),!1;var w=Error(r(520),{cause:p});if(w=is(w,d),of===null?of=[w]:of.push(w),Zn!==4&&(Zn=2),l===null)return!0;p=is(p,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,o=C&-C,d.lanes|=o,o=Mv(d.stateNode,p,o),uv(d,o),!1;case 1:if(l=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Li===null||!Li.has(w))))return d.flags|=65536,C&=-C,d.lanes|=C,C=Iw(C),Mw(C,o,d,p),uv(d,C),!1}d=d.return}while(d!==null);return!1}var kv=Error(r(461)),ur=!1;function Fr(o,l,d,p){l.child=o===null?UE(l,null,d,p):Yl(l,o.child,d,p)}function kw(o,l,d,p,C){d=d.render;var w=l.ref;if("ref"in p){var N={};for(var P in p)P!=="ref"&&(N[P]=p[P])}else N=p;return Gl(l),p=gv(o,l,d,N,w,C),P=xv(),o!==null&&!ur?(yv(o,l,C),Fo(o,l,C)):(Qt&&P&&Xy(l),l.flags|=1,Fr(o,l,p,C),l.child)}function Lw(o,l,d,p,C){if(o===null){var w=d.type;return typeof w=="function"&&!Wy(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,Pw(o,l,w,p,C)):(o=hm(d.type,null,p,l,l.mode,C),o.ref=l.ref,o.return=l,l.child=o)}if(w=o.child,!$v(o,C)){var N=w.memoizedProps;if(d=d.compare,d=d!==null?d:Ud,d(N,p)&&o.ref===l.ref)return Fo(o,l,C)}return l.flags|=1,o=Mo(w,p),o.ref=l.ref,o.return=l,l.child=o}function Pw(o,l,d,p,C){if(o!==null){var w=o.memoizedProps;if(Ud(w,p)&&o.ref===l.ref)if(ur=!1,l.pendingProps=p=w,$v(o,C))(o.flags&131072)!==0&&(ur=!0);else return l.lanes=o.lanes,Fo(o,l,C)}return Lv(o,l,d,p,C)}function Uw(o,l,d,p){var C=p.children,w=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(w=w!==null?w.baseLanes|d:d,o!==null){for(p=l.child=o.child,C=0;p!==null;)C=C|p.lanes|p.childLanes,p=p.sibling;p=C&~w}else p=0,l.child=null;return zw(o,l,w,d,p)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&xm(l,w!==null?w.cachePool:null),w!==null?HE(l,w):fv(),VE(l);else return p=l.lanes=536870912,zw(o,l,w!==null?w.baseLanes|d:d,d,p)}else w!==null?(xm(l,w.cachePool),HE(l,w),Oi(),l.memoizedState=null):(o!==null&&xm(l,null),fv(),Oi());return Fr(o,l,C,d),l.child}function Jd(o,l){return o!==null&&o.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function zw(o,l,d,p,C){var w=ov();return w=w===null?null:{parent:lr._currentValue,pool:w},l.memoizedState={baseLanes:d,cachePool:w},o!==null&&xm(l,null),fv(),VE(l),o!==null&&eu(o,l,p,!0),l.childLanes=C,null}function Im(o,l){return l=km({mode:l.mode,children:l.children},o.mode),l.ref=o.ref,o.child=l,l.return=o,l}function Fw(o,l,d){return Yl(l,o.child,null,d),o=Im(l,l.pendingProps),o.flags|=2,Ha(l),l.memoizedState=null,o}function kk(o,l,d){var p=l.pendingProps,C=(l.flags&128)!==0;if(l.flags&=-129,o===null){if(Qt){if(p.mode==="hidden")return o=Im(l,p),l.lanes=536870912,Jd(null,o);if(mv(l),(o=Pn)?(o=QR(o,us),o=o!==null&&o.data==="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:wi!==null?{id:Js,overflow:eo}:null,retryLane:536870912,hydrationErrors:null},d=EE(o),d.return=l,l.child=d,Ur=l,Pn=null)):o=null,o===null)throw ji(l);return l.lanes=536870912,null}return Im(l,p)}var w=o.memoizedState;if(w!==null){var N=w.dehydrated;if(mv(l),C)if(l.flags&256)l.flags&=-257,l=Fw(o,l,d);else if(l.memoizedState!==null)l.child=o.child,l.flags|=128,l=null;else throw Error(r(558));else if(ur||eu(o,l,d,!1),C=(d&o.childLanes)!==0,ur||C){if(p=Dn,p!==null&&(N=te(p,d),N!==0&&N!==w.retryLane))throw w.retryLane=N,Hl(o,N),Ea(p,o,N),kv;Bm(),l=Fw(o,l,d)}else o=w.treeContext,Pn=fs(N.nextSibling),Ur=l,Qt=!0,Ri=null,us=!1,o!==null&&jE(l,o),l=Im(l,p),l.flags|=4096;return l}return o=Mo(o.child,{mode:p.mode,children:p.children}),o.ref=l.ref,l.child=o,o.return=l,o}function Mm(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 Lv(o,l,d,p,C){return Gl(l),d=gv(o,l,d,p,void 0,C),p=xv(),o!==null&&!ur?(yv(o,l,C),Fo(o,l,C)):(Qt&&p&&Xy(l),l.flags|=1,Fr(o,l,d,C),l.child)}function Hw(o,l,d,p,C,w){return Gl(l),l.updateQueue=null,d=BE(l,p,d,C),$E(o),p=xv(),o!==null&&!ur?(yv(o,l,w),Fo(o,l,w)):(Qt&&p&&Xy(l),l.flags|=1,Fr(o,l,d,w),l.child)}function Vw(o,l,d,p,C){if(Gl(l),l.stateNode===null){var w=Zc,N=d.contextType;typeof N=="object"&&N!==null&&(w=zr(N)),w=new d(p,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Iv,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=p,w.state=l.memoizedState,w.refs={},lv(l),N=d.contextType,w.context=typeof N=="object"&&N!==null?zr(N):Zc,w.state=l.memoizedState,N=d.getDerivedStateFromProps,typeof N=="function"&&(Ov(l,d,N,p),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(N=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),N!==w.state&&Iv.enqueueReplaceState(w,w.state,null),Wd(l,p,w,C),Kd(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!0}else if(o===null){w=l.stateNode;var P=l.memoizedProps,X=Xl(d,P);w.props=X;var de=w.context,ve=d.contextType;N=Zc,typeof ve=="object"&&ve!==null&&(N=zr(ve));var Se=d.getDerivedStateFromProps;ve=typeof Se=="function"||typeof w.getSnapshotBeforeUpdate=="function",P=l.pendingProps!==P,ve||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P||de!==N)&&_w(l,w,p,N),_i=!1;var he=l.memoizedState;w.state=he,Wd(l,p,w,C),Kd(),de=l.memoizedState,P||he!==de||_i?(typeof Se=="function"&&(Ov(l,d,Se,p),de=l.memoizedState),(X=_i||Tw(l,d,X,p,he,de,N))?(ve||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=p,l.memoizedState=de),w.props=p,w.state=de,w.context=N,p=X):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),p=!1)}else{w=l.stateNode,cv(o,l),N=l.memoizedProps,ve=Xl(d,N),w.props=ve,Se=l.pendingProps,he=w.context,de=d.contextType,X=Zc,typeof de=="object"&&de!==null&&(X=zr(de)),P=d.getDerivedStateFromProps,(de=typeof P=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==Se||he!==X)&&_w(l,w,p,X),_i=!1,he=l.memoizedState,w.state=he,Wd(l,p,w,C),Kd();var ge=l.memoizedState;N!==Se||he!==ge||_i||o!==null&&o.dependencies!==null&&pm(o.dependencies)?(typeof P=="function"&&(Ov(l,d,P,p),ge=l.memoizedState),(ve=_i||Tw(l,d,ve,p,he,ge,X)||o!==null&&o.dependencies!==null&&pm(o.dependencies))?(de||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,ge,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,ge,X)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),l.memoizedProps=p,l.memoizedState=ge),w.props=p,w.state=ge,w.context=X,p=ve):(typeof w.componentDidUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===o.memoizedProps&&he===o.memoizedState||(l.flags|=1024),p=!1)}return w=p,Mm(o,l),p=(l.flags&128)!==0,w||p?(w=l.stateNode,d=p&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,o!==null&&p?(l.child=Yl(l,o.child,null,C),l.child=Yl(l,null,d,C)):Fr(o,l,d,C),l.memoizedState=w.state,o=l.child):o=Fo(o,l,C),o}function $w(o,l,d,p){return $l(),l.flags|=256,Fr(o,l,d,p),l.child}var Pv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Uv(o){return{baseLanes:o,cachePool:OE()}}function zv(o,l,d){return o=o!==null?o.childLanes&~d:0,l&&(o|=$a),o}function Bw(o,l,d){var p=l.pendingProps,C=!1,w=(l.flags&128)!==0,N;if((N=w)||(N=o!==null&&o.memoizedState===null?!1:(nr.current&2)!==0),N&&(C=!0,l.flags&=-129),N=(l.flags&32)!==0,l.flags&=-33,o===null){if(Qt){if(C?Di(l):Oi(),(o=Pn)?(o=QR(o,us),o=o!==null&&o.data!=="&"?o:null,o!==null&&(l.memoizedState={dehydrated:o,treeContext:wi!==null?{id:Js,overflow:eo}:null,retryLane:536870912,hydrationErrors:null},d=EE(o),d.return=l,l.child=d,Ur=l,Pn=null)):o=null,o===null)throw ji(l);return S0(o)?l.lanes=32:l.lanes=536870912,null}var P=p.children;return p=p.fallback,C?(Oi(),C=l.mode,P=km({mode:"hidden",children:P},C),p=Vl(p,C,d,null),P.return=l,p.return=l,P.sibling=p,l.child=P,p=l.child,p.memoizedState=Uv(d),p.childLanes=zv(o,N,d),l.memoizedState=Pv,Jd(null,p)):(Di(l),Fv(l,P))}var X=o.memoizedState;if(X!==null&&(P=X.dehydrated,P!==null)){if(w)l.flags&256?(Di(l),l.flags&=-257,l=Hv(o,l,d)):l.memoizedState!==null?(Oi(),l.child=o.child,l.flags|=128,l=null):(Oi(),P=p.fallback,C=l.mode,p=km({mode:"visible",children:p.children},C),P=Vl(P,C,d,null),P.flags|=2,p.return=l,P.return=l,p.sibling=P,l.child=p,Yl(l,o.child,null,d),p=l.child,p.memoizedState=Uv(d),p.childLanes=zv(o,N,d),l.memoizedState=Pv,l=Jd(null,p));else if(Di(l),S0(P)){if(N=P.nextSibling&&P.nextSibling.dataset,N)var de=N.dgst;N=de,p=Error(r(419)),p.stack="",p.digest=N,Hd({value:p,source:null,stack:null}),l=Hv(o,l,d)}else if(ur||eu(o,l,d,!1),N=(d&o.childLanes)!==0,ur||N){if(N=Dn,N!==null&&(p=te(N,d),p!==0&&p!==X.retryLane))throw X.retryLane=p,Hl(o,p),Ea(N,o,p),kv;b0(P)||Bm(),l=Hv(o,l,d)}else b0(P)?(l.flags|=192,l.child=o.child,l=null):(o=X.treeContext,Pn=fs(P.nextSibling),Ur=l,Qt=!0,Ri=null,us=!1,o!==null&&jE(l,o),l=Fv(l,p.children),l.flags|=4096);return l}return C?(Oi(),P=p.fallback,C=l.mode,X=o.child,de=X.sibling,p=Mo(X,{mode:"hidden",children:p.children}),p.subtreeFlags=X.subtreeFlags&65011712,de!==null?P=Mo(de,P):(P=Vl(P,C,d,null),P.flags|=2),P.return=l,p.return=l,p.sibling=P,l.child=p,Jd(null,p),p=l.child,P=o.child.memoizedState,P===null?P=Uv(d):(C=P.cachePool,C!==null?(X=lr._currentValue,C=C.parent!==X?{parent:X,pool:X}:C):C=OE(),P={baseLanes:P.baseLanes|d,cachePool:C}),p.memoizedState=P,p.childLanes=zv(o,N,d),l.memoizedState=Pv,Jd(o.child,p)):(Di(l),d=o.child,o=d.sibling,d=Mo(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 Fv(o,l){return l=km({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function km(o,l){return o=za(22,o,null,l),o.lanes=0,o}function Hv(o,l,d){return Yl(l,o.child,null,d),o=Fv(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function Gw(o,l,d){o.lanes|=l;var p=o.alternate;p!==null&&(p.lanes|=l),nv(o.return,l,d)}function Vv(o,l,d,p,C,w){var N=o.memoizedState;N===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:p,tail:d,tailMode:C,treeForkCount:w}:(N.isBackwards=l,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=d,N.tailMode=C,N.treeForkCount=w)}function qw(o,l,d){var p=l.pendingProps,C=p.revealOrder,w=p.tail;p=p.children;var N=nr.current,P=(N&2)!==0;if(P?(N=N&1|2,l.flags|=128):N&=1,H(nr,N),Fr(o,l,p,d),p=Qt?Fd:0,!P&&o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Gw(o,d,l);else if(o.tag===19)Gw(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(C){case"forwards":for(d=l.child,C=null;d!==null;)o=d.alternate,o!==null&&Em(o)===null&&(C=d),d=d.sibling;d=C,d===null?(C=l.child,l.child=null):(C=d.sibling,d.sibling=null),Vv(l,!1,C,d,w,p);break;case"backwards":case"unstable_legacy-backwards":for(d=null,C=l.child,l.child=null;C!==null;){if(o=C.alternate,o!==null&&Em(o)===null){l.child=C;break}o=C.sibling,C.sibling=d,d=C,C=o}Vv(l,!0,d,null,w,p);break;case"together":Vv(l,!1,null,null,void 0,p);break;default:l.memoizedState=null}return l.child}function Fo(o,l,d){if(o!==null&&(l.dependencies=o.dependencies),ki|=l.lanes,(d&l.childLanes)===0)if(o!==null){if(eu(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=Mo(o,o.pendingProps),l.child=d,d.return=l;o.sibling!==null;)o=o.sibling,d=d.sibling=Mo(o,o.pendingProps),d.return=l;d.sibling=null}return l.child}function $v(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&pm(o)))}function Lk(o,l,d){switch(l.tag){case 3:ie(l,l.stateNode.containerInfo),Ti(l,lr,o.memoizedState.cache),$l();break;case 27:case 5:Ee(l);break;case 4:ie(l,l.stateNode.containerInfo);break;case 10:Ti(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,mv(l),null;break;case 13:var p=l.memoizedState;if(p!==null)return p.dehydrated!==null?(Di(l),l.flags|=128,null):(d&l.child.childLanes)!==0?Bw(o,l,d):(Di(l),o=Fo(o,l,d),o!==null?o.sibling:null);Di(l);break;case 19:var C=(o.flags&128)!==0;if(p=(d&l.childLanes)!==0,p||(eu(o,l,d,!1),p=(d&l.childLanes)!==0),C){if(p)return qw(o,l,d);l.flags|=128}if(C=l.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),H(nr,nr.current),p)break;return null;case 22:return l.lanes=0,Uw(o,l,d,l.pendingProps);case 24:Ti(l,lr,o.memoizedState.cache)}return Fo(o,l,d)}function Kw(o,l,d){if(o!==null)if(o.memoizedProps!==l.pendingProps)ur=!0;else{if(!$v(o,d)&&(l.flags&128)===0)return ur=!1,Lk(o,l,d);ur=(o.flags&131072)!==0}else ur=!1,Qt&&(l.flags&1048576)!==0&&RE(l,Fd,l.index);switch(l.lanes=0,l.tag){case 16:e:{var p=l.pendingProps;if(o=Kl(l.elementType),l.type=o,typeof o=="function")Wy(o)?(p=Xl(o,p),l.tag=1,l=Vw(null,l,o,p,d)):(l.tag=0,l=Lv(null,l,o,p,d));else{if(o!=null){var C=o.$$typeof;if(C===D){l.tag=11,l=kw(null,l,o,p,d);break e}else if(C===T){l.tag=14,l=Lw(null,l,o,p,d);break e}}throw l=q(o)||o,Error(r(306,l,""))}}return l;case 0:return Lv(o,l,l.type,l.pendingProps,d);case 1:return p=l.type,C=Xl(p,l.pendingProps),Vw(o,l,p,C,d);case 3:e:{if(ie(l,l.stateNode.containerInfo),o===null)throw Error(r(387));p=l.pendingProps;var w=l.memoizedState;C=w.element,cv(o,l),Wd(l,p,null,d);var N=l.memoizedState;if(p=N.cache,Ti(l,lr,p),p!==w.cache&&rv(l,[lr],d,!0),Kd(),p=N.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:N.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=$w(o,l,p,d);break e}else if(p!==C){C=is(Error(r(424)),l),Hd(C),l=$w(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=fs(o.firstChild),Ur=l,Qt=!0,Ri=null,us=!0,d=UE(l,null,p,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if($l(),p===C){l=Fo(o,l,d);break e}Fr(o,l,p,d)}l=l.child}return l;case 26:return Mm(o,l),o===null?(d=aj(l.type,null,l.pendingProps,null))?l.memoizedState=d:Qt||(d=l.type,o=l.pendingProps,p=Xm(le.current).createElement(d),p[Le]=l,p[ze]=o,Hr(p,d,o),An(p),l.stateNode=p):l.memoizedState=aj(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return Ee(l),o===null&&Qt&&(p=l.stateNode=tj(l.type,l.pendingProps,le.current),Ur=l,us=!0,C=Pn,Fi(l.type)?(C0=C,Pn=fs(p.firstChild)):Pn=C),Fr(o,l,l.pendingProps.children,d),Mm(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Qt&&((C=p=Pn)&&(p=f9(p,l.type,l.pendingProps,us),p!==null?(l.stateNode=p,Ur=l,Pn=fs(p.firstChild),us=!1,C=!0):C=!1),C||ji(l)),Ee(l),C=l.type,w=l.pendingProps,N=o!==null?o.memoizedProps:null,p=w.children,x0(C,w)?p=null:N!==null&&x0(C,N)&&(l.flags|=32),l.memoizedState!==null&&(C=gv(o,l,Tk,null,null,d),pf._currentValue=C),Mm(o,l),Fr(o,l,p,d),l.child;case 6:return o===null&&Qt&&((o=d=Pn)&&(d=h9(d,l.pendingProps,us),d!==null?(l.stateNode=d,Ur=l,Pn=null,o=!0):o=!1),o||ji(l)),null;case 13:return Bw(o,l,d);case 4:return ie(l,l.stateNode.containerInfo),p=l.pendingProps,o===null?l.child=Yl(l,null,p,d):Fr(o,l,p,d),l.child;case 11:return kw(o,l,l.type,l.pendingProps,d);case 7:return Fr(o,l,l.pendingProps,d),l.child;case 8:return Fr(o,l,l.pendingProps.children,d),l.child;case 12:return Fr(o,l,l.pendingProps.children,d),l.child;case 10:return p=l.pendingProps,Ti(l,l.type,p.value),Fr(o,l,p.children,d),l.child;case 9:return C=l.type._context,p=l.pendingProps.children,Gl(l),C=zr(C),p=p(C),l.flags|=1,Fr(o,l,p,d),l.child;case 14:return Lw(o,l,l.type,l.pendingProps,d);case 15:return Pw(o,l,l.type,l.pendingProps,d);case 19:return qw(o,l,d);case 31:return kk(o,l,d);case 22:return Uw(o,l,d,l.pendingProps);case 24:return Gl(l),p=zr(lr),o===null?(C=ov(),C===null&&(C=Dn,w=av(),C.pooledCache=w,w.refCount++,w!==null&&(C.pooledCacheLanes|=d),C=w),l.memoizedState={parent:p,cache:C},lv(l),Ti(l,lr,C)):((o.lanes&d)!==0&&(cv(o,l),Wd(l,null,null,d),Kd()),C=o.memoizedState,w=l.memoizedState,C.parent!==p?(C={parent:p,cache:p},l.memoizedState=C,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=C),Ti(l,lr,p)):(p=w.cache,Ti(l,lr,p),p!==C.cache&&rv(l,[lr],d,!0))),Fr(o,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Ho(o){o.flags|=4}function Bv(o,l,d,p,C){if((l=(o.mode&32)!==0)&&(l=!1),l){if(o.flags|=16777216,(C&335544128)===C)if(o.stateNode.complete)o.flags|=8192;else if(bR())o.flags|=8192;else throw Wl=vm,iv}else o.flags&=-16777217}function Ww(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!cj(l))if(bR())o.flags|=8192;else throw Wl=vm,iv}function Lm(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?Xt():536870912,o.lanes|=l,fu|=l)}function ef(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 C=o.child;C!==null;)d|=C.lanes|C.childLanes,p|=C.subtreeFlags&65011712,p|=C.flags&65011712,C.return=o,C=C.sibling;else for(C=o.child;C!==null;)d|=C.lanes|C.childLanes,p|=C.subtreeFlags,p|=C.flags,C.return=o,C=C.sibling;return o.subtreeFlags|=p,o.childLanes=d,l}function Pk(o,l,d){var p=l.pendingProps;switch(Qy(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),Po(lr),ye(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(o===null||o.child===null)&&(Jc(l)?Ho(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,ev())),Un(l),null;case 26:var C=l.type,w=l.memoizedState;return o===null?(Ho(l),w!==null?(Un(l),Ww(l,w)):(Un(l),Bv(l,C,null,p,d))):w?w!==o.memoizedState?(Ho(l),Un(l),Ww(l,w)):(Un(l),l.flags&=-16777217):(o=o.memoizedProps,o!==p&&Ho(l),Un(l),Bv(l,C,o,p,d)),null;case 27:if(He(l),d=le.current,C=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Ho(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}o=W.current,Jc(l)?TE(l):(o=tj(C,p,d),l.stateNode=o,Ho(l))}return Un(l),null;case 5:if(He(l),C=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==p&&Ho(l);else{if(!p){if(l.stateNode===null)throw Error(r(166));return Un(l),null}if(w=W.current,Jc(l))TE(l);else{var N=Xm(le.current);switch(w){case 1:w=N.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:w=N.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":w=N.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":w=N.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":w=N.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?N.createElement(C,{is:p.is}):N.createElement(C)}}w[Le]=l,w[ze]=p;e:for(N=l.child;N!==null;){if(N.tag===5||N.tag===6)w.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=w;e:switch(Hr(w,C,p),C){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ho(l)}}return Un(l),Bv(l,l.type,o===null?null:o.memoizedProps,l.pendingProps,d),null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==p&&Ho(l);else{if(typeof p!="string"&&l.stateNode===null)throw Error(r(166));if(o=le.current,Jc(l)){if(o=l.stateNode,d=l.memoizedProps,p=null,C=Ur,C!==null)switch(C.tag){case 27:case 5:p=C.memoizedProps}o[Le]=l,o=!!(o.nodeValue===d||p!==null&&p.suppressHydrationWarning===!0||BR(o.nodeValue,d)),o||ji(l,!0)}else o=Xm(o).createTextNode(p),o[Le]=l,l.stateNode=o}return Un(l),null;case 31:if(d=l.memoizedState,o===null||o.memoizedState!==null){if(p=Jc(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[Le]=l}else $l(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),o=!1}else d=ev(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=d),o=!0;if(!o)return l.flags&256?(Ha(l),l):(Ha(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(C=Jc(l),p!==null&&p.dehydrated!==null){if(o===null){if(!C)throw Error(r(318));if(C=l.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(r(317));C[Le]=l}else $l(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Un(l),C=!1}else C=ev(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=C),C=!0;if(!C)return l.flags&256?(Ha(l),l):(Ha(l),null)}return Ha(l),(l.flags&128)!==0?(l.lanes=d,l):(d=p!==null,o=o!==null&&o.memoizedState!==null,d&&(p=l.child,C=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(C=p.alternate.memoizedState.cachePool.pool),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==C&&(p.flags|=2048)),d!==o&&d&&(l.child.flags|=8192),Lm(l,l.updateQueue),Un(l),null);case 4:return ye(),o===null&&f0(l.stateNode.containerInfo),Un(l),null;case 10:return Po(l.type),Un(l),null;case 19:if(F(nr),p=l.memoizedState,p===null)return Un(l),null;if(C=(l.flags&128)!==0,w=p.rendering,w===null)if(C)ef(p,!1);else{if(Zn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(w=Em(o),w!==null){for(l.flags|=128,ef(p,!1),o=w.updateQueue,l.updateQueue=o,Lm(l,o),l.subtreeFlags=0,o=d,d=l.child;d!==null;)CE(d,o),d=d.sibling;return H(nr,nr.current&1|2),Qt&&ko(l,p.treeForkCount),l.child}o=o.sibling}p.tail!==null&&je()>Hm&&(l.flags|=128,C=!0,ef(p,!1),l.lanes=4194304)}else{if(!C)if(o=Em(w),o!==null){if(l.flags|=128,C=!0,o=o.updateQueue,l.updateQueue=o,Lm(l,o),ef(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Qt)return Un(l),null}else 2*je()-p.renderingStartTime>Hm&&d!==536870912&&(l.flags|=128,C=!0,ef(p,!1),l.lanes=4194304);p.isBackwards?(w.sibling=l.child,l.child=w):(o=p.last,o!==null?o.sibling=w:l.child=w,p.last=w)}return p.tail!==null?(o=p.tail,p.rendering=o,p.tail=o.sibling,p.renderingStartTime=je(),o.sibling=null,d=nr.current,H(nr,C?d&1|2:d&1),Qt&&ko(l,p.treeForkCount),o):(Un(l),null);case 22:case 23:return Ha(l),hv(),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&&Lm(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&&F(ql),null;case 24:return d=null,o!==null&&(d=o.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Po(lr),Un(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function Uk(o,l){switch(Qy(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return Po(lr),ye(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return He(l),null;case 31:if(l.memoizedState!==null){if(Ha(l),l.alternate===null)throw Error(r(340));$l()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 13:if(Ha(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));$l()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return F(nr),null;case 4:return ye(),null;case 10:return Po(l.type),null;case 22:case 23:return Ha(l),hv(),o!==null&&F(ql),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return Po(lr),null;case 25:return null;default:return null}}function Yw(o,l){switch(Qy(l),l.tag){case 3:Po(lr),ye();break;case 26:case 27:case 5:He(l);break;case 4:ye();break;case 31:l.memoizedState!==null&&Ha(l);break;case 13:Ha(l);break;case 19:F(nr);break;case 10:Po(l.type);break;case 22:case 23:Ha(l),hv(),o!==null&&F(ql);break;case 24:Po(lr)}}function tf(o,l){try{var d=l.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var C=p.next;d=C;do{if((d.tag&o)===o){p=void 0;var w=d.create,N=d.inst;p=w(),N.destroy=p}d=d.next}while(d!==C)}}catch(P){Sn(l,l.return,P)}}function Ii(o,l,d){try{var p=l.updateQueue,C=p!==null?p.lastEffect:null;if(C!==null){var w=C.next;p=w;do{if((p.tag&o)===o){var N=p.inst,P=N.destroy;if(P!==void 0){N.destroy=void 0,C=l;var X=d,de=P;try{de()}catch(ve){Sn(C,X,ve)}}}p=p.next}while(p!==w)}}catch(ve){Sn(l,l.return,ve)}}function Zw(o){var l=o.updateQueue;if(l!==null){var d=o.stateNode;try{FE(l,d)}catch(p){Sn(o,o.return,p)}}}function Xw(o,l,d){d.props=Xl(o.type,o.memoizedProps),d.state=o.memoizedState;try{d.componentWillUnmount()}catch(p){Sn(o,l,p)}}function nf(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(C){Sn(o,l,C)}}function to(o,l){var d=o.ref,p=o.refCleanup;if(d!==null)if(typeof p=="function")try{p()}catch(C){Sn(o,l,C)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(C){Sn(o,l,C)}else d.current=null}function Qw(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(C){Sn(o,o.return,C)}}function Gv(o,l,d){try{var p=o.stateNode;o9(p,o.type,d,l),p[ze]=l}catch(C){Sn(o,o.return,C)}}function Jw(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Fi(o.type)||o.tag===4}function qv(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Jw(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&&Fi(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 Kv(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=Oo));else if(p!==4&&(p===27&&Fi(o.type)&&(d=o.stateNode,l=null),o=o.child,o!==null))for(Kv(o,l,d),o=o.sibling;o!==null;)Kv(o,l,d),o=o.sibling}function Pm(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&&Fi(o.type)&&(d=o.stateNode),o=o.child,o!==null))for(Pm(o,l,d),o=o.sibling;o!==null;)Pm(o,l,d),o=o.sibling}function eR(o){var l=o.stateNode,d=o.memoizedProps;try{for(var p=o.type,C=l.attributes;C.length;)l.removeAttributeNode(C[0]);Hr(l,p,d),l[Le]=o,l[ze]=d}catch(w){Sn(o,o.return,w)}}var Vo=!1,dr=!1,Wv=!1,tR=typeof WeakSet=="function"?WeakSet:Set,Nr=null;function zk(o,l){if(o=o.containerInfo,p0=ap,o=hE(o),Hy(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 C=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var N=0,P=-1,X=-1,de=0,ve=0,Se=o,he=null;t:for(;;){for(var ge;Se!==d||C!==0&&Se.nodeType!==3||(P=N+C),Se!==w||p!==0&&Se.nodeType!==3||(X=N+p),Se.nodeType===3&&(N+=Se.nodeValue.length),(ge=Se.firstChild)!==null;)he=Se,Se=ge;for(;;){if(Se===o)break t;if(he===d&&++de===C&&(P=N),he===w&&++ve===p&&(X=N),(ge=Se.nextSibling)!==null)break;Se=he,he=Se.parentNode}Se=ge}d=P===-1||X===-1?null:{start:P,end:X}}else d=null}d=d||{start:0,end:0}}else d=null;for(g0={focusedElem:o,selectionRange:d},ap=!1,Nr=l;Nr!==null;)if(l=Nr,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Nr=o;else for(;Nr!==null;){switch(l=Nr,w=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++)C=o[d],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&w!==null){o=void 0,d=l,C=w.memoizedProps,w=w.memoizedState,p=d.stateNode;try{var qe=Xl(d.type,C);o=p.getSnapshotBeforeUpdate(qe,w),p.__reactInternalSnapshotBeforeUpdate=o}catch(ot){Sn(d,d.return,ot)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,d=o.nodeType,d===9)v0(o);else if(d===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":v0(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,Nr=o;break}Nr=l.return}}function nR(o,l,d){var p=d.flags;switch(d.tag){case 0:case 11:case 15:Bo(o,d),p&4&&tf(5,d);break;case 1:if(Bo(o,d),p&4)if(o=d.stateNode,l===null)try{o.componentDidMount()}catch(N){Sn(d,d.return,N)}else{var C=Xl(d.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(C,l,o.__reactInternalSnapshotBeforeUpdate)}catch(N){Sn(d,d.return,N)}}p&64&&Zw(d),p&512&&nf(d,d.return);break;case 3:if(Bo(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{FE(o,l)}catch(N){Sn(d,d.return,N)}}break;case 27:l===null&&p&4&&eR(d);case 26:case 5:Bo(o,d),l===null&&p&4&&Qw(d),p&512&&nf(d,d.return);break;case 12:Bo(o,d);break;case 31:Bo(o,d),p&4&&sR(o,d);break;case 13:Bo(o,d),p&4&&oR(o,d),p&64&&(o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(d=Wk.bind(null,d),m9(o,d))));break;case 22:if(p=d.memoizedState!==null||Vo,!p){l=l!==null&&l.memoizedState!==null||dr,C=Vo;var w=dr;Vo=p,(dr=l)&&!w?Go(o,d,(d.subtreeFlags&8772)!==0):Bo(o,d),Vo=C,dr=w}break;case 30:break;default:Bo(o,d)}}function rR(o){var l=o.alternate;l!==null&&(o.alternate=null,rR(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Wn(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 Bn=null,va=!1;function $o(o,l,d){for(d=d.child;d!==null;)aR(o,l,d),d=d.sibling}function aR(o,l,d){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount(ea,d)}catch{}switch(d.tag){case 26:dr||to(d,l),$o(o,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:dr||to(d,l);var p=Bn,C=va;Fi(d.type)&&(Bn=d.stateNode,va=!1),$o(o,l,d),ff(d.stateNode),Bn=p,va=C;break;case 5:dr||to(d,l);case 6:if(p=Bn,C=va,Bn=null,$o(o,l,d),Bn=p,va=C,Bn!==null)if(va)try{(Bn.nodeType===9?Bn.body:Bn.nodeName==="HTML"?Bn.ownerDocument.body:Bn).removeChild(d.stateNode)}catch(w){Sn(d,l,w)}else try{Bn.removeChild(d.stateNode)}catch(w){Sn(d,l,w)}break;case 18:Bn!==null&&(va?(o=Bn,ZR(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,d.stateNode),bu(o)):ZR(Bn,d.stateNode));break;case 4:p=Bn,C=va,Bn=d.stateNode.containerInfo,va=!0,$o(o,l,d),Bn=p,va=C;break;case 0:case 11:case 14:case 15:Ii(2,d,l),dr||Ii(4,d,l),$o(o,l,d);break;case 1:dr||(to(d,l),p=d.stateNode,typeof p.componentWillUnmount=="function"&&Xw(d,l,p)),$o(o,l,d);break;case 21:$o(o,l,d);break;case 22:dr=(p=dr)||d.memoizedState!==null,$o(o,l,d),dr=p;break;default:$o(o,l,d)}}function sR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{bu(o)}catch(d){Sn(l,l.return,d)}}}function oR(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{bu(o)}catch(d){Sn(l,l.return,d)}}function Fk(o){switch(o.tag){case 31:case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new tR),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new tR),l;default:throw Error(r(435,o.tag))}}function Um(o,l){var d=Fk(o);l.forEach(function(p){if(!d.has(p)){d.add(p);var C=Yk.bind(null,o,p);p.then(C,C)}})}function ba(o,l){var d=l.deletions;if(d!==null)for(var p=0;p<d.length;p++){var C=d[p],w=o,N=l,P=N;e:for(;P!==null;){switch(P.tag){case 27:if(Fi(P.type)){Bn=P.stateNode,va=!1;break e}break;case 5:Bn=P.stateNode,va=!1;break e;case 3:case 4:Bn=P.stateNode.containerInfo,va=!0;break e}P=P.return}if(Bn===null)throw Error(r(160));aR(w,N,C),Bn=null,va=!1,w=C.alternate,w!==null&&(w.return=null),C.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)iR(l,o),l=l.sibling}var Ns=null;function iR(o,l){var d=o.alternate,p=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:ba(l,o),Sa(o),p&4&&(Ii(3,o,o.return),tf(3,o),Ii(5,o,o.return));break;case 1:ba(l,o),Sa(o),p&512&&(dr||d===null||to(d,d.return)),p&64&&Vo&&(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 C=Ns;if(ba(l,o),Sa(o),p&512&&(dr||d===null||to(d,d.return)),p&4){var w=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,C=C.ownerDocument||C;t:switch(p){case"title":w=C.getElementsByTagName("title")[0],(!w||w[Ln]||w[Le]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=C.createElement(p),C.head.insertBefore(w,C.querySelector("head > title"))),Hr(w,p,d),w[Le]=o,An(w),p=w;break e;case"link":var N=ij("link","href",C).get(p+(d.href||""));if(N){for(var P=0;P<N.length;P++)if(w=N[P],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){N.splice(P,1);break t}}w=C.createElement(p),Hr(w,p,d),C.head.appendChild(w);break;case"meta":if(N=ij("meta","content",C).get(p+(d.content||""))){for(P=0;P<N.length;P++)if(w=N[P],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){N.splice(P,1);break t}}w=C.createElement(p),Hr(w,p,d),C.head.appendChild(w);break;default:throw Error(r(468,p))}w[Le]=o,An(w),p=w}o.stateNode=p}else lj(C,o.type,o.stateNode);else o.stateNode=oj(C,p,o.memoizedProps);else w!==p?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,p===null?lj(C,o.type,o.stateNode):oj(C,p,o.memoizedProps)):p===null&&o.stateNode!==null&&Gv(o,o.memoizedProps,d.memoizedProps)}break;case 27:ba(l,o),Sa(o),p&512&&(dr||d===null||to(d,d.return)),d!==null&&p&4&&Gv(o,o.memoizedProps,d.memoizedProps);break;case 5:if(ba(l,o),Sa(o),p&512&&(dr||d===null||to(d,d.return)),o.flags&32){C=o.stateNode;try{$c(C,"")}catch(qe){Sn(o,o.return,qe)}}p&4&&o.stateNode!=null&&(C=o.memoizedProps,Gv(o,C,d!==null?d.memoizedProps:C)),p&1024&&(Wv=!0);break;case 6:if(ba(l,o),Sa(o),p&4){if(o.stateNode===null)throw Error(r(162));p=o.memoizedProps,d=o.stateNode;try{d.nodeValue=p}catch(qe){Sn(o,o.return,qe)}}break;case 3:if(ep=null,C=Ns,Ns=Qm(l.containerInfo),ba(l,o),Ns=C,Sa(o),p&4&&d!==null&&d.memoizedState.isDehydrated)try{bu(l.containerInfo)}catch(qe){Sn(o,o.return,qe)}Wv&&(Wv=!1,lR(o));break;case 4:p=Ns,Ns=Qm(o.stateNode.containerInfo),ba(l,o),Sa(o),Ns=p;break;case 12:ba(l,o),Sa(o);break;case 31:ba(l,o),Sa(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Um(o,p)));break;case 13:ba(l,o),Sa(o),o.child.flags&8192&&o.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Fm=je()),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Um(o,p)));break;case 22:C=o.memoizedState!==null;var X=d!==null&&d.memoizedState!==null,de=Vo,ve=dr;if(Vo=de||C,dr=ve||X,ba(l,o),dr=ve,Vo=de,Sa(o),p&8192)e:for(l=o.stateNode,l._visibility=C?l._visibility&-2:l._visibility|1,C&&(d===null||X||Vo||dr||Ql(o)),d=null,l=o;;){if(l.tag===5||l.tag===26){if(d===null){X=d=l;try{if(w=X.stateNode,C)N=w.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{P=X.stateNode;var Se=X.memoizedProps.style,he=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;P.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(qe){Sn(X,X.return,qe)}}}else if(l.tag===6){if(d===null){X=l;try{X.stateNode.nodeValue=C?"":X.memoizedProps}catch(qe){Sn(X,X.return,qe)}}}else if(l.tag===18){if(d===null){X=l;try{var ge=X.stateNode;C?XR(ge,!0):XR(X.stateNode,!1)}catch(qe){Sn(X,X.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,Um(o,d))));break;case 19:ba(l,o),Sa(o),p&4&&(p=o.updateQueue,p!==null&&(o.updateQueue=null,Um(o,p)));break;case 30:break;case 21:break;default:ba(l,o),Sa(o)}}function Sa(o){var l=o.flags;if(l&2){try{for(var d,p=o.return;p!==null;){if(Jw(p)){d=p;break}p=p.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var C=d.stateNode,w=qv(o);Pm(o,w,C);break;case 5:var N=d.stateNode;d.flags&32&&($c(N,""),d.flags&=-33);var P=qv(o);Pm(o,P,N);break;case 3:case 4:var X=d.stateNode.containerInfo,de=qv(o);Kv(o,de,X);break;default:throw Error(r(161))}}catch(ve){Sn(o,o.return,ve)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function lR(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;lR(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function Bo(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)nR(o,l.alternate,l),l=l.sibling}function Ql(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:Ii(4,l,l.return),Ql(l);break;case 1:to(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&Xw(l,l.return,d),Ql(l);break;case 27:ff(l.stateNode);case 26:case 5:to(l,l.return),Ql(l);break;case 22:l.memoizedState===null&&Ql(l);break;case 30:Ql(l);break;default:Ql(l)}o=o.sibling}}function Go(o,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var p=l.alternate,C=o,w=l,N=w.flags;switch(w.tag){case 0:case 11:case 15:Go(C,w,d),tf(4,w);break;case 1:if(Go(C,w,d),p=w,C=p.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(de){Sn(p,p.return,de)}if(p=w,C=p.updateQueue,C!==null){var P=p.stateNode;try{var X=C.shared.hiddenCallbacks;if(X!==null)for(C.shared.hiddenCallbacks=null,C=0;C<X.length;C++)zE(X[C],P)}catch(de){Sn(p,p.return,de)}}d&&N&64&&Zw(w),nf(w,w.return);break;case 27:eR(w);case 26:case 5:Go(C,w,d),d&&p===null&&N&4&&Qw(w),nf(w,w.return);break;case 12:Go(C,w,d);break;case 31:Go(C,w,d),d&&N&4&&sR(C,w);break;case 13:Go(C,w,d),d&&N&4&&oR(C,w);break;case 22:w.memoizedState===null&&Go(C,w,d),nf(w,w.return);break;case 30:break;default:Go(C,w,d)}l=l.sibling}}function Yv(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&&Vd(d))}function Zv(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Vd(o))}function As(o,l,d,p){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)cR(o,l,d,p),l=l.sibling}function cR(o,l,d,p){var C=l.flags;switch(l.tag){case 0:case 11:case 15:As(o,l,d,p),C&2048&&tf(9,l);break;case 1:As(o,l,d,p);break;case 3:As(o,l,d,p),C&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Vd(o)));break;case 12:if(C&2048){As(o,l,d,p),o=l.stateNode;try{var w=l.memoizedProps,N=w.id,P=w.onPostCommit;typeof P=="function"&&P(N,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(X){Sn(l,l.return,X)}}else As(o,l,d,p);break;case 31:As(o,l,d,p);break;case 13:As(o,l,d,p);break;case 23:break;case 22:w=l.stateNode,N=l.alternate,l.memoizedState!==null?w._visibility&2?As(o,l,d,p):rf(o,l):w._visibility&2?As(o,l,d,p):(w._visibility|=2,cu(o,l,d,p,(l.subtreeFlags&10256)!==0||!1)),C&2048&&Yv(N,l);break;case 24:As(o,l,d,p),C&2048&&Zv(l.alternate,l);break;default:As(o,l,d,p)}}function cu(o,l,d,p,C){for(C=C&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var w=o,N=l,P=d,X=p,de=N.flags;switch(N.tag){case 0:case 11:case 15:cu(w,N,P,X,C),tf(8,N);break;case 23:break;case 22:var ve=N.stateNode;N.memoizedState!==null?ve._visibility&2?cu(w,N,P,X,C):rf(w,N):(ve._visibility|=2,cu(w,N,P,X,C)),C&&de&2048&&Yv(N.alternate,N);break;case 24:cu(w,N,P,X,C),C&&de&2048&&Zv(N.alternate,N);break;default:cu(w,N,P,X,C)}l=l.sibling}}function rf(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=o,p=l,C=p.flags;switch(p.tag){case 22:rf(d,p),C&2048&&Yv(p.alternate,p);break;case 24:rf(d,p),C&2048&&Zv(p.alternate,p);break;default:rf(d,p)}l=l.sibling}}var af=8192;function uu(o,l,d){if(o.subtreeFlags&af)for(o=o.child;o!==null;)uR(o,l,d),o=o.sibling}function uR(o,l,d){switch(o.tag){case 26:uu(o,l,d),o.flags&af&&o.memoizedState!==null&&j9(d,Ns,o.memoizedState,o.memoizedProps);break;case 5:uu(o,l,d);break;case 3:case 4:var p=Ns;Ns=Qm(o.stateNode.containerInfo),uu(o,l,d),Ns=p;break;case 22:o.memoizedState===null&&(p=o.alternate,p!==null&&p.memoizedState!==null?(p=af,af=16777216,uu(o,l,d),af=p):uu(o,l,d));break;default:uu(o,l,d)}}function dR(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 sf(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];Nr=p,hR(p,o)}dR(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)fR(o),o=o.sibling}function fR(o){switch(o.tag){case 0:case 11:case 15:sf(o),o.flags&2048&&Ii(9,o,o.return);break;case 3:sf(o);break;case 12:sf(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,zm(o)):sf(o);break;default:sf(o)}}function zm(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];Nr=p,hR(p,o)}dR(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:Ii(8,l,l.return),zm(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,zm(l));break;default:zm(l)}o=o.sibling}}function hR(o,l){for(;Nr!==null;){var d=Nr;switch(d.tag){case 0:case 11:case 15:Ii(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:Vd(d.memoizedState.cache)}if(p=d.child,p!==null)p.return=d,Nr=p;else e:for(d=o;Nr!==null;){p=Nr;var C=p.sibling,w=p.return;if(rR(p),p===d){Nr=null;break e}if(C!==null){C.return=w,Nr=C;break e}Nr=w}}}var Hk={getCacheForType:function(o){var l=zr(lr),d=l.data.get(o);return d===void 0&&(d=o(),l.data.set(o,d)),d},cacheSignal:function(){return zr(lr).controller.signal}},Vk=typeof WeakMap=="function"?WeakMap:Map,xn=0,Dn=null,Ht=null,Kt=0,bn=0,Va=null,Mi=!1,du=!1,Xv=!1,qo=0,Zn=0,ki=0,Jl=0,Qv=0,$a=0,fu=0,of=null,Ca=null,Jv=!1,Fm=0,mR=0,Hm=1/0,Vm=null,Li=null,gr=0,Pi=null,hu=null,Ko=0,e0=0,t0=null,pR=null,lf=0,n0=null;function Ba(){return(xn&2)!==0&&Kt!==0?Kt&-Kt:I.T!==null?l0():Ae()}function gR(){if($a===0)if((Kt&536870912)===0||Qt){var o=js;js<<=1,(js&3932160)===0&&(js=262144),$a=o}else $a=536870912;return o=Fa.current,o!==null&&(o.flags|=32),$a}function Ea(o,l,d){(o===Dn&&(bn===2||bn===9)||o.cancelPendingCommit!==null)&&(mu(o,0),Ui(o,Kt,$a,!1)),an(o,d),((xn&2)===0||o!==Dn)&&(o===Dn&&((xn&2)===0&&(Jl|=d),Zn===4&&Ui(o,Kt,$a,!1)),no(o))}function xR(o,l,d){if((xn&6)!==0)throw Error(r(327));var p=!d&&(l&127)===0&&(l&o.expiredLanes)===0||Zt(o,l),C=p?Gk(o,l):a0(o,l,!0),w=p;do{if(C===0){du&&!p&&Ui(o,l,0,!1);break}else{if(d=o.current.alternate,w&&!$k(d)){C=a0(o,l,!1),w=!1;continue}if(C===2){if(w=l,o.errorRecoveryDisabledLanes&w)var N=0;else N=o.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){l=N;e:{var P=o;C=of;var X=P.current.memoizedState.isDehydrated;if(X&&(mu(P,N).flags|=256),N=a0(P,N,!1),N!==2){if(Xv&&!X){P.errorRecoveryDisabledLanes|=w,Jl|=w,C=4;break e}w=Ca,Ca=C,w!==null&&(Ca===null?Ca=w:Ca.push.apply(Ca,w))}C=N}if(w=!1,C!==2)continue}}if(C===1){mu(o,0),Ui(o,l,0,!0);break}e:{switch(p=o,w=C,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ui(p,l,$a,!Mi);break e;case 2:Ca=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(C=Fm+300-je(),10<C)){if(Ui(p,l,$a,!Mi),Ze(p,0,!0)!==0)break e;Ko=l,p.timeoutHandle=WR(yR.bind(null,p,d,Ca,Vm,Jv,l,$a,Jl,fu,Mi,w,"Throttled",-0,0),C);break e}yR(p,d,Ca,Vm,Jv,l,$a,Jl,fu,Mi,w,null,-0,0)}}break}while(!0);no(o)}function yR(o,l,d,p,C,w,N,P,X,de,ve,Se,he,ge){if(o.timeoutHandle=-1,Se=l.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Oo},uR(l,w,Se);var qe=(w&62914560)===w?Fm-je():(w&4194048)===w?mR-je():0;if(qe=T9(Se,qe),qe!==null){Ko=w,o.cancelPendingCommit=qe(jR.bind(null,o,l,w,d,p,C,N,P,X,ve,Se,null,he,ge)),Ui(o,w,N,!de);return}}jR(o,l,w,d,p,C,N,P,X)}function $k(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 C=d[p],w=C.getSnapshot;C=C.value;try{if(!Ua(w(),C))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 Ui(o,l,d,p){l&=~Qv,l&=~Jl,o.suspendedLanes|=l,o.pingedLanes&=~l,p&&(o.warmLanes|=l),p=o.expirationTimes;for(var C=l;0<C;){var w=31-kn(C),N=1<<w;p[w]=-1,C&=~N}d!==0&&Tr(o,d,l)}function $m(){return(xn&6)===0?(cf(0),!1):!0}function r0(){if(Ht!==null){if(bn===0)var o=Ht.return;else o=Ht,Lo=Bl=null,vv(o),au=null,Bd=0,o=Ht;for(;o!==null;)Yw(o.alternate,o),o=o.return;Ht=null}}function mu(o,l){var d=o.timeoutHandle;d!==-1&&(o.timeoutHandle=-1,c9(d)),d=o.cancelPendingCommit,d!==null&&(o.cancelPendingCommit=null,d()),Ko=0,r0(),Dn=o,Ht=d=Mo(o.current,null),Kt=l,bn=0,Va=null,Mi=!1,du=Zt(o,l),Xv=!1,fu=$a=Qv=Jl=ki=Zn=0,Ca=of=null,Jv=!1,(l&8)!==0&&(l|=l&32);var p=o.entangledLanes;if(p!==0)for(o=o.entanglements,p&=l;0<p;){var C=31-kn(p),w=1<<C;l|=o[C],p&=~w}return qo=l,um(),d}function vR(o,l){Dt=null,I.H=Qd,l===ru||l===ym?(l=kE(),bn=3):l===iv?(l=kE(),bn=4):bn=l===kv?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Va=l,Ht===null&&(Zn=1,Om(o,is(l,o.current)))}function bR(){var o=Fa.current;return o===null?!0:(Kt&4194048)===Kt?ds===null:(Kt&62914560)===Kt||(Kt&536870912)!==0?o===ds:!1}function SR(){var o=I.H;return I.H=Qd,o===null?Qd:o}function CR(){var o=I.A;return I.A=Hk,o}function Bm(){Zn=4,Mi||(Kt&4194048)!==Kt&&Fa.current!==null||(du=!0),(ki&134217727)===0&&(Jl&134217727)===0||Dn===null||Ui(Dn,Kt,$a,!1)}function a0(o,l,d){var p=xn;xn|=2;var C=SR(),w=CR();(Dn!==o||Kt!==l)&&(Vm=null,mu(o,l)),l=!1;var N=Zn;e:do try{if(bn!==0&&Ht!==null){var P=Ht,X=Va;switch(bn){case 8:r0(),N=6;break e;case 3:case 2:case 9:case 6:Fa.current===null&&(l=!0);var de=bn;if(bn=0,Va=null,pu(o,P,X,de),d&&du){N=0;break e}break;default:de=bn,bn=0,Va=null,pu(o,P,X,de)}}Bk(),N=Zn;break}catch(ve){vR(o,ve)}while(!0);return l&&o.shellSuspendCounter++,Lo=Bl=null,xn=p,I.H=C,I.A=w,Ht===null&&(Dn=null,Kt=0,um()),N}function Bk(){for(;Ht!==null;)ER(Ht)}function Gk(o,l){var d=xn;xn|=2;var p=SR(),C=CR();Dn!==o||Kt!==l?(Vm=null,Hm=je()+500,mu(o,l)):du=Zt(o,l);e:do try{if(bn!==0&&Ht!==null){l=Ht;var w=Va;t:switch(bn){case 1:bn=0,Va=null,pu(o,l,w,1);break;case 2:case 9:if(IE(w)){bn=0,Va=null,wR(l);break}l=function(){bn!==2&&bn!==9||Dn!==o||(bn=7),no(o)},w.then(l,l);break e;case 3:bn=7;break e;case 4:bn=5;break e;case 7:IE(w)?(bn=0,Va=null,wR(l)):(bn=0,Va=null,pu(o,l,w,7));break;case 5:var N=null;switch(Ht.tag){case 26:N=Ht.memoizedState;case 5:case 27:var P=Ht;if(N?cj(N):P.stateNode.complete){bn=0,Va=null;var X=P.sibling;if(X!==null)Ht=X;else{var de=P.return;de!==null?(Ht=de,Gm(de)):Ht=null}break t}}bn=0,Va=null,pu(o,l,w,5);break;case 6:bn=0,Va=null,pu(o,l,w,6);break;case 8:r0(),Zn=6;break e;default:throw Error(r(462))}}qk();break}catch(ve){vR(o,ve)}while(!0);return Lo=Bl=null,I.H=p,I.A=C,xn=d,Ht!==null?0:(Dn=null,Kt=0,um(),Zn)}function qk(){for(;Ht!==null&&!ce();)ER(Ht)}function ER(o){var l=Kw(o.alternate,o,qo);o.memoizedProps=o.pendingProps,l===null?Gm(o):Ht=l}function wR(o){var l=o,d=l.alternate;switch(l.tag){case 15:case 0:l=Hw(d,l,l.pendingProps,l.type,void 0,Kt);break;case 11:l=Hw(d,l,l.pendingProps,l.type.render,l.ref,Kt);break;case 5:vv(l);default:Yw(d,l),l=Ht=CE(l,qo),l=Kw(d,l,qo)}o.memoizedProps=o.pendingProps,l===null?Gm(o):Ht=l}function pu(o,l,d,p){Lo=Bl=null,vv(l),au=null,Bd=0;var C=l.return;try{if(Mk(o,C,l,d,Kt)){Zn=1,Om(o,is(d,o.current)),Ht=null;return}}catch(w){if(C!==null)throw Ht=C,w;Zn=1,Om(o,is(d,o.current)),Ht=null;return}l.flags&32768?(Qt||p===1?o=!0:du||(Kt&536870912)!==0?o=!1:(Mi=o=!0,(p===2||p===9||p===3||p===6)&&(p=Fa.current,p!==null&&p.tag===13&&(p.flags|=16384))),RR(l,o)):Gm(l)}function Gm(o){var l=o;do{if((l.flags&32768)!==0){RR(l,Mi);return}o=l.return;var d=Pk(l.alternate,l,qo);if(d!==null){Ht=d;return}if(l=l.sibling,l!==null){Ht=l;return}Ht=l=o}while(l!==null);Zn===0&&(Zn=5)}function RR(o,l){do{var d=Uk(o.alternate,o);if(d!==null){d.flags&=32767,Ht=d;return}if(d=o.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(o=o.sibling,o!==null)){Ht=o;return}Ht=o=d}while(o!==null);Zn=6,Ht=null}function jR(o,l,d,p,C,w,N,P,X){o.cancelPendingCommit=null;do qm();while(gr!==0);if((xn&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=qy,rn(o,d,w,N,P,X),o===Dn&&(Ht=Dn=null,Kt=0),hu=l,Pi=o,Ko=d,e0=w,t0=C,pR=p,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,Zk(st,function(){return DR(),null})):(o.callbackNode=null,o.callbackPriority=0),p=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||p){p=I.T,I.T=null,C=K.p,K.p=2,N=xn,xn|=4;try{zk(o,l,d)}finally{xn=N,K.p=C,I.T=p}}gr=1,TR(),_R(),NR()}}function TR(){if(gr===1){gr=0;var o=Pi,l=hu,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=I.T,I.T=null;var p=K.p;K.p=2;var C=xn;xn|=4;try{iR(l,o);var w=g0,N=hE(o.containerInfo),P=w.focusedElem,X=w.selectionRange;if(N!==P&&P&&P.ownerDocument&&fE(P.ownerDocument.documentElement,P)){if(X!==null&&Hy(P)){var de=X.start,ve=X.end;if(ve===void 0&&(ve=de),"selectionStart"in P)P.selectionStart=de,P.selectionEnd=Math.min(ve,P.value.length);else{var Se=P.ownerDocument||document,he=Se&&Se.defaultView||window;if(he.getSelection){var ge=he.getSelection(),qe=P.textContent.length,ot=Math.min(X.start,qe),jn=X.end===void 0?ot:Math.min(X.end,qe);!ge.extend&&ot>jn&&(N=jn,jn=ot,ot=N);var oe=dE(P,ot),ne=dE(P,jn);if(oe&&ne&&(ge.rangeCount!==1||ge.anchorNode!==oe.node||ge.anchorOffset!==oe.offset||ge.focusNode!==ne.node||ge.focusOffset!==ne.offset)){var ue=Se.createRange();ue.setStart(oe.node,oe.offset),ge.removeAllRanges(),ot>jn?(ge.addRange(ue),ge.extend(ne.node,ne.offset)):(ue.setEnd(ne.node,ne.offset),ge.addRange(ue))}}}}for(Se=[],ge=P;ge=ge.parentNode;)ge.nodeType===1&&Se.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Se.length;P++){var be=Se[P];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}ap=!!p0,g0=p0=null}finally{xn=C,K.p=p,I.T=d}}o.current=l,gr=2}}function _R(){if(gr===2){gr=0;var o=Pi,l=hu,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=I.T,I.T=null;var p=K.p;K.p=2;var C=xn;xn|=4;try{nR(o,l.alternate,l)}finally{xn=C,K.p=p,I.T=d}}gr=3}}function NR(){if(gr===4||gr===3){gr=0,Ie();var o=Pi,l=hu,d=Ko,p=pR;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?gr=5:(gr=0,hu=Pi=null,AR(o,o.pendingLanes));var C=o.pendingLanes;if(C===0&&(Li=null),Ce(d),l=l.stateNode,pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot(ea,l,void 0,(l.current.flags&128)===128)}catch{}if(p!==null){l=I.T,C=K.p,K.p=2,I.T=null;try{for(var w=o.onRecoverableError,N=0;N<p.length;N++){var P=p[N];w(P.value,{componentStack:P.stack})}}finally{I.T=l,K.p=C}}(Ko&3)!==0&&qm(),no(o),C=o.pendingLanes,(d&261930)!==0&&(C&42)!==0?o===n0?lf++:(lf=0,n0=o):lf=0,cf(0)}}function AR(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Vd(l)))}function qm(){return TR(),_R(),NR(),DR()}function DR(){if(gr!==5)return!1;var o=Pi,l=e0;e0=0;var d=Ce(Ko),p=I.T,C=K.p;try{K.p=32>d?32:d,I.T=null,d=t0,t0=null;var w=Pi,N=Ko;if(gr=0,hu=Pi=null,Ko=0,(xn&6)!==0)throw Error(r(331));var P=xn;if(xn|=4,fR(w.current),cR(w,w.current,N,d),xn=P,cf(0,!1),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot(ea,w)}catch{}return!0}finally{K.p=C,I.T=p,AR(o,l)}}function OR(o,l,d){l=is(d,l),l=Mv(o.stateNode,l,2),o=Ai(o,l,2),o!==null&&(an(o,2),no(o))}function Sn(o,l,d){if(o.tag===3)OR(o,o,d);else for(;l!==null;){if(l.tag===3){OR(l,o,d);break}else if(l.tag===1){var p=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Li===null||!Li.has(p))){o=is(d,o),d=Iw(2),p=Ai(l,d,2),p!==null&&(Mw(d,p,l,o),an(p,2),no(p));break}}l=l.return}}function s0(o,l,d){var p=o.pingCache;if(p===null){p=o.pingCache=new Vk;var C=new Set;p.set(l,C)}else C=p.get(l),C===void 0&&(C=new Set,p.set(l,C));C.has(d)||(Xv=!0,C.add(d),o=Kk.bind(null,o,l,d),l.then(o,o))}function Kk(o,l,d){var p=o.pingCache;p!==null&&p.delete(l),o.pingedLanes|=o.suspendedLanes&d,o.warmLanes&=~d,Dn===o&&(Kt&d)===d&&(Zn===4||Zn===3&&(Kt&62914560)===Kt&&300>je()-Fm?(xn&2)===0&&mu(o,0):Qv|=d,fu===Kt&&(fu=0)),no(o)}function IR(o,l){l===0&&(l=Xt()),o=Hl(o,l),o!==null&&(an(o,l),no(o))}function Wk(o){var l=o.memoizedState,d=0;l!==null&&(d=l.retryLane),IR(o,d)}function Yk(o,l){var d=0;switch(o.tag){case 31:case 13:var p=o.stateNode,C=o.memoizedState;C!==null&&(d=C.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),IR(o,d)}function Zk(o,l){return Y(o,l)}var Km=null,gu=null,o0=!1,Wm=!1,i0=!1,zi=0;function no(o){o!==gu&&o.next===null&&(gu===null?Km=gu=o:gu=gu.next=o),Wm=!0,o0||(o0=!0,Qk())}function cf(o,l){if(!i0&&Wm){i0=!0;do for(var d=!1,p=Km;p!==null;){if(o!==0){var C=p.pendingLanes;if(C===0)var w=0;else{var N=p.suspendedLanes,P=p.pingedLanes;w=(1<<31-kn(42|o)+1)-1,w&=C&~(N&~P),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,PR(p,w))}else w=Kt,w=Ze(p,p===Dn?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||Zt(p,w)||(d=!0,PR(p,w));p=p.next}while(d);i0=!1}}function Xk(){MR()}function MR(){Wm=o0=!1;var o=0;zi!==0&&l9()&&(o=zi);for(var l=je(),d=null,p=Km;p!==null;){var C=p.next,w=kR(p,l);w===0?(p.next=null,d===null?Km=C:d.next=C,C===null&&(gu=d)):(d=p,(o!==0||(w&3)!==0)&&(Wm=!0)),p=C}gr!==0&&gr!==5||cf(o),zi!==0&&(zi=0)}function kR(o,l){for(var d=o.suspendedLanes,p=o.pingedLanes,C=o.expirationTimes,w=o.pendingLanes&-62914561;0<w;){var N=31-kn(w),P=1<<N,X=C[N];X===-1?((P&d)===0||(P&p)!==0)&&(C[N]=nn(P,l)):X<=l&&(o.expiredLanes|=P),w&=~P}if(l=Dn,d=Kt,d=Ze(o,o===l?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p=o.callbackNode,d===0||o===l&&(bn===2||bn===9)||o.cancelPendingCommit!==null)return p!==null&&p!==null&&re(p),o.callbackNode=null,o.callbackPriority=0;if((d&3)===0||Zt(o,d)){if(l=d&-d,l===o.callbackPriority)return l;switch(p!==null&&re(p),Ce(d)){case 2:case 8:d=bt;break;case 32:d=st;break;case 268435456:d=or;break;default:d=st}return p=LR.bind(null,o),d=Y(d,p),o.callbackPriority=l,o.callbackNode=d,l}return p!==null&&p!==null&&re(p),o.callbackPriority=2,o.callbackNode=null,2}function LR(o,l){if(gr!==0&&gr!==5)return o.callbackNode=null,o.callbackPriority=0,null;var d=o.callbackNode;if(qm()&&o.callbackNode!==d)return null;var p=Kt;return p=Ze(o,o===Dn?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),p===0?null:(xR(o,p,l),kR(o,je()),o.callbackNode!=null&&o.callbackNode===d?LR.bind(null,o):null)}function PR(o,l){if(qm())return null;xR(o,l,!0)}function Qk(){u9(function(){(xn&6)!==0?Y(Ve,Xk):MR()})}function l0(){if(zi===0){var o=tu;o===0&&(o=Ma,Ma<<=1,(Ma&261888)===0&&(Ma=256)),zi=o}return zi}function UR(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:nm(""+o)}function zR(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 Jk(o,l,d,p,C){if(l==="submit"&&d&&d.stateNode===C){var w=UR((C[ze]||null).action),N=p.submitter;N&&(l=(l=N[ze]||null)?UR(l.formAction):N.getAttribute("formAction"),l!==null&&(w=l,N=null));var P=new om("action","action",null,p,C);o.push({event:P,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(zi!==0){var X=N?zR(C,N):new FormData(C);_v(d,{pending:!0,data:X,method:C.method,action:w},null,X)}}else typeof w=="function"&&(P.preventDefault(),X=N?zR(C,N):new FormData(C),_v(d,{pending:!0,data:X,method:C.method,action:w},w,X))},currentTarget:C}]})}}for(var c0=0;c0<Gy.length;c0++){var u0=Gy[c0],e9=u0.toLowerCase(),t9=u0[0].toUpperCase()+u0.slice(1);_s(e9,"on"+t9)}_s(gE,"onAnimationEnd"),_s(xE,"onAnimationIteration"),_s(yE,"onAnimationStart"),_s("dblclick","onDoubleClick"),_s("focusin","onFocus"),_s("focusout","onBlur"),_s(xk,"onTransitionRun"),_s(yk,"onTransitionStart"),_s(vk,"onTransitionCancel"),_s(vE,"onTransitionEnd"),xa("onMouseEnter",["mouseout","mouseover"]),xa("onMouseLeave",["mouseout","mouseover"]),xa("onPointerEnter",["pointerout","pointerover"]),xa("onPointerLeave",["pointerout","pointerover"]),Pa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uf="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(" "),n9=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uf));function FR(o,l){l=(l&4)!==0;for(var d=0;d<o.length;d++){var p=o[d],C=p.event;p=p.listeners;e:{var w=void 0;if(l)for(var N=p.length-1;0<=N;N--){var P=p[N],X=P.instance,de=P.currentTarget;if(P=P.listener,X!==w&&C.isPropagationStopped())break e;w=P,C.currentTarget=de;try{w(C)}catch(ve){cm(ve)}C.currentTarget=null,w=X}else for(N=0;N<p.length;N++){if(P=p[N],X=P.instance,de=P.currentTarget,P=P.listener,X!==w&&C.isPropagationStopped())break e;w=P,C.currentTarget=de;try{w(C)}catch(ve){cm(ve)}C.currentTarget=null,w=X}}}}function Vt(o,l){var d=l[at];d===void 0&&(d=l[at]=new Set);var p=o+"__bubble";d.has(p)||(HR(l,o,2,!1),d.add(p))}function d0(o,l,d){var p=0;l&&(p|=4),HR(d,o,p,l)}var Ym="_reactListening"+Math.random().toString(36).slice(2);function f0(o){if(!o[Ym]){o[Ym]=!0,La.forEach(function(d){d!=="selectionchange"&&(n9.has(d)||d0(d,!1,o),d0(d,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Ym]||(l[Ym]=!0,d0("selectionchange",!1,l))}}function HR(o,l,d,p){switch(gj(l)){case 2:var C=A9;break;case 8:C=D9;break;default:C=T0}d=C.bind(null,l,d,o),C=void 0,!Oy||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),p?C!==void 0?o.addEventListener(l,d,{capture:!0,passive:C}):o.addEventListener(l,d,!0):C!==void 0?o.addEventListener(l,d,{passive:C}):o.addEventListener(l,d,!1)}function h0(o,l,d,p,C){var w=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 P=p.stateNode.containerInfo;if(P===C)break;if(N===4)for(N=p.return;N!==null;){var X=N.tag;if((X===3||X===4)&&N.stateNode.containerInfo===C)return;N=N.return}for(;P!==null;){if(N=cn(P),N===null)return;if(X=N.tag,X===5||X===6||X===26||X===27){p=w=N;continue e}P=P.parentNode}}p=p.return}qC(function(){var de=w,ve=Ay(d),Se=[];e:{var he=bE.get(o);if(he!==void 0){var ge=om,qe=o;switch(o){case"keypress":if(am(d)===0)break e;case"keydown":case"keyup":ge=Y8;break;case"focusin":qe="focus",ge=Ly;break;case"focusout":qe="blur",ge=Ly;break;case"beforeblur":case"afterblur":ge=Ly;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":ge=YC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=P8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=Q8;break;case gE:case xE:case yE:ge=F8;break;case vE:ge=ek;break;case"scroll":case"scrollend":ge=k8;break;case"wheel":ge=nk;break;case"copy":case"cut":case"paste":ge=V8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=XC;break;case"toggle":case"beforetoggle":ge=ak}var ot=(l&4)!==0,jn=!ot&&(o==="scroll"||o==="scrollend"),oe=ot?he!==null?he+"Capture":null:he;ot=[];for(var ne=de,ue;ne!==null;){var be=ne;if(ue=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ue===null||oe===null||(be=Dd(ne,oe),be!=null&&ot.push(df(ne,be,ue))),jn)break;ne=ne.return}0<ot.length&&(he=new ge(he,qe,null,d,ve),Se.push({event:he,listeners:ot}))}}if((l&7)===0){e:{if(he=o==="mouseover"||o==="pointerover",ge=o==="mouseout"||o==="pointerout",he&&d!==Ny&&(qe=d.relatedTarget||d.fromElement)&&(cn(qe)||qe[Qe]))break e;if((ge||he)&&(he=ve.window===ve?ve:(he=ve.ownerDocument)?he.defaultView||he.parentWindow:window,ge?(qe=d.relatedTarget||d.toElement,ge=de,qe=qe?cn(qe):null,qe!==null&&(jn=i(qe),ot=qe.tag,qe!==jn||ot!==5&&ot!==27&&ot!==6)&&(qe=null)):(ge=null,qe=de),ge!==qe)){if(ot=YC,be="onMouseLeave",oe="onMouseEnter",ne="mouse",(o==="pointerout"||o==="pointerover")&&(ot=XC,be="onPointerLeave",oe="onPointerEnter",ne="pointer"),jn=ge==null?he:ka(ge),ue=qe==null?he:ka(qe),he=new ot(be,ne+"leave",ge,d,ve),he.target=jn,he.relatedTarget=ue,be=null,cn(ve)===de&&(ot=new ot(oe,ne+"enter",qe,d,ve),ot.target=ue,ot.relatedTarget=jn,be=ot),jn=be,ge&&qe)t:{for(ot=r9,oe=ge,ne=qe,ue=0,be=oe;be;be=ot(be))ue++;be=0;for(var rt=ne;rt;rt=ot(rt))be++;for(;0<ue-be;)oe=ot(oe),ue--;for(;0<be-ue;)ne=ot(ne),be--;for(;ue--;){if(oe===ne||ne!==null&&oe===ne.alternate){ot=oe;break t}oe=ot(oe),ne=ot(ne)}ot=null}else ot=null;ge!==null&&VR(Se,he,ge,ot,!1),qe!==null&&jn!==null&&VR(Se,jn,qe,ot,!0)}}e:{if(he=de?ka(de):window,ge=he.nodeName&&he.nodeName.toLowerCase(),ge==="select"||ge==="input"&&he.type==="file")var fn=sE;else if(rE(he))if(oE)fn=mk;else{fn=fk;var Xe=dk}else ge=he.nodeName,!ge||ge.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?de&&_y(de.elementType)&&(fn=sE):fn=hk;if(fn&&(fn=fn(o,de))){aE(Se,fn,d,ve);break e}Xe&&Xe(o,he,de),o==="focusout"&&de&&he.type==="number"&&de.memoizedProps.value!=null&&Ty(he,"number",he.value)}switch(Xe=de?ka(de):window,o){case"focusin":(rE(Xe)||Xe.contentEditable==="true")&&(Kc=Xe,Vy=de,zd=null);break;case"focusout":zd=Vy=Kc=null;break;case"mousedown":$y=!0;break;case"contextmenu":case"mouseup":case"dragend":$y=!1,mE(Se,d,ve);break;case"selectionchange":if(gk)break;case"keydown":case"keyup":mE(Se,d,ve)}var Mt;if(Uy)e:{switch(o){case"compositionstart":var Wt="onCompositionStart";break e;case"compositionend":Wt="onCompositionEnd";break e;case"compositionupdate":Wt="onCompositionUpdate";break e}Wt=void 0}else qc?tE(o,d)&&(Wt="onCompositionEnd"):o==="keydown"&&d.keyCode===229&&(Wt="onCompositionStart");Wt&&(QC&&d.locale!=="ko"&&(qc||Wt!=="onCompositionStart"?Wt==="onCompositionEnd"&&qc&&(Mt=KC()):(Ei=ve,Iy="value"in Ei?Ei.value:Ei.textContent,qc=!0)),Xe=Zm(de,Wt),0<Xe.length&&(Wt=new ZC(Wt,o,null,d,ve),Se.push({event:Wt,listeners:Xe}),Mt?Wt.data=Mt:(Mt=nE(d),Mt!==null&&(Wt.data=Mt)))),(Mt=ok?ik(o,d):lk(o,d))&&(Wt=Zm(de,"onBeforeInput"),0<Wt.length&&(Xe=new ZC("onBeforeInput","beforeinput",null,d,ve),Se.push({event:Xe,listeners:Wt}),Xe.data=Mt)),Jk(Se,o,de,d,ve)}FR(Se,l)})}function df(o,l,d){return{instance:o,listener:l,currentTarget:d}}function Zm(o,l){for(var d=l+"Capture",p=[];o!==null;){var C=o,w=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||w===null||(C=Dd(o,d),C!=null&&p.unshift(df(o,C,w)),C=Dd(o,l),C!=null&&p.push(df(o,C,w))),o.tag===3)return p;o=o.return}return[]}function r9(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function VR(o,l,d,p,C){for(var w=l._reactName,N=[];d!==null&&d!==p;){var P=d,X=P.alternate,de=P.stateNode;if(P=P.tag,X!==null&&X===p)break;P!==5&&P!==26&&P!==27||de===null||(X=de,C?(de=Dd(d,w),de!=null&&N.unshift(df(d,de,X))):C||(de=Dd(d,w),de!=null&&N.push(df(d,de,X)))),d=d.return}N.length!==0&&o.push({event:l,listeners:N})}var a9=/\r\n?/g,s9=/\u0000|\uFFFD/g;function $R(o){return(typeof o=="string"?o:""+o).replace(a9,`
49
+ `).replace(s9,"")}function BR(o,l){return l=$R(l),$R(o)===l}function Rn(o,l,d,p,C,w){switch(d){case"children":typeof p=="string"?l==="body"||l==="textarea"&&p===""||$c(o,p):(typeof p=="number"||typeof p=="bigint")&&l!=="body"&&$c(o,""+p);break;case"className":as(o,"class",p);break;case"tabIndex":as(o,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":as(o,d,p);break;case"style":BC(o,p,w);break;case"data":if(l!=="object"){as(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=nm(""+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 w=="function"&&(d==="formAction"?(l!=="input"&&Rn(o,l,"name",C.name,C,null),Rn(o,l,"formEncType",C.formEncType,C,null),Rn(o,l,"formMethod",C.formMethod,C,null),Rn(o,l,"formTarget",C.formTarget,C,null)):(Rn(o,l,"encType",C.encType,C,null),Rn(o,l,"method",C.method,C,null),Rn(o,l,"target",C.target,C,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){o.removeAttribute(d);break}p=nm(""+p),o.setAttribute(d,p);break;case"onClick":p!=null&&(o.onclick=Oo);break;case"onScroll":p!=null&&Vt("scroll",o);break;case"onScrollEnd":p!=null&&Vt("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(C.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=nm(""+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":Vt("beforetoggle",o),Vt("toggle",o),Ts(o,"popover",p);break;case"xlinkActuate":dn(o,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":dn(o,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":dn(o,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":dn(o,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":dn(o,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":dn(o,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":dn(o,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":dn(o,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":dn(o,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Ts(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=I8.get(d)||d,Ts(o,d,p))}}function m0(o,l,d,p,C,w){switch(d){case"style":BC(o,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(d=p.__html,d!=null){if(C.children!=null)throw Error(r(60));o.innerHTML=d}}break;case"children":typeof p=="string"?$c(o,p):(typeof p=="number"||typeof p=="bigint")&&$c(o,""+p);break;case"onScroll":p!=null&&Vt("scroll",o);break;case"onScrollEnd":p!=null&&Vt("scrollend",o);break;case"onClick":p!=null&&(o.onclick=Oo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fc.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(C=d.endsWith("Capture"),l=d.slice(2,C?d.length-7:void 0),w=o[ze]||null,w=w!=null?w[d]:null,typeof w=="function"&&o.removeEventListener(l,w,C),typeof p=="function")){typeof w!="function"&&w!==null&&(d in o?o[d]=null:o.hasAttribute(d)&&o.removeAttribute(d)),o.addEventListener(l,p,C);break e}d in o?o[d]=p:p===!0?o.setAttribute(d,""):Ts(o,d,p)}}}function Hr(o,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Vt("error",o),Vt("load",o);var p=!1,C=!1,w;for(w in d)if(d.hasOwnProperty(w)){var N=d[w];if(N!=null)switch(w){case"src":p=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Rn(o,l,w,N,d,null)}}C&&Rn(o,l,"srcSet",d.srcSet,d,null),p&&Rn(o,l,"src",d.src,d,null);return;case"input":Vt("invalid",o);var P=w=N=C=null,X=null,de=null;for(p in d)if(d.hasOwnProperty(p)){var ve=d[p];if(ve!=null)switch(p){case"name":C=ve;break;case"type":N=ve;break;case"checked":X=ve;break;case"defaultChecked":de=ve;break;case"value":w=ve;break;case"defaultValue":P=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,l));break;default:Rn(o,l,p,ve,d,null)}}FC(o,w,P,X,de,N,C,!1);return;case"select":Vt("invalid",o),p=N=w=null;for(C in d)if(d.hasOwnProperty(C)&&(P=d[C],P!=null))switch(C){case"value":w=P;break;case"defaultValue":N=P;break;case"multiple":p=P;default:Rn(o,l,C,P,d,null)}l=w,d=N,o.multiple=!!p,l!=null?Vc(o,!!p,l,!1):d!=null&&Vc(o,!!p,d,!0);return;case"textarea":Vt("invalid",o),w=C=p=null;for(N in d)if(d.hasOwnProperty(N)&&(P=d[N],P!=null))switch(N){case"value":p=P;break;case"defaultValue":C=P;break;case"children":w=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:Rn(o,l,N,P,d,null)}VC(o,p,C,w);return;case"option":for(X in d)if(d.hasOwnProperty(X)&&(p=d[X],p!=null))switch(X){case"selected":o.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Rn(o,l,X,p,d,null)}return;case"dialog":Vt("beforetoggle",o),Vt("toggle",o),Vt("cancel",o),Vt("close",o);break;case"iframe":case"object":Vt("load",o);break;case"video":case"audio":for(p=0;p<uf.length;p++)Vt(uf[p],o);break;case"image":Vt("error",o),Vt("load",o);break;case"details":Vt("toggle",o);break;case"embed":case"source":case"link":Vt("error",o),Vt("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(_y(l)){for(ve in d)d.hasOwnProperty(ve)&&(p=d[ve],p!==void 0&&m0(o,l,ve,p,d,void 0));return}}for(P in d)d.hasOwnProperty(P)&&(p=d[P],p!=null&&Rn(o,l,P,p,d,null))}function o9(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 C=null,w=null,N=null,P=null,X=null,de=null,ve=null;for(ge in d){var Se=d[ge];if(d.hasOwnProperty(ge)&&Se!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":X=Se;default:p.hasOwnProperty(ge)||Rn(o,l,ge,null,p,Se)}}for(var he in p){var ge=p[he];if(Se=d[he],p.hasOwnProperty(he)&&(ge!=null||Se!=null))switch(he){case"type":w=ge;break;case"name":C=ge;break;case"checked":de=ge;break;case"defaultChecked":ve=ge;break;case"value":N=ge;break;case"defaultValue":P=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,l));break;default:ge!==Se&&Rn(o,l,he,ge,p,Se)}}jy(o,N,P,X,de,ve,w,C);return;case"select":ge=N=P=he=null;for(w in d)if(X=d[w],d.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":ge=X;default:p.hasOwnProperty(w)||Rn(o,l,w,null,p,X)}for(C in p)if(w=p[C],X=d[C],p.hasOwnProperty(C)&&(w!=null||X!=null))switch(C){case"value":he=w;break;case"defaultValue":P=w;break;case"multiple":N=w;default:w!==X&&Rn(o,l,C,w,p,X)}l=P,d=N,p=ge,he!=null?Vc(o,!!d,he,!1):!!p!=!!d&&(l!=null?Vc(o,!!d,l,!0):Vc(o,!!d,d?[]:"",!1));return;case"textarea":ge=he=null;for(P in d)if(C=d[P],d.hasOwnProperty(P)&&C!=null&&!p.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Rn(o,l,P,null,p,C)}for(N in p)if(C=p[N],w=d[N],p.hasOwnProperty(N)&&(C!=null||w!=null))switch(N){case"value":he=C;break;case"defaultValue":ge=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:C!==w&&Rn(o,l,N,C,p,w)}HC(o,he,ge);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(X in p)if(he=p[X],ge=d[X],p.hasOwnProperty(X)&&he!==ge&&(he!=null||ge!=null))switch(X){case"selected":o.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:Rn(o,l,X,he,p,ge)}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],ge=d[de],p.hasOwnProperty(de)&&he!==ge&&(he!=null||ge!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,l));break;default:Rn(o,l,de,he,p,ge)}return;default:if(_y(l)){for(var jn in d)he=d[jn],d.hasOwnProperty(jn)&&he!==void 0&&!p.hasOwnProperty(jn)&&m0(o,l,jn,void 0,p,he);for(ve in p)he=p[ve],ge=d[ve],!p.hasOwnProperty(ve)||he===ge||he===void 0&&ge===void 0||m0(o,l,ve,he,p,ge);return}}for(var oe in d)he=d[oe],d.hasOwnProperty(oe)&&he!=null&&!p.hasOwnProperty(oe)&&Rn(o,l,oe,null,p,he);for(Se in p)he=p[Se],ge=d[Se],!p.hasOwnProperty(Se)||he===ge||he==null&&ge==null||Rn(o,l,Se,he,p,ge)}function GR(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i9(){if(typeof performance.getEntriesByType=="function"){for(var o=0,l=0,d=performance.getEntriesByType("resource"),p=0;p<d.length;p++){var C=d[p],w=C.transferSize,N=C.initiatorType,P=C.duration;if(w&&P&&GR(N)){for(N=0,P=C.responseEnd,p+=1;p<d.length;p++){var X=d[p],de=X.startTime;if(de>P)break;var ve=X.transferSize,Se=X.initiatorType;ve&&GR(Se)&&(X=X.responseEnd,N+=ve*(X<P?1:(P-de)/(X-de)))}if(--p,l+=8*(w+N)/(C.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 p0=null,g0=null;function Xm(o){return o.nodeType===9?o:o.ownerDocument}function qR(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 KR(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 x0(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 y0=null;function l9(){var o=window.event;return o&&o.type==="popstate"?o===y0?!1:(y0=o,!0):(y0=null,!1)}var WR=typeof setTimeout=="function"?setTimeout:void 0,c9=typeof clearTimeout=="function"?clearTimeout:void 0,YR=typeof Promise=="function"?Promise:void 0,u9=typeof queueMicrotask=="function"?queueMicrotask:typeof YR<"u"?function(o){return YR.resolve(null).then(o).catch(d9)}:WR;function d9(o){setTimeout(function(){throw o})}function Fi(o){return o==="head"}function ZR(o,l){var d=l,p=0;do{var C=d.nextSibling;if(o.removeChild(d),C&&C.nodeType===8)if(d=C.data,d==="/$"||d==="/&"){if(p===0){o.removeChild(C),bu(l);return}p--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")p++;else if(d==="html")ff(o.ownerDocument.documentElement);else if(d==="head"){d=o.ownerDocument.head,ff(d);for(var w=d.firstChild;w;){var N=w.nextSibling,P=w.nodeName;w[Ln]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=N}}else d==="body"&&ff(o.ownerDocument.body);d=C}while(d);bu(l)}function XR(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 v0(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":v0(d),Wn(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}o.removeChild(d)}}function f9(o,l,d,p){for(;o.nodeType===1;){var C=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(w=o.getAttribute("rel"),w==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(w!==C.rel||o.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||o.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||o.getAttribute("title")!==(C.title==null?null:C.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(w=o.getAttribute("src"),(w!==(C.src==null?null:C.src)||o.getAttribute("type")!==(C.type==null?null:C.type)||o.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&w&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var w=C.name==null?null:""+C.name;if(C.type==="hidden"&&o.getAttribute("name")===w)return o}else return o;if(o=fs(o.nextSibling),o===null)break}return null}function h9(o,l,d){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!d||(o=fs(o.nextSibling),o===null))return null;return o}function QR(o,l){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!l||(o=fs(o.nextSibling),o===null))return null;return o}function b0(o){return o.data==="$?"||o.data==="$~"}function S0(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function m9(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 fs(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 C0=null;function JR(o){o=o.nextSibling;for(var l=0;o;){if(o.nodeType===8){var d=o.data;if(d==="/$"||d==="/&"){if(l===0)return fs(o.nextSibling);l--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||l++}o=o.nextSibling}return null}function ej(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 tj(o,l,d){switch(l=Xm(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 ff(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Wn(o)}var hs=new Map,nj=new Set;function Qm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Wo=K.d;K.d={f:p9,r:g9,D:x9,C:y9,L:v9,m:b9,X:C9,S:S9,M:E9};function p9(){var o=Wo.f(),l=$m();return o||l}function g9(o){var l=un(o);l!==null&&l.tag===5&&l.type==="form"?vw(l):Wo.r(o)}var xu=typeof document>"u"?null:document;function rj(o,l,d){var p=xu;if(p&&typeof l=="string"&&l){var C=ss(l);C='link[rel="'+o+'"][href="'+C+'"]',typeof d=="string"&&(C+='[crossorigin="'+d+'"]'),nj.has(C)||(nj.add(C),o={rel:o,crossOrigin:d,href:l},p.querySelector(C)===null&&(l=p.createElement("link"),Hr(l,"link",o),An(l),p.head.appendChild(l)))}}function x9(o){Wo.D(o),rj("dns-prefetch",o,null)}function y9(o,l){Wo.C(o,l),rj("preconnect",o,l)}function v9(o,l,d){Wo.L(o,l,d);var p=xu;if(p&&o&&l){var C='link[rel="preload"][as="'+ss(l)+'"]';l==="image"&&d&&d.imageSrcSet?(C+='[imagesrcset="'+ss(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(C+='[imagesizes="'+ss(d.imageSizes)+'"]')):C+='[href="'+ss(o)+'"]';var w=C;switch(l){case"style":w=yu(o);break;case"script":w=vu(o)}hs.has(w)||(o=g({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:o,as:l},d),hs.set(w,o),p.querySelector(C)!==null||l==="style"&&p.querySelector(hf(w))||l==="script"&&p.querySelector(mf(w))||(l=p.createElement("link"),Hr(l,"link",o),An(l),p.head.appendChild(l)))}}function b9(o,l){Wo.m(o,l);var d=xu;if(d&&o){var p=l&&typeof l.as=="string"?l.as:"script",C='link[rel="modulepreload"][as="'+ss(p)+'"][href="'+ss(o)+'"]',w=C;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=vu(o)}if(!hs.has(w)&&(o=g({rel:"modulepreload",href:o},l),hs.set(w,o),d.querySelector(C)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(mf(w)))return}p=d.createElement("link"),Hr(p,"link",o),An(p),d.head.appendChild(p)}}}function S9(o,l,d){Wo.S(o,l,d);var p=xu;if(p&&o){var C=rs(p).hoistableStyles,w=yu(o);l=l||"default";var N=C.get(w);if(!N){var P={loading:0,preload:null};if(N=p.querySelector(hf(w)))P.loading=5;else{o=g({rel:"stylesheet",href:o,"data-precedence":l},d),(d=hs.get(w))&&E0(o,d);var X=N=p.createElement("link");An(X),Hr(X,"link",o),X._p=new Promise(function(de,ve){X.onload=de,X.onerror=ve}),X.addEventListener("load",function(){P.loading|=1}),X.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Jm(N,l,p)}N={type:"stylesheet",instance:N,count:1,state:P},C.set(w,N)}}}function C9(o,l){Wo.X(o,l);var d=xu;if(d&&o){var p=rs(d).hoistableScripts,C=vu(o),w=p.get(C);w||(w=d.querySelector(mf(C)),w||(o=g({src:o,async:!0},l),(l=hs.get(C))&&w0(o,l),w=d.createElement("script"),An(w),Hr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(C,w))}}function E9(o,l){Wo.M(o,l);var d=xu;if(d&&o){var p=rs(d).hoistableScripts,C=vu(o),w=p.get(C);w||(w=d.querySelector(mf(C)),w||(o=g({src:o,async:!0,type:"module"},l),(l=hs.get(C))&&w0(o,l),w=d.createElement("script"),An(w),Hr(w,"link",o),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(C,w))}}function aj(o,l,d,p){var C=(C=le.current)?Qm(C):null;if(!C)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=yu(d.href),d=rs(C).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=yu(d.href);var w=rs(C).hoistableStyles,N=w.get(o);if(N||(C=C.ownerDocument||C,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(o,N),(w=C.querySelector(hf(o)))&&!w._p&&(N.instance=w,N.state.loading=5),hs.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},hs.set(o,d),w||w9(C,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=vu(d),d=rs(C).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 yu(o){return'href="'+ss(o)+'"'}function hf(o){return'link[rel="stylesheet"]['+o+"]"}function sj(o){return g({},o,{"data-precedence":o.precedence,precedence:null})}function w9(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}),Hr(l,"link",d),An(l),o.head.appendChild(l))}function vu(o){return'[src="'+ss(o)+'"]'}function mf(o){return"script[async]"+o}function oj(o,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var p=o.querySelector('style[data-href~="'+ss(d.href)+'"]');if(p)return l.instance=p,An(p),p;var C=g({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return p=(o.ownerDocument||o).createElement("style"),An(p),Hr(p,"style",C),Jm(p,d.precedence,o),l.instance=p;case"stylesheet":C=yu(d.href);var w=o.querySelector(hf(C));if(w)return l.state.loading|=4,l.instance=w,An(w),w;p=sj(d),(C=hs.get(C))&&E0(p,C),w=(o.ownerDocument||o).createElement("link"),An(w);var N=w;return N._p=new Promise(function(P,X){N.onload=P,N.onerror=X}),Hr(w,"link",p),l.state.loading|=4,Jm(w,d.precedence,o),l.instance=w;case"script":return w=vu(d.src),(C=o.querySelector(mf(w)))?(l.instance=C,An(C),C):(p=d,(C=hs.get(w))&&(p=g({},d),w0(p,C)),o=o.ownerDocument||o,C=o.createElement("script"),An(C),Hr(C,"link",p),o.head.appendChild(C),l.instance=C);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,Jm(p,d.precedence,o));return l.instance}function Jm(o,l,d){for(var p=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=p.length?p[p.length-1]:null,w=C,N=0;N<p.length;N++){var P=p[N];if(P.dataset.precedence===l)w=P;else if(w!==C)break}w?w.parentNode.insertBefore(o,w.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(o,l.firstChild))}function E0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function w0(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var ep=null;function ij(o,l,d){if(ep===null){var p=new Map,C=ep=new Map;C.set(d,p)}else C=ep,p=C.get(d),p||(p=new Map,C.set(d,p));if(p.has(o))return p;for(p.set(o,null),d=d.getElementsByTagName(o),C=0;C<d.length;C++){var w=d[C];if(!(w[Ln]||w[Le]||o==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var N=w.getAttribute(l)||"";N=o+N;var P=p.get(N);P?P.push(w):p.set(N,[w])}}return p}function lj(o,l,d){o=o.ownerDocument||o,o.head.insertBefore(d,l==="title"?o.querySelector("head > title"):null)}function R9(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 cj(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function j9(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 C=yu(p.href),w=l.querySelector(hf(C));if(w){l=w._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(o.count++,o=tp.bind(o),l.then(o,o)),d.state.loading|=4,d.instance=w,An(w);return}w=l.ownerDocument||l,p=sj(p),(C=hs.get(C))&&E0(p,C),w=w.createElement("link"),An(w);var N=w;N._p=new Promise(function(P,X){N.onload=P,N.onerror=X}),Hr(w,"link",p),d.instance=w}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(d,l),(l=d.state.preload)&&(d.state.loading&3)===0&&(o.count++,d=tp.bind(o),l.addEventListener("load",d),l.addEventListener("error",d))}}var R0=0;function T9(o,l){return o.stylesheets&&o.count===0&&rp(o,o.stylesheets),0<o.count||0<o.imgCount?function(d){var p=setTimeout(function(){if(o.stylesheets&&rp(o,o.stylesheets),o.unsuspend){var w=o.unsuspend;o.unsuspend=null,w()}},6e4+l);0<o.imgBytes&&R0===0&&(R0=62500*i9());var C=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&rp(o,o.stylesheets),o.unsuspend)){var w=o.unsuspend;o.unsuspend=null,w()}},(o.imgBytes>R0?50:800)+l);return o.unsuspend=d,function(){o.unsuspend=null,clearTimeout(p),clearTimeout(C)}}:null}function tp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rp(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var np=null;function rp(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,np=new Map,l.forEach(_9,o),np=null,tp.call(o))}function _9(o,l){if(!(l.state.loading&4)){var d=np.get(o);if(d)var p=d.get(null);else{d=new Map,np.set(o,d);for(var C=o.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<C.length;w++){var N=C[w];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(d.set(N.dataset.precedence,N),p=N)}p&&d.set(null,p)}C=l.instance,N=C.getAttribute("data-precedence"),w=d.get(N)||p,w===p&&d.set(null,C),d.set(N,C),this.count++,p=tp.bind(this),C.addEventListener("load",p),C.addEventListener("error",p),w?w.parentNode.insertBefore(C,w.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(C,o.firstChild)),l.state.loading|=4}}var pf={$$typeof:_,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function N9(o,l,d,p,C,w,N,P,X){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=$n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$n(0),this.hiddenUpdates=$n(null),this.identifierPrefix=p,this.onUncaughtError=C,this.onCaughtError=w,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function uj(o,l,d,p,C,w,N,P,X,de,ve,Se){return o=new N9(o,l,d,N,X,de,ve,Se,P),l=1,w===!0&&(l|=24),w=za(3,null,null,l),o.current=w,w.stateNode=o,l=av(),l.refCount++,o.pooledCache=l,l.refCount++,w.memoizedState={element:p,isDehydrated:d,cache:l},lv(w),o}function dj(o){return o?(o=Zc,o):Zc}function fj(o,l,d,p,C,w){C=dj(C),p.context===null?p.context=C:p.pendingContext=C,p=Ni(l),p.payload={element:d},w=w===void 0?null:w,w!==null&&(p.callback=w),d=Ai(o,p,l),d!==null&&(Ea(d,o,l),qd(d,o,l))}function hj(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var d=o.retryLane;o.retryLane=d!==0&&d<l?d:l}}function j0(o,l){hj(o,l),(o=o.alternate)&&hj(o,l)}function mj(o){if(o.tag===13||o.tag===31){var l=Hl(o,67108864);l!==null&&Ea(l,o,67108864),j0(o,67108864)}}function pj(o){if(o.tag===13||o.tag===31){var l=Ba();l=fe(l);var d=Hl(o,l);d!==null&&Ea(d,o,l),j0(o,l)}}var ap=!0;function A9(o,l,d,p){var C=I.T;I.T=null;var w=K.p;try{K.p=2,T0(o,l,d,p)}finally{K.p=w,I.T=C}}function D9(o,l,d,p){var C=I.T;I.T=null;var w=K.p;try{K.p=8,T0(o,l,d,p)}finally{K.p=w,I.T=C}}function T0(o,l,d,p){if(ap){var C=_0(p);if(C===null)h0(o,l,p,sp,d),xj(o,p);else if(I9(C,o,l,d,p))p.stopPropagation();else if(xj(o,p),l&4&&-1<O9.indexOf(o)){for(;C!==null;){var w=un(C);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var N=In(w.pendingLanes);if(N!==0){var P=w;for(P.pendingLanes|=2,P.entangledLanes|=2;N;){var X=1<<31-kn(N);P.entanglements[1]|=X,N&=~X}no(w),(xn&6)===0&&(Hm=je()+500,cf(0))}}break;case 31:case 13:P=Hl(w,2),P!==null&&Ea(P,w,2),$m(),j0(w,2)}if(w=_0(p),w===null&&h0(o,l,p,sp,d),w===C)break;C=w}C!==null&&p.stopPropagation()}else h0(o,l,p,null,d)}}function _0(o){return o=Ay(o),N0(o)}var sp=null;function N0(o){if(sp=null,o=cn(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 sp=o,null}function gj(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(Te()){case Ve:return 2;case bt:return 8;case st:case tn:return 32;case or:return 268435456;default:return 32}default:return 32}}var A0=!1,Hi=null,Vi=null,$i=null,gf=new Map,xf=new Map,Bi=[],O9="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 xj(o,l){switch(o){case"focusin":case"focusout":Hi=null;break;case"dragenter":case"dragleave":Vi=null;break;case"mouseover":case"mouseout":$i=null;break;case"pointerover":case"pointerout":gf.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":xf.delete(l.pointerId)}}function yf(o,l,d,p,C,w){return o===null||o.nativeEvent!==w?(o={blockedOn:l,domEventName:d,eventSystemFlags:p,nativeEvent:w,targetContainers:[C]},l!==null&&(l=un(l),l!==null&&mj(l)),o):(o.eventSystemFlags|=p,l=o.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),o)}function I9(o,l,d,p,C){switch(l){case"focusin":return Hi=yf(Hi,o,l,d,p,C),!0;case"dragenter":return Vi=yf(Vi,o,l,d,p,C),!0;case"mouseover":return $i=yf($i,o,l,d,p,C),!0;case"pointerover":var w=C.pointerId;return gf.set(w,yf(gf.get(w)||null,o,l,d,p,C)),!0;case"gotpointercapture":return w=C.pointerId,xf.set(w,yf(xf.get(w)||null,o,l,d,p,C)),!0}return!1}function yj(o){var l=cn(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,Ge(o.priority,function(){pj(d)});return}}else if(l===31){if(l=u(d),l!==null){o.blockedOn=l,Ge(o.priority,function(){pj(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 op(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var d=_0(o.nativeEvent);if(d===null){d=o.nativeEvent;var p=new d.constructor(d.type,d);Ny=p,d.target.dispatchEvent(p),Ny=null}else return l=un(d),l!==null&&mj(l),o.blockedOn=d,!1;l.shift()}return!0}function vj(o,l,d){op(o)&&d.delete(l)}function M9(){A0=!1,Hi!==null&&op(Hi)&&(Hi=null),Vi!==null&&op(Vi)&&(Vi=null),$i!==null&&op($i)&&($i=null),gf.forEach(vj),xf.forEach(vj)}function ip(o,l){o.blockedOn===l&&(o.blockedOn=null,A0||(A0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,M9)))}var lp=null;function bj(o){lp!==o&&(lp=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lp===o&&(lp=null);for(var l=0;l<o.length;l+=3){var d=o[l],p=o[l+1],C=o[l+2];if(typeof p!="function"){if(N0(p||d)===null)continue;break}var w=un(d);w!==null&&(o.splice(l,3),l-=3,_v(w,{pending:!0,data:C,method:d.method,action:p},p,C))}}))}function bu(o){function l(X){return ip(X,o)}Hi!==null&&ip(Hi,o),Vi!==null&&ip(Vi,o),$i!==null&&ip($i,o),gf.forEach(l),xf.forEach(l);for(var d=0;d<Bi.length;d++){var p=Bi[d];p.blockedOn===o&&(p.blockedOn=null)}for(;0<Bi.length&&(d=Bi[0],d.blockedOn===null);)yj(d),d.blockedOn===null&&Bi.shift();if(d=(o.ownerDocument||o).$$reactFormReplay,d!=null)for(p=0;p<d.length;p+=3){var C=d[p],w=d[p+1],N=C[ze]||null;if(typeof w=="function")N||bj(d);else if(N){var P=null;if(w&&w.hasAttribute("formAction")){if(C=w,N=w[ze]||null)P=N.formAction;else if(N0(C)!==null)continue}else P=N.action;typeof P=="function"?d[p+1]=P:(d.splice(p,3),p-=3),bj(d)}}}function Sj(){function o(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(N){return C=N})},focusReset:"manual",scroll:"manual"})}function l(){C!==null&&(C(),C=null),p||setTimeout(d,20)}function d(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,C=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),C!==null&&(C(),C=null)}}}function D0(o){this._internalRoot=o}cp.prototype.render=D0.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,p=Ba();fj(d,p,o,l,null,null)},cp.prototype.unmount=D0.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;fj(o.current,2,null,o,null,null),$m(),l[Qe]=null}};function cp(o){this._internalRoot=o}cp.prototype.unstable_scheduleHydration=function(o){if(o){var l=Ae();o={blockedOn:null,target:o,priority:l};for(var d=0;d<Bi.length&&l!==0&&l<Bi[d].priority;d++);Bi.splice(d,0,o),d===0&&yj(o)}};var Cj=t.version;if(Cj!=="19.2.1")throw Error(r(527,Cj,"19.2.1"));K.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?x(o):null,o=o===null?null:o.stateNode,o};var k9={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!up.isDisabled&&up.supportsFiber)try{ea=up.inject(k9),pn=up}catch{}}return bf.createRoot=function(o,l){if(!s(o))throw Error(r(299));var d=!1,p="",C=Nw,w=Aw,N=Dw;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(C=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(N=l.onRecoverableError)),l=uj(o,1,!1,null,null,d,p,null,C,w,N,Sj),o[Qe]=l.current,f0(o),new D0(l)},bf.hydrateRoot=function(o,l,d){if(!s(o))throw Error(r(299));var p=!1,C="",w=Nw,N=Aw,P=Dw,X=null;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(C=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(N=d.onCaughtError),d.onRecoverableError!==void 0&&(P=d.onRecoverableError),d.formState!==void 0&&(X=d.formState)),l=uj(o,1,!0,l,d??null,p,C,X,w,N,P,Sj),l.context=dj(null),d=l.current,p=Ba(),p=fe(p),C=Ni(p),C.callback=null,Ai(d,C,p),d=p,l.current.lanes=d,an(l,d),no(l),o[Qe]=l.current,f0(o),new cp(l)},bf.version="19.2.1",bf}var Oj;function K9(){if(Oj)return M0.exports;Oj=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(),M0.exports=q9(),M0.exports}var W9=K9();/**
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 aA=e=>{throw TypeError(e)},Y9=(e,t,n)=>t.has(e)||aA("Cannot "+n),U0=(e,t,n)=>(Y9(e,t,"read from private field"),n?n.call(e):t.get(e)),Z9=(e,t,n)=>t.has(e)?aA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ij="popstate";function X9(e={}){function t(r,s){let{pathname:i,search:c,hash:u}=r.location;return Zf("",{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:wo(s)}return J9(t,n,null,e)}function zt(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 Q9(){return Math.random().toString(36).substring(2,10)}function Mj(e,t){return{usr:e.state,key:e.key,idx:t}}function Zf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?vl(t):t,state:n,key:t&&t.key||r||Q9()}}function wo({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 vl(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 J9(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:i=!1}=r,c=s.history,u="POP",f=null,m=x();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function x(){return(c.state||{idx:null}).idx}function g(){u="POP";let E=x(),R=E==null?null:E-m;m=E,f&&f({action:u,location:b.location,delta:R})}function y(E,R){u="PUSH";let j=Zf(b.location,E,R);m=x()+1;let _=Mj(j,m),D=b.createHref(j);try{c.pushState(_,"",D)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;s.location.assign(D)}i&&f&&f({action:u,location:b.location,delta:1})}function v(E,R){u="REPLACE";let j=Zf(b.location,E,R);m=x();let _=Mj(j,m),D=b.createHref(j);c.replaceState(_,"",D),i&&f&&f({action:u,location:b.location,delta:0})}function S(E){return sA(E)}let b={get action(){return u},get location(){return e(s,c)},listen(E){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(Ij,g),f=E,()=>{s.removeEventListener(Ij,g),f=null}},createHref(E){return t(s,E)},createURL:S,encodeLocation(E){let R=S(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:y,replace:v,go(E){return c.go(E)}};return b}function sA(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),zt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:wo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Mf,kj=class{constructor(e){if(Z9(this,Mf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(U0(this,Mf).has(e))return U0(this,Mf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){U0(this,Mf).set(e,t)}};Mf=new WeakMap;var eL=new Set(["lazy","caseSensitive","path","id","index","children"]);function tL(e){return eL.has(e)}var nL=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function rL(e){return nL.has(e)}function aL(e){return e.index===!0}function Xf(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(zt(i.index!==!0||!i.children,"Cannot specify children on an index route"),zt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),aL(i)){let m={...i,id:f};return r[f]=Lj(m,t(m)),m}else{let m={...i,id:f,children:void 0};return r[f]=Lj(m,t(m)),i.children&&(m.children=Xf(i.children,t,u,r,s)),m}})}function Lj(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Qi(e,t,n="/"){return kf(e,t,n,!1)}function kf(e,t,n,r){let s=typeof t=="string"?vl(t):t,i=vs(s.pathname||"/",n);if(i==null)return null;let c=oA(e);oL(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let m=xL(i);u=pL(c[f],m,r)}return u}function sL(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 oA(e,t=[],n=[],r="",s=!1){let i=(c,u,f=s,m)=>{let x={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:u,route:c};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(r)&&f)return;zt(x.relativePath.startsWith(r),`Absolute route path "${x.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(r.length)}let g=xo([r,x.relativePath]),y=n.concat(x);c.children&&c.children.length>0&&(zt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),oA(c.children,t,y,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:hL(g,c.index),routesMeta:y})};return e.forEach((c,u)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))i(c,u);else for(let m of iA(c.path))i(c,u,!0,m)}),t}function iA(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=iA(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 oL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mL(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var iL=/^:[\w-]+$/,lL=3,cL=2,uL=1,dL=10,fL=-2,Pj=e=>e==="*";function hL(e,t){let n=e.split("/"),r=n.length;return n.some(Pj)&&(r+=fL),t&&(r+=cL),n.filter(s=>!Pj(s)).reduce((s,i)=>s+(iL.test(i)?lL:i===""?uL:dL),r)}function mL(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 pL(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,x=i==="/"?t:t.slice(i.length)||"/",g=ng({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},x),y=f.route;if(!g&&m&&n&&!r[r.length-1].route.index&&(g=ng({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},x)),!g)return null;Object.assign(s,g.params),c.push({params:s,pathname:xo([i,g.pathname]),pathnameBase:SL(xo([i,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(i=xo([i,g.pathnameBase]))}return c}function ng(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=gL(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:x,isOptional:g},y)=>{if(x==="*"){let S=u[y]||"";c=i.slice(0,i.length-S.length).replace(/(.)\/+$/,"$1")}const v=u[y];return g&&!v?m[x]=void 0:m[x]=(v||"").replace(/%2F/g,"/"),m},{}),pathname:i,pathnameBase:c,pattern:e}}function gL(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 xL(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 vs(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 yL({basename:e,pathname:t}){return t==="/"?e:xo([e,t])}var vL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qg=e=>vL.test(e);function bL(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?vl(e):e,i;if(n)if(qg(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=Uj(n.substring(1),"/"):i=Uj(n,t)}else i=t;return{pathname:i,search:CL(r),hash:EL(s)}}function Uj(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 z0(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 lA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Kg(e){let t=lA(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Wg(e,t,n,r=!1){let s;typeof e=="string"?s=vl(e):(s={...e},zt(!s.pathname||!s.pathname.includes("?"),z0("?","pathname","search",s)),zt(!s.pathname||!s.pathname.includes("#"),z0("#","pathname","hash",s)),zt(!s.search||!s.search.includes("#"),z0("#","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 y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;s.pathname=y.join("/")}u=g>=0?t[g]:"/"}let f=bL(s,u),m=c&&c!=="/"&&c.endsWith("/"),x=(i||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||x)&&(f.pathname+="/"),f}var xo=e=>e.join("/").replace(/\/\/+/g,"/"),SL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),CL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,EL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Yg=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 Qf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function gh(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var rl=Symbol("Uninstrumented");function wL(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=zu(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=zu(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[rl]??i,u=zu(n[s],c,(...f)=>zj(f[0]));u&&(u[rl]=c,r[s]=u)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let i=s[rl]??s,c=zu(n.middleware,i,(...u)=>zj(u[0]));return c?(c[rl]=i,c):s})),r}function RL(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[rl]??e.navigate,s=zu(n.navigate,r,(...i)=>{let[c,u]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?wo(c):".",...Fj(e,u??{})}});s&&(s[rl]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[rl]??e.fetch,s=zu(n.fetch,r,(...i)=>{let[c,,u,f]=i;return{href:u??".",fetcherKey:c,...Fj(e,f??{})}});s&&(s[rl]=r,e.fetch=s)}return e}function zu(e,t,n){return e.length===0?null:async(...r)=>{let s=await cA(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function cA(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=cA(e,t,n,r-1),i=await c,zt(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 zj(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:jL(t),params:{...r},unstable_pattern:s,context:TL(n)}}function Fj(e,t){return{currentUrl:wo(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 jL(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function TL(e){if(NL(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var _L=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function NL(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")===_L}var uA=["POST","PUT","PATCH","DELETE"],AL=new Set(uA),DL=["GET",...uA],OL=new Set(DL),IL=new Set([301,302,303,307,308]),ML=new Set([307,308]),F0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},kL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Sf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},LL=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),dA="remix-router-transitions",fA=Symbol("ResetLoaderData");function PL(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";zt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||LL,i=s;if(e.unstable_instrumentations){let Z=e.unstable_instrumentations;i=te=>({...s(te),...wL(Z.map(fe=>fe.route).filter(Boolean),te)})}let c={},u=Xf(e.routes,i,void 0,c),f,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let x=e.dataStrategy||VL,g={...e.future},y=null,v=new Set,S=null,b=null,E=null,R=e.hydrationData!=null,j=Qi(u,e.history.location,m),_=!1,D=null,O;if(j==null&&!e.patchRoutesOnNavigation){let Z=ms(404,{pathname:e.history.location.pathname}),{matches:te,route:fe}=dp(u);O=!0,j=te,D={[fe.id]:Z}}else if(j&&!e.hydrationData&&Xt(j,u,e.history.location.pathname).active&&(j=null),j)if(j.some(Z=>Z.route.lazy))O=!1;else if(!j.some(Z=>fS(Z.route)))O=!0;else{let Z=e.hydrationData?e.hydrationData.loaderData:null,te=e.hydrationData?e.hydrationData.errors:null;if(te){let fe=j.findIndex(Ce=>te[Ce.route.id]!==void 0);O=j.slice(0,fe+1).every(Ce=>!W1(Ce.route,Z,te))}else O=j.every(fe=>!W1(fe.route,Z,te))}else{O=!1,j=[];let Z=Xt(null,u,e.history.location.pathname);Z.active&&Z.matches&&(_=!0,j=Z.matches)}let A,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:O,navigation:F0,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||D,fetchers:new Map,blockers:new Map},M="POP",k=null,z=!1,L,G=!1,B=new Map,q=null,V=!1,I=!1,K=new Set,$=new Map,ee=0,me=-1,U=new Map,F=new Set,H=new Map,W=new Map,Q=new Set,le=new Map,J,ie=null;function ye(){if(y=e.history.listen(({action:Z,location:te,delta:fe})=>{if(J){J(),J=void 0;return}Kn(le.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 Ce=js({currentLocation:T.location,nextLocation:te,historyAction:Z});if(Ce&&fe!=null){let Ae=new Promise(Ge=>{J=Ge});e.history.go(fe*-1),Ma(Ce,{state:"blocked",location:te,proceed(){Ma(Ce,{state:"proceeding",proceed:void 0,reset:void 0,location:te}),Ae.then(()=>e.history.go(fe))},reset(){let Ge=new Map(T.blockers);Ge.set(Ce,Sf),Re({blockers:Ge})}}),k==null||k.resolve(),k=null;return}return Ft(Z,te)}),n){a7(t,B);let Z=()=>s7(t,B);t.addEventListener("pagehide",Z),q=()=>t.removeEventListener("pagehide",Z)}return T.initialized||Ft("POP",T.location,{initialHydration:!0}),A}function Ee(){y&&y(),q&&q(),v.clear(),L&&L.abort(),T.fetchers.forEach((Z,te)=>Lr(te)),T.blockers.forEach((Z,te)=>ta(te))}function He(Z){return v.add(Z),()=>v.delete(Z)}function Re(Z,te={}){Z.matches&&(Z.matches=Z.matches.map(Ae=>{let Ge=c[Ae.route.id],Fe=Ae.route;return Fe.element!==Ge.element||Fe.errorElement!==Ge.errorElement||Fe.hydrateFallbackElement!==Ge.hydrateFallbackElement?{...Ae,route:Ge}:Ae})),T={...T,...Z};let fe=[],Ce=[];T.fetchers.forEach((Ae,Ge)=>{Ae.state==="idle"&&(Q.has(Ge)?fe.push(Ge):Ce.push(Ge))}),Q.forEach(Ae=>{!T.fetchers.has(Ae)&&!$.has(Ae)&&fe.push(Ae)}),[...v].forEach(Ae=>Ae(T,{deletedFetchers:fe,newErrors:Z.errors??null,viewTransitionOpts:te.viewTransitionOpts,flushSync:te.flushSync===!0})),fe.forEach(Ae=>Lr(Ae)),Ce.forEach(Ae=>T.fetchers.delete(Ae))}function Ke(Z,te,{flushSync:fe}={}){var at,tt;let Ce=T.actionData!=null&&T.navigation.formMethod!=null&&sa(T.navigation.formMethod)&&T.navigation.state==="loading"&&((at=Z.state)==null?void 0:at._isRedirect)!==!0,Ae;te.actionData?Object.keys(te.actionData).length>0?Ae=te.actionData:Ae=null:Ce?Ae=T.actionData:Ae=null;let Ge=te.loaderData?Zj(T.loaderData,te.loaderData,te.matches||[],te.errors):T.loaderData,Fe=T.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((Ct,gn)=>Fe.set(gn,Sf)));let Le=V?!1:nn(Z,te.matches||T.matches),ze=z===!0||T.navigation.formMethod!=null&&sa(T.navigation.formMethod)&&((tt=Z.state)==null?void 0:tt._isRedirect)!==!0;f&&(u=f,f=void 0),V||M==="POP"||(M==="PUSH"?e.history.push(Z,Z.state):M==="REPLACE"&&e.history.replace(Z,Z.state));let Qe;if(M==="POP"){let Ct=B.get(T.location.pathname);Ct&&Ct.has(Z.pathname)?Qe={currentLocation:T.location,nextLocation:Z}:B.has(Z.pathname)&&(Qe={currentLocation:Z,nextLocation:T.location})}else if(G){let Ct=B.get(T.location.pathname);Ct?Ct.add(Z.pathname):(Ct=new Set([Z.pathname]),B.set(T.location.pathname,Ct)),Qe={currentLocation:T.location,nextLocation:Z}}Re({...te,actionData:Ae,loaderData:Ge,historyAction:M,location:Z,initialized:!0,navigation:F0,revalidation:"idle",restoreScrollPosition:Le,preventScrollReset:ze,blockers:Fe},{viewTransitionOpts:Qe,flushSync:fe===!0}),M="POP",z=!1,G=!1,V=!1,I=!1,k==null||k.resolve(),k=null,ie==null||ie.resolve(),ie=null}async function nt(Z,te){if(k==null||k.resolve(),k=null,typeof Z=="number"){k||(k=eT());let gn=k.promise;return e.history.go(Z),gn}let fe=K1(T.location,T.matches,m,Z,te==null?void 0:te.fromRouteId,te==null?void 0:te.relative),{path:Ce,submission:Ae,error:Ge}=Hj(!1,fe,te),Fe=T.location,Le=Zf(T.location,Ce,te&&te.state);Le={...Le,...e.history.encodeLocation(Le)};let ze=te&&te.replace!=null?te.replace:void 0,Qe="PUSH";ze===!0?Qe="REPLACE":ze===!1||Ae!=null&&sa(Ae.formMethod)&&Ae.formAction===T.location.pathname+T.location.search&&(Qe="REPLACE");let at=te&&"preventScrollReset"in te?te.preventScrollReset===!0:void 0,tt=(te&&te.flushSync)===!0,Ct=js({currentLocation:Fe,nextLocation:Le,historyAction:Qe});if(Ct){Ma(Ct,{state:"blocked",location:Le,proceed(){Ma(Ct,{state:"proceeding",proceed:void 0,reset:void 0,location:Le}),nt(Z,te)},reset(){let gn=new Map(T.blockers);gn.set(Ct,Sf),Re({blockers:gn})}});return}await Ft(Qe,Le,{submission:Ae,pendingError:Ge,preventScrollReset:at,replace:te&&te.replace,enableViewTransition:te&&te.viewTransition,flushSync:tt})}function Gt(){ie||(ie=eT()),bt(),Re({revalidation:"loading"});let Z=ie.promise;return T.navigation.state==="submitting"?Z:T.navigation.state==="idle"?(Ft(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),Z):(Ft(M||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:G===!0}),Z)}async function Ft(Z,te,fe){L&&L.abort(),L=null,M=Z,V=(fe&&fe.startUninterruptedRevalidation)===!0,Zt(T.location,T.matches),z=(fe&&fe.preventScrollReset)===!0,G=(fe&&fe.enableViewTransition)===!0;let Ce=f||u,Ae=fe&&fe.overrideNavigation,Ge=fe!=null&&fe.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Qi(Ce,te,m),Fe=(fe&&fe.flushSync)===!0;if(Ge&&T.initialized&&!I&&ZL(T.location,te)&&!(fe&&fe.submission&&sa(fe.submission.formMethod))){Ke(te,{matches:Ge},{flushSync:Fe});return}let Le=Xt(Ge,Ce,te.pathname);if(Le.active&&Le.matches&&(Ge=Le.matches),!Ge){let{error:Wn,notFoundMatches:cn,route:un}=En(te.pathname);Ke(te,{matches:cn,loaderData:{},errors:{[un.id]:Wn}},{flushSync:Fe});return}L=new AbortController;let ze=Au(e.history,te,L.signal,fe&&fe.submission),Qe=e.getContext?await e.getContext():new kj,at;if(fe&&fe.pendingError)at=[Ji(Ge).route.id,{type:"error",error:fe.pendingError}];else if(fe&&fe.submission&&sa(fe.submission.formMethod)){let Wn=await On(ze,te,fe.submission,Ge,Qe,Le.active,fe&&fe.initialHydration===!0,{replace:fe.replace,flushSync:Fe});if(Wn.shortCircuited)return;if(Wn.pendingActionResult){let[cn,un]=Wn.pendingActionResult;if(qa(un)&&Qf(un.error)&&un.error.status===404){L=null,Ke(te,{matches:Wn.matches,loaderData:{},errors:{[cn]:un.error}});return}}Ge=Wn.matches||Ge,at=Wn.pendingActionResult,Ae=H0(te,fe.submission),Fe=!1,Le.active=!1,ze=Au(e.history,ze.url,ze.signal)}let{shortCircuited:tt,matches:Ct,loaderData:gn,errors:Ln}=await vn(ze,te,Ge,Qe,Le.active,Ae,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,Fe,at);tt||(L=null,Ke(te,{matches:Ct||Ge,...Xj(at),loaderData:gn,errors:Ln}))}async function On(Z,te,fe,Ce,Ae,Ge,Fe,Le={}){bt();let ze=n7(te,fe);if(Re({navigation:ze},{flushSync:Le.flushSync===!0}),Ge){let tt=await $n(Ce,te.pathname,Z.signal);if(tt.type==="aborted")return{shortCircuited:!0};if(tt.type==="error"){if(tt.partialMatches.length===0){let{matches:gn,route:Ln}=dp(u);return{matches:gn,pendingActionResult:[Ln.id,{type:"error",error:tt.error}]}}let Ct=Ji(tt.partialMatches).route.id;return{matches:tt.partialMatches,pendingActionResult:[Ct,{type:"error",error:tt.error}]}}else if(tt.matches)Ce=tt.matches;else{let{notFoundMatches:Ct,error:gn,route:Ln}=En(te.pathname);return{matches:Ct,pendingActionResult:[Ln.id,{type:"error",error:gn}]}}}let Qe,at=Hp(Ce,te);if(!at.route.action&&!at.route.lazy)Qe={type:"error",error:ms(405,{method:Z.method,pathname:te.pathname,routeId:at.route.id})};else{let tt=Vu(i,c,Z,Ce,at,Fe?[]:r,Ae),Ct=await Te(Z,tt,Ae,null);if(Qe=Ct[at.route.id],!Qe){for(let gn of Ce)if(Ct[gn.route.id]){Qe=Ct[gn.route.id];break}}if(Z.signal.aborted)return{shortCircuited:!0}}if(sc(Qe)){let tt;return Le&&Le.replace!=null?tt=Le.replace:tt=Kj(Qe.response.headers.get("Location"),new URL(Z.url),m)===T.location.pathname+T.location.search,await je(Z,Qe,!0,{submission:fe,replace:tt}),{shortCircuited:!0}}if(qa(Qe)){let tt=Ji(Ce,at.route.id);return(Le&&Le.replace)!==!0&&(M="PUSH"),{matches:Ce,pendingActionResult:[tt.route.id,Qe,at.route.id]}}return{matches:Ce,pendingActionResult:[at.route.id,Qe]}}async function vn(Z,te,fe,Ce,Ae,Ge,Fe,Le,ze,Qe,at,tt){let Ct=Ge||H0(te,Fe),gn=Fe||Le||Jj(Ct),Ln=!V&&!Qe;if(Ae){if(Ln){let _r=ke(tt);Re({navigation:Ct,..._r!==void 0?{actionData:_r}:{}},{flushSync:at})}let qt=await $n(fe,te.pathname,Z.signal);if(qt.type==="aborted")return{shortCircuited:!0};if(qt.type==="error"){if(qt.partialMatches.length===0){let{matches:Ts,route:as}=dp(u);return{matches:Ts,loaderData:{},errors:{[as.id]:qt.error}}}let _r=Ji(qt.partialMatches).route.id;return{matches:qt.partialMatches,loaderData:{},errors:{[_r]:qt.error}}}else if(qt.matches)fe=qt.matches;else{let{error:_r,notFoundMatches:Ts,route:as}=En(te.pathname);return{matches:Ts,loaderData:{},errors:{[as.id]:_r}}}}let Wn=f||u,{dsMatches:cn,revalidatingFetchers:un}=Vj(Z,Ce,i,c,e.history,T,fe,gn,te,Qe?[]:r,Qe===!0,I,K,Q,H,F,Wn,m,e.patchRoutesOnNavigation!=null,tt);if(me=++ee,!e.dataStrategy&&!cn.some(qt=>qt.shouldLoad)&&!cn.some(qt=>qt.route.middleware&&qt.route.middleware.length>0)&&un.length===0){let qt=kn();return Ke(te,{matches:fe,loaderData:{},errors:tt&&qa(tt[1])?{[tt[0]]:tt[1].error}:null,...Xj(tt),...qt?{fetchers:new Map(T.fetchers)}:{}},{flushSync:at}),{shortCircuited:!0}}if(Ln){let qt={};if(!Ae){qt.navigation=Ct;let _r=ke(tt);_r!==void 0&&(qt.actionData=_r)}un.length>0&&(qt.fetchers=Y(un)),Re(qt,{flushSync:at})}un.forEach(qt=>{pn(qt.key),qt.controller&&$.set(qt.key,qt.controller)});let ka=()=>un.forEach(qt=>pn(qt.key));L&&L.signal.addEventListener("abort",ka);let{loaderResults:rs,fetcherResults:An}=await Ve(cn,un,Z,Ce);if(Z.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",ka),un.forEach(qt=>$.delete(qt.key));let La=fp(rs);if(La)return await je(Z,La.result,!0,{replace:ze}),{shortCircuited:!0};if(La=fp(An),La)return F.add(La.key),await je(Z,La.result,!0,{replace:ze}),{shortCircuited:!0};let{loaderData:Fc,errors:Pa}=Yj(T,fe,rs,tt,un,An);Qe&&T.errors&&(Pa={...T.errors,...Pa});let xa=kn(),Hc=Qs(me),Pl=xa||Hc||un.length>0;return{matches:fe,loaderData:Fc,errors:Pa,...Pl?{fetchers:new Map(T.fetchers)}:{}}}function ke(Z){if(Z&&!qa(Z[1]))return{[Z[0]]:Z[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Y(Z){return Z.forEach(te=>{let fe=T.fetchers.get(te.key),Ce=Cf(void 0,fe?fe.data:void 0);T.fetchers.set(te.key,Ce)}),new Map(T.fetchers)}async function re(Z,te,fe,Ce){pn(Z);let Ae=(Ce&&Ce.flushSync)===!0,Ge=f||u,Fe=K1(T.location,T.matches,m,fe,te,Ce==null?void 0:Ce.relative),Le=Qi(Ge,Fe,m),ze=Xt(Le,Ge,Fe);if(ze.active&&ze.matches&&(Le=ze.matches),!Le){tn(Z,te,ms(404,{pathname:Fe}),{flushSync:Ae});return}let{path:Qe,submission:at,error:tt}=Hj(!0,Fe,Ce);if(tt){tn(Z,te,tt,{flushSync:Ae});return}let Ct=e.getContext?await e.getContext():new kj,gn=(Ce&&Ce.preventScrollReset)===!0;if(at&&sa(at.formMethod)){await ce(Z,te,Qe,Le,Ct,ze.active,Ae,gn,at);return}H.set(Z,{routeId:te,path:Qe}),await Ie(Z,te,Qe,Le,Ct,ze.active,Ae,gn,at)}async function ce(Z,te,fe,Ce,Ae,Ge,Fe,Le,ze){bt(),H.delete(Z);let Qe=T.fetchers.get(Z);st(Z,r7(ze,Qe),{flushSync:Fe});let at=new AbortController,tt=Au(e.history,fe,at.signal,ze);if(Ge){let dn=await $n(Ce,new URL(tt.url).pathname,tt.signal,Z);if(dn.type==="aborted")return;if(dn.type==="error"){tn(Z,te,dn.error,{flushSync:Fe});return}else if(dn.matches)Ce=dn.matches;else{tn(Z,te,ms(404,{pathname:fe}),{flushSync:Fe});return}}let Ct=Hp(Ce,fe);if(!Ct.route.action&&!Ct.route.lazy){let dn=ms(405,{method:ze.formMethod,pathname:fe,routeId:te});tn(Z,te,dn,{flushSync:Fe});return}$.set(Z,at);let gn=ee,Ln=Vu(i,c,tt,Ce,Ct,r,Ae),Wn=await Te(tt,Ln,Ae,Z),cn=Wn[Ct.route.id];if(!cn){for(let dn of Ln)if(Wn[dn.route.id]){cn=Wn[dn.route.id];break}}if(tt.signal.aborted){$.get(Z)===at&&$.delete(Z);return}if(Q.has(Z)){if(sc(cn)||qa(cn)){st(Z,Qo(void 0));return}}else{if(sc(cn))if($.delete(Z),me>gn){st(Z,Qo(void 0));return}else return F.add(Z),st(Z,Cf(ze)),je(tt,cn,!1,{fetcherSubmission:ze,preventScrollReset:Le});if(qa(cn)){tn(Z,te,cn.error);return}}let un=T.navigation.location||T.location,ka=Au(e.history,un,at.signal),rs=f||u,An=T.navigation.state!=="idle"?Qi(rs,T.navigation.location,m):T.matches;zt(An,"Didn't find any matches after fetcher action");let La=++ee;U.set(Z,La);let Fc=Cf(ze,cn.data);T.fetchers.set(Z,Fc);let{dsMatches:Pa,revalidatingFetchers:xa}=Vj(ka,Ae,i,c,e.history,T,An,ze,un,r,!1,I,K,Q,H,F,rs,m,e.patchRoutesOnNavigation!=null,[Ct.route.id,cn]);xa.filter(dn=>dn.key!==Z).forEach(dn=>{let Pr=dn.key,Ad=T.fetchers.get(Pr),wy=Cf(void 0,Ad?Ad.data:void 0);T.fetchers.set(Pr,wy),pn(Pr),dn.controller&&$.set(Pr,dn.controller)}),Re({fetchers:new Map(T.fetchers)});let Hc=()=>xa.forEach(dn=>pn(dn.key));at.signal.addEventListener("abort",Hc);let{loaderResults:Pl,fetcherResults:qt}=await Ve(Pa,xa,ka,Ae);if(at.signal.aborted)return;if(at.signal.removeEventListener("abort",Hc),U.delete(Z),$.delete(Z),xa.forEach(dn=>$.delete(dn.key)),T.fetchers.has(Z)){let dn=Qo(cn.data);T.fetchers.set(Z,dn)}let _r=fp(Pl);if(_r)return je(ka,_r.result,!1,{preventScrollReset:Le});if(_r=fp(qt),_r)return F.add(_r.key),je(ka,_r.result,!1,{preventScrollReset:Le});let{loaderData:Ts,errors:as}=Yj(T,An,Pl,void 0,xa,qt);Qs(La),T.navigation.state==="loading"&&La>me?(zt(M,"Expected pending action"),L&&L.abort(),Ke(T.navigation.location,{matches:An,loaderData:Ts,errors:as,fetchers:new Map(T.fetchers)})):(Re({errors:as,loaderData:Zj(T.loaderData,Ts,An,as),fetchers:new Map(T.fetchers)}),I=!1)}async function Ie(Z,te,fe,Ce,Ae,Ge,Fe,Le,ze){let Qe=T.fetchers.get(Z);st(Z,Cf(ze,Qe?Qe.data:void 0),{flushSync:Fe});let at=new AbortController,tt=Au(e.history,fe,at.signal);if(Ge){let un=await $n(Ce,new URL(tt.url).pathname,tt.signal,Z);if(un.type==="aborted")return;if(un.type==="error"){tn(Z,te,un.error,{flushSync:Fe});return}else if(un.matches)Ce=un.matches;else{tn(Z,te,ms(404,{pathname:fe}),{flushSync:Fe});return}}let Ct=Hp(Ce,fe);$.set(Z,at);let gn=ee,Ln=Vu(i,c,tt,Ce,Ct,r,Ae),cn=(await Te(tt,Ln,Ae,Z))[Ct.route.id];if($.get(Z)===at&&$.delete(Z),!tt.signal.aborted){if(Q.has(Z)){st(Z,Qo(void 0));return}if(sc(cn))if(me>gn){st(Z,Qo(void 0));return}else{F.add(Z),await je(tt,cn,!1,{preventScrollReset:Le});return}if(qa(cn)){tn(Z,te,cn.error);return}st(Z,Qo(cn.data))}}async function je(Z,te,fe,{submission:Ce,fetcherSubmission:Ae,preventScrollReset:Ge,replace:Fe}={}){fe||(k==null||k.resolve(),k=null),te.response.headers.has("X-Remix-Revalidate")&&(I=!0);let Le=te.response.headers.get("Location");zt(Le,"Expected a Location header on the redirect Response"),Le=Kj(Le,new URL(Z.url),m);let ze=Zf(T.location,Le,{_isRedirect:!0});if(n){let Ln=!1;if(te.response.headers.has("X-Remix-Reload-Document"))Ln=!0;else if(qg(Le)){const Wn=sA(Le,!0);Ln=Wn.origin!==t.location.origin||vs(Wn.pathname,m)==null}if(Ln){Fe?t.location.replace(Le):t.location.assign(Le);return}}L=null;let Qe=Fe===!0||te.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:at,formAction:tt,formEncType:Ct}=T.navigation;!Ce&&!Ae&&at&&tt&&Ct&&(Ce=Jj(T.navigation));let gn=Ce||Ae;if(ML.has(te.response.status)&&gn&&sa(gn.formMethod))await Ft(Qe,ze,{submission:{...gn,formAction:Le},preventScrollReset:Ge||z,enableViewTransition:fe?G:void 0});else{let Ln=H0(ze,Ce);await Ft(Qe,ze,{overrideNavigation:Ln,fetcherSubmission:Ae,preventScrollReset:Ge||z,enableViewTransition:fe?G:void 0})}}async function Te(Z,te,fe,Ce){let Ae,Ge={};try{Ae=await BL(x,Z,te,Ce,fe,!1)}catch(Fe){return te.filter(Le=>Le.shouldLoad).forEach(Le=>{Ge[Le.route.id]={type:"error",error:Fe}}),Ge}if(Z.signal.aborted)return Ge;for(let[Fe,Le]of Object.entries(Ae))if(e7(Le)){let ze=Le.result;Ge[Fe]={type:"redirect",response:WL(ze,Z,Fe,te,m)}}else Ge[Fe]=await KL(Le);return Ge}async function Ve(Z,te,fe,Ce){let Ae=Te(fe,Z,Ce,null),Ge=Promise.all(te.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let at=(await Te(ze.request,ze.matches,Ce,ze.key))[ze.match.route.id];return{[ze.key]:at}}else return Promise.resolve({[ze.key]:{type:"error",error:ms(404,{pathname:ze.path})}})})),Fe=await Ae,Le=(await Ge).reduce((ze,Qe)=>Object.assign(ze,Qe),{});return{loaderResults:Fe,fetcherResults:Le}}function bt(){I=!0,H.forEach((Z,te)=>{$.has(te)&&K.add(te),pn(te)})}function st(Z,te,fe={}){T.fetchers.set(Z,te),Re({fetchers:new Map(T.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function tn(Z,te,fe,Ce={}){let Ae=Ji(T.matches,te);Lr(Z),Re({errors:{[Ae.route.id]:fe},fetchers:new Map(T.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function or(Z){return W.set(Z,(W.get(Z)||0)+1),Q.has(Z)&&Q.delete(Z),T.fetchers.get(Z)||kL}function Vn(Z,te){pn(Z,te==null?void 0:te.reason),st(Z,Qo(null))}function Lr(Z){let te=T.fetchers.get(Z);$.has(Z)&&!(te&&te.state==="loading"&&U.has(Z))&&pn(Z),H.delete(Z),U.delete(Z),F.delete(Z),Q.delete(Z),K.delete(Z),T.fetchers.delete(Z)}function ea(Z){let te=(W.get(Z)||0)-1;te<=0?(W.delete(Z),Q.add(Z)):W.set(Z,te),Re({fetchers:new Map(T.fetchers)})}function pn(Z,te){let fe=$.get(Z);fe&&(fe.abort(te),$.delete(Z))}function ir(Z){for(let te of Z){let fe=or(te),Ce=Qo(fe.data);T.fetchers.set(te,Ce)}}function kn(){let Z=[],te=!1;for(let fe of F){let Ce=T.fetchers.get(fe);zt(Ce,`Expected fetcher: ${fe}`),Ce.state==="loading"&&(F.delete(fe),Z.push(fe),te=!0)}return ir(Z),te}function Qs(Z){let te=[];for(let[fe,Ce]of U)if(Ce<Z){let Ae=T.fetchers.get(fe);zt(Ae,`Expected fetcher: ${fe}`),Ae.state==="loading"&&(pn(fe),U.delete(fe),te.push(fe))}return ir(te),te.length>0}function Ia(Z,te){let fe=T.blockers.get(Z)||Sf;return le.get(Z)!==te&&le.set(Z,te),fe}function ta(Z){T.blockers.delete(Z),le.delete(Z)}function Ma(Z,te){let fe=T.blockers.get(Z)||Sf;zt(fe.state==="unblocked"&&te.state==="blocked"||fe.state==="blocked"&&te.state==="blocked"||fe.state==="blocked"&&te.state==="proceeding"||fe.state==="blocked"&&te.state==="unblocked"||fe.state==="proceeding"&&te.state==="unblocked",`Invalid blocker state transition: ${fe.state} -> ${te.state}`);let Ce=new Map(T.blockers);Ce.set(Z,te),Re({blockers:Ce})}function js({currentLocation:Z,nextLocation:te,historyAction:fe}){if(le.size===0)return;le.size>1&&Kn(!1,"A router only supports one blocker at a time");let Ce=Array.from(le.entries()),[Ae,Ge]=Ce[Ce.length-1],Fe=T.blockers.get(Ae);if(!(Fe&&Fe.state==="proceeding")&&Ge({currentLocation:Z,nextLocation:te,historyAction:fe}))return Ae}function En(Z){let te=ms(404,{pathname:Z}),fe=f||u,{matches:Ce,route:Ae}=dp(fe);return{notFoundMatches:Ce,route:Ae,error:te}}function In(Z,te,fe){if(S=Z,E=te,b=fe||null,!R&&T.navigation===F0){R=!0;let Ce=nn(T.location,T.matches);Ce!=null&&Re({restoreScrollPosition:Ce})}return()=>{S=null,E=null,b=null}}function Ze(Z,te){return b&&b(Z,te.map(Ce=>sL(Ce,T.loaderData)))||Z.key}function Zt(Z,te){if(S&&E){let fe=Ze(Z,te);S[fe]=E()}}function nn(Z,te){if(S){let fe=Ze(Z,te),Ce=S[fe];if(typeof Ce=="number")return Ce}return null}function Xt(Z,te,fe){if(e.patchRoutesOnNavigation)if(Z){if(Object.keys(Z[0].params).length>0)return{active:!0,matches:kf(te,fe,m,!0)}}else return{active:!0,matches:kf(te,fe,m,!0)||[]};return{active:!1,matches:null}}async function $n(Z,te,fe,Ce){if(!e.patchRoutesOnNavigation)return{type:"success",matches:Z};let Ae=Z;for(;;){let Ge=f==null,Fe=f||u,Le=c;try{await e.patchRoutesOnNavigation({signal:fe,path:te,matches:Ae,fetcherKey:Ce,patch:(at,tt)=>{fe.aborted||$j(at,tt,Fe,Le,i,!1)}})}catch(at){return{type:"error",error:at,partialMatches:Ae}}finally{Ge&&!fe.aborted&&(u=[...u])}if(fe.aborted)return{type:"aborted"};let ze=Qi(Fe,te,m),Qe=null;if(ze){if(Object.keys(ze[0].params).length===0)return{type:"success",matches:ze};if(Qe=kf(Fe,te,m,!0),!(Qe&&Ae.length<Qe.length&&an(Ae,Qe.slice(0,Ae.length))))return{type:"success",matches:ze}}if(Qe||(Qe=kf(Fe,te,m,!0)),!Qe||an(Ae,Qe))return{type:"success",matches:null};Ae=Qe}}function an(Z,te){return Z.length===te.length&&Z.every((fe,Ce)=>fe.route.id===te[Ce].route.id)}function rn(Z){c={},f=Xf(Z,i,void 0,c)}function Tr(Z,te,fe=!1){let Ce=f==null;$j(Z,te,f||u,c,i,fe),Ce&&(u=[...u],Re({}))}return A={get basename(){return m},get future(){return g},get state(){return T},get routes(){return u},get window(){return t},initialize:ye,subscribe:He,enableScrollRestoration:In,navigate:nt,fetch:re,revalidate:Gt,createHref:Z=>e.history.createHref(Z),encodeLocation:Z=>e.history.encodeLocation(Z),getFetcher:or,resetFetcher:Vn,deleteFetcher:ea,dispose:Ee,getBlocker:Ia,deleteBlocker:ta,patchRoutes:Tr,_internalFetchControllers:$,_internalSetRoutes:rn,_internalSetStateDoNotUseOrYouWillBreakYourApp(Z){Re(Z)}},e.unstable_instrumentations&&(A=RL(A,e.unstable_instrumentations.map(Z=>Z.router).filter(Boolean))),A}function UL(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function K1(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=Wg(r||".",Kg(c),vs(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=hS(f.search);if(u.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&m){let x=new URLSearchParams(f.search),g=x.getAll("index");x.delete("index"),g.filter(v=>v).forEach(v=>x.append("index",v));let y=x.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=yL({basename:n,pathname:f.pathname})),wo(f)}function Hj(e,t,n){if(!n||!UL(n))return{path:t};if(n.formMethod&&!t7(n.formMethod))return{path:t,error:ms(405,{method:n.formMethod})};let r=()=>({path:t,error:ms(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=yA(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!sa(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((y,[v,S])=>`${y}${v}=${S}
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(!sa(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()}}}zt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=Z1(n.formData),f=n.formData;else if(n.body instanceof FormData)u=Z1(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=Wj(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=Wj(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(sa(m.formMethod))return{path:t,submission:m};let x=vl(t);return e&&x.search&&hS(x.search)&&u.append("index",""),x.search=`?${u}`,{path:wo(x),submission:m}}function Vj(e,t,n,r,s,i,c,u,f,m,x,g,y,v,S,b,E,R,j,_){var q;let D=_?qa(_[1])?_[1].error:_[1].data:void 0,O=s.createURL(i.location),A=s.createURL(f),T;if(x&&i.errors){let V=Object.keys(i.errors)[0];T=c.findIndex(I=>I.route.id===V)}else if(_&&qa(_[1])){let V=_[0];T=c.findIndex(I=>I.route.id===V)-1}let M=_?_[1].statusCode:void 0,k=M&&M>=400,z={currentUrl:O,currentParams:((q=i.matches[0])==null?void 0:q.params)||{},nextUrl:A,nextParams:c[0].params,...u,actionResult:D,actionStatus:M},L=gh(c),G=c.map((V,I)=>{let{route:K}=V,$=null;if(T!=null&&I>T?$=!1:K.lazy?$=!0:fS(K)?x?$=W1(K,i.loaderData,i.errors):zL(i.loaderData,i.matches[I],V)&&($=!0):$=!1,$!==null)return Y1(n,r,e,L,V,m,t,$);let ee=k?!1:g||O.pathname+O.search===A.pathname+A.search||O.search!==A.search||FL(i.matches[I],V),me={...z,defaultShouldRevalidate:ee},U=rg(V,me);return Y1(n,r,e,L,V,m,t,U,me)}),B=[];return S.forEach((V,I)=>{if(x||!c.some(W=>W.route.id===V.routeId)||v.has(I))return;let K=i.fetchers.get(I),$=K&&K.state!=="idle"&&K.data===void 0,ee=Qi(E,V.path,R);if(!ee){if(j&&$)return;B.push({key:I,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(b.has(I))return;let me=Hp(ee,V.path),U=new AbortController,F=Au(s,V.path,U.signal),H=null;if(y.has(I))y.delete(I),H=Vu(n,r,F,ee,me,m,t);else if($)g&&(H=Vu(n,r,F,ee,me,m,t));else{let W={...z,defaultShouldRevalidate:k?!1:g};rg(me,W)&&(H=Vu(n,r,F,ee,me,m,t,W))}H&&B.push({key:I,routeId:V.routeId,path:V.path,matches:H,match:me,request:F,controller:U})}),{dsMatches:G,revalidatingFetchers:B}}function fS(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function W1(e,t,n){if(e.lazy)return!0;if(!fS(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 zL(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function FL(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function rg(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function $j(e,t,n,r,s,i){let c;if(e){let m=r[e];zt(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 x=c.find(g=>hA(m,g));x?f.push({existingRoute:x,newRoute:m}):u.push(m)}),u.length>0){let m=Xf(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:x,newRoute:g}=f[m],y=x,[v]=Xf([g],s,[],{},!0);Object.assign(y,{element:v.element?v.element:y.element,errorElement:v.errorElement?v.errorElement:y.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:y.hydrateFallbackElement})}}function hA(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=>hA(n,i))}):!1}var Bj=new WeakMap,mA=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(zt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let c=Bj.get(s);c||(c={},Bj.set(s,c));let u=c[e];if(u)return u;let f=(async()=>{let m=tL(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 y=await i();y!=null&&(Object.assign(s,{[e]:y}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(y=>y===void 0)&&(s.lazy=void 0))})();return c[e]=f,f},Gj=new WeakMap;function HL(e,t,n,r,s){let i=n[e.id];if(zt(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let x=Gj.get(i);if(x)return{lazyRoutePromise:x,lazyHandlerPromise:x};let g=(async()=>{zt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),v={};for(let S in y){let b=y[S];if(b===void 0)continue;let E=rL(S),j=i[S]!==void 0&&S!=="hasErrorBoundary";E?Kn(!E,"Route property "+S+" 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 "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):v[S]=b}Object.assign(i,v),Object.assign(i,{...r(i),lazy:void 0})})();return Gj.set(i,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let x of c){if(s&&s.includes(x))continue;let g=mA({key:x,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),x===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 qj(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 VL(e){return e.matches.some(t=>t.route.middleware)?pA(e,()=>qj(e)):qj(e)}function pA(e,t){return $L(e,t,r=>r,QL,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=Ji(c,c[u].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function $L(e,t,n,r,s){let{matches:i,request:c,params:u,context:f,unstable_pattern:m}=e,x=i.flatMap(y=>y.route.middleware?y.route.middleware.map(v=>[y.route.id,v]):[]);return await gA({request:c,params:u,context:f,unstable_pattern:m},x,t,n,r,s)}async function gA(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,x]=f,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await gA(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 x(e,y),S=v!=null?r(v):void 0;return s(S)?S:g?S??g.value:(g={value:await y()},g.value)}catch(v){return await i(v,m,g)}}function xA(e,t,n,r,s){let i=mA({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=HL(r.route,sa(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Y1(e,t,n,r,s,i,c,u,f=null){let m=!1,x=xA(e,t,n,s,i);return{...s,_lazyPromises:x,shouldLoad:u,shouldRevalidateArgs:f,shouldCallHandler(g){return m=!0,f?typeof g=="boolean"?rg(s,{...f,defaultShouldRevalidate:g}):rg(s,f):u},resolve(g){let{lazy:y,loader:v,middleware:S}=s.route,b=m||u||g&&!sa(n.method)&&(y||v),E=S&&S.length>0&&!v&&!y;return b&&(sa(n.method)||!E)?GL({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:x==null?void 0:x.handler,lazyRoutePromise:x==null?void 0:x.route,handlerOverride:g,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function Vu(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:xA(e,t,n,f,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Y1(e,t,n,gh(r),f,i,c,!0,u))}async function BL(e,t,n,r,s,i){n.some(m=>{var x;return(x=m._lazyPromises)==null?void 0:x.middleware})&&await Promise.all(n.map(m=>{var x;return(x=m._lazyPromises)==null?void 0:x.middleware}));let c={request:t,unstable_pattern:gh(n),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let x=c;return pA(x,()=>m({...x,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var x,g;return[(x=m._lazyPromises)==null?void 0:x.handler,(g=m._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function GL({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let u,f,m=sa(e.method),x=m?"action":"loader",g=y=>{let v,S=new Promise((R,j)=>v=j);f=()=>v(),e.signal.addEventListener("abort",f);let b=R=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${x}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),E=(async()=>{try{return{type:"data",result:await(i?i(j=>b(j)):b())}}catch(R){return{type:"error",result:R}}})();return Promise.race([E,S])};try{let y=m?n.route.action:n.route.loader;if(r||s)if(y){let v,[S]=await Promise.all([g(y).catch(b=>{v=b}),r,s]);if(v!==void 0)throw v;u=S}else{await r;let v=m?n.route.action:n.route.loader;if(v)[u]=await Promise.all([g(v),s]);else if(x==="action"){let S=new URL(e.url),b=S.pathname+S.search;throw ms(405,{method:e.method,pathname:b,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)u=await g(y);else{let v=new URL(e.url),S=v.pathname+v.search;throw ms(404,{pathname:S})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return u}async function qL(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 KL(e){var r,s,i,c,u;let{result:t,type:n}=e;if(vA(t)){let f;try{f=await qL(t)}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Yg(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?Qj(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:XL(t),statusCode:Qf(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Qf(t)?t.status:void 0}:Qj(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 WL(e,t,n,r,s){let i=e.headers.get("Location");if(zt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!qg(i)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=K1(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function Kj(e,t,n){if(qg(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=vs(s.pathname,n)!=null;if(s.origin===t.origin&&i)return s.pathname+s.search+s.hash}return e}function Au(e,t,n,r){let s=e.createURL(yA(t)).toString(),i={signal:n};if(r&&sa(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=Z1(r.formData):i.body=r.formData}return new Request(s,i)}function Z1(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Wj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function YL(e,t,n,r=!1,s=!1){let i={},c=null,u,f=!1,m={},x=n&&qa(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let y=g.route.id,v=t[y];if(zt(!sc(v),"Cannot handle redirect results in processLoaderData"),qa(v)){let S=v.error;if(x!==void 0&&(S=x,x=void 0),c=c||{},s)c[y]=S;else{let b=Ji(e,y);c[b.route.id]==null&&(c[b.route.id]=S)}r||(i[y]=fA),f||(f=!0,u=Qf(v.error)?v.error.status:500),v.headers&&(m[y]=v.headers)}else i[y]=v.data,v.statusCode&&v.statusCode!==200&&!f&&(u=v.statusCode),v.headers&&(m[y]=v.headers)}),x!==void 0&&n&&(c={[n[0]]:x},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:u||200,loaderHeaders:m}}function Yj(e,t,n,r,s,i){let{loaderData:c,errors:u}=YL(t,n,r);return s.filter(f=>!f.matches||f.matches.some(m=>m.shouldLoad)).forEach(f=>{let{key:m,match:x,controller:g}=f;if(g&&g.signal.aborted)return;let y=i[m];if(zt(y,"Did not find corresponding fetcher result"),qa(y)){let v=Ji(e.matches,x==null?void 0:x.route.id);u&&u[v.route.id]||(u={...u,[v.route.id]:y.error}),e.fetchers.delete(m)}else if(sc(y))zt(!1,"Unhandled fetcher revalidation redirect");else{let v=Qo(y.data);e.fetchers.set(m,v)}}),{loaderData:c,errors:u}}function Zj(e,t,n,r){let s=Object.entries(t).filter(([,i])=>i!==fA).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 Xj(e){return e?qa(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ji(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 dp(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 ms(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 Yg(e||500,c,new Error(u),!0)}function fp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(sc(s))return{key:r,result:s}}}function yA(e){let t=typeof e=="string"?vl(e):e;return wo({...t,hash:""})}function ZL(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function XL(e){var t,n;return new Yg(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function QL(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&JL(n))}function JL(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function e7(e){return vA(e.result)&&IL.has(e.result.status)}function qa(e){return e.type==="error"}function sc(e){return(e&&e.type)==="redirect"}function Qj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function vA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function t7(e){return OL.has(e.toUpperCase())}function sa(e){return AL.has(e.toUpperCase())}function hS(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Hp(e,t){let n=typeof t=="string"?vl(t).search:t.search;if(e[e.length-1].route.index&&hS(n||""))return e[e.length-1];let r=lA(e);return r[r.length-1]}function Jj(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 H0(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 n7(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 Cf(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 r7(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 a7(e,t){try{let n=e.sessionStorage.getItem(dA);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 s7(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(dA,JSON.stringify(n))}catch(r){Kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function eT(){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 jc=h.createContext(null);jc.displayName="DataRouter";var xh=h.createContext(null);xh.displayName="DataRouterState";h.createContext(!1);var mS=h.createContext({isTransitioning:!1});mS.displayName="ViewTransition";var bA=h.createContext(new Map);bA.displayName="Fetchers";var o7=h.createContext(null);o7.displayName="Await";var bs=h.createContext(null);bs.displayName="Navigation";var Zg=h.createContext(null);Zg.displayName="Location";var Ss=h.createContext({outlet:null,matches:[],isDataRoute:!1});Ss.displayName="Route";var pS=h.createContext(null);pS.displayName="RouteError";function i7(e,{relative:t}={}){zt(ud(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(bs),{hash:s,pathname:i,search:c}=yh(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:xo([n,i])),r.createHref({pathname:u,search:c,hash:s})}function ud(){return h.useContext(Zg)!=null}function Ks(){return zt(ud(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(Zg).location}var SA="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function CA(e){h.useContext(bs).static||h.useLayoutEffect(e)}function Tc(){let{isDataRoute:e}=h.useContext(Ss);return e?S7():l7()}function l7(){zt(ud(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(jc),{basename:t,navigator:n}=h.useContext(bs),{matches:r}=h.useContext(Ss),{pathname:s}=Ks(),i=JSON.stringify(Kg(r)),c=h.useRef(!1);return CA(()=>{c.current=!0}),h.useCallback((f,m={})=>{if(Kn(c.current,SA),!c.current)return;if(typeof f=="number"){n.go(f);return}let x=Wg(f,JSON.parse(i),s,m.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:xo([t,x.pathname])),(m.replace?n.replace:n.push)(x,m.state,m)},[t,n,i,s,e])}var EA=h.createContext(null);function Cs(){return h.useContext(EA)}function c7(e){let t=h.useContext(Ss).outlet;return h.useMemo(()=>t&&h.createElement(EA.Provider,{value:e},t),[t,e])}function Xg(){let{matches:e}=h.useContext(Ss),t=e[e.length-1];return t?t.params:{}}function yh(e,{relative:t}={}){let{matches:n}=h.useContext(Ss),{pathname:r}=Ks(),s=JSON.stringify(Kg(n));return h.useMemo(()=>Wg(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function u7(e,t,n,r,s){zt(ud(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=h.useContext(bs),{matches:c}=h.useContext(Ss),u=c[c.length-1],f=u?u.params:{},m=u?u.pathname:"/",x=u?u.pathnameBase:"/",g=u&&u.route;{let j=g&&g.path||"";wA(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 y=Ks(),v;v=y;let S=v.pathname||"/",b=S;if(x!=="/"){let j=x.replace(/^\//,"").split("/");b="/"+S.replace(/^\//,"").split("/").slice(j.length).join("/")}let E=Qi(e,{pathname:b});return Kn(g||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Kn(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${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.`),p7(E&&E.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:xo([x,i.encodeLocation?i.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?x:xo([x,i.encodeLocation?i.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,s)}function d7(){let e=b7(),t=Qf(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 f7=h.createElement(d7,null),h7=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(Ss.Provider,{value:this.props.routeContext},h.createElement(pS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function m7({routeContext:e,match:t,children:n}){let r=h.useContext(jc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Ss.Provider,{value:e},n)}function p7(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 x=i.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);zt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,x+1))}let u=!1,f=-1;if(n)for(let x=0;x<i.length;x++){let g=i[x];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=x),g.route.id){let{loaderData:y,errors:v}=n,S=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||S){u=!0,f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}let m=n&&r?(x,g)=>{var y,v;r(x,{location:n.location,params:((v=(y=n.matches)==null?void 0:y[0])==null?void 0:v.params)??{},unstable_pattern:gh(n.matches),errorInfo:g})}:void 0;return i.reduceRight((x,g,y)=>{let v,S=!1,b=null,E=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,b=g.route.errorElement||f7,u&&(f<0&&y===0?(wA("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,E=null):f===y&&(S=!0,E=g.route.hydrateFallbackElement||null)));let R=t.concat(i.slice(0,y+1)),j=()=>{let _;return v?_=b:S?_=E:g.route.Component?_=h.createElement(g.route.Component,null):g.route.element?_=g.route.element:_=x,h.createElement(m7,{match:g,routeContext:{outlet:x,matches:R,isDataRoute:n!=null},children:_})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?h.createElement(h7,{location:n.location,revalidation:n.revalidation,component:b,error:v,children:j(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:m}):j()},null)}function gS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function g7(e){let t=h.useContext(jc);return zt(t,gS(e)),t}function x7(e){let t=h.useContext(xh);return zt(t,gS(e)),t}function y7(e){let t=h.useContext(Ss);return zt(t,gS(e)),t}function xS(e){let t=y7(e),n=t.matches[t.matches.length-1];return zt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function v7(){return xS("useRouteId")}function b7(){var r;let e=h.useContext(pS),t=x7("useRouteError"),n=xS("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function S7(){let{router:e}=g7("useNavigate"),t=xS("useNavigate"),n=h.useRef(!1);return CA(()=>{n.current=!0}),h.useCallback(async(s,i={})=>{Kn(n.current,SA),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var tT={};function wA(e,t,n){!t&&!tT[e]&&(tT[e]=!0,Kn(!1,n))}var nT={};function rT(e,t){!e&&!nT[t]&&(nT[t]=!0,console.warn(t))}var C7="useOptimistic",aT=ph[C7],E7=()=>{};function w7(e){return aT?aT(e):[e,E7]}function R7(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 j7=["HydrateFallback","hydrateFallbackElement"],T7=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 _7({router:e,flushSync:t,unstable_onError:n,unstable_useTransitions:r}){let[s,i]=h.useState(e.state),[c,u]=w7(s),[f,m]=h.useState(),[x,g]=h.useState({isTransitioning:!1}),[y,v]=h.useState(),[S,b]=h.useState(),[E,R]=h.useState(),j=h.useRef(new Map),_=h.useCallback((T,{deletedFetchers:M,newErrors:k,flushSync:z,viewTransitionOpts:L})=>{k&&n&&Object.values(k).forEach(B=>{var q;return n(B,{location:T.location,params:((q=T.matches[0])==null?void 0:q.params)??{},unstable_pattern:gh(T.matches)})}),T.fetchers.forEach((B,q)=>{B.data!==void 0&&j.current.set(q,B.data)}),M.forEach(B=>j.current.delete(B)),rT(z===!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 G=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(rT(L==null||G,"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."),!L||!G){t&&z?t(()=>i(T)):r===!1?i(T):h.startTransition(()=>{r===!0&&u(B=>sT(B,T)),i(T)});return}if(t&&z){t(()=>{S&&(y==null||y.resolve(),S.skipTransition()),g({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>i(T))});B.finished.finally(()=>{t(()=>{v(void 0),b(void 0),m(void 0),g({isTransitioning:!1})})}),t(()=>b(B));return}S?(y==null||y.resolve(),S.skipTransition(),R({state:T,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(m(T),g({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[e.window,t,S,y,r,u,n]);h.useLayoutEffect(()=>e.subscribe(_),[e,_]),h.useEffect(()=>{x.isTransitioning&&!x.flushSync&&v(new T7)},[x]),h.useEffect(()=>{if(y&&f&&e.window){let T=f,M=y.promise,k=e.window.document.startViewTransition(async()=>{r===!1?i(T):h.startTransition(()=>{r===!0&&u(z=>sT(z,T)),i(T)}),await M});k.finished.finally(()=>{v(void 0),b(void 0),m(void 0),g({isTransitioning:!1})}),b(k)}},[f,y,e.window,r,u]),h.useEffect(()=>{y&&f&&c.location.key===f.location.key&&y.resolve()},[y,S,c.location,f]),h.useEffect(()=>{!x.isTransitioning&&E&&(m(E.state),g({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),R(void 0))},[x.isTransitioning,E]);let D=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,M,k)=>e.navigate(T,{state:M,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(T,M,k)=>e.navigate(T,{replace:!0,state:M,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[e]),O=e.basename||"/",A=h.useMemo(()=>({router:e,navigator:D,static:!1,basename:O,unstable_onError:n}),[e,D,O,n]);return h.createElement(h.Fragment,null,h.createElement(jc.Provider,{value:A},h.createElement(xh.Provider,{value:c},h.createElement(bA.Provider,{value:j.current},h.createElement(mS.Provider,{value:x},h.createElement(O7,{basename:O,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r===!0},h.createElement(N7,{routes:e.routes,future:e.future,state:c,unstable_onError:n})))))),null)}function sT(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 N7=h.memo(A7);function A7({routes:e,future:t,state:n,unstable_onError:r}){return u7(e,void 0,n,r,t)}function D7({to:e,replace:t,state:n,relative:r}){zt(ud(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=h.useContext(bs);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(Ss),{pathname:c}=Ks(),u=Tc(),f=Wg(e,Kg(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 yS(e){return c7(e.context)}function O7({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:i=!1,unstable_useTransitions:c}){zt(!ud(),"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=vl(n));let{pathname:m="/",search:x="",hash:g="",state:y=null,key:v="default"}=n,S=h.useMemo(()=>{let b=vs(m,u);return b==null?null:{location:{pathname:b,search:x,hash:g,state:y,key:v},navigationType:r}},[u,m,x,g,y,v,r]);return Kn(S!=null,`<Router basename="${u}"> is not able to match the URL "${m}${x}${g}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:h.createElement(bs.Provider,{value:f},h.createElement(Zg.Provider,{children:t,value:S}))}var Vp="get",$p="application/x-www-form-urlencoded";function Qg(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function I7(e){return Qg(e)&&e.tagName.toLowerCase()==="button"}function M7(e){return Qg(e)&&e.tagName.toLowerCase()==="form"}function k7(e){return Qg(e)&&e.tagName.toLowerCase()==="input"}function L7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function P7(e,t){return e.button===0&&(!t||t==="_self")&&!L7(e)}function X1(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 U7(e,t){let n=X1(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}var hp=null;function z7(){if(hp===null)try{new FormData(document.createElement("form"),0),hp=!1}catch{hp=!0}return hp}var F7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function V0(e){return e!=null&&!F7.has(e)?(Kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$p}"`),null):e}function H7(e,t){let n,r,s,i,c;if(M7(e)){let u=e.getAttribute("action");r=u?vs(u,t):null,n=e.getAttribute("method")||Vp,s=V0(e.getAttribute("enctype"))||$p,i=new FormData(e)}else if(I7(e)||k7(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?vs(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Vp,s=V0(e.getAttribute("formenctype"))||V0(u.getAttribute("enctype"))||$p,i=new FormData(u,e),!z7()){let{name:m,type:x,value:g}=e;if(x==="image"){let y=m?`${m}.`:"";i.append(`${y}x`,"0"),i.append(`${y}y`,"0")}else m&&i.append(m,g)}}else{if(Qg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Vp,r=null,s=$p,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 vS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function V7(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&&vs(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function $7(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 B7(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 G7(e,t,n){let r=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await $7(i,n);return c.links?c.links():[]}return[]}));return Y7(r.flat(1).filter(B7).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function oT(e,t,n,r,s,i){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,u=(f,m)=>{var x;return n[m].pathname!==f.pathname||((x=n[m].route.path)==null?void 0:x.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 x=r.routes[f.route.id];if(!x||!x.hasLoader)return!1;if(c(f,m)||u(f,m))return!0;if(f.route.shouldRevalidate){let y=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 y=="boolean")return y}return!0}):[]}function q7(e,t,{includeHydrateFallback:n}={}){return K7(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 K7(e){return[...new Set(e)]}function W7(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Y7(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let i=JSON.stringify(W7(s));return n.has(i)||(n.add(i),r.push({key:i,link:s})),r},[])}function RA(){let e=h.useContext(jc);return vS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Z7(){let e=h.useContext(xh);return vS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var bS=h.createContext(void 0);bS.displayName="FrameworkContext";function jA(){let e=h.useContext(bS);return vS(e,"You must render this element inside a <HydratedRouter> element"),e}function X7(e,t){let n=h.useContext(bS),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:m,onMouseLeave:x,onTouchStart:g}=t,y=h.useRef(null);h.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let b=R=>{R.forEach(j=>{c(j.isIntersecting)})},E=new IntersectionObserver(b,{threshold:.5});return y.current&&E.observe(y.current),()=>{E.disconnect()}}},[e]),h.useEffect(()=>{if(r){let b=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(b)}}},[r]);let v=()=>{s(!0)},S=()=>{s(!1),c(!1)};return n?e!=="intent"?[i,y,{}]:[i,y,{onFocus:Ef(u,v),onBlur:Ef(f,S),onMouseEnter:Ef(m,v),onMouseLeave:Ef(x,S),onTouchStart:Ef(g,v)}]:[!1,y,{}]}function Ef(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Q7({page:e,...t}){let{router:n}=RA(),r=h.useMemo(()=>Qi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(eP,{page:e,matches:r,...t}):null}function J7(e){let{manifest:t,routeModules:n}=jA(),[r,s]=h.useState([]);return h.useEffect(()=>{let i=!1;return G7(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),r}function eP({page:e,matches:t,...n}){let r=Ks(),{manifest:s,routeModules:i}=jA(),{basename:c}=RA(),{loaderData:u,matches:f}=Z7(),m=h.useMemo(()=>oT(e,t,f,s,r,"data"),[e,t,f,s,r]),x=h.useMemo(()=>oT(e,t,f,s,r,"assets"),[e,t,f,s,r]),g=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,b=!1;if(t.forEach(R=>{var _;let j=s.routes[R.route.id];!j||!j.hasLoader||(!m.some(D=>D.route.id===R.route.id)&&R.route.id in u&&((_=i[R.route.id])!=null&&_.shouldRevalidate)||j.hasClientLoader?b=!0:S.add(R.route.id))}),S.size===0)return[];let E=V7(e,c,"data");return b&&S.size>0&&E.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,u,r,s,m,t,e,i]),y=h.useMemo(()=>q7(x,s),[x,s]),v=J7(x);return h.createElement(h.Fragment,null,g.map(S=>h.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),y.map(S=>h.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),v.map(({key:S,link:b})=>h.createElement("link",{key:S,nonce:n.nonce,...b})))}function tP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var TA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{TA&&(window.__reactRouterVersion="7.10.1")}catch{}function nP(e,t){return PL({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:X9({window:t==null?void 0:t.window}),hydrationData:rP(),routes:e,mapRouteProperties:R7,hydrationRouteProperties:j7,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 rP(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:aP(e.errors)}),e}function aP(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 Yg(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 _A=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xr=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:i,replace:c,state:u,target:f,to:m,preventScrollReset:x,viewTransition:g,...y},v){let{basename:S,unstable_useTransitions:b}=h.useContext(bs),E=typeof m=="string"&&_A.test(m),R,j=!1;if(typeof m=="string"&&E&&(R=m,TA))try{let z=new URL(window.location.href),L=m.startsWith("//")?new URL(z.protocol+m):new URL(m),G=vs(L.pathname,S);L.origin===z.origin&&G!=null?m=G+L.search+L.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 _=i7(m,{relative:s}),[D,O,A]=X7(r,y),T=iP(m,{replace:c,state:u,target:f,preventScrollReset:x,relative:s,viewTransition:g,unstable_useTransitions:b});function M(z){t&&t(z),z.defaultPrevented||T(z)}let k=h.createElement("a",{...y,...A,href:R||_,onClick:j||i?t:M,ref:tP(v,O),target:f,"data-discover":!E&&n==="render"?"true":void 0});return D&&!E?h.createElement(h.Fragment,null,k,h.createElement(Q7,{page:_})):k});Xr.displayName="Link";var vh=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:i,to:c,viewTransition:u,children:f,...m},x){let g=yh(c,{relative:m.relative}),y=Ks(),v=h.useContext(xh),{navigator:S,basename:b}=h.useContext(bs),E=v!=null&&hP(g)&&u===!0,R=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,j=y.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(j=j.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&b&&(_=vs(_,b)||_);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=j===R||!s&&j.startsWith(R)&&j.charAt(D)==="/",A=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),T={isActive:O,isPending:A,isTransitioning:E},M=O?t:void 0,k;typeof r=="function"?k=r(T):k=[r,O?"active":null,A?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let z=typeof i=="function"?i(T):i;return h.createElement(Xr,{...m,"aria-current":M,className:k,ref:x,style:z,to:c,viewTransition:u},typeof f=="function"?f(T):f)});vh.displayName="NavLink";var sP=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:i,method:c=Vp,action:u,onSubmit:f,relative:m,preventScrollReset:x,viewTransition:g,...y},v)=>{let{unstable_useTransitions:S}=h.useContext(bs),b=dP(),E=fP(u,{relative:m}),R=c.toLowerCase()==="get"?"get":"post",j=typeof u=="string"&&_A.test(u),_=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let O=D.nativeEvent.submitter,A=(O==null?void 0:O.getAttribute("formmethod"))||c,T=()=>b(O||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:s,state:i,relative:m,preventScrollReset:x,viewTransition:g});S&&n!==!1?h.startTransition(()=>T()):T()};return h.createElement("form",{ref:v,method:R,action:E,onSubmit:r?f:_,...y,"data-discover":!j&&e==="render"?"true":void 0})});sP.displayName="Form";function oP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function NA(e){let t=h.useContext(jc);return zt(t,oP(e)),t}function iP(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:c,unstable_useTransitions:u}={}){let f=Tc(),m=Ks(),x=yh(e,{relative:i});return h.useCallback(g=>{if(P7(g,t)){g.preventDefault();let y=n!==void 0?n:wo(m)===wo(x),v=()=>f(e,{replace:y,state:r,preventScrollReset:s,relative:i,viewTransition:c});u?h.startTransition(()=>v()):v()}},[m,f,x,n,r,t,e,s,i,c,u])}function lP(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(X1(e)),n=h.useRef(!1),r=Ks(),s=h.useMemo(()=>U7(r.search,n.current?null:t.current),[r.search]),i=Tc(),c=h.useCallback((u,f)=>{const m=X1(typeof u=="function"?u(new URLSearchParams(s)):u);n.current=!0,i("?"+m,f)},[i,s]);return[s,c]}var cP=0,uP=()=>`__${String(++cP)}__`;function dP(){let{router:e}=NA("useSubmit"),{basename:t}=h.useContext(bs),n=v7(),r=e.fetch,s=e.navigate;return h.useCallback(async(i,c={})=>{let{action:u,method:f,encType:m,formData:x,body:g}=H7(i,t);if(c.navigate===!1){let y=c.fetcherKey||uP();await r(y,n,c.action||u,{preventScrollReset:c.preventScrollReset,formData:x,body:g,formMethod:c.method||f,formEncType:c.encType||m,flushSync:c.flushSync})}else await s(c.action||u,{preventScrollReset:c.preventScrollReset,formData:x,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 fP(e,{relative:t}={}){let{basename:n}=h.useContext(bs),r=h.useContext(Ss);zt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),i={...yh(e||".",{relative:t})},c=Ks();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search),f=u.getAll("index");if(f.some(x=>x==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let x=u.toString();i.search=x?`?${x}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:xo([n,i.pathname])),wo(i)}function hP(e,{relative:t}={}){let n=h.useContext(mS);zt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=NA("useViewTransitionState"),s=yh(e,{relative:t});if(!n.isTransitioning)return!1;let i=vs(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=vs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ng(s.pathname,c)!=null||ng(s.pathname,i)!=null}var Us=rA();const AA=nA(Us);function mP(e){return h.createElement(_7,{flushSync:Us.flushSync,...e})}function iT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qr(...e){return t=>{let n=!1;const r=e.map(s=>{const i=iT(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():iT(e[s],null)}}}}function vt(...e){return h.useCallback(Qr(...e),e)}var pP=Symbol.for("react.lazy"),ag=ph[" use ".trim().toString()];function gP(e){return typeof e=="object"&&e!==null&&"then"in e}function DA(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===pP&&"_payload"in e&&gP(e._payload)}function SS(e){const t=xP(e),n=h.forwardRef((r,s)=>{let{children:i,...c}=r;DA(i)&&typeof ag=="function"&&(i=ag(i._payload));const u=h.Children.toArray(i),f=u.find(vP);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var bh=SS("Slot");function xP(e){const t=h.forwardRef((n,r)=>{let{children:s,...i}=n;if(DA(s)&&typeof ag=="function"&&(s=ag(s._payload)),h.isValidElement(s)){const c=SP(s),u=bP(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 yP=Symbol("radix.slottable");function vP(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yP}function bP(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 SP(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 OA(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=OA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function IA(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=OA(e))&&(r&&(r+=" "),r+=t);return r}const lT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cT=IA,_c=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return cT(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 x=n==null?void 0:n[m],g=i==null?void 0:i[m];if(x===null)return null;const y=lT(x)||lT(g);return s[m][y]}),u=n&&Object.entries(n).reduce((m,x)=>{let[g,y]=x;return y===void 0||(m[g]=y),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,x)=>{let{class:g,className:y,...v}=x;return Object.entries(v).every(S=>{let[b,E]=S;return Array.isArray(E)?E.includes({...i,...u}[b]):{...i,...u}[b]===E})?[...m,g,y]:m},[]);return cT(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 CP=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MA=(...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 EP={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 wP=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,...EP,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:MA("lucide",s),...u},[...c.map(([m,x])=>h.createElement(m,x)),...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(wP,{ref:i,iconNode:t,className:MA(`lucide-${CP(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 RP=[["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"}]],$0=_e("Airplay",RP);/**
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 jP=[["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"}]],CS=_e("ArchiveRestore",jP);/**
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 TP=[["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"}]],uT=_e("ArrowDownZA",TP);/**
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 _P=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],NP=_e("ArrowLeft",_P);/**
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 AP=[["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"}]],DP=_e("ArrowRightLeft",AP);/**
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 OP=[["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"}]],dT=_e("ArrowUpAZ",OP);/**
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 IP=[["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"}]],fT=_e("ArrowUpDown",IP);/**
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 MP=[["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"}]],kP=_e("Asterisk",MP);/**
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 LP=[["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"}]],PP=_e("BadgeAlert",LP);/**
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 UP=[["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"}]],zP=_e("Blocks",UP);/**
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 FP=[["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"}]],HP=_e("BookOpen",FP);/**
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 VP=[["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"}]],sg=_e("Box",VP);/**
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 $P=[["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"}]],BP=_e("BriefcaseBusiness",$P);/**
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 GP=[["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"}]],ES=_e("CalendarClock",GP);/**
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 qP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],la=_e("Check",qP);/**
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 KP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Es=_e("ChevronDown",KP);/**
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 WP=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],YP=_e("ChevronLeft",WP);/**
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 ZP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Da=_e("ChevronRight",ZP);/**
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 XP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ju=_e("ChevronUp",XP);/**
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 QP=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],JP=_e("ChevronsDownUp",QP);/**
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 eU=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],wS=_e("ChevronsUpDown",eU);/**
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 tU=[["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"}]],Sh=_e("CircleAlert",tU);/**
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 nU=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rU=_e("CircleCheckBig",nU);/**
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 aU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ch=_e("CircleCheck",aU);/**
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 sU=[["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"}]],og=_e("CircleX",sU);/**
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 oU=[["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"}]],iU=_e("Clapperboard",oU);/**
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 lU=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],RS=_e("Code",lU);/**
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 cU=[["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"}]],uU=_e("Columns3",cU);/**
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 dU=[["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"}]],ed=_e("Copy",dU);/**
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 fU=[["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"}]],kA=_e("DatabaseZap",fU);/**
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 hU=[["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"}]],fc=_e("Database",hU);/**
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 mU=[["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"}]],pU=_e("Download",mU);/**
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 gU=[["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"}]],LA=_e("EllipsisVertical",gU);/**
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 xU=[["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"}]],Ws=_e("Ellipsis",xU);/**
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 yU=[["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"}]],ci=_e("ExternalLink",yU);/**
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 vU=[["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"}]],bU=_e("EyeOff",vU);/**
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 SU=[["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"}]],PA=_e("Eye",SU);/**
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 CU=[["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"}]],EU=_e("FilePenLine",CU);/**
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 wU=[["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"}]],RU=_e("FileScan",wU);/**
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 jU=[["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"}]],TU=_e("FileText",jU);/**
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 _U=[["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"}]],NU=_e("FlaskConical",_U);/**
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 AU=[["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"}]],DU=_e("FolderTree",AU);/**
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 OU=[["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"}]],hT=_e("Gem",OU);/**
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 IU=[["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"}]],MU=_e("Goal",IU);/**
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 kU=[["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"}]],LU=_e("GraduationCap",kU);/**
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 PU=[["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"}]],UU=_e("Grid2x2Check",PU);/**
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 zU=[["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"}]],UA=_e("GripVertical",zU);/**
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 FU=[["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"}]],HU=_e("Grip",FU);/**
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 VU=[["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"}]],$U=_e("Group",VU);/**
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 BU=[["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"}]],GU=_e("History",BU);/**
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 qU=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Or=_e("Info",qU);/**
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 KU=[["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"}]],Q1=_e("KeyRound",KU);/**
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 WU=[["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"}]],YU=_e("Layers",WU);/**
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 ZU=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],XU=_e("Lightbulb",ZU);/**
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 QU=[["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"}]],JU=_e("ListChecks",QU);/**
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 ez=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Nc=_e("LoaderCircle",ez);/**
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 tz=[["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"}]],nz=_e("Lock",tz);/**
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 rz=[["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"}]],az=_e("LogOut",rz);/**
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 sz=[["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"}]],oz=_e("Menu",sz);/**
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 iz=[["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"}]],zA=_e("MessageCircleQuestion",iz);/**
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 lz=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],cz=_e("MessageCircle",lz);/**
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 uz=[["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"}]],dz=_e("MessagesSquare",uz);/**
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 fz=[["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"}]],FA=_e("Monitor",fz);/**
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 hz=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],HA=_e("Moon",hz);/**
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 mz=[["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"}]],pz=_e("Network",mz);/**
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 gz=[["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"}]],xz=_e("OctagonAlert",gz);/**
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 yz=[["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"}]],VA=_e("OctagonX",yz);/**
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 vz=[["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"}]],bz=_e("PackageSearch",vz);/**
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 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"}]],Cz=_e("PenLine",Sz);/**
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 Ez=[["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"}]],dd=_e("Pencil",Ez);/**
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 wz=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Jg=_e("Play",wz);/**
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 Rz=[["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"}]],jS=_e("Plug",Rz);/**
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 jz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ga=_e("Plus",jz);/**
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 Tz=[["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"}]],_z=_e("RefreshCw",Tz);/**
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 Nz=[["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"}]],Az=_e("Rocket",Nz);/**
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 Dz=[["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"}]],Oz=_e("Route",Dz);/**
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 Iz=[["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"}]],Mz=_e("Scale",Iz);/**
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 kz=[["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"}]],Lz=_e("ScanSearch",kz);/**
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 Pz=[["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"}]],Uz=_e("ScanText",Pz);/**
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 zz=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Ac=_e("Search",zz);/**
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 Fz=[["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"}]],Hz=_e("Send",Fz);/**
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 Vz=[["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"}]],$A=_e("Settings",Vz);/**
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=[["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"}]],uo=_e("Sparkles",$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 Bz=[["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"}]],Gz=_e("SquareChartGantt",Bz);/**
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 qz=[["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"}]],Kz=_e("SquareCheckBig",qz);/**
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 Wz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],BA=_e("SquarePlay",Wz);/**
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 Yz=[["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"}]],GA=_e("Sun",Yz);/**
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 Zz=[["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"}]],Xz=_e("SwatchBook",Zz);/**
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 Qz=[["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"}]],qA=_e("Table",Qz);/**
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 Jz=[["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"}]],eF=_e("Telescope",Jz);/**
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 tF=[["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"}]],ts=_e("Trash2",tF);/**
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 nF=[["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"}]],Eh=_e("TriangleAlert",nF);/**
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 rF=[["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"}]],Jf=_e("Unplug",rF);/**
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 aF=[["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"}]],mT=_e("Users",aF);/**
552
+ * @license lucide-react v0.475.0 - ISC
553
+ *
554
+ * This source code is licensed under the ISC license.
555
+ * See the LICENSE file in the root directory of this source tree.
556
+ */const sF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hc=_e("X",sF),B0=768;function oF(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${B0-1}px)`),r=()=>{t(window.innerWidth<B0)};return n.addEventListener("change",r),t(window.innerWidth<B0),()=>n.removeEventListener("change",r)},[]),!!e}const iF=(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},lF=(e,t)=>({classGroupId:e,validator:t}),KA=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ig="-",pT=[],cF="arbitrary..",uF=e=>{const t=fF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return dF(c);const u=c.split(ig),f=u[0]===""&&u.length>1?1:0;return WA(u,f,t)},getConflictingClassGroupIds:(c,u)=>{if(u){const f=r[c],m=n[c];return f?m?iF(m,f):f:m||pT}return n[c]||pT}}},WA=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const m=WA(e,t+1,i);if(m)return m}const c=n.validators;if(c===null)return;const u=t===0?e.join(ig):e.slice(t).join(ig),f=c.length;for(let m=0;m<f;m++){const x=c[m];if(x.validator(u))return x.classGroupId}},dF=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?cF+r:void 0})(),fF=e=>{const{theme:t,classGroups:n}=e;return hF(n,t)},hF=(e,t)=>{const n=KA();for(const r in e){const s=e[r];TS(s,n,r,t)}return n},TS=(e,t,n,r)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];mF(c,t,n,r)}},mF=(e,t,n,r)=>{if(typeof e=="string"){pF(e,t,n);return}if(typeof e=="function"){gF(e,t,n,r);return}xF(e,t,n,r)},pF=(e,t,n)=>{const r=e===""?t:YA(t,e);r.classGroupId=n},gF=(e,t,n,r)=>{if(yF(e)){TS(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(lF(n,e))},xF=(e,t,n,r)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[u,f]=s[c];TS(f,YA(t,u),n,r)}},YA=(e,t)=>{let n=e;const r=t.split(ig),s=r.length;for(let i=0;i<s;i++){const c=r[i];let u=n.nextPart.get(c);u||(u=KA(),n.nextPart.set(c,u)),n=u}return n},yF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,vF=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)}}},J1="!",gT=":",bF=[],xT=(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 x=s.length;for(let b=0;b<x;b++){const E=s[b];if(c===0&&u===0){if(E===gT){i.push(s.slice(f,b)),f=b+1;continue}if(E==="/"){m=b;continue}}E==="["?c++:E==="]"?c--:E==="("?u++:E===")"&&u--}const g=i.length===0?s:s.slice(f);let y=g,v=!1;g.endsWith(J1)?(y=g.slice(0,-1),v=!0):g.startsWith(J1)&&(y=g.slice(1),v=!0);const S=m&&m>f?m-f:void 0;return xT(i,v,y,S)};if(t){const s=t+gT,i=r;r=c=>c.startsWith(s)?i(c.slice(s.length)):xT(bF,!1,c,void 0,!0)}if(n){const s=r;r=i=>n({className:i,parseClassName:s})}return r},CF=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}},EF=e=>({cache:vF(e.cacheSize),parseClassName:SF(e),sortModifiers:CF(e),...uF(e)}),wF=/\s+/,RF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],u=e.trim().split(wF);let f="";for(let m=u.length-1;m>=0;m-=1){const x=u[m],{isExternal:g,modifiers:y,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:b}=n(x);if(g){f=x+(f.length>0?" "+f:f);continue}let E=!!b,R=r(E?S.substring(0,b):S);if(!R){if(!E){f=x+(f.length>0?" "+f:f);continue}if(R=r(S),!R){f=x+(f.length>0?" "+f:f);continue}E=!1}const j=y.length===0?"":y.length===1?y[0]:i(y).join(":"),_=v?j+J1:j,D=_+R;if(c.indexOf(D)>-1)continue;c.push(D);const O=s(R,E);for(let A=0;A<O.length;++A){const T=O[A];c.push(_+T)}f=x+(f.length>0?" "+f:f)}return f},jF=(...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},TF=(e,...t)=>{let n,r,s,i;const c=f=>{const m=t.reduce((x,g)=>g(x),e());return n=EF(m),r=n.cache.get,s=n.cache.set,i=u,u(f)},u=f=>{const m=r(f);if(m)return m;const x=RF(f,n);return s(f,x),x};return i=c,(...f)=>i(jF(...f))},_F=[],xr=e=>{const t=n=>n[e]||_F;return t.isThemeGetter=!0,t},XA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,QA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,NF=/^\d+\/\d+$/,AF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DF=/\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$/,OF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,MF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Su=e=>NF.test(e),Ut=e=>!!e&&!Number.isNaN(Number(e)),qi=e=>!!e&&Number.isInteger(Number(e)),G0=e=>e.endsWith("%")&&Ut(e.slice(0,-1)),Yo=e=>AF.test(e),kF=()=>!0,LF=e=>DF.test(e)&&!OF.test(e),JA=()=>!1,PF=e=>IF.test(e),UF=e=>MF.test(e),zF=e=>!We(e)&&!Ye(e),FF=e=>fd(e,n4,JA),We=e=>XA.test(e),ec=e=>fd(e,r4,LF),q0=e=>fd(e,GF,Ut),yT=e=>fd(e,e4,JA),HF=e=>fd(e,t4,UF),mp=e=>fd(e,a4,PF),Ye=e=>QA.test(e),wf=e=>hd(e,r4),VF=e=>hd(e,qF),vT=e=>hd(e,e4),$F=e=>hd(e,n4),BF=e=>hd(e,t4),pp=e=>hd(e,a4,!0),fd=(e,t,n)=>{const r=XA.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},hd=(e,t,n=!1)=>{const r=QA.exec(e);return r?r[1]?t(r[1]):n:!1},e4=e=>e==="position"||e==="percentage",t4=e=>e==="image"||e==="url",n4=e=>e==="length"||e==="size"||e==="bg-size",r4=e=>e==="length",GF=e=>e==="number",qF=e=>e==="family-name",a4=e=>e==="shadow",KF=()=>{const e=xr("color"),t=xr("font"),n=xr("text"),r=xr("font-weight"),s=xr("tracking"),i=xr("leading"),c=xr("breakpoint"),u=xr("container"),f=xr("spacing"),m=xr("radius"),x=xr("shadow"),g=xr("inset-shadow"),y=xr("text-shadow"),v=xr("drop-shadow"),S=xr("blur"),b=xr("perspective"),E=xr("aspect"),R=xr("ease"),j=xr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...D(),Ye,We],A=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],M=()=>[Ye,We,f],k=()=>[Su,"full","auto",...M()],z=()=>[qi,"none","subgrid",Ye,We],L=()=>["auto",{span:["full",qi,Ye,We]},qi,Ye,We],G=()=>[qi,"auto",Ye,We],B=()=>["auto","min","max","fr",Ye,We],q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...M()],K=()=>[Su,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],$=()=>[e,Ye,We],ee=()=>[...D(),vT,yT,{position:[Ye,We]}],me=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",$F,FF,{size:[Ye,We]}],F=()=>[G0,wf,ec],H=()=>["","none","full",m,Ye,We],W=()=>["",Ut,wf,ec],Q=()=>["solid","dashed","dotted","double"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[Ut,G0,vT,yT],ie=()=>["","none",S,Ye,We],ye=()=>["none",Ut,Ye,We],Ee=()=>["none",Ut,Ye,We],He=()=>[Ut,Ye,We],Re=()=>[Su,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Yo],breakpoint:[Yo],color:[kF],container:[Yo],"drop-shadow":[Yo],ease:["in","out","in-out"],font:[zF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Yo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Yo],shadow:[Yo],spacing:["px",Ut],text:[Yo],"text-shadow":[Yo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Su,We,Ye,E]}],container:["container"],columns:[{columns:[Ut,We,Ye,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:O()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],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:[qi,"auto",Ye,We]}],basis:[{basis:[Su,"full","auto",u,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ut,Su,"auto","initial","none",We]}],grow:[{grow:["",Ut,Ye,We]}],shrink:[{shrink:["",Ut,Ye,We]}],order:[{order:[qi,"first","last","none",Ye,We]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[u,"screen",...K()]}],"min-w":[{"min-w":[u,"screen","none",...K()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[c]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,wf,ec]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,q0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",G0,We]}],"font-family":[{font:[VF,We,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,Ye,We]}],"line-clamp":[{"line-clamp":[Ut,"none",Ye,q0]}],leading:[{leading:[i,...M()]}],"list-image":[{"list-image":["none",Ye,We]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,We]}],"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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ut,"from-font","auto",Ye,ec]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Ut,"auto",Ye,We]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,We]}],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",Ye,We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:me()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qi,Ye,We],radial:["",Ye,We],conic:[qi,Ye,We]},BF,HF]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Q(),"hidden","none"]}],"divide-style":[{divide:[...Q(),"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:[...Q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ut,Ye,We]}],"outline-w":[{outline:["",Ut,wf,ec]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",x,pp,mp]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",g,pp,mp]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Ut,ec]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",y,pp,mp]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Ut,Ye,We]}],"mix-blend":[{"mix-blend":[...le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":le()}],"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":[Ut]}],"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":[Ye,We]}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[Ut]}],"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:ee()}],"mask-repeat":[{mask:me()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,We]}],filter:[{filter:["","none",Ye,We]}],blur:[{blur:ie()}],brightness:[{brightness:[Ut,Ye,We]}],contrast:[{contrast:[Ut,Ye,We]}],"drop-shadow":[{"drop-shadow":["","none",v,pp,mp]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Ut,Ye,We]}],"hue-rotate":[{"hue-rotate":[Ut,Ye,We]}],invert:[{invert:["",Ut,Ye,We]}],saturate:[{saturate:[Ut,Ye,We]}],sepia:[{sepia:["",Ut,Ye,We]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,We]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Ut,Ye,We]}],"backdrop-contrast":[{"backdrop-contrast":[Ut,Ye,We]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ut,Ye,We]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ut,Ye,We]}],"backdrop-invert":[{"backdrop-invert":["",Ut,Ye,We]}],"backdrop-opacity":[{"backdrop-opacity":[Ut,Ye,We]}],"backdrop-saturate":[{"backdrop-saturate":[Ut,Ye,We]}],"backdrop-sepia":[{"backdrop-sepia":["",Ut,Ye,We]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,We]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ut,"initial",Ye,We]}],ease:[{ease:["linear","initial",R,Ye,We]}],delay:[{delay:[Ut,Ye,We]}],animate:[{animate:["none",j,Ye,We]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ye,We]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[Ye,We,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"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",Ye,We]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,We]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Ut,wf,ec,q0]}],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"]}},WF=TF(KF);function se(...e){return WF(IA(e))}const _S=_c("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?bh:"button";return a.jsx(i,{"data-slot":"button",className:se(_S({variant:t,size:n,className:e})),...s})}function dt({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 YF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZF=YF.reduce((e,t)=>{const n=SS(`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}},{}),XF="Separator",bT="horizontal",QF=["horizontal","vertical"],s4=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=bT,...s}=e,i=JF(r)?r:bT,u=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(ZF.div,{"data-orientation":i,...u,...s,ref:t})});s4.displayName=XF;function JF(e){return QF.includes(e)}var eH=s4;function NS({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx(eH,{"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 Me(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 tH(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 Er(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:y,children:v,...S}=g,b=((R=y==null?void 0:y[e])==null?void 0:R[f])||u,E=h.useMemo(()=>S,Object.values(S));return a.jsx(b.Provider,{value:E,children:v})};m.displayName=i+"Provider";function x(g,y){var b;const v=((b=y==null?void 0:y[e])==null?void 0:b[f])||u,S=h.useContext(v);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,x]}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,nH(s,...t)]}function nH(...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 Br=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},rH=ph[" useId ".trim().toString()]||(()=>{}),aH=0;function er(e){const[t,n]=h.useState(rH());return Br(()=>{n(r=>r??String(aH++))},[e]),e||(t?`radix-${t}`:"")}var sH=ph[" useInsertionEffect ".trim().toString()]||Br;function ca({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,c]=oH({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:s;{const x=h.useRef(e!==void 0);h.useEffect(()=>{const g=x.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.`),x.current=u},[u,r])}const m=h.useCallback(x=>{var g;if(u){const y=iH(x)?x(e):x;y!==e&&((g=c.current)==null||g.call(c,y))}else i(x)},[u,e,i,c]);return[f,m]}function oH({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return sH(()=>{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 iH(e){return typeof e=="function"}function lH(e){const t=cH(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(dH);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function cH(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=hH(s),u=fH(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 uH=Symbol("radix.slottable");function dH(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uH}function fH(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 hH(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 mH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=mH.reduce((e,t)=>{const n=lH(`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 o4(e,t){e&&Us.flushSync(()=>e.dispatchEvent(t))}function Vs(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 pH(e,t=globalThis==null?void 0:globalThis.document){const n=Vs(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 gH="DismissableLayer",eb="dismissableLayer.update",xH="dismissableLayer.pointerDownOutside",yH="dismissableLayer.focusOutside",ST,i4=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dc=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,onDismiss:u,...f}=e,m=h.useContext(i4),[x,g]=h.useState(null),y=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=h.useState({}),S=vt(t,T=>g(T)),b=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=b.indexOf(E),j=x?b.indexOf(x):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,D=j>=R,O=SH(T=>{const M=T.target,k=[...m.branches].some(z=>z.contains(M));!D||k||(s==null||s(T),c==null||c(T),T.defaultPrevented||u==null||u())},y),A=CH(T=>{const M=T.target;[...m.branches].some(z=>z.contains(M))||(i==null||i(T),c==null||c(T),T.defaultPrevented||u==null||u())},y);return pH(T=>{j===m.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},y),h.useEffect(()=>{if(x)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ST=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(x)),m.layers.add(x),CT(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=ST)}},[x,y,n,m]),h.useEffect(()=>()=>{x&&(m.layers.delete(x),m.layersWithOutsidePointerEventsDisabled.delete(x),CT())},[x,m]),h.useEffect(()=>{const T=()=>v({});return document.addEventListener(eb,T),()=>document.removeEventListener(eb,T)},[]),a.jsx(et.div,{...f,ref:S,style:{pointerEvents:_?D?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,O.onPointerDownCapture)})});Dc.displayName=gH;var vH="DismissableLayerBranch",bH=h.forwardRef((e,t)=>{const n=h.useContext(i4),r=h.useRef(null),s=vt(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(et.div,{...e,ref:s})});bH.displayName=vH;function SH(e,t=globalThis==null?void 0:globalThis.document){const n=Vs(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=u=>{if(u.target&&!r.current){let f=function(){l4(xH,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 CH(e,t=globalThis==null?void 0:globalThis.document){const n=Vs(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&l4(yH,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 CT(){const e=new CustomEvent(eb);document.dispatchEvent(e)}function l4(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?o4(s,i):s.dispatchEvent(i)}var K0="focusScope.autoFocusOnMount",W0="focusScope.autoFocusOnUnmount",ET={bubbles:!1,cancelable:!0},EH="FocusScope",wh=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=e,[u,f]=h.useState(null),m=Vs(s),x=Vs(i),g=h.useRef(null),y=vt(t,b=>f(b)),v=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let b=function(_){if(v.paused||!u)return;const D=_.target;u.contains(D)?g.current=D:Yi(g.current,{select:!0})},E=function(_){if(v.paused||!u)return;const D=_.relatedTarget;D!==null&&(u.contains(D)||Yi(g.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const O of _)O.removedNodes.length>0&&Yi(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",E);const j=new MutationObserver(R);return u&&j.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",E),j.disconnect()}}},[r,u,v.paused]),h.useEffect(()=>{if(u){RT.add(v);const b=document.activeElement;if(!u.contains(b)){const R=new CustomEvent(K0,ET);u.addEventListener(K0,m),u.dispatchEvent(R),R.defaultPrevented||(wH(NH(c4(u)),{select:!0}),document.activeElement===b&&Yi(u))}return()=>{u.removeEventListener(K0,m),setTimeout(()=>{const R=new CustomEvent(W0,ET);u.addEventListener(W0,x),u.dispatchEvent(R),R.defaultPrevented||Yi(b??document.body,{select:!0}),u.removeEventListener(W0,x),RT.remove(v)},0)}}},[u,m,x,v]);const S=h.useCallback(b=>{if(!n&&!r||v.paused)return;const E=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,R=document.activeElement;if(E&&R){const j=b.currentTarget,[_,D]=RH(j);_&&D?!b.shiftKey&&R===D?(b.preventDefault(),n&&Yi(_,{select:!0})):b.shiftKey&&R===_&&(b.preventDefault(),n&&Yi(D,{select:!0})):R===j&&b.preventDefault()}},[n,r,v.paused]);return a.jsx(et.div,{tabIndex:-1,...c,ref:y,onKeyDown:S})});wh.displayName=EH;function wH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Yi(r,{select:t}),document.activeElement!==n)return}function RH(e){const t=c4(e),n=wT(t,e),r=wT(t.reverse(),e);return[n,r]}function c4(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 wT(e,t){for(const n of e)if(!jH(n,{upTo:t}))return n}function jH(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 TH(e){return e instanceof HTMLInputElement&&"select"in e}function Yi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TH(e)&&t&&e.select()}}var RT=_H();function _H(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jT(e,t),e.unshift(t)},remove(t){var n;e=jT(e,t),(n=e[0])==null||n.resume()}}}function jT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function NH(e){return e.filter(t=>t.tagName!=="A")}var AH="Portal",Oc=h.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,i]=h.useState(!1);Br(()=>i(!0),[]);const c=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?AA.createPortal(a.jsx(et.div,{...r,ref:t}),c):null});Oc.displayName=AH;function DH(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var qr=e=>{const{present:t,children:n}=e,r=OH(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=vt(r.ref,IH(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};qr.displayName="Presence";function OH(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),c=e?"mounted":"unmounted",[u,f]=DH(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const m=gp(r.current);i.current=u==="mounted"?m:"none"},[u]),Br(()=>{const m=r.current,x=s.current;if(x!==e){const y=i.current,v=gp(m);e?f("MOUNT"):v==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(x&&y!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),Br(()=>{if(t){let m;const x=t.ownerDocument.defaultView??window,g=v=>{const b=gp(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(f("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=x.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},y=v=>{v.target===t&&(i.current=gp(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{x.clearTimeout(m),t.removeEventListener("animationstart",y),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 gp(e){return(e==null?void 0:e.animationName)||"none"}function IH(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 Y0=0;function ex(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??TT()),document.body.insertAdjacentElement("beforeend",e[1]??TT()),Y0++,()=>{Y0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Y0--}},[])}function TT(){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 ho=function(){return ho=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},ho.apply(this,arguments)};function u4(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 MH(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 Bp="right-scroll-bar-position",Gp="width-before-scroll-bar",kH="with-scroll-bars-hidden",LH="--removed-body-scroll-bar-size";function Z0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function PH(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 UH=typeof window<"u"?h.useLayoutEffect:h.useEffect,_T=new WeakMap;function zH(e,t){var n=PH(null,function(r){return e.forEach(function(s){return Z0(s,r)})});return UH(function(){var r=_T.get(n);if(r){var s=new Set(r),i=new Set(e),c=n.current;s.forEach(function(u){i.has(u)||Z0(u,null)}),i.forEach(function(u){s.has(u)||Z0(u,c)})}_T.set(n,e)},[e]),n}function FH(e){return e}function HH(e,t){t===void 0&&(t=FH);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 x=c;c=[],x.forEach(i)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(x){c.push(x),m()},filter:function(x){return c=c.filter(x),n}}}};return s}function VH(e){e===void 0&&(e={});var t=HH(null);return t.options=ho({async:!0,ssr:!1},e),t}var d4=function(e){var t=e.sideCar,n=u4(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,ho({},n))};d4.isSideCarExport=!0;function $H(e,t){return e.useMedium(t),d4}var f4=VH(),X0=function(){},tx=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:X0,onWheelCapture:X0,onTouchMoveCapture:X0}),s=r[0],i=r[1],c=e.forwardProps,u=e.children,f=e.className,m=e.removeScrollBar,x=e.enabled,g=e.shards,y=e.sideCar,v=e.noRelative,S=e.noIsolation,b=e.inert,E=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,D=u4(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=y,A=zH([n,t]),T=ho(ho({},D),s);return h.createElement(h.Fragment,null,x&&h.createElement(O,{sideCar:f4,removeScrollBar:m,shards:g,noRelative:v,noIsolation:S,inert:b,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:_}),c?h.cloneElement(h.Children.only(u),ho(ho({},T),{ref:A})):h.createElement(j,ho({},T,{className:f,ref:A}),u))});tx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tx.classNames={fullWidth:Gp,zeroRight:Bp};var BH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=BH();return t&&e.setAttribute("nonce",t),e}function qH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function KH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=GH())&&(qH(t,n),KH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},YH=function(){var e=WH();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},h4=function(){var e=YH(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},ZH={left:0,top:0,right:0,gap:0},Q0=function(e){return parseInt(e||"",10)||0},XH=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[Q0(n),Q0(r),Q0(s)]},QH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ZH;var t=XH(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])}},JH=h4(),$u="data-scroll-locked",eV=function(e,t,n,r){var s=e.left,i=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
557
+ .`.concat(kH,` {
558
+ overflow: hidden `).concat(r,`;
559
+ padding-right: `).concat(u,"px ").concat(r,`;
560
+ }
561
+ body[`).concat($u,`] {
562
+ overflow: hidden `).concat(r,`;
563
+ overscroll-behavior: contain;
564
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
565
+ padding-left: `.concat(s,`px;
566
+ padding-top: `).concat(i,`px;
567
+ padding-right: `).concat(c,`px;
568
+ margin-left:0;
569
+ margin-top:0;
570
+ margin-right: `).concat(u,"px ").concat(r,`;
571
+ `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
572
+ }
573
+
574
+ .`).concat(Bp,` {
575
+ right: `).concat(u,"px ").concat(r,`;
576
+ }
577
+
578
+ .`).concat(Gp,` {
579
+ margin-right: `).concat(u,"px ").concat(r,`;
580
+ }
581
+
582
+ .`).concat(Bp," .").concat(Bp,` {
583
+ right: 0 `).concat(r,`;
584
+ }
585
+
586
+ .`).concat(Gp," .").concat(Gp,` {
587
+ margin-right: 0 `).concat(r,`;
588
+ }
589
+
590
+ body[`).concat($u,`] {
591
+ `).concat(LH,": ").concat(u,`px;
592
+ }
593
+ `)},NT=function(){var e=parseInt(document.body.getAttribute($u)||"0",10);return isFinite(e)?e:0},tV=function(){h.useEffect(function(){return document.body.setAttribute($u,(NT()+1).toString()),function(){var e=NT()-1;e<=0?document.body.removeAttribute($u):document.body.setAttribute($u,e.toString())}},[])},nV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;tV();var i=h.useMemo(function(){return QH(s)},[s]);return h.createElement(JH,{styles:eV(i,!t,s,n?"":"!important")})},tb=!1;if(typeof window<"u")try{var xp=Object.defineProperty({},"passive",{get:function(){return tb=!0,!0}});window.addEventListener("test",xp,xp),window.removeEventListener("test",xp,xp)}catch{tb=!1}var Cu=tb?{passive:!1}:!1,rV=function(e){return e.tagName==="TEXTAREA"},m4=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!rV(e)&&n[t]==="visible")},aV=function(e){return m4(e,"overflowY")},sV=function(e){return m4(e,"overflowX")},AT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=p4(e,r);if(s){var i=g4(e,r),c=i[1],u=i[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},oV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},p4=function(e,t){return e==="v"?aV(t):sV(t)},g4=function(e,t){return e==="v"?oV(t):iV(t)},lV=function(e,t){return e==="h"&&t==="rtl"?-1:1},cV=function(e,t,n,r,s){var i=lV(e,window.getComputedStyle(t).direction),c=i*r,u=n.target,f=t.contains(u),m=!1,x=c>0,g=0,y=0;do{if(!u)break;var v=g4(e,u),S=v[0],b=v[1],E=v[2],R=b-E-i*S;(S||R)&&p4(e,u)&&(g+=R,y+=S);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(x&&Math.abs(g)<1||!x&&Math.abs(y)<1)&&(m=!0),m},yp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},DT=function(e){return[e.deltaX,e.deltaY]},OT=function(e){return e&&"current"in e?e.current:e},uV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dV=function(e){return`
594
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
595
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
596
+ `)},fV=0,Eu=[];function hV(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(fV++)[0],i=h.useState(h4)[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 b=MH([e.lockRef.current],(e.shards||[]).map(OT),!0).filter(Boolean);return b.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),b.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=h.useCallback(function(b,E){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!c.current.allowPinchZoom;var R=yp(b),j=n.current,_="deltaX"in b?b.deltaX:j[0]-R[0],D="deltaY"in b?b.deltaY:j[1]-R[1],O,A=b.target,T=Math.abs(_)>Math.abs(D)?"h":"v";if("touches"in b&&T==="h"&&A.type==="range")return!1;var M=window.getSelection(),k=M&&M.anchorNode,z=k?k===A||k.contains(A):!1;if(z)return!1;var L=AT(T,A);if(!L)return!0;if(L?O=T:(O=T==="v"?"h":"v",L=AT(T,A)),!L)return!1;if(!r.current&&"changedTouches"in b&&(_||D)&&(r.current=O),!O)return!0;var G=r.current||O;return cV(G,E,b,G==="h"?_:D)},[]),f=h.useCallback(function(b){var E=b;if(!(!Eu.length||Eu[Eu.length-1]!==i)){var R="deltaY"in E?DT(E):yp(E),j=t.current.filter(function(O){return O.name===E.type&&(O.target===E.target||E.target===O.shadowParent)&&uV(O.delta,R)})[0];if(j&&j.should){E.cancelable&&E.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(OT).filter(Boolean).filter(function(O){return O.contains(E.target)}),D=_.length>0?u(E,_[0]):!c.current.noIsolation;D&&E.cancelable&&E.preventDefault()}}},[]),m=h.useCallback(function(b,E,R,j){var _={name:b,delta:E,target:R,should:j,shadowParent:mV(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(D){return D!==_})},1)},[]),x=h.useCallback(function(b){n.current=yp(b),r.current=void 0},[]),g=h.useCallback(function(b){m(b.type,DT(b),b.target,u(b,e.lockRef.current))},[]),y=h.useCallback(function(b){m(b.type,yp(b),b.target,u(b,e.lockRef.current))},[]);h.useEffect(function(){return Eu.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,Cu),document.addEventListener("touchmove",f,Cu),document.addEventListener("touchstart",x,Cu),function(){Eu=Eu.filter(function(b){return b!==i}),document.removeEventListener("wheel",f,Cu),document.removeEventListener("touchmove",f,Cu),document.removeEventListener("touchstart",x,Cu)}},[]);var v=e.removeScrollBar,S=e.inert;return h.createElement(h.Fragment,null,S?h.createElement(i,{styles:dV(s)}):null,v?h.createElement(nV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pV=$H(f4,hV);var Rh=h.forwardRef(function(e,t){return h.createElement(tx,ho({},e,{ref:t,sideCar:pV}))});Rh.classNames=tx.classNames;var gV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wu=new WeakMap,vp=new WeakMap,bp={},J0=0,x4=function(e){return e&&(e.host||x4(e.parentNode))},xV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=x4(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})},yV=function(e,t,n,r){var s=xV(t,Array.isArray(e)?e:[e]);bp[n]||(bp[n]=new WeakMap);var i=bp[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 x=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(y){if(u.has(y))x(y);else try{var v=y.getAttribute(r),S=v!==null&&v!=="false",b=(wu.get(y)||0)+1,E=(i.get(y)||0)+1;wu.set(y,b),i.set(y,E),c.push(y),b===1&&S&&vp.set(y,!0),E===1&&y.setAttribute(n,"true"),S||y.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",y,R)}})};return x(t),u.clear(),J0++,function(){c.forEach(function(g){var y=wu.get(g)-1,v=i.get(g)-1;wu.set(g,y),i.set(g,v),y||(vp.has(g)||g.removeAttribute(r),vp.delete(g)),v||g.removeAttribute(n)}),J0--,J0||(wu=new WeakMap,wu=new WeakMap,vp=new WeakMap,bp={})}},nx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=gV(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),yV(r,s,n,"aria-hidden")):function(){return null}};function vV(e){const t=bV(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(CV);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function bV(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=wV(s),u=EV(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 SV=Symbol("radix.slottable");function CV(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SV}function EV(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 wV(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 rx="Dialog",[y4,v4]=Er(rx),[RV,Ys]=y4(rx),b4=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,x]=ca({prop:r,defaultProp:s??!1,onChange:i,caller:rx});return a.jsx(RV,{scope:t,triggerRef:u,contentRef:f,contentId:er(),titleId:er(),descriptionId:er(),open:m,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(g=>!g),[x]),modal:c,children:n})};b4.displayName=rx;var S4="DialogTrigger",C4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(S4,n),i=vt(t,s.triggerRef);return a.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":OS(s.open),...r,ref:i,onClick:Me(e.onClick,s.onOpenToggle)})});C4.displayName=S4;var AS="DialogPortal",[jV,E4]=y4(AS,{forceMount:void 0}),w4=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=Ys(AS,t);return a.jsx(jV,{scope:t,forceMount:n,children:h.Children.map(r,c=>a.jsx(qr,{present:n||i.open,children:a.jsx(Oc,{asChild:!0,container:s,children:c})}))})};w4.displayName=AS;var lg="DialogOverlay",R4=h.forwardRef((e,t)=>{const n=E4(lg,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ys(lg,e.__scopeDialog);return i.modal?a.jsx(qr,{present:r||i.open,children:a.jsx(_V,{...s,ref:t})}):null});R4.displayName=lg;var TV=vV("DialogOverlay.RemoveScroll"),_V=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(lg,n);return a.jsx(Rh,{as:TV,allowPinchZoom:!0,shards:[s.contentRef],children:a.jsx(et.div,{"data-state":OS(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),mc="DialogContent",j4=h.forwardRef((e,t)=>{const n=E4(mc,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=Ys(mc,e.__scopeDialog);return a.jsx(qr,{present:r||i.open,children:i.modal?a.jsx(NV,{...s,ref:t}):a.jsx(AV,{...s,ref:t})})});j4.displayName=mc;var NV=h.forwardRef((e,t)=>{const n=Ys(mc,e.__scopeDialog),r=h.useRef(null),s=vt(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return nx(i)},[]),a.jsx(T4,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Me(e.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault())})}),AV=h.forwardRef((e,t)=>{const n=Ys(mc,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(T4,{...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()}})}),T4=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=e,u=Ys(mc,n),f=h.useRef(null),m=vt(t,f);return ex(),a.jsxs(a.Fragment,{children:[a.jsx(wh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Dc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":OS(u.open),...c,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(OV,{titleId:u.titleId}),a.jsx(MV,{contentRef:f,descriptionId:u.descriptionId})]})]})}),DS="DialogTitle",_4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(DS,n);return a.jsx(et.h2,{id:s.titleId,...r,ref:t})});_4.displayName=DS;var N4="DialogDescription",A4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(N4,n);return a.jsx(et.p,{id:s.descriptionId,...r,ref:t})});A4.displayName=N4;var D4="DialogClose",O4=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Ys(D4,n);return a.jsx(et.button,{type:"button",...r,ref:t,onClick:Me(e.onClick,()=>s.onOpenChange(!1))})});O4.displayName=D4;function OS(e){return e?"open":"closed"}var I4="DialogTitleWarning",[DV,M4]=tH(I4,{contentName:mc,titleName:DS,docsSlug:"dialog"}),OV=({titleId:e})=>{const t=M4(I4),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
597
+
598
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
599
+
600
+ 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},IV="DialogDescriptionWarning",MV=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${M4(IV).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},ax=b4,kV=C4,sx=w4,ox=R4,ix=j4,IS=_4,MS=A4,lx=O4;function mi({...e}){return a.jsx(ax,{"data-slot":"sheet",...e})}function LV({...e}){return a.jsx(sx,{"data-slot":"sheet-portal",...e})}function PV({className:e,...t}){return a.jsx(ox,{"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 pi({className:e,children:t,side:n="right",...r}){return a.jsxs(LV,{children:[a.jsx(PV,{}),a.jsxs(ix,{"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(lx,{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(hc,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gi({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 xi({className:e,...t}){return a.jsx(IS,{"data-slot":"sheet-title",className:se("text-foreground font-semibold",e),...t})}function bl({className:e,...t}){return a.jsx(MS,{"data-slot":"sheet-description",className:se("text-muted-foreground text-sm",e),...t})}function $r({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:se("bg-accent animate-pulse rounded-md",e),...t})}const UV=["top","right","bottom","left"],ml=Math.min,Ya=Math.max,cg=Math.round,Sp=Math.floor,yo=e=>({x:e,y:e}),zV={left:"right",right:"left",bottom:"top",top:"bottom"},FV={start:"end",end:"start"};function nb(e,t,n){return Ya(e,ml(t,n))}function ui(e,t){return typeof e=="function"?e(t):e}function di(e){return e.split("-")[0]}function md(e){return e.split("-")[1]}function kS(e){return e==="x"?"y":"x"}function LS(e){return e==="y"?"height":"width"}const HV=new Set(["top","bottom"]);function mo(e){return HV.has(di(e))?"y":"x"}function PS(e){return kS(mo(e))}function VV(e,t,n){n===void 0&&(n=!1);const r=md(e),s=PS(e),i=LS(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=ug(c)),[c,ug(c)]}function $V(e){const t=ug(e);return[rb(e),t,rb(t)]}function rb(e){return e.replace(/start|end/g,t=>FV[t])}const IT=["left","right"],MT=["right","left"],BV=["top","bottom"],GV=["bottom","top"];function qV(e,t,n){switch(e){case"top":case"bottom":return n?t?MT:IT:t?IT:MT;case"left":case"right":return t?BV:GV;default:return[]}}function KV(e,t,n,r){const s=md(e);let i=qV(di(e),n==="start",r);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map(rb)))),i}function ug(e){return e.replace(/left|right|bottom|top/g,t=>zV[t])}function WV(e){return{top:0,right:0,bottom:0,left:0,...e}}function k4(e){return typeof e!="number"?WV(e):{top:e,right:e,bottom:e,left:e}}function dg(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 kT(e,t,n){let{reference:r,floating:s}=e;const i=mo(t),c=PS(t),u=LS(c),f=di(t),m=i==="y",x=r.x+r.width/2-s.width/2,g=r.y+r.height/2-s.height/2,y=r[u]/2-s[u]/2;let v;switch(f){case"top":v={x,y:r.y-s.height};break;case"bottom":v={x,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(md(t)){case"start":v[c]-=y*(n&&m?-1:1);break;case"end":v[c]+=y*(n&&m?-1:1);break}return v}const YV=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:g}=kT(m,r,f),y=r,v={},S=0;for(let b=0;b<u.length;b++){const{name:E,fn:R}=u[b],{x:j,y:_,data:D,reset:O}=await R({x,y:g,initialPlacement:r,placement:y,strategy:s,middlewareData:v,rects:m,platform:c,elements:{reference:e,floating:t}});x=j??x,g=_??g,v={...v,[E]:{...v[E],...D}},O&&S<=50&&(S++,typeof O=="object"&&(O.placement&&(y=O.placement),O.rects&&(m=O.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x,y:g}=kT(m,y,f)),b=-1)}return{x,y:g,placement:y,strategy:s,middlewareData:v}};async function eh(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:x="viewport",elementContext:g="floating",altBoundary:y=!1,padding:v=0}=ui(t,e),S=k4(v),E=u[y?g==="floating"?"reference":"floating":g],R=dg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(E)))==null||n?E:E.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:m,rootBoundary:x,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)),D=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},O=dg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:j,offsetParent:_,strategy:f}):j);return{top:(R.top-O.top+S.top)/D.y,bottom:(O.bottom-R.bottom+S.bottom)/D.y,left:(R.left-O.left+S.left)/D.x,right:(O.right-R.right+S.right)/D.x}}const ZV=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:x=0}=ui(e,t)||{};if(m==null)return{};const g=k4(x),y={x:n,y:r},v=PS(s),S=LS(v),b=await c.getDimensions(m),E=v==="y",R=E?"top":"left",j=E?"bottom":"right",_=E?"clientHeight":"clientWidth",D=i.reference[S]+i.reference[v]-y[v]-i.floating[S],O=y[v]-i.reference[v],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let T=A?A[_]:0;(!T||!await(c.isElement==null?void 0:c.isElement(A)))&&(T=u.floating[_]||i.floating[S]);const M=D/2-O/2,k=T/2-b[S]/2-1,z=ml(g[R],k),L=ml(g[j],k),G=z,B=T-b[S]-L,q=T/2-b[S]/2+M,V=nb(G,q,B),I=!f.arrow&&md(s)!=null&&q!==V&&i.reference[S]/2-(q<G?z:L)-b[S]/2<0,K=I?q<G?q-G:q-B:0;return{[v]:y[v]+K,data:{[v]:V,centerOffset:q-V-K,...I&&{alignmentOffset:K}},reset:I}}}),XV=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:x=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...E}=ui(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const R=di(s),j=mo(u),_=di(u)===u,D=await(f.isRTL==null?void 0:f.isRTL(m.floating)),O=y||(_||!b?[ug(u)]:$V(u)),A=S!=="none";!y&&A&&O.push(...KV(u,b,S,D));const T=[u,...O],M=await eh(t,E),k=[];let z=((r=i.flip)==null?void 0:r.overflows)||[];if(x&&k.push(M[R]),g){const q=VV(s,c,D);k.push(M[q[0]],M[q[1]])}if(z=[...z,{placement:s,overflows:k}],!k.every(q=>q<=0)){var L,G;const q=(((L=i.flip)==null?void 0:L.index)||0)+1,V=T[q];if(V&&(!(g==="alignment"?j!==mo(V):!1)||z.every($=>mo($.placement)===j?$.overflows[0]>0:!0)))return{data:{index:q,overflows:z},reset:{placement:V}};let I=(G=z.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:G.placement;if(!I)switch(v){case"bestFit":{var B;const K=(B=z.filter($=>{if(A){const ee=mo($.placement);return ee===j||ee==="y"}return!0}).map($=>[$.placement,$.overflows.filter(ee=>ee>0).reduce((ee,me)=>ee+me,0)]).sort(($,ee)=>$[1]-ee[1])[0])==null?void 0:B[0];K&&(I=K);break}case"initialPlacement":I=u;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function LT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function PT(e){return UV.some(t=>e[t]>=0)}const QV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=ui(e,t);switch(r){case"referenceHidden":{const i=await eh(t,{...s,elementContext:"reference"}),c=LT(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:PT(c)}}}case"escaped":{const i=await eh(t,{...s,altBoundary:!0}),c=LT(i,n.floating);return{data:{escapedOffsets:c,escaped:PT(c)}}}default:return{}}}}},L4=new Set(["left","top"]);async function JV(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=di(n),u=md(n),f=mo(n)==="y",m=L4.has(c)?-1:1,x=i&&f?-1:1,g=ui(t,e);let{mainAxis:y,crossAxis:v,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(v=u==="end"?S*-1:S),f?{x:v*x,y:y*m}:{x:y*m,y:v*x}}const e$=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 JV(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}}}}},t$=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:E=>{let{x:R,y:j}=E;return{x:R,y:j}}},...f}=ui(e,t),m={x:n,y:r},x=await eh(t,f),g=mo(di(s)),y=kS(g);let v=m[y],S=m[g];if(i){const E=y==="y"?"top":"left",R=y==="y"?"bottom":"right",j=v+x[E],_=v-x[R];v=nb(j,v,_)}if(c){const E=g==="y"?"top":"left",R=g==="y"?"bottom":"right",j=S+x[E],_=S-x[R];S=nb(j,S,_)}const b=u.fn({...t,[y]:v,[g]:S});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[y]:i,[g]:c}}}}}},n$=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}=ui(e,t),x={x:n,y:r},g=mo(s),y=kS(g);let v=x[y],S=x[g];const b=ui(u,t),E=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const _=y==="y"?"height":"width",D=i.reference[y]-i.floating[_]+E.mainAxis,O=i.reference[y]+i.reference[_]-E.mainAxis;v<D?v=D:v>O&&(v=O)}if(m){var R,j;const _=y==="y"?"width":"height",D=L4.has(di(s)),O=i.reference[g]-i.floating[_]+(D&&((R=c.offset)==null?void 0:R[g])||0)+(D?0:E.crossAxis),A=i.reference[g]+i.reference[_]+(D?0:((j=c.offset)==null?void 0:j[g])||0)-(D?E.crossAxis:0);S<O?S=O:S>A&&(S=A)}return{[y]:v,[g]:S}}}},r$=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}=ui(e,t),x=await eh(t,m),g=di(s),y=md(s),v=mo(s)==="y",{width:S,height:b}=i.floating;let E,R;g==="top"||g==="bottom"?(E=g,R=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,E=y==="end"?"top":"bottom");const j=b-x.top-x.bottom,_=S-x.left-x.right,D=ml(b-x[E],j),O=ml(S-x[R],_),A=!t.middlewareData.shift;let T=D,M=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),A&&!y){const z=Ya(x.left,0),L=Ya(x.right,0),G=Ya(x.top,0),B=Ya(x.bottom,0);v?M=S-2*(z!==0||L!==0?z+L:Ya(x.left,x.right)):T=b-2*(G!==0||B!==0?G+B:Ya(x.top,x.bottom))}await f({...t,availableWidth:M,availableHeight:T});const k=await c.getDimensions(u.floating);return S!==k.width||b!==k.height?{reset:{rects:!0}}:{}}}};function cx(){return typeof window<"u"}function pd(e){return P4(e)?(e.nodeName||"").toLowerCase():"#document"}function Qa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _o(e){var t;return(t=(P4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function P4(e){return cx()?e instanceof Node||e instanceof Qa(e).Node:!1}function $s(e){return cx()?e instanceof Element||e instanceof Qa(e).Element:!1}function Ro(e){return cx()?e instanceof HTMLElement||e instanceof Qa(e).HTMLElement:!1}function UT(e){return!cx()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qa(e).ShadowRoot}const a$=new Set(["inline","contents"]);function jh(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Bs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!a$.has(s)}const s$=new Set(["table","td","th"]);function o$(e){return s$.has(pd(e))}const i$=[":popover-open",":modal"];function ux(e){return i$.some(t=>{try{return e.matches(t)}catch{return!1}})}const l$=["transform","translate","scale","rotate","perspective"],c$=["transform","translate","scale","rotate","perspective","filter"],u$=["paint","layout","strict","content"];function US(e){const t=zS(),n=$s(e)?Bs(e):e;return l$.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)||c$.some(r=>(n.willChange||"").includes(r))||u$.some(r=>(n.contain||"").includes(r))}function d$(e){let t=pl(e);for(;Ro(t)&&!td(t);){if(US(t))return t;if(ux(t))return null;t=pl(t)}return null}function zS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const f$=new Set(["html","body","#document"]);function td(e){return f$.has(pd(e))}function Bs(e){return Qa(e).getComputedStyle(e)}function dx(e){return $s(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pl(e){if(pd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||UT(e)&&e.host||_o(e);return UT(t)?t.host:t}function U4(e){const t=pl(e);return td(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ro(t)&&jh(t)?t:U4(t)}function th(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=U4(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),c=Qa(s);if(i){const u=ab(c);return t.concat(c,c.visualViewport||[],jh(s)?s:[],u&&n?th(u):[])}return t.concat(s,th(s,[],n))}function ab(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function z4(e){const t=Bs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Ro(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=cg(n)!==i||cg(r)!==c;return u&&(n=i,r=c),{width:n,height:r,$:u}}function FS(e){return $s(e)?e:e.contextElement}function Bu(e){const t=FS(e);if(!Ro(t))return yo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=z4(t);let c=(i?cg(n.width):n.width)/r,u=(i?cg(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const h$=yo(0);function F4(e){const t=Qa(e);return!zS()||!t.visualViewport?h$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function m$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qa(e)?!1:t}function pc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=FS(e);let c=yo(1);t&&(r?$s(r)&&(c=Bu(r)):c=Bu(e));const u=m$(i,n,r)?F4(i):yo(0);let f=(s.left+u.x)/c.x,m=(s.top+u.y)/c.y,x=s.width/c.x,g=s.height/c.y;if(i){const y=Qa(i),v=r&&$s(r)?Qa(r):r;let S=y,b=ab(S);for(;b&&r&&v!==S;){const E=Bu(b),R=b.getBoundingClientRect(),j=Bs(b),_=R.left+(b.clientLeft+parseFloat(j.paddingLeft))*E.x,D=R.top+(b.clientTop+parseFloat(j.paddingTop))*E.y;f*=E.x,m*=E.y,x*=E.x,g*=E.y,f+=_,m+=D,S=Qa(b),b=ab(S)}}return dg({width:x,height:g,x:f,y:m})}function fx(e,t){const n=dx(e).scrollLeft;return t?t.left+n:pc(_o(e)).left+n}function H4(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-fx(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function p$(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",c=_o(r),u=t?ux(t.floating):!1;if(r===c||u&&i)return n;let f={scrollLeft:0,scrollTop:0},m=yo(1);const x=yo(0),g=Ro(r);if((g||!g&&!i)&&((pd(r)!=="body"||jh(c))&&(f=dx(r)),Ro(r))){const v=pc(r);m=Bu(r),x.x=v.x+r.clientLeft,x.y=v.y+r.clientTop}const y=c&&!g&&!i?H4(c,f):yo(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+x.x+y.x,y:n.y*m.y-f.scrollTop*m.y+x.y+y.y}}function g$(e){return Array.from(e.getClientRects())}function x$(e){const t=_o(e),n=dx(e),r=e.ownerDocument.body,s=Ya(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ya(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+fx(e);const u=-n.scrollTop;return Bs(r).direction==="rtl"&&(c+=Ya(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:c,y:u}}const zT=25;function y$(e,t){const n=Qa(e),r=_o(e),s=n.visualViewport;let i=r.clientWidth,c=r.clientHeight,u=0,f=0;if(s){i=s.width,c=s.height;const x=zS();(!x||x&&t==="fixed")&&(u=s.offsetLeft,f=s.offsetTop)}const m=fx(r);if(m<=0){const x=r.ownerDocument,g=x.body,y=getComputedStyle(g),v=x.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(r.clientWidth-g.clientWidth-v);S<=zT&&(i-=S)}else m<=zT&&(i+=m);return{width:i,height:c,x:u,y:f}}const v$=new Set(["absolute","fixed"]);function b$(e,t){const n=pc(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Ro(e)?Bu(e):yo(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 FT(e,t,n){let r;if(t==="viewport")r=y$(e,n);else if(t==="document")r=x$(_o(e));else if($s(t))r=b$(t,n);else{const s=F4(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return dg(r)}function V4(e,t){const n=pl(e);return n===t||!$s(n)||td(n)?!1:Bs(n).position==="fixed"||V4(n,t)}function S$(e,t){const n=t.get(e);if(n)return n;let r=th(e,[],!1).filter(u=>$s(u)&&pd(u)!=="body"),s=null;const i=Bs(e).position==="fixed";let c=i?pl(e):e;for(;$s(c)&&!td(c);){const u=Bs(c),f=US(c);!f&&u.position==="fixed"&&(s=null),(i?!f&&!s:!f&&u.position==="static"&&!!s&&v$.has(s.position)||jh(c)&&!f&&V4(e,c))?r=r.filter(x=>x!==c):s=u,c=pl(c)}return t.set(e,r),r}function C$(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?ux(t)?[]:S$(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((m,x)=>{const g=FT(t,x,s);return m.top=Ya(g.top,m.top),m.right=ml(g.right,m.right),m.bottom=ml(g.bottom,m.bottom),m.left=Ya(g.left,m.left),m},FT(t,u,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function E$(e){const{width:t,height:n}=z4(e);return{width:t,height:n}}function w$(e,t,n){const r=Ro(t),s=_o(t),i=n==="fixed",c=pc(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const f=yo(0);function m(){f.x=fx(s)}if(r||!r&&!i)if((pd(t)!=="body"||jh(s))&&(u=dx(t)),r){const v=pc(t,!0,i,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else s&&m();i&&!r&&s&&m();const x=s&&!r&&!i?H4(s,u):yo(0),g=c.left+u.scrollLeft-f.x-x.x,y=c.top+u.scrollTop-f.y-x.y;return{x:g,y,width:c.width,height:c.height}}function e1(e){return Bs(e).position==="static"}function HT(e,t){if(!Ro(e)||Bs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _o(e)===n&&(n=n.ownerDocument.body),n}function $4(e,t){const n=Qa(e);if(ux(e))return n;if(!Ro(e)){let s=pl(e);for(;s&&!td(s);){if($s(s)&&!e1(s))return s;s=pl(s)}return n}let r=HT(e,t);for(;r&&o$(r)&&e1(r);)r=HT(r,t);return r&&td(r)&&e1(r)&&!US(r)?n:r||d$(e)||n}const R$=async function(e){const t=this.getOffsetParent||$4,n=this.getDimensions,r=await n(e.floating);return{reference:w$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function j$(e){return Bs(e).direction==="rtl"}const T$={convertOffsetParentRelativeRectToViewportRelativeRect:p$,getDocumentElement:_o,getClippingRect:C$,getOffsetParent:$4,getElementRects:R$,getClientRects:g$,getDimensions:E$,getScale:Bu,isElement:$s,isRTL:j$};function B4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _$(e,t){let n=null,r;const s=_o(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:x,top:g,width:y,height:v}=m;if(u||t(),!y||!v)return;const S=Sp(g),b=Sp(s.clientWidth-(x+y)),E=Sp(s.clientHeight-(g+v)),R=Sp(x),_={rootMargin:-S+"px "+-b+"px "+-E+"px "+-R+"px",threshold:Ya(0,ml(1,f))||1};let D=!0;function O(A){const T=A[0].intersectionRatio;if(T!==f){if(!D)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!B4(m,e.getBoundingClientRect())&&c(),D=!1}try{n=new IntersectionObserver(O,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,_)}n.observe(e)}return c(!0),i}function N$(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=FS(e),x=s||i?[...m?th(m):[],...th(t)]:[];x.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),i&&R.addEventListener("resize",n)});const g=m&&u?_$(m,n):null;let y=-1,v=null;c&&(v=new ResizeObserver(R=>{let[j]=R;j&&j.target===m&&v&&(v.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var _;(_=v)==null||_.observe(t)})),n()}),m&&!f&&v.observe(m),v.observe(t));let S,b=f?pc(e):null;f&&E();function E(){const R=pc(e);b&&!B4(b,R)&&n(),b=R,S=requestAnimationFrame(E)}return n(),()=>{var R;x.forEach(j=>{s&&j.removeEventListener("scroll",n),i&&j.removeEventListener("resize",n)}),g==null||g(),(R=v)==null||R.disconnect(),v=null,f&&cancelAnimationFrame(S)}}const A$=e$,D$=t$,O$=XV,I$=r$,M$=QV,VT=ZV,k$=n$,L$=(e,t,n)=>{const r=new Map,s={platform:T$,...n},i={...s.platform,_c:r};return YV(e,t,{...s,platform:i})};var P$=typeof document<"u",U$=function(){},qp=P$?h.useLayoutEffect:U$;function fg(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(!fg(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)&&!fg(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function G4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $T(e,t){const n=G4(e);return Math.round(t*n)/n}function t1(e){const t=h.useRef(e);return qp(()=>{t.current=e}),t}function z$(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,[x,g]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,v]=h.useState(r);fg(y,r)||v(r);const[S,b]=h.useState(null),[E,R]=h.useState(null),j=h.useCallback($=>{$!==A.current&&(A.current=$,b($))},[]),_=h.useCallback($=>{$!==T.current&&(T.current=$,R($))},[]),D=i||S,O=c||E,A=h.useRef(null),T=h.useRef(null),M=h.useRef(x),k=f!=null,z=t1(f),L=t1(s),G=t1(m),B=h.useCallback(()=>{if(!A.current||!T.current)return;const $={placement:t,strategy:n,middleware:y};L.current&&($.platform=L.current),L$(A.current,T.current,$).then(ee=>{const me={...ee,isPositioned:G.current!==!1};q.current&&!fg(M.current,me)&&(M.current=me,Us.flushSync(()=>{g(me)}))})},[y,t,n,L,G]);qp(()=>{m===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[m]);const q=h.useRef(!1);qp(()=>(q.current=!0,()=>{q.current=!1}),[]),qp(()=>{if(D&&(A.current=D),O&&(T.current=O),D&&O){if(z.current)return z.current(D,O,B);B()}},[D,O,B,z,k]);const V=h.useMemo(()=>({reference:A,floating:T,setReference:j,setFloating:_}),[j,_]),I=h.useMemo(()=>({reference:D,floating:O}),[D,O]),K=h.useMemo(()=>{const $={position:n,left:0,top:0};if(!I.floating)return $;const ee=$T(I.floating,x.x),me=$T(I.floating,x.y);return u?{...$,transform:"translate("+ee+"px, "+me+"px)",...G4(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:me}},[n,u,I.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:B,refs:V,elements:I,floatingStyles:K}),[x,B,V,I,K])}const F$=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?VT({element:r.current,padding:s}).fn(n):{}:r?VT({element:r,padding:s}).fn(n):{}}}},H$=(e,t)=>({...A$(e),options:[e,t]}),V$=(e,t)=>({...D$(e),options:[e,t]}),$$=(e,t)=>({...k$(e),options:[e,t]}),B$=(e,t)=>({...O$(e),options:[e,t]}),G$=(e,t)=>({...I$(e),options:[e,t]}),q$=(e,t)=>({...M$(e),options:[e,t]}),K$=(e,t)=>({...F$(e),options:[e,t]});var W$="Arrow",q4=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return a.jsx(et.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"})})});q4.displayName=W$;var Y$=q4;function HS(e){const[t,n]=h.useState(void 0);return Br(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const 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 VS="Popper",[K4,No]=Er(VS),[Z$,W4]=K4(VS),Y4=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return a.jsx(Z$,{scope:t,anchor:r,onAnchorChange:s,children:n})};Y4.displayName=VS;var Z4="PopperAnchor",X4=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=W4(Z4,n),c=h.useRef(null),u=vt(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(et.div,{...s,ref:u})});X4.displayName=Z4;var $S="PopperContent",[X$,Q$]=K4($S),Q4=h.forwardRef((e,t)=>{var J,ie,ye,Ee,He,Re;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:x=0,sticky:g="partial",hideWhenDetached:y=!1,updatePositionStrategy:v="optimized",onPlaced:S,...b}=e,E=W4($S,n),[R,j]=h.useState(null),_=vt(t,Ke=>j(Ke)),[D,O]=h.useState(null),A=HS(D),T=(A==null?void 0:A.width)??0,M=(A==null?void 0:A.height)??0,k=r+(i!=="center"?"-"+i:""),z=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},L=Array.isArray(m)?m:[m],G=L.length>0,B={padding:z,boundary:L.filter(eB),altBoundary:G},{refs:q,floatingStyles:V,placement:I,isPositioned:K,middlewareData:$}=z$({strategy:"fixed",placement:k,whileElementsMounted:(...Ke)=>N$(...Ke,{animationFrame:v==="always"}),elements:{reference:E.anchor},middleware:[H$({mainAxis:s+M,alignmentAxis:c}),f&&V$({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?$$():void 0,...B}),f&&B$({...B}),G$({...B,apply:({elements:Ke,rects:nt,availableWidth:Gt,availableHeight:Ft})=>{const{width:On,height:vn}=nt.reference,ke=Ke.floating.style;ke.setProperty("--radix-popper-available-width",`${Gt}px`),ke.setProperty("--radix-popper-available-height",`${Ft}px`),ke.setProperty("--radix-popper-anchor-width",`${On}px`),ke.setProperty("--radix-popper-anchor-height",`${vn}px`)}}),D&&K$({element:D,padding:u}),tB({arrowWidth:T,arrowHeight:M}),y&&q$({strategy:"referenceHidden",...B})]}),[ee,me]=t3(I),U=Vs(S);Br(()=>{K&&(U==null||U())},[K,U]);const F=(J=$.arrow)==null?void 0:J.x,H=(ie=$.arrow)==null?void 0:ie.y,W=((ye=$.arrow)==null?void 0:ye.centerOffset)!==0,[Q,le]=h.useState();return Br(()=>{R&&le(window.getComputedStyle(R).zIndex)},[R]),a.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:K?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(Ee=$.transformOrigin)==null?void 0:Ee.x,(He=$.transformOrigin)==null?void 0:He.y].join(" "),...((Re=$.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(X$,{scope:n,placedSide:ee,onArrowChange:O,arrowX:F,arrowY:H,shouldHideArrow:W,children:a.jsx(et.div,{"data-side":ee,"data-align":me,...b,ref:_,style:{...b.style,animation:K?void 0:"none"}})})})});Q4.displayName=$S;var J4="PopperArrow",J$={top:"bottom",right:"left",bottom:"top",left:"right"},e3=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=Q$(J4,r),c=J$[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(Y$,{...s,ref:n,style:{...s.style,display:"block"}})})});e3.displayName=J4;function eB(e){return e!==null}var tB=e=>({name:"transformOrigin",options:e,fn(t){var E,R,j;const{placement:n,rects:r,middlewareData:s}=t,c=((E=s.arrow)==null?void 0:E.centerOffset)!==0,u=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,x]=t3(n),g={start:"0%",center:"50%",end:"100%"}[x],y=(((R=s.arrow)==null?void 0:R.x)??0)+u/2,v=(((j=s.arrow)==null?void 0:j.y)??0)+f/2;let S="",b="";return m==="bottom"?(S=c?g:`${y}px`,b=`${-f}px`):m==="top"?(S=c?g:`${y}px`,b=`${r.floating.height+f}px`):m==="right"?(S=`${-f}px`,b=c?g:`${v}px`):m==="left"&&(S=`${r.floating.width+f}px`,b=c?g:`${v}px`),{data:{x:S,y:b}}}});function t3(e){const[t,n="center"]=e.split("-");return[t,n]}var gd=Y4,xd=X4,Th=Q4,_h=e3,nB=Symbol("radix.slottable");function rB(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=nB,t}var n3=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"}),aB="VisuallyHidden",r3=h.forwardRef((e,t)=>a.jsx(et.span,{...e,ref:t,style:{...n3,...e.style}}));r3.displayName=aB;var sB=r3,[hx]=Er("Tooltip",[No]),mx=No(),a3="TooltipProvider",oB=700,sb="tooltip.open",[iB,BS]=hx(a3),s3=e=>{const{__scopeTooltip:t,delayDuration:n=oB,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(iB,{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})};s3.displayName=a3;var nh="Tooltip",[lB,Nh]=hx(nh),o3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:c,delayDuration:u}=e,f=BS(nh,e.__scopeTooltip),m=mx(t),[x,g]=h.useState(null),y=er(),v=h.useRef(0),S=c??f.disableHoverableContent,b=u??f.delayDuration,E=h.useRef(!1),[R,j]=ca({prop:r,defaultProp:s??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(sb))):f.onClose(),i==null||i(T)},caller:nh}),_=h.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),D=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E.current=!1,j(!0)},[j]),O=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,j(!1)},[j]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{E.current=!0,j(!0),v.current=0},b)},[b,j]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),a.jsx(gd,{...m,children:a.jsx(lB,{scope:t,contentId:y,open:R,stateAttribute:_,trigger:x,onTriggerChange:g,onTriggerEnter:h.useCallback(()=>{f.isOpenDelayedRef.current?A():D()},[f.isOpenDelayedRef,A,D]),onTriggerLeave:h.useCallback(()=>{S?O():(window.clearTimeout(v.current),v.current=0)},[O,S]),onOpen:D,onClose:O,disableHoverableContent:S,children:n})})};o3.displayName=nh;var ob="TooltipTrigger",i3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Nh(ob,n),i=BS(ob,n),c=mx(n),u=h.useRef(null),f=vt(t,u,s.onTriggerChange),m=h.useRef(!1),x=h.useRef(!1),g=h.useCallback(()=>m.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),a.jsx(xd,{asChild:!0,...c,children:a.jsx(et.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Me(e.onPointerMove,y=>{y.pointerType!=="touch"&&!x.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),x.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{s.onTriggerLeave(),x.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:Me(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Me(e.onBlur,s.onClose),onClick:Me(e.onClick,s.onClose)})})});i3.displayName=ob;var GS="TooltipPortal",[cB,uB]=hx(GS,{forceMount:void 0}),l3=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,i=Nh(GS,t);return a.jsx(cB,{scope:t,forceMount:n,children:a.jsx(qr,{present:n||i.open,children:a.jsx(Oc,{asChild:!0,container:s,children:r})})})};l3.displayName=GS;var nd="TooltipContent",c3=h.forwardRef((e,t)=>{const n=uB(nd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,c=Nh(nd,e.__scopeTooltip);return a.jsx(qr,{present:r||c.open,children:c.disableHoverableContent?a.jsx(u3,{side:s,...i,ref:t}):a.jsx(dB,{side:s,...i,ref:t})})}),dB=h.forwardRef((e,t)=>{const n=Nh(nd,e.__scopeTooltip),r=BS(nd,e.__scopeTooltip),s=h.useRef(null),i=vt(t,s),[c,u]=h.useState(null),{trigger:f,onClose:m}=n,x=s.current,{onPointerInTransitChange:g}=r,y=h.useCallback(()=>{u(null),g(!1)},[g]),v=h.useCallback((S,b)=>{const E=S.currentTarget,R={x:S.clientX,y:S.clientY},j=pB(R,E.getBoundingClientRect()),_=gB(R,j),D=xB(b.getBoundingClientRect()),O=vB([..._,...D]);u(O),g(!0)},[g]);return h.useEffect(()=>()=>y(),[y]),h.useEffect(()=>{if(f&&x){const S=E=>v(E,x),b=E=>v(E,f);return f.addEventListener("pointerleave",S),x.addEventListener("pointerleave",b),()=>{f.removeEventListener("pointerleave",S),x.removeEventListener("pointerleave",b)}}},[f,x,v,y]),h.useEffect(()=>{if(c){const S=b=>{const E=b.target,R={x:b.clientX,y:b.clientY},j=(f==null?void 0:f.contains(E))||(x==null?void 0:x.contains(E)),_=!yB(R,c);j?y():_&&(y(),m())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[f,x,c,m,y]),a.jsx(u3,{...e,ref:i})}),[fB,hB]=hx(nh,{isInside:!1}),mB=rB("TooltipContent"),u3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:c,...u}=e,f=Nh(nd,n),m=mx(n),{onClose:x}=f;return h.useEffect(()=>(document.addEventListener(sb,x),()=>document.removeEventListener(sb,x)),[x]),h.useEffect(()=>{if(f.trigger){const g=y=>{const v=y.target;v!=null&&v.contains(f.trigger)&&x()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[f.trigger,x]),a.jsx(Dc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:g=>g.preventDefault(),onDismiss:x,children:a.jsxs(Th,{"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(mB,{children:r}),a.jsx(fB,{scope:n,isInside:!0,children:a.jsx(sB,{id:f.contentId,role:"tooltip",children:s||r})})]})})});c3.displayName=nd;var d3="TooltipArrow",f3=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=mx(n);return hB(d3,n).isInside?null:a.jsx(_h,{...s,...r,ref:t})});f3.displayName=d3;function pB(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 gB(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 xB(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 yB(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,x=u.y,g=f.x,y=f.y;x>r!=y>r&&n<(g-m)*(r-x)/(y-x)+m&&(s=!s)}return s}function vB(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),bB(t)}function bB(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 SB=s3,CB=o3,EB=i3,wB=l3,RB=c3,jB=f3;function Xa({delayDuration:e=0,...t}){return a.jsx(SB,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function wt({...e}){return a.jsx(Xa,{children:a.jsx(CB,{"data-slot":"tooltip",...e})})}function Rt({...e}){return a.jsx(EB,{"data-slot":"tooltip-trigger",...e})}function jt({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(wB,{children:a.jsxs(RB,{"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(jB,{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 TB="sidebar_state",_B=3600*24*7,NB="16rem",AB="18rem",DB="3rem",OB="b",h3=h.createContext(null);function Ah(){const e=h.useContext(h3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function IB({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:i,...c}){const u=oF(),[f,m]=h.useState(!1),[x,g]=h.useState(e),y=t??x,v=h.useCallback(R=>{const j=typeof R=="function"?R(y):R;n?n(j):g(j),document.cookie=`${TB}=${j}; path=/; max-age=${_B}`},[n,y]),S=h.useCallback(()=>u?m(R=>!R):v(R=>!R),[u,v,m]);h.useEffect(()=>{const R=j=>{j.key===OB&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),S())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[S]);const b=y?"expanded":"collapsed",E=h.useMemo(()=>({state:b,open:y,setOpen:v,isMobile:u,openMobile:f,setOpenMobile:m,toggleSidebar:S}),[b,y,v,u,f,m,S]);return a.jsx(h3.Provider,{value:E,children:a.jsx(Xa,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":NB,"--sidebar-width-icon":DB,...s},className:se("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:i})})})}function MB({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...i}){const{isMobile:c,state:u,openMobile:f,setOpenMobile:m}=Ah();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(mi,{open:f,onOpenChange:m,...i,children:a.jsxs(pi,{"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":AB},side:e,children:[a.jsxs(gi,{className:"sr-only",children:[a.jsx(xi,{children:"Sidebar"}),a.jsx(bl,{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 kB({className:e,onClick:t,...n}){const{toggleSidebar:r}=Ah();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(oz,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function LB({className:e,...t}){const{toggleSidebar:n}=Ah();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 PB({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 UB({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 zB({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 FB({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 BT({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 GT({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 HB({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 VB({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 $B=_c("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 BB({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:i,...c}){const u=e?bh:"button",{isMobile:f,state:m}=Ah(),x=a.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:se($B({variant:n,size:r}),i),...c});return s?(typeof s=="string"&&(s={children:s}),a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:x}),a.jsx(jt,{side:"right",align:"center",hidden:m!=="collapsed"||f,...s})]})):x}function ib(e){const t=GB(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(KB);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function GB(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=YB(s),u=WB(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 qB=Symbol("radix.slottable");function KB(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qB}function WB(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 YB(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 ZB(e){const t=e+"CollectionProvider",[n,r]=Er(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:E,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=ib(u),m=ae.forwardRef((b,E)=>{const{scope:R,children:j}=b,_=i(u,R),D=vt(E,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=ib(x),v=ae.forwardRef((b,E)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=vt(E,D),A=i(x,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(y,{[g]:"",ref:O,children:j})});v.displayName=x;function S(b){const E=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}var XB=h.createContext(void 0);function Dh(e){const t=h.useContext(XB);return e||t||"ltr"}function qT(e){const t=QB(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(eG);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function QB(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=nG(s),u=tG(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 JB=Symbol("radix.slottable");function eG(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===JB}function tG(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 nG(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 rG(e){const t=e+"CollectionProvider",[n,r]=Er(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:E,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=qT(u),m=ae.forwardRef((b,E)=>{const{scope:R,children:j}=b,_=i(u,R),D=vt(E,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=qT(x),v=ae.forwardRef((b,E)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=vt(E,D),A=i(x,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(y,{[g]:"",ref:O,children:j})});v.displayName=x;function S(b){const E=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}var n1="rovingFocusGroup.onEntryFocus",aG={bubbles:!1,cancelable:!0},Oh="RovingFocusGroup",[lb,m3,sG]=rG(Oh),[oG,px]=Er(Oh,[sG]),[iG,lG]=oG(Oh),p3=h.forwardRef((e,t)=>a.jsx(lb.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(lb.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(cG,{...e,ref:t})})}));p3.displayName=Oh;var cG=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:x=!1,...g}=e,y=h.useRef(null),v=vt(t,y),S=Dh(i),[b,E]=ca({prop:c,defaultProp:u??null,onChange:f,caller:Oh}),[R,j]=h.useState(!1),_=Vs(m),D=m3(n),O=h.useRef(!1),[A,T]=h.useState(0);return h.useEffect(()=>{const M=y.current;if(M)return M.addEventListener(n1,_),()=>M.removeEventListener(n1,_)},[_]),a.jsx(iG,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:b,onItemFocus:h.useCallback(M=>E(M),[E]),onItemShiftTab:h.useCallback(()=>j(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:h.useCallback(()=>T(M=>M-1),[]),children:a.jsx(et.div,{tabIndex:R||A===0?-1:0,"data-orientation":r,...g,ref:v,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{O.current=!0}),onFocus:Me(e.onFocus,M=>{const k=!O.current;if(M.target===M.currentTarget&&k&&!R){const z=new CustomEvent(n1,aG);if(M.currentTarget.dispatchEvent(z),!z.defaultPrevented){const L=D().filter(I=>I.focusable),G=L.find(I=>I.active),B=L.find(I=>I.id===b),V=[G,B,...L].filter(Boolean).map(I=>I.ref.current);y3(V,x)}}O.current=!1}),onBlur:Me(e.onBlur,()=>j(!1))})})}),g3="RovingFocusGroupItem",x3=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:c,...u}=e,f=er(),m=i||f,x=lG(g3,n),g=x.currentTabStopId===m,y=m3(n),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:b}=x;return h.useEffect(()=>{if(r)return v(),()=>S()},[r,v,S]),a.jsx(lb.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:a.jsx(et.span,{tabIndex:g?0:-1,"data-orientation":x.orientation,...u,ref:t,onMouseDown:Me(e.onMouseDown,E=>{r?x.onItemFocus(m):E.preventDefault()}),onFocus:Me(e.onFocus,()=>x.onItemFocus(m)),onKeyDown:Me(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){x.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=fG(E,x.orientation,x.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let _=y().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const D=_.indexOf(E.currentTarget);_=x.loop?hG(_,D+1):_.slice(D+1)}setTimeout(()=>y3(_))}}),children:typeof c=="function"?c({isCurrentTabStop:g,hasTabStop:b!=null}):c})})});x3.displayName=g3;var uG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function fG(e,t,n){const r=dG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return uG[r]}function y3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function hG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var v3=p3,b3=x3,cb=["Enter"," "],mG=["ArrowDown","PageUp","Home"],S3=["ArrowUp","PageDown","End"],pG=[...mG,...S3],gG={ltr:[...cb,"ArrowRight"],rtl:[...cb,"ArrowLeft"]},xG={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ih="Menu",[rh,yG,vG]=ZB(Ih),[Ic,C3]=Er(Ih,[vG,No,px]),Mh=No(),E3=px(),[w3,Sl]=Ic(Ih),[bG,kh]=Ic(Ih),R3=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:c=!0}=e,u=Mh(t),[f,m]=h.useState(null),x=h.useRef(!1),g=Vs(i),y=Dh(s);return h.useEffect(()=>{const v=()=>{x.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>x.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),a.jsx(gd,{...u,children:a.jsx(w3,{scope:t,open:n,onOpenChange:g,content:f,onContentChange:m,children:a.jsx(bG,{scope:t,onClose:h.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:x,dir:y,modal:c,children:r})})})};R3.displayName=Ih;var SG="MenuAnchor",qS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Mh(n);return a.jsx(xd,{...s,...r,ref:t})});qS.displayName=SG;var KS="MenuPortal",[CG,j3]=Ic(KS,{forceMount:void 0}),T3=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=Sl(KS,t);return a.jsx(CG,{scope:t,forceMount:n,children:a.jsx(qr,{present:n||i.open,children:a.jsx(Oc,{asChild:!0,container:s,children:r})})})};T3.displayName=KS;var ys="MenuContent",[EG,WS]=Ic(ys),_3=h.forwardRef((e,t)=>{const n=j3(ys,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Sl(ys,e.__scopeMenu),c=kh(ys,e.__scopeMenu);return a.jsx(rh.Provider,{scope:e.__scopeMenu,children:a.jsx(qr,{present:r||i.open,children:a.jsx(rh.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(wG,{...s,ref:t}):a.jsx(RG,{...s,ref:t})})})})}),wG=h.forwardRef((e,t)=>{const n=Sl(ys,e.__scopeMenu),r=h.useRef(null),s=vt(t,r);return h.useEffect(()=>{const i=r.current;if(i)return nx(i)},[]),a.jsx(YS,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Me(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),RG=h.forwardRef((e,t)=>{const n=Sl(ys,e.__scopeMenu);return a.jsx(YS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),jG=ib("MenuContent.ScrollLock"),YS=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:g,onInteractOutside:y,onDismiss:v,disableOutsideScroll:S,...b}=e,E=Sl(ys,n),R=kh(ys,n),j=Mh(n),_=E3(n),D=yG(n),[O,A]=h.useState(null),T=h.useRef(null),M=vt(t,T,E.onContentChange),k=h.useRef(0),z=h.useRef(""),L=h.useRef(0),G=h.useRef(null),B=h.useRef("right"),q=h.useRef(0),V=S?Rh:h.Fragment,I=S?{as:jG,allowPinchZoom:!0}:void 0,K=ee=>{var J,ie;const me=z.current+ee,U=D().filter(ye=>!ye.disabled),F=document.activeElement,H=(J=U.find(ye=>ye.ref.current===F))==null?void 0:J.textValue,W=U.map(ye=>ye.textValue),Q=UG(W,me,H),le=(ie=U.find(ye=>ye.textValue===Q))==null?void 0:ie.ref.current;(function ye(Ee){z.current=Ee,window.clearTimeout(k.current),Ee!==""&&(k.current=window.setTimeout(()=>ye(""),1e3))})(me),le&&setTimeout(()=>le.focus())};h.useEffect(()=>()=>window.clearTimeout(k.current),[]),ex();const $=h.useCallback(ee=>{var U,F;return B.current===((U=G.current)==null?void 0:U.side)&&FG(ee,(F=G.current)==null?void 0:F.area)},[]);return a.jsx(EG,{scope:n,searchRef:z,onItemEnter:h.useCallback(ee=>{$(ee)&&ee.preventDefault()},[$]),onItemLeave:h.useCallback(ee=>{var me;$(ee)||((me=T.current)==null||me.focus(),A(null))},[$]),onTriggerLeave:h.useCallback(ee=>{$(ee)&&ee.preventDefault()},[$]),pointerGraceTimerRef:L,onPointerGraceIntentChange:h.useCallback(ee=>{G.current=ee},[]),children:a.jsx(V,{...I,children:a.jsx(wh,{asChild:!0,trapped:s,onMountAutoFocus:Me(i,ee=>{var me;ee.preventDefault(),(me=T.current)==null||me.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(Dc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:x,onFocusOutside:g,onInteractOutside:y,onDismiss:v,children:a.jsx(v3,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:A,onEntryFocus:Me(f,ee=>{R.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Th,{role:"menu","aria-orientation":"vertical","data-state":G3(E.open),"data-radix-menu-content":"",dir:R.dir,...j,...b,ref:M,style:{outline:"none",...b.style},onKeyDown:Me(b.onKeyDown,ee=>{const U=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,F=ee.ctrlKey||ee.altKey||ee.metaKey,H=ee.key.length===1;U&&(ee.key==="Tab"&&ee.preventDefault(),!F&&H&&K(ee.key));const W=T.current;if(ee.target!==W||!pG.includes(ee.key))return;ee.preventDefault();const le=D().filter(J=>!J.disabled).map(J=>J.ref.current);S3.includes(ee.key)&&le.reverse(),LG(le)}),onBlur:Me(e.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(k.current),z.current="")}),onPointerMove:Me(e.onPointerMove,ah(ee=>{const me=ee.target,U=q.current!==ee.clientX;if(ee.currentTarget.contains(me)&&U){const F=ee.clientX>q.current?"right":"left";B.current=F,q.current=ee.clientX}}))})})})})})})});_3.displayName=ys;var TG="MenuGroup",ZS=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{role:"group",...r,ref:t})});ZS.displayName=TG;var _G="MenuLabel",N3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{...r,ref:t})});N3.displayName=_G;var hg="MenuItem",KT="menu.itemSelect",gx=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=h.useRef(null),c=kh(hg,e.__scopeMenu),u=WS(hg,e.__scopeMenu),f=vt(t,i),m=h.useRef(!1),x=()=>{const g=i.current;if(!n&&g){const y=new CustomEvent(KT,{bubbles:!0,cancelable:!0});g.addEventListener(KT,v=>r==null?void 0:r(v),{once:!0}),o4(g,y),y.defaultPrevented?m.current=!1:c.onClose()}};return a.jsx(A3,{...s,ref:f,disabled:n,onClick:Me(e.onClick,x),onPointerDown:g=>{var y;(y=e.onPointerDown)==null||y.call(e,g),m.current=!0},onPointerUp:Me(e.onPointerUp,g=>{var y;m.current||(y=g.currentTarget)==null||y.click()}),onKeyDown:Me(e.onKeyDown,g=>{const y=u.searchRef.current!=="";n||y&&g.key===" "||cb.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});gx.displayName=hg;var A3=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,c=WS(hg,n),u=E3(n),f=h.useRef(null),m=vt(t,f),[x,g]=h.useState(!1),[y,v]=h.useState("");return h.useEffect(()=>{const S=f.current;S&&v((S.textContent??"").trim())},[i.children]),a.jsx(rh.ItemSlot,{scope:n,disabled:r,textValue:s??y,children:a.jsx(b3,{asChild:!0,...u,focusable:!r,children:a.jsx(et.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:m,onPointerMove:Me(e.onPointerMove,ah(S=>{r?c.onItemLeave(S):(c.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Me(e.onPointerLeave,ah(S=>c.onItemLeave(S))),onFocus:Me(e.onFocus,()=>g(!0)),onBlur:Me(e.onBlur,()=>g(!1))})})})}),NG="MenuCheckboxItem",D3=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return a.jsx(L3,{scope:e.__scopeMenu,checked:n,children:a.jsx(gx,{role:"menuitemcheckbox","aria-checked":mg(n)?"mixed":n,...s,ref:t,"data-state":JS(n),onSelect:Me(s.onSelect,()=>r==null?void 0:r(mg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});D3.displayName=NG;var O3="MenuRadioGroup",[AG,DG]=Ic(O3,{value:void 0,onValueChange:()=>{}}),I3=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Vs(r);return a.jsx(AG,{scope:e.__scopeMenu,value:n,onValueChange:i,children:a.jsx(ZS,{...s,ref:t})})});I3.displayName=O3;var M3="MenuRadioItem",k3=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=DG(M3,e.__scopeMenu),i=n===s.value;return a.jsx(L3,{scope:e.__scopeMenu,checked:i,children:a.jsx(gx,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":JS(i),onSelect:Me(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});k3.displayName=M3;var XS="MenuItemIndicator",[L3,OG]=Ic(XS,{checked:!1}),P3=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=OG(XS,n);return a.jsx(qr,{present:r||mg(i.checked)||i.checked===!0,children:a.jsx(et.span,{...s,ref:t,"data-state":JS(i.checked)})})});P3.displayName=XS;var IG="MenuSeparator",U3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});U3.displayName=IG;var MG="MenuArrow",z3=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Mh(n);return a.jsx(_h,{...s,...r,ref:t})});z3.displayName=MG;var QS="MenuSub",[kG,F3]=Ic(QS),H3=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,i=Sl(QS,t),c=Mh(t),[u,f]=h.useState(null),[m,x]=h.useState(null),g=Vs(s);return h.useEffect(()=>(i.open===!1&&g(!1),()=>g(!1)),[i.open,g]),a.jsx(gd,{...c,children:a.jsx(w3,{scope:t,open:r,onOpenChange:g,content:m,onContentChange:x,children:a.jsx(kG,{scope:t,contentId:er(),triggerId:er(),trigger:u,onTriggerChange:f,children:n})})})};H3.displayName=QS;var Lf="MenuSubTrigger",V3=h.forwardRef((e,t)=>{const n=Sl(Lf,e.__scopeMenu),r=kh(Lf,e.__scopeMenu),s=F3(Lf,e.__scopeMenu),i=WS(Lf,e.__scopeMenu),c=h.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:f}=i,m={__scopeMenu:e.__scopeMenu},x=h.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return h.useEffect(()=>x,[x]),h.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),f(null)}},[u,f]),a.jsx(qS,{asChild:!0,...m,children:a.jsx(A3,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":G3(n.open),...e,ref:Qr(t,s.onTriggerChange),onClick:g=>{var y;(y=e.onClick)==null||y.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Me(e.onPointerMove,ah(g=>{i.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(i.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),x()},100))})),onPointerLeave:Me(e.onPointerLeave,ah(g=>{var v,S;x();const y=(v=n.content)==null?void 0:v.getBoundingClientRect();if(y){const b=(S=n.content)==null?void 0:S.dataset.side,E=b==="right",R=E?-5:5,j=y[E?"left":"right"],_=y[E?"right":"left"];i.onPointerGraceIntentChange({area:[{x:g.clientX+R,y:g.clientY},{x:j,y:y.top},{x:_,y:y.top},{x:_,y:y.bottom},{x:j,y:y.bottom}],side:b}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(g),g.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Me(e.onKeyDown,g=>{var v;const y=i.searchRef.current!=="";e.disabled||y&&g.key===" "||gG[r.dir].includes(g.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),g.preventDefault())})})})});V3.displayName=Lf;var $3="MenuSubContent",B3=h.forwardRef((e,t)=>{const n=j3(ys,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=Sl(ys,e.__scopeMenu),c=kh(ys,e.__scopeMenu),u=F3($3,e.__scopeMenu),f=h.useRef(null),m=vt(t,f);return a.jsx(rh.Provider,{scope:e.__scopeMenu,children:a.jsx(qr,{present:r||i.open,children:a.jsx(rh.Slot,{scope:e.__scopeMenu,children:a.jsx(YS,{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:x=>{var g;c.isUsingKeyboardRef.current&&((g=f.current)==null||g.focus()),x.preventDefault()},onCloseAutoFocus:x=>x.preventDefault(),onFocusOutside:Me(e.onFocusOutside,x=>{x.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Me(e.onEscapeKeyDown,x=>{c.onClose(),x.preventDefault()}),onKeyDown:Me(e.onKeyDown,x=>{var v;const g=x.currentTarget.contains(x.target),y=xG[c.dir].includes(x.key);g&&y&&(i.onOpenChange(!1),(v=u.trigger)==null||v.focus(),x.preventDefault())})})})})})});B3.displayName=$3;function G3(e){return e?"open":"closed"}function mg(e){return e==="indeterminate"}function JS(e){return mg(e)?"indeterminate":e?"checked":"unchecked"}function LG(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function PG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function UG(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=PG(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 zG(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,x=u.y,g=f.x,y=f.y;x>r!=y>r&&n<(g-m)*(r-x)/(y-x)+m&&(s=!s)}return s}function FG(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return zG(n,t)}function ah(e){return t=>t.pointerType==="mouse"?e(t):void 0}var HG=R3,VG=qS,$G=T3,BG=_3,GG=ZS,qG=N3,KG=gx,WG=D3,YG=I3,ZG=k3,XG=P3,QG=U3,JG=z3,eq=H3,tq=V3,nq=B3,xx="DropdownMenu",[rq]=Er(xx,[C3]),Jr=C3(),[aq,q3]=rq(xx),K3=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:c,modal:u=!0}=e,f=Jr(t),m=h.useRef(null),[x,g]=ca({prop:s,defaultProp:i??!1,onChange:c,caller:xx});return a.jsx(aq,{scope:t,triggerId:er(),triggerRef:m,contentId:er(),open:x,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(y=>!y),[g]),modal:u,children:a.jsx(HG,{...f,open:x,onOpenChange:g,dir:r,modal:u,children:n})})};K3.displayName=xx;var W3="DropdownMenuTrigger",Y3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=q3(W3,n),c=Jr(n);return a.jsx(VG,{asChild:!0,...c,children:a.jsx(et.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Qr(t,i.triggerRef),onPointerDown:Me(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:Me(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});Y3.displayName=W3;var sq="DropdownMenuPortal",Z3=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Jr(t);return a.jsx($G,{...r,...n})};Z3.displayName=sq;var X3="DropdownMenuContent",Q3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=q3(X3,n),i=Jr(n),c=h.useRef(!1);return a.jsx(BG,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:Me(e.onCloseAutoFocus,u=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,u.preventDefault()}),onInteractOutside:Me(e.onInteractOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,x=f.button===2||m;(!s.modal||x)&&(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)"}})});Q3.displayName=X3;var oq="DropdownMenuGroup",iq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(GG,{...s,...r,ref:t})});iq.displayName=oq;var lq="DropdownMenuLabel",cq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(qG,{...s,...r,ref:t})});cq.displayName=lq;var uq="DropdownMenuItem",J3=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(KG,{...s,...r,ref:t})});J3.displayName=uq;var dq="DropdownMenuCheckboxItem",fq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(WG,{...s,...r,ref:t})});fq.displayName=dq;var hq="DropdownMenuRadioGroup",mq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(YG,{...s,...r,ref:t})});mq.displayName=hq;var pq="DropdownMenuRadioItem",gq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(ZG,{...s,...r,ref:t})});gq.displayName=pq;var xq="DropdownMenuItemIndicator",yq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(XG,{...s,...r,ref:t})});yq.displayName=xq;var vq="DropdownMenuSeparator",eD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(QG,{...s,...r,ref:t})});eD.displayName=vq;var bq="DropdownMenuArrow",Sq=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(JG,{...s,...r,ref:t})});Sq.displayName=bq;var Cq=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:i}=e,c=Jr(t),[u,f]=ca({prop:r,defaultProp:i??!1,onChange:s,caller:"DropdownMenuSub"});return a.jsx(eq,{...c,open:u,onOpenChange:f,children:n})},Eq="DropdownMenuSubTrigger",tD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(tq,{...s,...r,ref:t})});tD.displayName=Eq;var wq="DropdownMenuSubContent",nD=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Jr(n);return a.jsx(nq,{...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)"}})});nD.displayName=wq;var Rq=K3,jq=Y3,rD=Z3,Tq=Q3,_q=J3,Nq=eD,Aq=Cq,Dq=tD,Oq=nD;function wr({...e}){return a.jsx(Rq,{"data-slot":"dropdown-menu",...e})}function Iq({...e}){return a.jsx(rD,{"data-slot":"dropdown-menu-portal",...e})}function Rr({...e}){return a.jsx(jq,{"data-slot":"dropdown-menu-trigger",...e})}function jr({className:e,sideOffset:t=4,...n}){return a.jsx(rD,{children:a.jsx(Tq,{"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 Tt({className:e,inset:t,variant:n="default",...r}){return a.jsx(_q,{"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 ua({className:e,...t}){return a.jsx(Nq,{"data-slot":"dropdown-menu-separator",className:se("bg-border -mx-1 my-1 h-px",e),...t})}function yx({...e}){return a.jsx(Aq,{"data-slot":"dropdown-menu-sub",...e})}function vx({className:e,inset:t,children:n,...r}){return a.jsxs(Dq,{"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(Da,{className:"ml-auto size-4"})]})}function bx({className:e,...t}){return a.jsx(Oq,{"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 Mq="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",kq=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:Mq,alt:"OWOX Logo",width:e,height:t,className:n}),aD=h.createContext(null),sD=h.createContext(()=>{});function oD(){return h.useContext(sD)}function sh(e){const t=h.useContext(aD);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function iD(){return sh(e=>e.project)}function yd(){const{data:e,callState:t,error:n}=sh(r=>r.flags);return{flags:e,callState:t,error:n}}function Lq({isOpen:e}){const{title:t}=iD();return a.jsx(Rr,{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(kq,{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(Es,{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 lD(e,t){return function(){return e.apply(t,arguments)}}const{toString:Pq}=Object.prototype,{getPrototypeOf:e2}=Object,{iterator:Sx,toStringTag:cD}=Symbol,Cx=(e=>t=>{const n=Pq.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zs=e=>(e=e.toLowerCase(),t=>Cx(t)===e),Ex=e=>t=>typeof t===e,{isArray:vd}=Array,rd=Ex("undefined");function Lh(e){return e!==null&&!rd(e)&&e.constructor!==null&&!rd(e.constructor)&&Ta(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const uD=Zs("ArrayBuffer");function Uq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&uD(e.buffer),t}const zq=Ex("string"),Ta=Ex("function"),dD=Ex("number"),Ph=e=>e!==null&&typeof e=="object",Fq=e=>e===!0||e===!1,Kp=e=>{if(Cx(e)!=="object")return!1;const t=e2(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(cD in e)&&!(Sx in e)},Hq=e=>{if(!Ph(e)||Lh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Vq=Zs("Date"),$q=Zs("File"),Bq=Zs("Blob"),Gq=Zs("FileList"),qq=e=>Ph(e)&&Ta(e.pipe),Kq=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Ta(e.append)&&((t=Cx(e))==="formdata"||t==="object"&&Ta(e.toString)&&e.toString()==="[object FormData]"))},Wq=Zs("URLSearchParams"),[Yq,Zq,Xq,Qq]=["ReadableStream","Request","Response","Headers"].map(Zs),Jq=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Uh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),vd(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Lh(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 fD(e,t){if(Lh(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 oc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hD=e=>!rd(e)&&e!==oc;function ub(){const{caseless:e,skipUndefined:t}=hD(this)&&this||{},n={},r=(s,i)=>{const c=e&&fD(n,i)||i;Kp(n[c])&&Kp(s)?n[c]=ub(n[c],s):Kp(s)?n[c]=ub({},s):vd(s)?n[c]=s.slice():(!t||!rd(s))&&(n[c]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Uh(arguments[s],r);return n}const eK=(e,t,n,{allOwnKeys:r}={})=>(Uh(t,(s,i)=>{n&&Ta(s)?e[i]=lD(s,n):e[i]=s},{allOwnKeys:r}),e),tK=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nK=(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)},rK=(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&&e2(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},aK=(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},sK=e=>{if(!e)return null;if(vd(e))return e;let t=e.length;if(!dD(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},oK=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&e2(Uint8Array)),iK=(e,t)=>{const r=(e&&e[Sx]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},lK=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},cK=Zs("HTMLFormElement"),uK=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),WT=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dK=Zs("RegExp"),mD=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Uh(n,(s,i)=>{let c;(c=t(s,i,e))!==!1&&(r[i]=c||s)}),Object.defineProperties(e,r)},fK=e=>{mD(e,(t,n)=>{if(Ta(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ta(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+"'")})}})},hK=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return vd(e)?r(e):r(String(e).split(t)),n},mK=()=>{},pK=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function gK(e){return!!(e&&Ta(e.append)&&e[cD]==="FormData"&&e[Sx])}const xK=e=>{const t=new Array(10),n=(r,s)=>{if(Ph(r)){if(t.indexOf(r)>=0)return;if(Lh(r))return r;if(!("toJSON"in r)){t[s]=r;const i=vd(r)?[]:{};return Uh(r,(c,u)=>{const f=n(c,s+1);!rd(f)&&(i[u]=f)}),t[s]=void 0,i}}return r};return n(e,0)},yK=Zs("AsyncFunction"),vK=e=>e&&(Ph(e)||Ta(e))&&Ta(e.then)&&Ta(e.catch),pD=((e,t)=>e?setImmediate:t?((n,r)=>(oc.addEventListener("message",({source:s,data:i})=>{s===oc&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),oc.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Ta(oc.postMessage)),bK=typeof queueMicrotask<"u"?queueMicrotask.bind(oc):typeof process<"u"&&process.nextTick||pD,SK=e=>e!=null&&Ta(e[Sx]),pe={isArray:vd,isArrayBuffer:uD,isBuffer:Lh,isFormData:Kq,isArrayBufferView:Uq,isString:zq,isNumber:dD,isBoolean:Fq,isObject:Ph,isPlainObject:Kp,isEmptyObject:Hq,isReadableStream:Yq,isRequest:Zq,isResponse:Xq,isHeaders:Qq,isUndefined:rd,isDate:Vq,isFile:$q,isBlob:Bq,isRegExp:dK,isFunction:Ta,isStream:qq,isURLSearchParams:Wq,isTypedArray:oK,isFileList:Gq,forEach:Uh,merge:ub,extend:eK,trim:Jq,stripBOM:tK,inherits:nK,toFlatObject:rK,kindOf:Cx,kindOfTest:Zs,endsWith:aK,toArray:sK,forEachEntry:iK,matchAll:lK,isHTMLForm:cK,hasOwnProperty:WT,hasOwnProp:WT,reduceDescriptors:mD,freezeMethods:fK,toObjectSet:hK,toCamelCase:uK,noop:mK,toFiniteNumber:pK,findKey:fD,global:oc,isContextDefined:hD,isSpecCompliantForm:gK,toJSONObject:xK,isAsyncFn:yK,isThenable:vK,setImmediate:pD,asap:bK,isIterable:SK};function It(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)}pe.inherits(It,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:pe.toJSONObject(this.config),code:this.code,status:this.status}}});const gD=It.prototype,xD={};["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=>{xD[e]={value:e}});Object.defineProperties(It,xD);Object.defineProperty(gD,"isAxiosError",{value:!0});It.from=(e,t,n,r,s,i)=>{const c=Object.create(gD);pe.toFlatObject(e,c,function(x){return x!==Error.prototype},m=>m!=="isAxiosError");const u=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return It.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 CK=null;function db(e){return pe.isPlainObject(e)||pe.isArray(e)}function yD(e){return pe.endsWith(e,"[]")?e.slice(0,-2):e}function YT(e,t,n){return e?e.concat(t).map(function(s,i){return s=yD(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function EK(e){return pe.isArray(e)&&!e.some(db)}const wK=pe.toFlatObject(pe,{},null,function(t){return/^is[A-Z]/.test(t)});function wx(e,t,n){if(!pe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=pe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,E){return!pe.isUndefined(E[b])});const r=n.metaTokens,s=n.visitor||x,i=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&pe.isSpecCompliantForm(t);if(!pe.isFunction(s))throw new TypeError("visitor must be a function");function m(S){if(S===null)return"";if(pe.isDate(S))return S.toISOString();if(pe.isBoolean(S))return S.toString();if(!f&&pe.isBlob(S))throw new It("Blob is not supported. Use a Buffer instead.");return pe.isArrayBuffer(S)||pe.isTypedArray(S)?f&&typeof Blob=="function"?new Blob([S]):Buffer.from(S):S}function x(S,b,E){let R=S;if(S&&!E&&typeof S=="object"){if(pe.endsWith(b,"{}"))b=r?b:b.slice(0,-2),S=JSON.stringify(S);else if(pe.isArray(S)&&EK(S)||(pe.isFileList(S)||pe.endsWith(b,"[]"))&&(R=pe.toArray(S)))return b=yD(b),R.forEach(function(_,D){!(pe.isUndefined(_)||_===null)&&t.append(c===!0?YT([b],D,i):c===null?b:b+"[]",m(_))}),!1}return db(S)?!0:(t.append(YT(E,b,i),m(S)),!1)}const g=[],y=Object.assign(wK,{defaultVisitor:x,convertValue:m,isVisitable:db});function v(S,b){if(!pe.isUndefined(S)){if(g.indexOf(S)!==-1)throw Error("Circular reference detected in "+b.join("."));g.push(S),pe.forEach(S,function(R,j){(!(pe.isUndefined(R)||R===null)&&s.call(t,R,pe.isString(j)?j.trim():j,b,y))===!0&&v(R,b?b.concat(j):[j])}),g.pop()}}if(!pe.isObject(e))throw new TypeError("data must be an object");return v(e),t}function ZT(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function t2(e,t){this._pairs=[],e&&wx(e,this,t)}const vD=t2.prototype;vD.append=function(t,n){this._pairs.push([t,n])};vD.toString=function(t){const n=t?function(r){return t.call(this,r,ZT)}:ZT;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function RK(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function bD(e,t,n){if(!t)return e;const r=n&&n.encode||RK;pe.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(t,n):i=pe.isURLSearchParams(t)?t.toString():new t2(t,n).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class XT{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){pe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const SD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},jK=typeof URLSearchParams<"u"?URLSearchParams:t2,TK=typeof FormData<"u"?FormData:null,_K=typeof Blob<"u"?Blob:null,NK={isBrowser:!0,classes:{URLSearchParams:jK,FormData:TK,Blob:_K},protocols:["http","https","file","blob","url","data"]},n2=typeof window<"u"&&typeof document<"u",fb=typeof navigator=="object"&&navigator||void 0,AK=n2&&(!fb||["ReactNative","NativeScript","NS"].indexOf(fb.product)<0),DK=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OK=n2&&window.location.href||"http://localhost",IK=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:n2,hasStandardBrowserEnv:AK,hasStandardBrowserWebWorkerEnv:DK,navigator:fb,origin:OK},Symbol.toStringTag,{value:"Module"})),Yr={...IK,...NK};function MK(e,t){return wx(e,new Yr.classes.URLSearchParams,{visitor:function(n,r,s,i){return Yr.isNode&&pe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function kK(e){return pe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function LK(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 CD(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&&pe.isArray(s)?s.length:c,f?(pe.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!u):((!s[c]||!pe.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],i)&&pe.isArray(s[c])&&(s[c]=LK(s[c])),!u)}if(pe.isFormData(e)&&pe.isFunction(e.entries)){const n={};return pe.forEachEntry(e,(r,s)=>{t(kK(r),s,n,0)}),n}return null}function PK(e,t,n){if(pe.isString(e))try{return(t||JSON.parse)(e),pe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const zh={transitional:SD,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=pe.isObject(t);if(i&&pe.isHTMLForm(t)&&(t=new FormData(t)),pe.isFormData(t))return s?JSON.stringify(CD(t)):t;if(pe.isArrayBuffer(t)||pe.isBuffer(t)||pe.isStream(t)||pe.isFile(t)||pe.isBlob(t)||pe.isReadableStream(t))return t;if(pe.isArrayBufferView(t))return t.buffer;if(pe.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 MK(t,this.formSerializer).toString();if((u=pe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return wx(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),PK(t)):t}],transformResponse:[function(t){const n=this.transitional||zh.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(pe.isResponse(t)||pe.isReadableStream(t))return t;if(t&&pe.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"?It.from(u,It.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:Yr.classes.FormData,Blob:Yr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pe.forEach(["delete","get","head","post","put","patch"],e=>{zh.headers[e]={}});const UK=pe.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"]),zK=e=>{const t={};let n,r,s;return e&&e.split(`
601
+ `).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&UK[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},QT=Symbol("internals");function Rf(e){return e&&String(e).trim().toLowerCase()}function Wp(e){return e===!1||e==null?e:pe.isArray(e)?e.map(Wp):String(e)}function FK(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 HK=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function r1(e,t,n,r,s){if(pe.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!pe.isString(t)){if(pe.isString(r))return t.indexOf(r)!==-1;if(pe.isRegExp(r))return r.test(t)}}function VK(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $K(e,t){const n=pe.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 _a=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(u,f,m){const x=Rf(f);if(!x)throw new Error("header name must be a non-empty string");const g=pe.findKey(s,x);(!g||s[g]===void 0||m===!0||m===void 0&&s[g]!==!1)&&(s[g||f]=Wp(u))}const c=(u,f)=>pe.forEach(u,(m,x)=>i(m,x,f));if(pe.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(pe.isString(t)&&(t=t.trim())&&!HK(t))c(zK(t),n);else if(pe.isObject(t)&&pe.isIterable(t)){let u={},f,m;for(const x of t){if(!pe.isArray(x))throw TypeError("Object iterator must return a key-value pair");u[m=x[0]]=(f=u[m])?pe.isArray(f)?[...f,x[1]]:[f,x[1]]:x[1]}c(u,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=Rf(t),t){const r=pe.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return FK(s);if(pe.isFunction(n))return n.call(this,s,r);if(pe.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Rf(t),t){const r=pe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||r1(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(c){if(c=Rf(c),c){const u=pe.findKey(r,c);u&&(!n||r1(r,r[u],u,n))&&(delete r[u],s=!0)}}return pe.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||r1(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return pe.forEach(this,(s,i)=>{const c=pe.findKey(r,i);if(c){n[c]=Wp(s),delete n[i];return}const u=t?VK(i):String(i).trim();u!==i&&delete n[i],n[u]=Wp(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return pe.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&pe.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(`
602
+ `)}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[QT]=this[QT]={accessors:{}}).accessors,s=this.prototype;function i(c){const u=Rf(c);r[u]||($K(s,c),r[u]=!0)}return pe.isArray(t)?t.forEach(i):i(t),this}};_a.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);pe.reduceDescriptors(_a.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});pe.freezeMethods(_a);function a1(e,t){const n=this||zh,r=t||n,s=_a.from(r.headers);let i=r.data;return pe.forEach(e,function(u){i=u.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function ED(e){return!!(e&&e.__CANCEL__)}function bd(e,t,n){It.call(this,e??"canceled",It.ERR_CANCELED,t,n),this.name="CanceledError"}pe.inherits(bd,It,{__CANCEL__:!0});function wD(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new It("Request failed with status code "+n.status,[It.ERR_BAD_REQUEST,It.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function BK(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function GK(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(),x=r[i];c||(c=m),n[s]=f,r[s]=m;let g=i,y=0;for(;g!==s;)y+=n[g++],g=g%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),m-c<t)return;const v=x&&m-x;return v?Math.round(y*1e3/v):void 0}}function qK(e,t){let n=0,r=1e3/t,s,i;const c=(m,x=Date.now())=>{n=x,s=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const x=Date.now(),g=x-n;g>=r?c(m,x):(s=m,i||(i=setTimeout(()=>{i=null,c(s)},r-g)))},()=>s&&c(s)]}const pg=(e,t,n=3)=>{let r=0;const s=GK(50,250);return qK(i=>{const c=i.loaded,u=i.lengthComputable?i.total:void 0,f=c-r,m=s(f),x=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&&x?(u-c)/m:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},JT=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},e_=e=>(...t)=>pe.asap(()=>e(...t)),KK=Yr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Yr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Yr.origin),Yr.navigator&&/(msie|trident)/i.test(Yr.navigator.userAgent)):()=>!0,WK=Yr.hasStandardBrowserEnv?{write(e,t,n,r,s,i,c){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];pe.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),pe.isString(r)&&u.push(`path=${r}`),pe.isString(s)&&u.push(`domain=${s}`),i===!0&&u.push("secure"),pe.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 YK(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ZK(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function RD(e,t,n){let r=!YK(t);return e&&(r||n==!1)?ZK(e,t):t}const t_=e=>e instanceof _a?{...e}:e;function gc(e,t){t=t||{};const n={};function r(m,x,g,y){return pe.isPlainObject(m)&&pe.isPlainObject(x)?pe.merge.call({caseless:y},m,x):pe.isPlainObject(x)?pe.merge({},x):pe.isArray(x)?x.slice():x}function s(m,x,g,y){if(pe.isUndefined(x)){if(!pe.isUndefined(m))return r(void 0,m,g,y)}else return r(m,x,g,y)}function i(m,x){if(!pe.isUndefined(x))return r(void 0,x)}function c(m,x){if(pe.isUndefined(x)){if(!pe.isUndefined(m))return r(void 0,m)}else return r(void 0,x)}function u(m,x,g){if(g in t)return r(m,x);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,x,g)=>s(t_(m),t_(x),g,!0)};return pe.forEach(Object.keys({...e,...t}),function(x){const g=f[x]||s,y=g(e[x],t[x],x);pe.isUndefined(y)&&g!==u||(n[x]=y)}),n}const jD=e=>{const t=gc({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=t;if(t.headers=c=_a.from(c),t.url=bD(RD(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),pe.isFormData(n)){if(Yr.hasStandardBrowserEnv||Yr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(pe.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([x,g])=>{m.includes(x.toLowerCase())&&c.set(x,g)})}}if(Yr.hasStandardBrowserEnv&&(r&&pe.isFunction(r)&&(r=r(t)),r||r!==!1&&KK(t.url))){const f=s&&i&&WK.read(i);f&&c.set(s,f)}return t},XK=typeof XMLHttpRequest<"u",QK=XK&&function(e){return new Promise(function(n,r){const s=jD(e);let i=s.data;const c=_a.from(s.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:m}=s,x,g,y,v,S;function b(){v&&v(),S&&S(),s.cancelToken&&s.cancelToken.unsubscribe(x),s.signal&&s.signal.removeEventListener("abort",x)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function R(){if(!E)return;const _=_a.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),O={data:!u||u==="text"||u==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:_,config:e,request:E};wD(function(T){n(T),b()},function(T){r(T),b()},O),E=null}"onloadend"in E?E.onloadend=R:E.onreadystatechange=function(){!E||E.readyState!==4||E.status===0&&!(E.responseURL&&E.responseURL.indexOf("file:")===0)||setTimeout(R)},E.onabort=function(){E&&(r(new It("Request aborted",It.ECONNABORTED,e,E)),E=null)},E.onerror=function(D){const O=D&&D.message?D.message:"Network Error",A=new It(O,It.ERR_NETWORK,e,E);A.event=D||null,r(A),E=null},E.ontimeout=function(){let D=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const O=s.transitional||SD;s.timeoutErrorMessage&&(D=s.timeoutErrorMessage),r(new It(D,O.clarifyTimeoutError?It.ETIMEDOUT:It.ECONNABORTED,e,E)),E=null},i===void 0&&c.setContentType(null),"setRequestHeader"in E&&pe.forEach(c.toJSON(),function(D,O){E.setRequestHeader(O,D)}),pe.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),u&&u!=="json"&&(E.responseType=s.responseType),m&&([y,S]=pg(m,!0),E.addEventListener("progress",y)),f&&E.upload&&([g,v]=pg(f),E.upload.addEventListener("progress",g),E.upload.addEventListener("loadend",v)),(s.cancelToken||s.signal)&&(x=_=>{E&&(r(!_||_.type?new bd(null,e,E):_),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(x),s.signal&&(s.signal.aborted?x():s.signal.addEventListener("abort",x)));const j=BK(s.url);if(j&&Yr.protocols.indexOf(j)===-1){r(new It("Unsupported protocol "+j+":",It.ERR_BAD_REQUEST,e));return}E.send(i||null)})},JK=(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 x=m instanceof Error?m:this.reason;r.abort(x instanceof It?x:new bd(x instanceof Error?x.message:x))}};let c=t&&setTimeout(()=>{c=null,i(new It(`timeout ${t} of ms exceeded`,It.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=()=>pe.asap(u),f}},eW=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},tW=async function*(e,t){for await(const n of nW(e))yield*eW(n,t)},nW=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()}},n_=(e,t,n,r)=>{const s=tW(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:x}=await s.next();if(m){u(),f.close();return}let g=x.byteLength;if(n){let y=i+=g;n(y)}f.enqueue(new Uint8Array(x))}catch(m){throw u(m),m}},cancel(f){return u(f),s.return()}},{highWaterMark:2})},r_=64*1024,{isFunction:Cp}=pe,rW=(({Request:e,Response:t})=>({Request:e,Response:t}))(pe.global),{ReadableStream:a_,TextEncoder:s_}=pe.global,o_=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aW=e=>{e=pe.merge.call({skipUndefined:!0},rW,e);const{fetch:t,Request:n,Response:r}=e,s=t?Cp(t):typeof fetch=="function",i=Cp(n),c=Cp(r);if(!s)return!1;const u=s&&Cp(a_),f=s&&(typeof s_=="function"?(S=>b=>S.encode(b))(new s_):async S=>new Uint8Array(await new n(S).arrayBuffer())),m=i&&u&&o_(()=>{let S=!1;const b=new n(Yr.origin,{body:new a_,method:"POST",get duplex(){return S=!0,"half"}}).headers.has("Content-Type");return S&&!b}),x=c&&u&&o_(()=>pe.isReadableStream(new r("").body)),g={stream:x&&(S=>S.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(S=>{!g[S]&&(g[S]=(b,E)=>{let R=b&&b[S];if(R)return R.call(b);throw new It(`Response type '${S}' is not supported`,It.ERR_NOT_SUPPORT,E)})});const y=async S=>{if(S==null)return 0;if(pe.isBlob(S))return S.size;if(pe.isSpecCompliantForm(S))return(await new n(Yr.origin,{method:"POST",body:S}).arrayBuffer()).byteLength;if(pe.isArrayBufferView(S)||pe.isArrayBuffer(S))return S.byteLength;if(pe.isURLSearchParams(S)&&(S=S+""),pe.isString(S))return(await f(S)).byteLength},v=async(S,b)=>{const E=pe.toFiniteNumber(S.getContentLength());return E??y(b)};return async S=>{let{url:b,method:E,data:R,signal:j,cancelToken:_,timeout:D,onDownloadProgress:O,onUploadProgress:A,responseType:T,headers:M,withCredentials:k="same-origin",fetchOptions:z}=jD(S),L=t||fetch;T=T?(T+"").toLowerCase():"text";let G=JK([j,_&&_.toAbortSignal()],D),B=null;const q=G&&G.unsubscribe&&(()=>{G.unsubscribe()});let V;try{if(A&&m&&E!=="get"&&E!=="head"&&(V=await v(M,R))!==0){let U=new n(b,{method:"POST",body:R,duplex:"half"}),F;if(pe.isFormData(R)&&(F=U.headers.get("content-type"))&&M.setContentType(F),U.body){const[H,W]=JT(V,pg(e_(A)));R=n_(U.body,r_,H,W)}}pe.isString(k)||(k=k?"include":"omit");const I=i&&"credentials"in n.prototype,K={...z,signal:G,method:E.toUpperCase(),headers:M.normalize().toJSON(),body:R,duplex:"half",credentials:I?k:void 0};B=i&&new n(b,K);let $=await(i?L(B,z):L(b,K));const ee=x&&(T==="stream"||T==="response");if(x&&(O||ee&&q)){const U={};["status","statusText","headers"].forEach(Q=>{U[Q]=$[Q]});const F=pe.toFiniteNumber($.headers.get("content-length")),[H,W]=O&&JT(F,pg(e_(O),!0))||[];$=new r(n_($.body,r_,H,()=>{W&&W(),q&&q()}),U)}T=T||"text";let me=await g[pe.findKey(g,T)||"text"]($,S);return!ee&&q&&q(),await new Promise((U,F)=>{wD(U,F,{data:me,headers:_a.from($.headers),status:$.status,statusText:$.statusText,config:S,request:B})})}catch(I){throw q&&q(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new It("Network Error",It.ERR_NETWORK,S,B),{cause:I.cause||I}):It.from(I,I&&I.code,S,B)}}},sW=new Map,TD=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,x=sW;for(;u--;)f=i[u],m=x.get(f),m===void 0&&x.set(f,m=u?new Map:aW(t)),x=m;return m};TD();const r2={http:CK,xhr:QK,fetch:{get:TD}};pe.forEach(r2,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const i_=e=>`- ${e}`,oW=e=>pe.isFunction(e)||e===null||e===!1;function iW(e,t){e=pe.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,!oW(r)&&(s=r2[(u=String(r)).toLowerCase()],s===void 0))throw new It(`Unknown adapter '${u}'`);if(s&&(pe.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 :
603
+ `+c.map(i_).join(`
604
+ `):" "+i_(c[0]):"as no adapter specified";throw new It("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}const _D={getAdapter:iW,adapters:r2};function s1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new bd(null,e)}function l_(e){return s1(e),e.headers=_a.from(e.headers),e.data=a1.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),_D.getAdapter(e.adapter||zh.adapter,e)(e).then(function(r){return s1(e),r.data=a1.call(e,e.transformResponse,r),r.headers=_a.from(r.headers),r},function(r){return ED(r)||(s1(e),r&&r.response&&(r.response.data=a1.call(e,e.transformResponse,r.response),r.response.headers=_a.from(r.response.headers))),Promise.reject(r)})}const ND="1.13.2",Rx={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Rx[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const c_={};Rx.transitional=function(t,n,r){function s(i,c){return"[Axios v"+ND+"] Transitional option '"+i+"'"+c+(r?". "+r:"")}return(i,c,u)=>{if(t===!1)throw new It(s(c," has been removed"+(n?" in "+n:"")),It.ERR_DEPRECATED);return n&&!c_[c]&&(c_[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}};Rx.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function lW(e,t,n){if(typeof e!="object")throw new It("options must be an object",It.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 It("option "+i+" must be "+f,It.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new It("Unknown option "+i,It.ERR_BAD_OPTION)}}const Yp={assertOptions:lW,validators:Rx},ao=Yp.validators;let cc=class{constructor(t){this.defaults=t||{},this.interceptors={request:new XT,response:new XT}}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+=`
605
+ `+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=gc(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&Yp.assertOptions(r,{silentJSONParsing:ao.transitional(ao.boolean),forcedJSONParsing:ao.transitional(ao.boolean),clarifyTimeoutError:ao.transitional(ao.boolean)},!1),s!=null&&(pe.isFunction(s)?n.paramsSerializer={serialize:s}:Yp.assertOptions(s,{encode:ao.function,serialize:ao.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Yp.assertOptions(n,{baseUrl:ao.spelling("baseURL"),withXsrfToken:ao.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=i&&pe.merge(i.common,i[n.method]);i&&pe.forEach(["delete","get","head","post","put","patch","common"],S=>{delete i[S]}),n.headers=_a.concat(c,i);const u=[];let f=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(f=f&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const m=[];this.interceptors.response.forEach(function(b){m.push(b.fulfilled,b.rejected)});let x,g=0,y;if(!f){const S=[l_.bind(this),void 0];for(S.unshift(...u),S.push(...m),y=S.length,x=Promise.resolve(n);g<y;)x=x.then(S[g++],S[g++]);return x}y=u.length;let v=n;for(;g<y;){const S=u[g++],b=u[g++];try{v=S(v)}catch(E){b.call(this,E);break}}try{x=l_.call(this,v)}catch(S){return Promise.reject(S)}for(g=0,y=m.length;g<y;)x=x.then(m[g++],m[g++]);return x}getUri(t){t=gc(this.defaults,t);const n=RD(t.baseURL,t.url,t.allowAbsoluteUrls);return bD(n,t.params,t.paramsSerializer)}};pe.forEach(["delete","get","head","options"],function(t){cc.prototype[t]=function(n,r){return this.request(gc(r||{},{method:t,url:n,data:(r||{}).data}))}});pe.forEach(["post","put","patch"],function(t){function n(r){return function(i,c,u){return this.request(gc(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:c}))}}cc.prototype[t]=n(),cc.prototype[t+"Form"]=n(!0)});let cW=class AD{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 bd(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 AD(function(s){t=s}),cancel:t}}};function uW(e){return function(n){return e.apply(null,n)}}function dW(e){return pe.isObject(e)&&e.isAxiosError===!0}const hb={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(hb).forEach(([e,t])=>{hb[t]=e});function DD(e){const t=new cc(e),n=lD(cc.prototype.request,t);return pe.extend(n,cc.prototype,t,{allOwnKeys:!0}),pe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return DD(gc(e,s))},n}const tr=DD(zh);tr.Axios=cc;tr.CanceledError=bd;tr.CancelToken=cW;tr.isCancel=ED;tr.VERSION=ND;tr.toFormData=wx;tr.AxiosError=It;tr.Cancel=tr.CanceledError;tr.all=function(t){return Promise.all(t)};tr.spread=uW;tr.isAxiosError=dW;tr.mergeConfig=gc;tr.AxiosHeaders=_a;tr.formToJSON=e=>CD(pe.isHTMLForm(e)?new FormData(e):e);tr.getAdapter=_D.getAdapter;tr.HttpStatusCode=hb;tr.default=tr;const{Axios:rpe,AxiosError:u_,CanceledError:ape,isCancel:spe,CancelToken:ope,VERSION:ipe,all:lpe,Cancel:cpe,isAxiosError:upe,spread:dpe,toFormData:fpe,AxiosHeaders:fW,HttpStatusCode:hpe,formToJSON:mpe,getAdapter:ppe,mergeConfig:gpe}=tr;function hW(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const ad={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 mW(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 a2=tr.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function pW(){const e=window.location.pathname+window.location.search,t=new URL(ad.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function gW(){const e=new URL(ad.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",ad.SIGN_IN),window.location.href=e.toString()}async function xW(){try{return(await a2.post(ad.ACCESS_TOKEN,{})).data}catch(e){const t=mW(e);throw new Error(t.message)}}async function yW(e){const t=await a2.get(ad.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return hW(t.data)}async function vW(e){return(await a2.get(ad.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const OD=h.createContext(null);class bW{constructor(t,n){ro(this,"getToken");ro(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let s2=null;function SW(e){s2=e}function o2(){return s2}function Ep(){s2=null}const CW=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},De=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",i2(e)},EW=e=>{De({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},wW=()=>{De({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},i2=e=>{var t;if(typeof window<"u"){CW();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function RW(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 jW={status:Zr.LOADING,session:null,user:null};function TW({children:e}){var x;const[t,n]=h.useReducer(RW,jW);h.useEffect(()=>{var g;if((g=t.session)!=null&&g.accessToken){const y=new bW(()=>{var v;return((v=t.session)==null?void 0:v.accessToken)??null},async()=>await s());SW(y)}else Ep()},[(x=t.session)==null?void 0:x.accessToken]);const r=h.useCallback(()=>{pW()},[]);async function s(){try{const y=(await xW()).accessToken;if(!y)throw new Error("Invalid token received");const v={accessToken:y},S=await yW(y);return n({type:"SET_USER",payload:{user:S}}),n({type:"SET_AUTHENTICATED",payload:{session:v}}),y}catch(g){throw Ep(),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),Ep(),n({type:"SET_UNAUTHENTICATED"})}},[i,r]),u=h.useCallback(()=>{try{wW()}finally{gW()}},[]),f=h.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t.user&&(i2({projectId:t.user.projectId}),EW({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),Ep()}},[u]);const m={...t,signIn:r,signOut:u,refreshToken:i,clearError:f};return a.jsx(OD.Provider,{value:m,children:e})}function yi(){const e=h.useContext(OD);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function ID(){const{status:e,session:t,user:n,error:r}=yi();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 _W(){const{user:e}=yi();return e}function Gu({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 d_({message:e}){return a.jsx(Gu,{fullScreen:!0,message:e})}function f_(){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 NW({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:i}=ID();return r?a.jsx(d_,{}):s?a.jsx(a.Fragment,{children:e}):i?n?(window.location.href=n,a.jsx(d_,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(f_,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(f_,{})}const MD=h.createContext(null);function kD(){const e=h.useContext(MD);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const AW="/ui",DW=()=>AW,gg=(e,t)=>{const n=DW(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function OW(){const{projects:e,loadProjects:t,error:n,isLoading:r}=kD(),{user:s}=yi();return a.jsxs(yx,{children:[a.jsx(ua,{}),a.jsxs(vx,{className:"flex items-center gap-2",children:[a.jsx(DP,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(Iq,{children:a.jsxs(bx,{children:[r&&a.jsx(Tt,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Nc,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&a.jsxs(a.Fragment,{children:[a.jsx(Tt,{disabled:!0,children:"Unable to load projects. Please try again."}),a.jsx(Tt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(i=>{const c=i.id===(s==null?void 0:s.projectId);return a.jsx(Tt,{asChild:!0,children:a.jsxs(vh,{to:gg(encodeURIComponent(i.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(la,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),i.title]})},i.id)})]})})]})}function IW(){return a.jsx(OW,{})}const MW=({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"})}),LD=({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"})]}),PD=({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"})]}),kW=({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"})]}),LW=({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"})]}),PW=({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"})]}),UD=({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"})]}),UW=({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"})}),zD=({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"})]}),zW=({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"})]})]})]}),Mc=({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}}),FW=({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"})]}),HW=({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"})]}),VW=({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"})]}),$W=({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"})]}),BW=({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"})]}),GW=({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"})]}),qW=({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"})]}),KW=({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"})]}),WW=({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)"})})]})]}),YW=({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"})]}),ZW=({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 Ao({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 FD({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:s="min-h-[150px]",displayOnly:i=!1,showCopyButton:c=!1}){const u=(E,R)=>{if(!E||R.length===0)return!1;try{const j=JSON.parse(E),_=D=>typeof D!="object"||D===null?!1:Array.isArray(D)?D.some(O=>typeof O=="object"&&O!==null&&_(O)):Object.keys(D).some(O=>R.includes(O)||typeof D[O]=="object"&&D[O]!==null&&_(D[O]));return _(j)}catch{return!1}},f=i?!1:!e||n.length===0||!u(e,n),[m,x]=h.useState(f),[g,y]=h.useState(!1);h.useEffect(()=>{i?x(!1):(!e||n.length===0||!u(e,n))&&x(!0)},[e,n,i]),h.useEffect(()=>{if(g){const E=setTimeout(()=>{y(!1)},2e3);return()=>{clearTimeout(E)}}},[g]);const v=()=>{navigator.clipboard.writeText(e),y(!0)},S=E=>{if(!E)return"";try{const R=JSON.parse(E),j=O=>{if(typeof O!="object"||O===null)return O;const A=Array.isArray(O)?[...O]:{...O};return Array.isArray(A)?A.forEach((T,M)=>{typeof T=="object"&&T!==null&&(A[M]=j(T))}):Object.entries(A).forEach(([T,M])=>{if(n.includes(T))if(typeof M=="string"){const k=M.length;k>30?A[T]="*".repeat(Math.min(20,Math.ceil(k/3))):k>10?A[T]="*".repeat(Math.min(10,Math.ceil(k/2))):A[T]="*".repeat(k)}else A[T]="***";else typeof M=="object"&&M!==null&&(A[T]=j(M))}),A},D=j(typeof R=="object"?R:{});return JSON.stringify(D,null,2)}catch{return E}},b=e&&n.length>0&&u(e,n);return a.jsxs("div",{className:"relative",children:[!m&&b&&!i&&a.jsx(Xa,{children:a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(nz,{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:S(e)}):a.jsx(Ao,{value:m?e:S(e),onChange:E=>{(m||!b)&&t&&t(E.target.value)},onFocus:E=>{!m&&b&&E.target.blur()},readOnly:!!(!m&&b),className:`font-mono ${r??""} ${!m&&b?"cursor-not-allowed opacity-70":""} ${s}`,rows:8}),b&&!i&&a.jsx(we,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{x(!m)},children:m?a.jsx(Xa,{children:a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(bU,{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(Xa,{children:a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(PA,{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 ${b&&!i?"top-2 right-24":"top-2 right-2"}`,onClick:v,children:a.jsx(Xa,{children:a.jsxs(wt,{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(la,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copied!"})]}):a.jsxs(a.Fragment,{children:[a.jsx(ed,{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 ln;(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})(ln||(ln={}));var h_;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(h_||(h_={}));const Be=ln.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zi=e=>{switch(typeof e){case"undefined":return Be.undefined;case"string":return Be.string;case"number":return Number.isNaN(e)?Be.nan:Be.number;case"boolean":return Be.boolean;case"function":return Be.function;case"bigint":return Be.bigint;case"symbol":return Be.symbol;case"object":return Array.isArray(e)?Be.array:e===null?Be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Be.promise:typeof Map<"u"&&e instanceof Map?Be.map:typeof Set<"u"&&e instanceof Set?Be.set:typeof Date<"u"&&e instanceof Date?Be.date:Be.object;default:return Be.unknown}},Ne=ln.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 fi 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 fi))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ln.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()}}fi.create=e=>new fi(e);const mb=(e,t)=>{let n;switch(e.code){case Ne.invalid_type:e.received===Be.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ln.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${ln.joinValues(e.keys,", ")}`;break;case Ne.invalid_union:n="Invalid input";break;case Ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ln.joinValues(e.options)}`;break;case Ne.invalid_enum_value:n=`Invalid enum value. Expected ${ln.joinValues(e.options)}, received '${e.received}'`;break;case Ne.invalid_arguments:n="Invalid function arguments";break;case Ne.invalid_return_type:n="Invalid function return type";break;case Ne.invalid_date:n="Invalid date";break;case Ne.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}"`:ln.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ne.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 Ne.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 Ne.custom:n="Invalid input";break;case Ne.invalid_intersection_types:n="Intersection results could not be merged";break;case Ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,ln.assertNever(e)}return{message:n}};let XW=mb;function QW(){return XW}const JW=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=QW(),r=JW({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===mb?void 0:mb].filter(s=>!!s)});e.common.issues.push(r)}class da{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 ft;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 da.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 ft;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 ft=Object.freeze({status:"aborted"}),Pf=e=>({status:"dirty",value:e}),ws=e=>({status:"valid",value:e}),m_=e=>e.status==="aborted",p_=e=>e.status==="dirty",sd=e=>e.status==="valid",xg=e=>typeof Promise<"u"&&e instanceof Promise;var Je;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Je||(Je={}));class jo{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 g_=(e,t)=>{if(sd(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 fi(e.common.issues);return this._error=n,this._error}}};function Lt(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 Yt{get description(){return this._def.description}_getType(t){return Zi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Zi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new da,ctx:{common:t.parent.common,data:t.data,parsedType:Zi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(xg(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:Zi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return g_(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:Zi(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:n});return sd(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=>sd(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:Zi(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(xg(s)?s:Promise.resolve(s));return g_(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:Ne.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 vc({schema:this,typeName:pt.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 oi.create(this,this._def)}nullable(){return bc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vo.create(this)}promise(){return Rg.create(this,this._def)}or(t){return bg.create([this,t],this._def)}and(t){return Sg.create(this,t,this._def)}transform(t){return new vc({...Lt(this._def),schema:this,typeName:pt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new jg({...Lt(this._def),innerType:this,defaultValue:n,typeName:pt.ZodDefault})}brand(){return new BD({typeName:pt.ZodBranded,type:this,...Lt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Tg({...Lt(this._def),innerType:this,catchValue:n,typeName:pt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return c2.create(this,t)}readonly(){return _g.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const eY=/^c[^\s-]{8,}$/i,tY=/^[0-9a-z]+$/,nY=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rY=/^[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,aY=/^[a-z0-9_-]{21}$/i,sY=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oY=/^[-+]?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)?)??$/,iY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let o1;const cY=/^(?:(?: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])$/,uY=/^(?:(?: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])$/,dY=/^(([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]))$/,fY=/^(([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])$/,hY=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mY=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,HD="((\\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])))",pY=new RegExp(`^${HD}$`);function VD(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 gY(e){return new RegExp(`^${VD(e)}$`)}function xY(e){let t=`${HD}T${VD(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 yY(e,t){return!!((t==="v4"||!t)&&cY.test(e)||(t==="v6"||!t)&&dY.test(e))}function vY(e,t){if(!sY.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 bY(e,t){return!!((t==="v4"||!t)&&uY.test(e)||(t==="v6"||!t)&&fY.test(e))}class si extends Yt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Be.string){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_type,expected:Be.string,received:i.parsedType}),ft}const r=new da;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:Ne.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:Ne.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:Ne.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&Ue(s,{code:Ne.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")iY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"email",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")o1||(o1=new RegExp(lY,"u")),o1.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"emoji",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")rY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"uuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")aY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"nanoid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")eY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")tY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cuid2",code:Ne.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")nY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ulid",code:Ne.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:Ne.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:Ne.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:Ne.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:Ne.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:Ne.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?xY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?pY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?gY(i).test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{code:Ne.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?oY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"duration",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?yY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"ip",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?vY(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"jwt",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?bY(t.data,i.version)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"cidr",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?hY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64",code:Ne.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?mY.test(t.data)||(s=this._getOrReturnCtx(t,s),Ue(s,{validation:"base64url",code:Ne.invalid_string,message:i.message}),r.dirty()):ln.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Ne.invalid_string,...Je.errToObj(r)})}_addCheck(t){return new si({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Je.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Je.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Je.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Je.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Je.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Je.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Je.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Je.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Je.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Je.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Je.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Je.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Je.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,...Je.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,...Je.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Je.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Je.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Je.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Je.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Je.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Je.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Je.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Je.errToObj(n)})}nonempty(t){return this.min(1,Je.errToObj(t))}trim(){return new si({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new si({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new si({...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}}si.create=e=>new si({checks:[],typeName:pt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...Lt(e)});function SY(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 od extends Yt{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)!==Be.number){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_type,expected:Be.number,received:i.parsedType}),ft}let r;const s=new da;for(const i of this._def.checks)i.kind==="int"?ln.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.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:Ne.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:Ne.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?SY(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),Ue(r,{code:Ne.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:Ne.not_finite,message:i.message}),s.dirty()):ln.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Je.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Je.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Je.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Je.toString(n))}setLimit(t,n,r,s){return new od({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(s)}]})}_addCheck(t){return new od({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Je.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Je.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Je.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.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"&&ln.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)}}od.create=e=>new od({checks:[],typeName:pt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Lt(e)});class oh extends Yt{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)!==Be.bigint)return this._getInvalidInput(t);let r;const s=new da;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:Ne.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:Ne.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:Ne.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):ln.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Ne.invalid_type,expected:Be.bigint,received:n.parsedType}),ft}gte(t,n){return this.setLimit("min",t,!0,Je.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Je.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Je.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Je.toString(n))}setLimit(t,n,r,s){return new oh({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(s)}]})}_addCheck(t){return new oh({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Je.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}}oh.create=e=>new oh({checks:[],typeName:pt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...Lt(e)});class pb extends Yt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Be.boolean){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Be.boolean,received:r.parsedType}),ft}return ws(t.data)}}pb.create=e=>new pb({typeName:pt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Lt(e)});class yg extends Yt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Be.date){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_type,expected:Be.date,received:i.parsedType}),ft}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return Ue(i,{code:Ne.invalid_date}),ft}const r=new da;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:Ne.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:Ne.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):ln.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new yg({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Je.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Je.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}}yg.create=e=>new yg({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:pt.ZodDate,...Lt(e)});class x_ extends Yt{_parse(t){if(this._getType(t)!==Be.symbol){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Be.symbol,received:r.parsedType}),ft}return ws(t.data)}}x_.create=e=>new x_({typeName:pt.ZodSymbol,...Lt(e)});class gb extends Yt{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Be.undefined,received:r.parsedType}),ft}return ws(t.data)}}gb.create=e=>new gb({typeName:pt.ZodUndefined,...Lt(e)});class vg extends Yt{_parse(t){if(this._getType(t)!==Be.null){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Be.null,received:r.parsedType}),ft}return ws(t.data)}}vg.create=e=>new vg({typeName:pt.ZodNull,...Lt(e)});class y_ extends Yt{constructor(){super(...arguments),this._any=!0}_parse(t){return ws(t.data)}}y_.create=e=>new y_({typeName:pt.ZodAny,...Lt(e)});class xb extends Yt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ws(t.data)}}xb.create=e=>new xb({typeName:pt.ZodUnknown,...Lt(e)});class gl extends Yt{_parse(t){const n=this._getOrReturnCtx(t);return Ue(n,{code:Ne.invalid_type,expected:Be.never,received:n.parsedType}),ft}}gl.create=e=>new gl({typeName:pt.ZodNever,...Lt(e)});class v_ extends Yt{_parse(t){if(this._getType(t)!==Be.undefined){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Be.void,received:r.parsedType}),ft}return ws(t.data)}}v_.create=e=>new v_({typeName:pt.ZodVoid,...Lt(e)});class vo extends Yt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Be.array)return Ue(n,{code:Ne.invalid_type,expected:Be.array,received:n.parsedType}),ft;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?Ne.too_big:Ne.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:Ne.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:Ne.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 jo(n,c,n.path,u)))).then(c=>da.mergeArray(r,c));const i=[...n.data].map((c,u)=>s.type._parseSync(new jo(n,c,n.path,u)));return da.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new vo({...this._def,minLength:{value:t,message:Je.toString(n)}})}max(t,n){return new vo({...this._def,maxLength:{value:t,message:Je.toString(n)}})}length(t,n){return new vo({...this._def,exactLength:{value:t,message:Je.toString(n)}})}nonempty(t){return this.min(1,t)}}vo.create=(e,t)=>new vo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:pt.ZodArray,...Lt(t)});function Du(e){if(e instanceof hr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=oi.create(Du(r))}return new hr({...e._def,shape:()=>t})}else return e instanceof vo?new vo({...e._def,type:Du(e.element)}):e instanceof oi?oi.create(Du(e.unwrap())):e instanceof bc?bc.create(Du(e.unwrap())):e instanceof xc?xc.create(e.items.map(t=>Du(t))):e}class hr extends Yt{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=ln.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Be.object){const m=this._getOrReturnCtx(t);return Ue(m,{code:Ne.invalid_type,expected:Be.object,received:m.parsedType}),ft}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof gl&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||u.push(m);const f=[];for(const m of c){const x=i[m],g=s.data[m];f.push({key:{status:"valid",value:m},value:x._parse(new jo(s,g,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof gl){const m=this._def.unknownKeys;if(m==="passthrough")for(const x of u)f.push({key:{status:"valid",value:x},value:{status:"valid",value:s.data[x]}});else if(m==="strict")u.length>0&&(Ue(s,{code:Ne.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 x of u){const g=s.data[x];f.push({key:{status:"valid",value:x},value:m._parse(new jo(s,g,s.path,x)),alwaysSet:x in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const x of f){const g=await x.key,y=await x.value;m.push({key:g,value:y,alwaysSet:x.alwaysSet})}return m}).then(m=>da.mergeObjectSync(r,m)):da.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Je.errToObj,new hr({...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:Je.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new hr({...this._def,unknownKeys:"strip"})}passthrough(){return new hr({...this._def,unknownKeys:"passthrough"})}extend(t){return new hr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new hr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:pt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new hr({...this._def,catchall:t})}pick(t){const n={};for(const r of ln.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new hr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of ln.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new hr({...this._def,shape:()=>n})}deepPartial(){return Du(this)}partial(t){const n={};for(const r of ln.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new hr({...this._def,shape:()=>n})}required(t){const n={};for(const r of ln.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof oi;)i=i._def.innerType;n[r]=i}return new hr({...this._def,shape:()=>n})}keyof(){return $D(ln.objectKeys(this.shape))}}hr.create=(e,t)=>new hr({shape:()=>e,unknownKeys:"strip",catchall:gl.create(),typeName:pt.ZodObject,...Lt(t)});hr.strictCreate=(e,t)=>new hr({shape:()=>e,unknownKeys:"strict",catchall:gl.create(),typeName:pt.ZodObject,...Lt(t)});hr.lazycreate=(e,t)=>new hr({shape:e,unknownKeys:"strip",catchall:gl.create(),typeName:pt.ZodObject,...Lt(t)});class bg extends Yt{_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 fi(u.ctx.common.issues));return Ue(n,{code:Ne.invalid_union,unionErrors:c}),ft}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},x=f._parseSync({data:n.data,path:n.path,parent:m});if(x.status==="valid")return x;x.status==="dirty"&&!i&&(i={result:x,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 fi(f));return Ue(n,{code:Ne.invalid_union,unionErrors:u}),ft}}get options(){return this._def.options}}bg.create=(e,t)=>new bg({options:e,typeName:pt.ZodUnion,...Lt(t)});const Jo=e=>e instanceof vb?Jo(e.schema):e instanceof vc?Jo(e.innerType()):e instanceof Eg?[e.value]:e instanceof yc?e.options:e instanceof wg?ln.objectValues(e.enum):e instanceof jg?Jo(e._def.innerType):e instanceof gb?[void 0]:e instanceof vg?[null]:e instanceof oi?[void 0,...Jo(e.unwrap())]:e instanceof bc?[null,...Jo(e.unwrap())]:e instanceof BD||e instanceof _g?Jo(e.unwrap()):e instanceof Tg?Jo(e._def.innerType):[];class l2 extends Yt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.object)return Ue(n,{code:Ne.invalid_type,expected:Be.object,received:n.parsedType}),ft;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:Ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ft)}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=Jo(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 l2({typeName:pt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Lt(r)})}}function yb(e,t){const n=Zi(e),r=Zi(t);if(e===t)return{valid:!0,data:e};if(n===Be.object&&r===Be.object){const s=ln.objectKeys(t),i=ln.objectKeys(e).filter(u=>s.indexOf(u)!==-1),c={...e,...t};for(const u of i){const f=yb(e[u],t[u]);if(!f.valid)return{valid:!1};c[u]=f.data}return{valid:!0,data:c}}else if(n===Be.array&&r===Be.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=yb(c,u);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===Be.date&&r===Be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Sg extends Yt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,c)=>{if(m_(i)||m_(c))return ft;const u=yb(i.value,c.value);return u.valid?((p_(i)||p_(c))&&n.dirty(),{status:n.value,value:u.data}):(Ue(r,{code:Ne.invalid_intersection_types}),ft)};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}))}}Sg.create=(e,t,n)=>new Sg({left:e,right:t,typeName:pt.ZodIntersection,...Lt(n)});class xc extends Yt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.array)return Ue(r,{code:Ne.invalid_type,expected:Be.array,received:r.parsedType}),ft;if(r.data.length<this._def.items.length)return Ue(r,{code:Ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ft;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:Ne.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 jo(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(i).then(c=>da.mergeArray(n,c)):da.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new xc({...this._def,rest:t})}}xc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xc({items:e,typeName:pt.ZodTuple,rest:null,...Lt(t)})};class Cg extends Yt{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!==Be.object)return Ue(r,{code:Ne.invalid_type,expected:Be.object,received:r.parsedType}),ft;const s=[],i=this._def.keyType,c=this._def.valueType;for(const u in r.data)s.push({key:i._parse(new jo(r,u,r.path,u)),value:c._parse(new jo(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?da.mergeObjectAsync(n,s):da.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Yt?new Cg({keyType:t,valueType:n,typeName:pt.ZodRecord,...Lt(r)}):new Cg({keyType:si.create(),valueType:t,typeName:pt.ZodRecord,...Lt(n)})}}class b_ extends Yt{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!==Be.map)return Ue(r,{code:Ne.invalid_type,expected:Be.map,received:r.parsedType}),ft;const s=this._def.keyType,i=this._def.valueType,c=[...r.data.entries()].map(([u,f],m)=>({key:s._parse(new jo(r,u,r.path,[m,"key"])),value:i._parse(new jo(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,x=await f.value;if(m.status==="aborted"||x.status==="aborted")return ft;(m.status==="dirty"||x.status==="dirty")&&n.dirty(),u.set(m.value,x.value)}return{status:n.value,value:u}})}else{const u=new Map;for(const f of c){const m=f.key,x=f.value;if(m.status==="aborted"||x.status==="aborted")return ft;(m.status==="dirty"||x.status==="dirty")&&n.dirty(),u.set(m.value,x.value)}return{status:n.value,value:u}}}}b_.create=(e,t,n)=>new b_({valueType:t,keyType:e,typeName:pt.ZodMap,...Lt(n)});class ih extends Yt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Be.set)return Ue(r,{code:Ne.invalid_type,expected:Be.set,received:r.parsedType}),ft;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(Ue(r,{code:Ne.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:Ne.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 x of f){if(x.status==="aborted")return ft;x.status==="dirty"&&n.dirty(),m.add(x.value)}return{status:n.value,value:m}}const u=[...r.data.values()].map((f,m)=>i._parse(new jo(r,f,r.path,m)));return r.common.async?Promise.all(u).then(f=>c(f)):c(u)}min(t,n){return new ih({...this._def,minSize:{value:t,message:Je.toString(n)}})}max(t,n){return new ih({...this._def,maxSize:{value:t,message:Je.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ih.create=(e,t)=>new ih({valueType:e,minSize:null,maxSize:null,typeName:pt.ZodSet,...Lt(t)});class vb extends Yt{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})}}vb.create=(e,t)=>new vb({getter:e,typeName:pt.ZodLazy,...Lt(t)});class Eg extends Yt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ue(n,{received:n.data,code:Ne.invalid_literal,expected:this._def.value}),ft}return{status:"valid",value:t.data}}get value(){return this._def.value}}Eg.create=(e,t)=>new Eg({value:e,typeName:pt.ZodLiteral,...Lt(t)});function $D(e,t){return new yc({values:e,typeName:pt.ZodEnum,...Lt(t)})}class yc extends Yt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ue(n,{expected:ln.joinValues(r),received:n.parsedType,code:Ne.invalid_type}),ft}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:Ne.invalid_enum_value,options:r}),ft}return ws(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 yc.create(t,{...this._def,...n})}exclude(t,n=this._def){return yc.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}yc.create=$D;class wg extends Yt{_parse(t){const n=ln.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Be.string&&r.parsedType!==Be.number){const s=ln.objectValues(n);return Ue(r,{expected:ln.joinValues(s),received:r.parsedType,code:Ne.invalid_type}),ft}if(this._cache||(this._cache=new Set(ln.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=ln.objectValues(n);return Ue(r,{received:r.data,code:Ne.invalid_enum_value,options:s}),ft}return ws(t.data)}get enum(){return this._def.values}}wg.create=(e,t)=>new wg({values:e,typeName:pt.ZodNativeEnum,...Lt(t)});class Rg extends Yt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Be.promise&&n.common.async===!1)return Ue(n,{code:Ne.invalid_type,expected:Be.promise,received:n.parsedType}),ft;const r=n.parsedType===Be.promise?n.data:Promise.resolve(n.data);return ws(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Rg.create=(e,t)=>new Rg({type:e,typeName:pt.ZodPromise,...Lt(t)});class vc extends Yt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===pt.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 ft;const f=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return f.status==="aborted"?ft:f.status==="dirty"||n.value==="dirty"?Pf(f.value):f});{if(n.value==="aborted")return ft;const u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?ft:u.status==="dirty"||n.value==="dirty"?Pf(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"?ft:(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"?ft:(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(!sd(c))return ft;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=>sd(c)?Promise.resolve(s.transform(c.value,i)).then(u=>({status:n.value,value:u})):ft);ln.assertNever(s)}}vc.create=(e,t,n)=>new vc({schema:e,typeName:pt.ZodEffects,effect:t,...Lt(n)});vc.createWithPreprocess=(e,t,n)=>new vc({schema:t,effect:{type:"preprocess",transform:e},typeName:pt.ZodEffects,...Lt(n)});class oi extends Yt{_parse(t){return this._getType(t)===Be.undefined?ws(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:pt.ZodOptional,...Lt(t)});class bc extends Yt{_parse(t){return this._getType(t)===Be.null?ws(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bc.create=(e,t)=>new bc({innerType:e,typeName:pt.ZodNullable,...Lt(t)});class jg extends Yt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}jg.create=(e,t)=>new jg({innerType:e,typeName:pt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Lt(t)});class Tg extends Yt{_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 xg(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new fi(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new fi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Tg.create=(e,t)=>new Tg({innerType:e,typeName:pt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Lt(t)});class S_ extends Yt{_parse(t){if(this._getType(t)!==Be.nan){const r=this._getOrReturnCtx(t);return Ue(r,{code:Ne.invalid_type,expected:Be.nan,received:r.parsedType}),ft}return{status:"valid",value:t.data}}}S_.create=e=>new S_({typeName:pt.ZodNaN,...Lt(e)});class BD extends Yt{_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 c2 extends Yt{_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"?ft:i.status==="dirty"?(n.dirty(),Pf(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"?ft: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 c2({in:t,out:n,typeName:pt.ZodPipeline})}}class _g extends Yt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(sd(s)&&(s.value=Object.freeze(s.value)),s);return xg(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}_g.create=(e,t)=>new _g({innerType:e,typeName:pt.ZodReadonly,...Lt(t)});var pt;(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"})(pt||(pt={}));const gt=si.create,CY=od.create,EY=pb.create,wY=vg.create,RY=xb.create;gl.create;const bb=vo.create,en=hr.create,jY=bg.create,jx=l2.create;Sg.create;xc.create;const TY=Cg.create,pr=Eg.create;yc.create;const Tx=wg.create;Rg.create;oi.create;const _Y=bc.create,i1=ft,GD=en({serviceAccount:gt().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Ne.custom,message:"Service Account must be a valid JSON object"}),i1):n.client_email?e:(t.addIssue({code:Ne.custom,message:"Service Account must contain a client_email field"}),i1)}catch(n){return console.error(n),t.addIssue({code:Ne.custom,message:"Service Account must be a valid JSON string"}),i1}})}),NY=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:MW,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:hT,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:$A,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:hT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:BP,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:mT,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:mT,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:cz,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:PP,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:Mz,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:FW,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function Sb(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function AY(){const{flags:e}=yd(),{loadProjects:t,projects:n}=kD(),{id:r}=iD(),s=Sb("IDP_PROVIDER","owox",e);h.useEffect(()=>{s&&t()},[t,s]);const i=n.length>1;return{visibleMenuItems:h.useMemo(()=>{const f=NY.filter(y=>typeof y.visible=="boolean"?y.visible:Sb(y.visible.flagKey,y.visible.expectedValue,e)).map(y=>{if(y.group==="project"&&y.href&&r)try{const v=y.href.replace("/p/none/",`/p/${r}/`);return{...y,href:v}}catch{return y}return y}),m=new Map;f.forEach(y=>{const v=y.group||"default";m.has(v)||m.set(v,[]);const S=m.get(v);S&&S.push(y)});const x=[],g=Array.from(m.entries()).filter(([,y])=>y.length>0);return g.forEach(([,y],v)=>{x.push(...y),v<g.length-1&&x.push({type:"separator",visible:!0})}),x},[e,r]),canSwitchProject:i}}function DY(){const{visibleMenuItems:e,canSwitchProject:t}=AY();return a.jsxs(jr,{align:"start",side:"right",className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(ua,{},`separator-${String(r)}`);const s=n.icon;return a.jsx(Tt,{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(IW,{},"switch-project")]})}var Ot=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(Ot||{});let OY={data:""},IY=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||OY},MY=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,kY=/\/\*[^]*?\*\/| +/g,C_=/\n+/g,el=(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"?el(c,i):i+"{"+el(c,i[1]=="k"?"":t)+"}":typeof c=="object"?r+=el(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+=el.p?el.p(i,c):i+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Zo={},qD=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+qD(e[n]);return t}return e},LY=(e,t,n,r,s)=>{let i=qD(e),c=Zo[i]||(Zo[i]=(f=>{let m=0,x=11;for(;m<f.length;)x=101*x+f.charCodeAt(m++)>>>0;return"go"+x})(i));if(!Zo[c]){let f=i!==e?e:(m=>{let x,g,y=[{}];for(;x=MY.exec(m.replace(kY,""));)x[4]?y.shift():x[3]?(g=x[3].replace(C_," ").trim(),y.unshift(y[0][g]=y[0][g]||{})):y[0][x[1]]=x[2].replace(C_," ").trim();return y[0]})(e);Zo[c]=el(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let u=n&&Zo.g?Zo.g:null;return n&&(Zo.g=Zo[c]),((f,m,x,g)=>{g?m.data=m.data.replace(g,f):m.data.indexOf(f)===-1&&(m.data=x?f+m.data:m.data+f)})(Zo[c],t,r,u),c},PY=(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?"":el(u,""):u===!1?"":u}return r+s+(c??"")},"");function _x(e){let t=this||{},n=e.call?e(t.p):e;return LY(n.unshift?n.raw?PY(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,IY(t.target),t.g,t.o,t.k)}let KD,Cb,Eb;_x.bind({g:1});let hi=_x.bind({k:1});function UY(e,t,n,r){el.p=t,KD=e,Cb=n,Eb=r}function Cl(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:Cb&&Cb()},u),n.o=/ *go\d+/.test(f),u.className=_x.apply(n,r)+(f?" "+f:"");let m=e;return e[0]&&(m=u.as||e,delete u.as),Eb&&m[0]&&Eb(u),KD(m,u)}return s}}var zY=e=>typeof e=="function",Ng=(e,t)=>zY(e)?e(t):e,FY=(()=>{let e=0;return()=>(++e).toString()})(),WD=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),HY=20,u2="default",YD=(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 YD(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:HY}},po={},XD=(e,t=u2)=>{po[t]=YD(po[t]||ZD,e),Zp.forEach(([n,r])=>{n===t&&r(po[t])})},QD=e=>Object.keys(po).forEach(t=>XD(e,t)),VY=e=>Object.keys(po).find(t=>po[t].toasts.some(n=>n.id===e)),Nx=(e=u2)=>t=>{XD(t,e)},$Y={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},BY=(e={},t=u2)=>{let[n,r]=h.useState(po[t]||ZD),s=h.useRef(po[t]);h.useEffect(()=>(s.current!==po[t]&&r(po[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}},GY=(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)||FY()}),Fh=e=>(t,n)=>{let r=GY(t,e,n);return Nx(r.toasterId||VY(r.id))({type:2,toast:r}),r.id},_n=(e,t)=>Fh("blank")(e,t);_n.error=Fh("error");_n.success=Fh("success");_n.loading=Fh("loading");_n.custom=Fh("custom");_n.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Nx(t)(n):QD(n)};_n.dismissAll=e=>_n.dismiss(void 0,e);_n.remove=(e,t)=>{let n={type:4,toastId:e};t?Nx(t)(n):QD(n)};_n.removeAll=e=>_n.remove(void 0,e);_n.promise=(e,t,n)=>{let r=_n.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?Ng(t.success,s):void 0;return i?_n.success(i,{id:r,...n,...n==null?void 0:n.success}):_n.dismiss(r),s}).catch(s=>{let i=t.error?Ng(t.error,s):void 0;i?_n.error(i,{id:r,...n,...n==null?void 0:n.error}):_n.dismiss(r)}),e};var qY=1e3,KY=(e,t="default")=>{let{toasts:n,pausedAt:r}=BY(e,t),s=h.useRef(new Map).current,i=h.useCallback((g,y=qY)=>{if(s.has(g))return;let v=setTimeout(()=>{s.delete(g),c({type:4,toastId:g})},y);s.set(g,v)},[]);h.useEffect(()=>{if(r)return;let g=Date.now(),y=n.map(v=>{if(v.duration===1/0)return;let S=(v.duration||0)+v.pauseDuration-(g-v.createdAt);if(S<0){v.visible&&_n.dismiss(v.id);return}return setTimeout(()=>_n.dismiss(v.id,t),S)});return()=>{y.forEach(v=>v&&clearTimeout(v))}},[n,r,t]);let c=h.useCallback(Nx(t),[t]),u=h.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=h.useCallback((g,y)=>{c({type:1,toast:{id:g,height:y}})},[c]),m=h.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),x=h.useCallback((g,y)=>{let{reverseOrder:v=!1,gutter:S=8,defaultPosition:b}=y||{},E=n.filter(_=>(_.position||b)===(g.position||b)&&_.height),R=E.findIndex(_=>_.id===g.id),j=E.filter((_,D)=>D<R&&_.visible).length;return E.filter(_=>_.visible).slice(...v?[j+1]:[0,j]).reduce((_,D)=>_+(D.height||0)+S,0)},[n]);return h.useEffect(()=>{n.forEach(g=>{if(g.dismissed)i(g.id,g.removeDelay);else{let y=s.get(g.id);y&&(clearTimeout(y),s.delete(g.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:f,startPause:u,endPause:m,calculateOffset:x}}},WY=hi`
606
+ from {
607
+ transform: scale(0) rotate(45deg);
608
+ opacity: 0;
609
+ }
610
+ to {
611
+ transform: scale(1) rotate(45deg);
612
+ opacity: 1;
613
+ }`,YY=hi`
614
+ from {
615
+ transform: scale(0);
616
+ opacity: 0;
617
+ }
618
+ to {
619
+ transform: scale(1);
620
+ opacity: 1;
621
+ }`,ZY=hi`
622
+ from {
623
+ transform: scale(0) rotate(90deg);
624
+ opacity: 0;
625
+ }
626
+ to {
627
+ transform: scale(1) rotate(90deg);
628
+ opacity: 1;
629
+ }`,XY=Cl("div")`
630
+ width: 20px;
631
+ opacity: 0;
632
+ height: 20px;
633
+ border-radius: 10px;
634
+ background: ${e=>e.primary||"#ff4b4b"};
635
+ position: relative;
636
+ transform: rotate(45deg);
637
+
638
+ animation: ${WY} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
639
+ forwards;
640
+ animation-delay: 100ms;
641
+
642
+ &:after,
643
+ &:before {
644
+ content: '';
645
+ animation: ${YY} 0.15s ease-out forwards;
646
+ animation-delay: 150ms;
647
+ position: absolute;
648
+ border-radius: 3px;
649
+ opacity: 0;
650
+ background: ${e=>e.secondary||"#fff"};
651
+ bottom: 9px;
652
+ left: 4px;
653
+ height: 2px;
654
+ width: 12px;
655
+ }
656
+
657
+ &:before {
658
+ animation: ${ZY} 0.15s ease-out forwards;
659
+ animation-delay: 180ms;
660
+ transform: rotate(90deg);
661
+ }
662
+ `,QY=hi`
663
+ from {
664
+ transform: rotate(0deg);
665
+ }
666
+ to {
667
+ transform: rotate(360deg);
668
+ }
669
+ `,JY=Cl("div")`
670
+ width: 12px;
671
+ height: 12px;
672
+ box-sizing: border-box;
673
+ border: 2px solid;
674
+ border-radius: 100%;
675
+ border-color: ${e=>e.secondary||"#e0e0e0"};
676
+ border-right-color: ${e=>e.primary||"#616161"};
677
+ animation: ${QY} 1s linear infinite;
678
+ `,eZ=hi`
679
+ from {
680
+ transform: scale(0) rotate(45deg);
681
+ opacity: 0;
682
+ }
683
+ to {
684
+ transform: scale(1) rotate(45deg);
685
+ opacity: 1;
686
+ }`,tZ=hi`
687
+ 0% {
688
+ height: 0;
689
+ width: 0;
690
+ opacity: 0;
691
+ }
692
+ 40% {
693
+ height: 0;
694
+ width: 6px;
695
+ opacity: 1;
696
+ }
697
+ 100% {
698
+ opacity: 1;
699
+ height: 10px;
700
+ }`,nZ=Cl("div")`
701
+ width: 20px;
702
+ opacity: 0;
703
+ height: 20px;
704
+ border-radius: 10px;
705
+ background: ${e=>e.primary||"#61d345"};
706
+ position: relative;
707
+ transform: rotate(45deg);
708
+
709
+ animation: ${eZ} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
710
+ forwards;
711
+ animation-delay: 100ms;
712
+ &:after {
713
+ content: '';
714
+ box-sizing: border-box;
715
+ animation: ${tZ} 0.2s ease-out forwards;
716
+ opacity: 0;
717
+ animation-delay: 200ms;
718
+ position: absolute;
719
+ border-right: 2px solid;
720
+ border-bottom: 2px solid;
721
+ border-color: ${e=>e.secondary||"#fff"};
722
+ bottom: 6px;
723
+ left: 6px;
724
+ height: 10px;
725
+ width: 6px;
726
+ }
727
+ `,rZ=Cl("div")`
728
+ position: absolute;
729
+ `,aZ=Cl("div")`
730
+ position: relative;
731
+ display: flex;
732
+ justify-content: center;
733
+ align-items: center;
734
+ min-width: 20px;
735
+ min-height: 20px;
736
+ `,sZ=hi`
737
+ from {
738
+ transform: scale(0.6);
739
+ opacity: 0.4;
740
+ }
741
+ to {
742
+ transform: scale(1);
743
+ opacity: 1;
744
+ }`,oZ=Cl("div")`
745
+ position: relative;
746
+ transform: scale(0.6);
747
+ opacity: 0.4;
748
+ min-width: 20px;
749
+ animation: ${sZ} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
750
+ forwards;
751
+ `,iZ=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?h.createElement(oZ,null,t):t:n==="blank"?null:h.createElement(aZ,null,h.createElement(JY,{...r}),n!=="loading"&&h.createElement(rZ,null,n==="error"?h.createElement(XY,{...r}):h.createElement(nZ,{...r})))},lZ=e=>`
752
+ 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
753
+ 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
754
+ `,cZ=e=>`
755
+ 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
756
+ 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
757
+ `,uZ="0%{opacity:0;} 100%{opacity:1;}",dZ="0%{opacity:1;} 100%{opacity:0;}",fZ=Cl("div")`
758
+ display: flex;
759
+ align-items: center;
760
+ background: #fff;
761
+ color: #363636;
762
+ line-height: 1.3;
763
+ will-change: transform;
764
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
765
+ max-width: 350px;
766
+ pointer-events: auto;
767
+ padding: 8px 10px;
768
+ border-radius: 8px;
769
+ `,hZ=Cl("div")`
770
+ display: flex;
771
+ justify-content: center;
772
+ margin: 4px 10px;
773
+ color: inherit;
774
+ flex: 1 1 auto;
775
+ white-space: pre-line;
776
+ `,mZ=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=WD()?[uZ,dZ]:[lZ(n),cZ(n)];return{animation:t?`${hi(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${hi(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},pZ=h.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?mZ(e.position||t||"top-center",e.visible):{opacity:0},i=h.createElement(iZ,{toast:e}),c=h.createElement(hZ,{...e.ariaProps},Ng(e.message,e));return h.createElement(fZ,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:c}):h.createElement(h.Fragment,null,i,c))});UY(h.createElement);var gZ=({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)},xZ=(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:WD()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},yZ=_x`
777
+ z-index: 9999;
778
+ > * {
779
+ pointer-events: auto;
780
+ }
781
+ `,wp=16,vZ=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:c,containerClassName:u})=>{let{toasts:f,handlers:m}=KY(n,i);return h.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:wp,left:wp,right:wp,bottom:wp,pointerEvents:"none",...c},className:u,onMouseEnter:m.startPause,onMouseLeave:m.endPause},f.map(x=>{let g=x.position||t,y=m.calculateOffset(x,{reverseOrder:e,gutter:r,defaultPosition:t}),v=xZ(g,y);return h.createElement(gZ,{id:x.id,key:x.id,onHeightUpdate:m.updateHeight,className:x.visible?yZ:"",style:v},x.type==="custom"?Ng(x.message,x):s?s(x):h.createElement(pZ,{toast:x,position:g}))}))},kt=_n;const mn=e=>{var n;return(n=e.response)==null?void 0:n.data};function E_(e,t="Something went wrong"){var s,i;const n=mn(e);let r=n.message.trim()||t;(i=(s=n.errorDetails)==null?void 0:s.error)!=null&&i.trim()&&(r=`${r}. ${n.errorDetails.error}`),kt.error(r)}function JD(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 bZ{constructor(){ro(this,"isRefreshingToken",!1);ro(this,"refreshTokenPromise",null);ro(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 SZ={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},ja=tr.create(SZ),wb=new bZ;ja.interceptors.request.use(e=>{if(e.skipAuthHeader||new fW(e.headers).has("X-OWOX-Authorization"))return e;const n=o2(),r=(n==null?void 0:n.getAccessToken())??wb.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));ja.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=o2();if(!i)throw new Error("No token provider available");const c=await wb.refreshToken(()=>i.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await ja(t)}catch{return wb.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&&E_(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&E_(e,"Bad request"),Promise.reject(e)});const eO={projects:[],callState:Ot.IDLE,error:null};function CZ(e,t){switch(t.type){case"LOADING":return{...e,callState:Ot.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:Ot.LOADED,error:null};case"ERROR":return{...e,callState:Ot.ERROR,error:t.payload};case"RESET":return{...eO};default:return e}}function EZ({children:e}){const[t,n]=h.useReducer(CZ,eO),r=h.useCallback(async()=>{n({type:"LOADING"});try{const u=o2();if(!u){n({type:"ERROR",payload:mn(new u_("No token provider"))});return}const f=u.getAccessToken();if(!f){n({type:"ERROR",payload:mn(new u_("Unable to obtain access token"))});return}const m=await vW(f);n({type:"SUCCESS",payload:m})}catch(u){n({type:"ERROR",payload:mn(u)})}},[]),s=h.useCallback(()=>{n({type:"RESET"})},[]),i=t.callState===Ot.LOADING,c={...t,loadProjects:r,reset:s,isLoading:i};return a.jsx(MD.Provider,{value:c,children:e})}function wZ(){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(wr,{open:e,onOpenChange:t,children:[a.jsx(Lq,{isOpen:e}),a.jsx(EZ,{children:a.jsx(DY,{})})]})})})})}var RZ=(e,t,n,r,s,i,c,u)=>{let f=document.documentElement,m=["light","dark"];function x(v){(Array.isArray(e)?e:[e]).forEach(S=>{let b=S==="class",E=b&&i?s.map(R=>i[R]||R):s;b?(f.classList.remove(...E),f.classList.add(i&&i[v]?i[v]:v)):f.setAttribute(S,v)}),g(v)}function g(v){u&&m.includes(v)&&(f.style.colorScheme=v)}function y(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)x(r);else try{let v=localStorage.getItem(t)||n,S=c&&v==="system"?y():v;x(S)}catch{}},w_=["light","dark"],tO="(prefers-color-scheme: dark)",jZ=typeof window>"u",d2=h.createContext(void 0),TZ={setTheme:e=>{},themes:[]},Hh=()=>{var e;return(e=h.useContext(d2))!=null?e:TZ},_Z=e=>h.useContext(d2)?h.createElement(h.Fragment,null,e.children):h.createElement(AZ,{...e}),NZ=["light","dark"],AZ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:i=NZ,defaultTheme:c=n?"system":"light",attribute:u="data-theme",value:f,children:m,nonce:x,scriptProps:g})=>{let[y,v]=h.useState(()=>OZ(s,c)),[S,b]=h.useState(()=>y==="system"?l1():y),E=f?Object.values(f):i,R=h.useCallback(O=>{let A=O;if(!A)return;O==="system"&&n&&(A=l1());let T=f?f[A]:A,M=t?IZ(x):null,k=document.documentElement,z=L=>{L==="class"?(k.classList.remove(...E),T&&k.classList.add(T)):L.startsWith("data-")&&(T?k.setAttribute(L,T):k.removeAttribute(L))};if(Array.isArray(u)?u.forEach(z):z(u),r){let L=w_.includes(c)?c:null,G=w_.includes(A)?A:L;k.style.colorScheme=G}M==null||M()},[x]),j=h.useCallback(O=>{let A=typeof O=="function"?O(y):O;v(A);try{localStorage.setItem(s,A)}catch{}},[y]),_=h.useCallback(O=>{let A=l1(O);b(A),y==="system"&&n&&!e&&R("system")},[y,e]);h.useEffect(()=>{let O=window.matchMedia(tO);return O.addListener(_),_(O),()=>O.removeListener(_)},[_]),h.useEffect(()=>{let O=A=>{A.key===s&&(A.newValue?v(A.newValue):j(c))};return window.addEventListener("storage",O),()=>window.removeEventListener("storage",O)},[j]),h.useEffect(()=>{R(e??y)},[e,y]);let D=h.useMemo(()=>({theme:y,setTheme:j,forcedTheme:e,resolvedTheme:y==="system"?S:y,themes:n?[...i,"system"]:i,systemTheme:n?S:void 0}),[y,j,e,S,n,i]);return h.createElement(d2.Provider,{value:D},h.createElement(DZ,{forcedTheme:e,storageKey:s,attribute:u,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:i,nonce:x,scriptProps:g}),m)},DZ=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:c,themes:u,nonce:f,scriptProps:m})=>{let x=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:`(${RZ.toString()})(${x})`}})}),OZ=(e,t)=>{if(jZ)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},IZ=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)}},l1=e=>(e||(e=window.matchMedia(tO)),e.matches?"dark":"light");const MZ=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:kZ(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:FA},{value:"light",label:"Light",icon:GA},{value:"dark",label:"Dark",icon:HA}]}},{type:"separator"},{type:"item",title:"Sign out",icon:az,onClick:n,className:"text-red-600 focus:text-red-600"}];function kZ(e){switch(e){case"light":return GA;case"dark":return HA;case"system":default:return FA}}var qu=(e=>(e.LARGE="LARGE",e.NORMAL="NORMAL",e.SMALL="SMALL",e))(qu||{});function Rb({avatar:e,initials:t,displayName:n,size:r=qu.NORMAL}){let s,i,c;switch(r){case qu.SMALL:s="w-6 h-6",i="w-5 h-5",c="text-[10px]";break;case qu.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 LZ({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return a.jsx(Rr,{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(Rb,{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(Es,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function PZ({items:e}){return a.jsx(jr,{align:"end",side:"right",className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return a.jsx(ua,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(yx,{children:[a.jsxs(vx,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(bx,{children:r.options.map(s=>a.jsxs(Tt,{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(la,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return a.jsxs(Tt,{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 UZ(){const{user:e,signOut:t}=yi(),{setTheme:n,theme:r}=Hh(),[s,i]=h.useState(!1);if(!e)return null;const{fullName:c,email:u,avatar:f}=e,m=c??u??"Unknown User",x=JD(c,u);return a.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(wr,{open:s,onOpenChange:i,children:[a.jsx(LZ,{isOpen:s,displayName:m,email:u,avatar:f,initials:x}),a.jsx(PZ,{items:MZ({theme:r,setTheme:n,signOut:t})})]})})}function zZ(){const{user:e,status:t}=yi();return t===Zr.LOADING||t===Zr.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function vi(){const e=Tc(),t=zZ(),n=h.useCallback((i,c)=>{if(!t){e("/",{replace:!0});return}const u=gg(t,i);e(u,c)},[e,t]),r=h.useCallback(i=>t?gg(t,i):i,[t]);return h.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function FZ(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 HZ(){const{scope:e}=vi();return a.jsxs(vh,{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(ga,{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 VZ=[{title:"Data Marts",url:"/data-marts",icon:sg},{title:"Storages",url:"/data-storages",icon:fc},{title:"Destinations",url:"/data-destinations",icon:CS}];function $Z(){const{scope:e}=vi();return a.jsx(HB,{children:VZ.map(t=>{const n=t.icon;return a.jsx(VB,{children:a.jsx(vh,{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(wt,{delayDuration:500,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs(BB,{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 nO=20,rO=20;function aO({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 BZ(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 GZ(e=30,t=0){aO({vertical:rO+e,horizontal:nO+t})}function jb(){if(aO({vertical:rO,horizontal:nO}),BZ(!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 qZ(){if(window.Intercom)try{window.Intercom("show")}catch(e){console.warn("Intercom show failed",e)}else window.__intercom_open_on_ready=!0}function KZ(e){return[{type:"menu-item",title:"What´s new",icon:Az,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:Or,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:Or,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"}},{type:"submenu",title:"Video tutorials",icon:iU,visible:!0,submenu:{options:[{label:"Getting Started with Data Marts",icon:$0,onClick:()=>{e("video-3-getting-started-with-data-marts")}},{label:"SQL to Google Sheets in Minutes",icon:$0,onClick:()=>{e("video-1-google-sheets")}},{label:"Looker Studio Setup",icon:$0,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:VW,visible:!0},{type:"menu-item",title:"Online Chat",icon:dz,onClick:()=>{qZ()},visible:!0}]}function WZ({isOpen:e}){return a.jsx(Rr,{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(zA,{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(Es,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"-rotate-90":""}`})]})})}function YZ({items:e,onClose:t}){return a.jsx(jr,{align:"end",side:"right",className:"w-56",children:e.map((n,r)=>{if(n.type==="separator")return a.jsx(ua,{},`sep-${String(r)}`);const s=n.icon;if(n.type==="submenu"){const{submenu:i}=n;return a.jsxs(yx,{children:[a.jsxs(vx,{className:"flex items-center gap-2",children:[a.jsx(s,{className:"text-muted-foreground size-4"}),n.title]}),a.jsx(bx,{children:i.options.map((c,u)=>a.jsxs(Tt,{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(Tt,{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 ZZ(e){const{flags:t}=yd();return{visibleItems:h.useMemo(()=>e.filter(r=>r.type==="separator"||r.type==="submenu"?!0:typeof r.visible=="boolean"?r.visible:Sb(r.visible.flagKey,r.visible.expectedValue,t)),[e,t])}}const sO={activePopoverId:null,isOpen:!1},oO="contentPopovers/OPEN_POPOVER",iO="contentPopovers/CLOSE_POPOVER",lO="contentPopovers/TOGGLE_POPOVER";function XZ(e){return{type:oO,payload:e}}function QZ(e){return{type:iO,payload:e}}function JZ(e){return{type:lO,payload:e}}function eX(e=sO,t){switch(t.type){case oO:return{activePopoverId:t.payload,isOpen:!0};case iO:{const n=t.payload;return e.activePopoverId!==n?e:{activePopoverId:null,isOpen:!1}}case lO:{const n=t.payload;return e.activePopoverId!==n?{activePopoverId:n,isOpen:!0}:{activePopoverId:n,isOpen:!e.isOpen}}default:return e}}function f2(){const e=oD(),t=sh(n=>n.contentPopovers);return{activePopoverId:t.activePopoverId,isOpen:t.isOpen,open:n=>{e(XZ(n))},close:()=>{t.activePopoverId&&e(QZ(t.activePopoverId))},toggle:n=>{e(JZ(n))}}}function tX(){const[e,t]=h.useState(!1),{open:n}=f2(),r=KZ(n),{visibleItems:s}=ZZ(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(wr,{open:e,onOpenChange:t,children:[a.jsx(WZ,{isOpen:e}),a.jsx(YZ,{items:s,onClose:()=>{t(!1)}})]})})})})}function nX({variant:e="inset",collapsible:t="icon"}){return a.jsxs(MB,{variant:e,collapsible:t,children:[a.jsx(UB,{children:a.jsx(wZ,{})}),a.jsxs(FB,{children:[a.jsx(BT,{children:a.jsx(GT,{children:a.jsx(HZ,{})})}),a.jsx(BT,{children:a.jsx(GT,{children:a.jsx($Z,{})})})]}),a.jsxs(zB,{children:[a.jsx(tX,{}),a.jsx(NS,{}),a.jsx(UZ,{})]}),a.jsx(LB,{})]})}function rX({children:e,...t}){return a.jsx(_Z,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class El{constructor(t){ro(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await ja.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await ja.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await ja.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await ja.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await ja.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class aX{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 xs=new aX;class sX{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 oX=new sX;function iX({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 cO=h.createContext({isLoading:!1});function lX({children:e}){const[t,n]=h.useState(0),r=t>0;return h.useEffect(()=>{const s=ja.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=ja.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()=>{ja.interceptors.request.eject(s),ja.interceptors.response.eject(i)}},[]),a.jsx(cO.Provider,{value:{isLoading:r},children:e})}function cX(){return h.useContext(cO)}function uX(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 dX=e=>{switch(e){case"success":return mX;case"info":return gX;case"warning":return pX;case"error":return xX;default:return null}},fX=Array(12).fill(0),hX=({visible:e,className:t})=>ae.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ae.createElement("div",{className:"sonner-spinner"},fX.map((n,r)=>ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),mX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),pX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),gX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),xX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),yX=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),vX=()=>{const[e,t]=ae.useState(document.hidden);return ae.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Tb=1;class bX{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:Tb++,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],ae.isValidElement(m))i=!1,this.create({id:r,type:"default",message:m});else if(CX(m)&&!m.ok){i=!1;const g=typeof n.error=="function"?await n.error(`HTTP error! status: ${m.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${m.status}`):n.description,S=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:y,...S})}else if(m instanceof Error){i=!1;const g=typeof n.error=="function"?await n.error(m):n.error,y=typeof n.description=="function"?await n.description(m):n.description,S=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:r,type:"error",description:y,...S})}else if(n.success!==void 0){i=!1;const g=typeof n.success=="function"?await n.success(m):n.success,y=typeof n.description=="function"?await n.description(m):n.description,S=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:r,type:"success",description:y,...S})}}).catch(async m=>{if(c=["reject",m],n.error!==void 0){i=!1;const x=typeof n.error=="function"?await n.error(m):n.error,g=typeof n.description=="function"?await n.description(m):n.description,v=typeof x=="object"&&!ae.isValidElement(x)?x:{message:x};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,x)=>u.then(()=>c[0]==="reject"?x(c[1]):m(c[1])).catch(x));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)||Tb++;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 wa=new bX,SX=(e,t)=>{const n=(t==null?void 0:t.id)||Tb++;return wa.addToast({title:e,...t,id:n}),n},CX=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",EX=SX,wX=()=>wa.toasts,RX=()=>wa.getActiveToasts(),R_=Object.assign(EX,{success:wa.success,info:wa.info,warning:wa.warning,error:wa.error,custom:wa.custom,message:wa.message,promise:wa.promise,dismiss:wa.dismiss,loading:wa.loading},{getHistory:wX,getToasts:RX});uX("[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 Rp(e){return e.label!==void 0}const jX=3,TX="24px",_X="16px",j_=4e3,NX=356,AX=14,DX=45,OX=200;function so(...e){return e.filter(Boolean).join(" ")}function IX(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const MX=e=>{var t,n,r,s,i,c,u,f,m;const{invert:x,toast:g,unstyled:y,interacting:v,setHeights:S,visibleToasts:b,heights:E,index:R,toasts:j,expanded:_,removeToast:D,defaultRichColors:O,closeButton:A,style:T,cancelButtonStyle:M,actionButtonStyle:k,className:z="",descriptionClassName:L="",duration:G,position:B,gap:q,expandByDefault:V,classNames:I,icons:K,closeButtonAriaLabel:$="Close toast"}=e,[ee,me]=ae.useState(null),[U,F]=ae.useState(null),[H,W]=ae.useState(!1),[Q,le]=ae.useState(!1),[J,ie]=ae.useState(!1),[ye,Ee]=ae.useState(!1),[He,Re]=ae.useState(!1),[Ke,nt]=ae.useState(0),[Gt,Ft]=ae.useState(0),On=ae.useRef(g.duration||G||j_),vn=ae.useRef(null),ke=ae.useRef(null),Y=R===0,re=R+1<=b,ce=g.type,Ie=g.dismissible!==!1,je=g.className||"",Te=g.descriptionClassName||"",Ve=ae.useMemo(()=>E.findIndex(Ze=>Ze.toastId===g.id)||0,[E,g.id]),bt=ae.useMemo(()=>{var Ze;return(Ze=g.closeButton)!=null?Ze:A},[g.closeButton,A]),st=ae.useMemo(()=>g.duration||G||j_,[g.duration,G]),tn=ae.useRef(0),or=ae.useRef(0),Vn=ae.useRef(0),Lr=ae.useRef(null),[ea,pn]=B.split("-"),ir=ae.useMemo(()=>E.reduce((Ze,Zt,nn)=>nn>=Ve?Ze:Ze+Zt.height,0),[E,Ve]),kn=vX(),Qs=g.invert||x,Ia=ce==="loading";or.current=ae.useMemo(()=>Ve*q+ir,[Ve,ir]),ae.useEffect(()=>{On.current=st},[st]),ae.useEffect(()=>{W(!0)},[]),ae.useEffect(()=>{const Ze=ke.current;if(Ze){const Zt=Ze.getBoundingClientRect().height;return Ft(Zt),S(nn=>[{toastId:g.id,height:Zt,position:g.position},...nn]),()=>S(nn=>nn.filter(Xt=>Xt.toastId!==g.id))}},[S,g.id]),ae.useLayoutEffect(()=>{if(!H)return;const Ze=ke.current,Zt=Ze.style.height;Ze.style.height="auto";const nn=Ze.getBoundingClientRect().height;Ze.style.height=Zt,Ft(nn),S(Xt=>Xt.find(an=>an.toastId===g.id)?Xt.map(an=>an.toastId===g.id?{...an,height:nn}:an):[{toastId:g.id,height:nn,position:g.position},...Xt])},[H,g.title,g.description,S,g.id,g.jsx,g.action,g.cancel]);const ta=ae.useCallback(()=>{le(!0),nt(or.current),S(Ze=>Ze.filter(Zt=>Zt.toastId!==g.id)),setTimeout(()=>{D(g)},OX)},[g,D,S,or]);ae.useEffect(()=>{if(g.promise&&ce==="loading"||g.duration===1/0||g.type==="loading")return;let Ze;return _||v||kn?(()=>{if(Vn.current<tn.current){const Xt=new Date().getTime()-tn.current;On.current=On.current-Xt}Vn.current=new Date().getTime()})():(()=>{On.current!==1/0&&(tn.current=new Date().getTime(),Ze=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),ta()},On.current))})(),()=>clearTimeout(Ze)},[_,v,g,ce,kn,ta]),ae.useEffect(()=>{g.delete&&(ta(),g.onDismiss==null||g.onDismiss.call(g,g))},[ta,g.delete]);function Ma(){var Ze;if(K!=null&&K.loading){var Zt;return ae.createElement("div",{className:so(I==null?void 0:I.loader,g==null||(Zt=g.classNames)==null?void 0:Zt.loader,"sonner-loader"),"data-visible":ce==="loading"},K.loading)}return ae.createElement(hX,{className:so(I==null?void 0:I.loader,g==null||(Ze=g.classNames)==null?void 0:Ze.loader),visible:ce==="loading"})}const js=g.icon||(K==null?void 0:K[ce])||dX(ce);var En,In;return ae.createElement("li",{tabIndex:0,ref:ke,className:so(z,je,I==null?void 0:I.toast,g==null||(t=g.classNames)==null?void 0:t.toast,I==null?void 0:I.default,I==null?void 0:I[ce],g==null||(n=g.classNames)==null?void 0:n[ce]),"data-sonner-toast":"","data-rich-colors":(En=g.richColors)!=null?En:O,"data-styled":!(g.jsx||g.unstyled||y),"data-mounted":H,"data-promise":!!g.promise,"data-swiped":He,"data-removed":Q,"data-visible":re,"data-y-position":ea,"data-x-position":pn,"data-index":R,"data-front":Y,"data-swiping":J,"data-dismissible":Ie,"data-type":ce,"data-invert":Qs,"data-swipe-out":ye,"data-swipe-direction":U,"data-expanded":!!(_||V&&H),"data-testid":g.testId,style:{"--index":R,"--toasts-before":R,"--z-index":j.length-R,"--offset":`${Q?Ke:or.current}px`,"--initial-height":V?"auto":`${Gt}px`,...T,...g.style},onDragEnd:()=>{ie(!1),me(null),Lr.current=null},onPointerDown:Ze=>{Ze.button!==2&&(Ia||!Ie||(vn.current=new Date,nt(or.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(ie(!0),Lr.current={x:Ze.clientX,y:Ze.clientY})))},onPointerUp:()=>{var Ze,Zt,nn;if(ye||!Ie)return;Lr.current=null;const Xt=Number(((Ze=ke.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$n=Number(((Zt=ke.current)==null?void 0:Zt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),an=new Date().getTime()-((nn=vn.current)==null?void 0:nn.getTime()),rn=ee==="x"?Xt:$n,Tr=Math.abs(rn)/an;if(Math.abs(rn)>=DX||Tr>.11){nt(or.current),g.onDismiss==null||g.onDismiss.call(g,g),F(ee==="x"?Xt>0?"right":"left":$n>0?"down":"up"),ta(),Ee(!0);return}else{var Z,te;(Z=ke.current)==null||Z.style.setProperty("--swipe-amount-x","0px"),(te=ke.current)==null||te.style.setProperty("--swipe-amount-y","0px")}Re(!1),ie(!1),me(null)},onPointerMove:Ze=>{var Zt,nn,Xt;if(!Lr.current||!Ie||((Zt=window.getSelection())==null?void 0:Zt.toString().length)>0)return;const an=Ze.clientY-Lr.current.y,rn=Ze.clientX-Lr.current.x;var Tr;const Z=(Tr=e.swipeDirections)!=null?Tr:IX(B);!ee&&(Math.abs(rn)>1||Math.abs(an)>1)&&me(Math.abs(rn)>Math.abs(an)?"x":"y");let te={x:0,y:0};const fe=Ce=>1/(1.5+Math.abs(Ce)/20);if(ee==="y"){if(Z.includes("top")||Z.includes("bottom"))if(Z.includes("top")&&an<0||Z.includes("bottom")&&an>0)te.y=an;else{const Ce=an*fe(an);te.y=Math.abs(Ce)<Math.abs(an)?Ce:an}}else if(ee==="x"&&(Z.includes("left")||Z.includes("right")))if(Z.includes("left")&&rn<0||Z.includes("right")&&rn>0)te.x=rn;else{const Ce=rn*fe(rn);te.x=Math.abs(Ce)<Math.abs(rn)?Ce:rn}(Math.abs(te.x)>0||Math.abs(te.y)>0)&&Re(!0),(nn=ke.current)==null||nn.style.setProperty("--swipe-amount-x",`${te.x}px`),(Xt=ke.current)==null||Xt.style.setProperty("--swipe-amount-y",`${te.y}px`)}},bt&&!g.jsx&&ce!=="loading"?ae.createElement("button",{"aria-label":$,"data-disabled":Ia,"data-close-button":!0,onClick:Ia||!Ie?()=>{}:()=>{ta(),g.onDismiss==null||g.onDismiss.call(g,g)},className:so(I==null?void 0:I.closeButton,g==null||(r=g.classNames)==null?void 0:r.closeButton)},(In=K==null?void 0:K.close)!=null?In:yX):null,(ce||g.icon||g.promise)&&g.icon!==null&&((K==null?void 0:K[ce])!==null||g.icon)?ae.createElement("div",{"data-icon":"",className:so(I==null?void 0:I.icon,g==null||(s=g.classNames)==null?void 0:s.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||Ma():null,g.type!=="loading"?js:null):null,ae.createElement("div",{"data-content":"",className:so(I==null?void 0:I.content,g==null||(i=g.classNames)==null?void 0:i.content)},ae.createElement("div",{"data-title":"",className:so(I==null?void 0:I.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?ae.createElement("div",{"data-description":"",className:so(L,Te,I==null?void 0:I.description,g==null||(u=g.classNames)==null?void 0:u.description)},typeof g.description=="function"?g.description():g.description):null),ae.isValidElement(g.cancel)?g.cancel:g.cancel&&Rp(g.cancel)?ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||M,onClick:Ze=>{Rp(g.cancel)&&Ie&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,Ze),ta())},className:so(I==null?void 0:I.cancelButton,g==null||(f=g.classNames)==null?void 0:f.cancelButton)},g.cancel.label):null,ae.isValidElement(g.action)?g.action:g.action&&Rp(g.action)?ae.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||k,onClick:Ze=>{Rp(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,Ze),!Ze.defaultPrevented&&ta())},className:so(I==null?void 0:I.actionButton,g==null||(m=g.classNames)==null?void 0:m.actionButton)},g.action.label):null)};function T_(){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 kX(e,t){const n={};return[e,t].forEach((r,s)=>{const i=s===1,c=i?"--mobile-offset":"--offset",u=i?_X:TX;function f(m){["top","right","bottom","left"].forEach(x=>{n[`${c}-${x}`]=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 LX=ae.forwardRef(function(t,n){const{id:r,invert:s,position:i="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:m,offset:x,mobileOffset:g,theme:y="light",richColors:v,duration:S,style:b,visibleToasts:E=jX,toastOptions:R,dir:j=T_(),gap:_=AX,icons:D,containerAriaLabel:O="Notifications"}=t,[A,T]=ae.useState([]),M=ae.useMemo(()=>r?A.filter(H=>H.toasterId===r):A.filter(H=>!H.toasterId),[A,r]),k=ae.useMemo(()=>Array.from(new Set([i].concat(M.filter(H=>H.position).map(H=>H.position)))),[M,i]),[z,L]=ae.useState([]),[G,B]=ae.useState(!1),[q,V]=ae.useState(!1),[I,K]=ae.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ae.useRef(null),ee=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),me=ae.useRef(null),U=ae.useRef(!1),F=ae.useCallback(H=>{T(W=>{var Q;return(Q=W.find(le=>le.id===H.id))!=null&&Q.delete||wa.dismiss(H.id),W.filter(({id:le})=>le!==H.id)})},[]);return ae.useEffect(()=>wa.subscribe(H=>{if(H.dismiss){requestAnimationFrame(()=>{T(W=>W.map(Q=>Q.id===H.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{AA.flushSync(()=>{T(W=>{const Q=W.findIndex(le=>le.id===H.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...H},...W.slice(Q+1)]:[H,...W]})})})}),[A]),ae.useEffect(()=>{if(y!=="system"){K(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;const H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:W})=>{K(W?"dark":"light")})}catch{H.addListener(({matches:Q})=>{try{K(Q?"dark":"light")}catch(le){console.error(le)}})}},[y]),ae.useEffect(()=>{A.length<=1&&B(!1)},[A]),ae.useEffect(()=>{const H=W=>{var Q;if(c.every(ie=>W[ie]||W.code===ie)){var J;B(!0),(J=$.current)==null||J.focus()}W.code==="Escape"&&(document.activeElement===$.current||(Q=$.current)!=null&&Q.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[c]),ae.useEffect(()=>{if($.current)return()=>{me.current&&(me.current.focus({preventScroll:!0}),me.current=null,U.current=!1)}},[$.current]),ae.createElement("section",{ref:n,"aria-label":`${O} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((H,W)=>{var Q;const[le,J]=H.split("-");return M.length?ae.createElement("ol",{key:H,dir:j==="auto"?T_():j,tabIndex:-1,ref:$,className:m,"data-sonner-toaster":!0,"data-sonner-theme":I,"data-y-position":le,"data-x-position":J,style:{"--front-toast-height":`${((Q=z[0])==null?void 0:Q.height)||0}px`,"--width":`${NX}px`,"--gap":`${_}px`,...b,...kX(x,g)},onBlur:ie=>{U.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(U.current=!1,me.current&&(me.current.focus({preventScroll:!0}),me.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||U.current||(U.current=!0,me.current=ie.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{q||B(!1)},onDragEnd:()=>B(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||V(!0)},onPointerUp:()=>V(!1)},M.filter(ie=>!ie.position&&W===0||ie.position===H).map((ie,ye)=>{var Ee,He;return ae.createElement(MX,{key:ie.id,icons:D,index:ye,toast:ie,defaultRichColors:v,duration:(Ee=R==null?void 0:R.duration)!=null?Ee:S,className:R==null?void 0:R.className,descriptionClassName:R==null?void 0:R.descriptionClassName,invert:s,visibleToasts:E,closeButton:(He=R==null?void 0:R.closeButton)!=null?He:f,interacting:q,position:H,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:F,toasts:M.filter(Re=>Re.position==ie.position),heights:z.filter(Re=>Re.position==ie.position),setHeights:L,expandByDefault:u,gap:_,expanded:G,swipeDirections:t.swipeDirections})})):null}))}),PX=({...e})=>{const{theme:t="system"}=Hh();return a.jsx(LX,{theme:t,className:"toaster group",icons:{success:a.jsx(Ch,{className:"size-4"}),info:a.jsx(Or,{className:"size-4"}),warning:a.jsx(Eh,{className:"size-4"}),error:a.jsx(VA,{className:"size-4"}),loading:a.jsx(Nc,{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 UX(){return a.jsx(vZ,{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 zX({children:e}){const{isLoading:t}=ID(),n=_W(),r=Xg(),s=Ks();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 __="sidebar_state";function FX(){const{state:e,isMobile:t}=Ah(),r=t||e==="collapsed",{isLoading:s}=cX();return a.jsxs(a.Fragment,{children:[a.jsx(PX,{position:"bottom-right",closeButton:!0}),a.jsx(UX,{}),a.jsx(iX,{isLoading:s}),a.jsxs(NW,{redirectTo:"/auth/sign-in",children:[a.jsx(nX,{variant:"inset",collapsible:"icon"}),a.jsxs(PB,{children:[r&&a.jsx(kB,{}),a.jsx(zX,{children:a.jsx(yS,{})})]})]})]})}function HX(){const[e,t]=h.useState(()=>xs.get(__,"boolean")??!0),n=r=>{t(r),xs.set(__,r)};return a.jsx(rX,{children:a.jsx(lX,{children:a.jsx(IB,{open:e,onOpenChange:n,children:a.jsx(FX,{})})})})}function VX(){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 N_(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx(eF,{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(Xr,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(Da,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const $X={items:[],loading:!1,error:null};function BX(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 uO=h.createContext(void 0);function GX({children:e}){const[t,n]=h.useReducer(BX,$X);return a.jsx(uO.Provider,{value:{state:t,dispatch:n},children:e})}function qX(){const e=h.useContext(uO);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class KX extends El{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 KX;var Ir=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Ir||{}),$e=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))($e||{}),Xp=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Xp||{});const WX={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 dO=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(dO||{}),Vr=(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))(Vr||{}),qn=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(qn||{});const fO={statuses:{[Ir.DRAFT]:{code:Ir.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Ir.PUBLISHED]:{code:Ir.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},hO=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,mO=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,YX=e=>e?hO(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",ZX=e=>e?mO(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",pO=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)},gO=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)},XX=e=>e?pO(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",QX=e=>e?gO(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required";var zs=(e=>(e.PASSWORD="PASSWORD",e.KEY_PAIR="KEY_PAIR",e))(zs||{}),sr=(e=>(e.SERVERLESS="SERVERLESS",e.PROVISIONED="PROVISIONED",e))(sr||{});const JX=[{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 eQ(e){return"projectId"in e}function tQ(e){return"outputBucket"in e}var xe=(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))(xe||{}),ni=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(ni||{});const nQ=({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})]})},rQ=({type:e,config:t})=>{const n={[xe.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[xe.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[xe.SNOWFLAKE]:[],[xe.DATABRICKS]:[],[xe.AWS_REDSHIFT]:[],[xe.AZURE_SYNAPSE]:[]},r=t&&(e===xe.GOOGLE_BIGQUERY&&eQ(t)||e===xe.AWS_ATHENA&&tQ(t));return a.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:i})=>{let c;return r&&(c=(e===xe.GOOGLE_BIGQUERY,t[i])),a.jsx(nQ,{label:s,value:c},i)})})},aQ=({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(rQ,{type:e,config:t})]})}),sQ=_c("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 Dr({className:e,variant:t,asChild:n=!1,...r}){const s=n?bh:"span";return a.jsx(s,{"data-slot":"badge",className:se(sQ({variant:t}),e),...r})}function xO(e){return e.type===xe.GOOGLE_BIGQUERY}function yO(e){return e.type===xe.AWS_ATHENA}function vO(e){return e.type===xe.SNOWFLAKE}const wl={types:{[xe.GOOGLE_BIGQUERY]:{type:xe.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:LD,status:ni.ACTIVE},[xe.AWS_ATHENA]:{type:xe.AWS_ATHENA,displayName:"AWS Athena",icon:PD,status:ni.ACTIVE},[xe.SNOWFLAKE]:{type:xe.SNOWFLAKE,displayName:"Snowflake",icon:UD,status:ni.ACTIVE},[xe.AWS_REDSHIFT]:{type:xe.AWS_REDSHIFT,displayName:"AWS Redshift",icon:zD,status:ni.ACTIVE},[xe.DATABRICKS]:{type:xe.DATABRICKS,displayName:"Databricks",icon:UW,status:ni.COMING_SOON},[xe.AZURE_SYNAPSE]:{type:xe.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:zW,status:ni.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function oQ({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($r,{className:"h-5 w-24"}),a.jsx($r,{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(Dr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:u}=wl.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(aQ,{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 iQ(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 lQ(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 cQ(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function uQ(e){return`https://${e}.snowflakecomputing.com/`}function dQ(e,t){const n=iQ(t);if(!n)return null;const{dataset:r,table:s}=n;return xO(e)?lQ(e.config.projectId,r,s):yO(e)?cQ(e.config.region):vO(e)?uQ(e.config.account):null}function fQ(e,t){const n=dQ(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function hQ(e){return xO(e)?"Open table in Google BigQuery":yO(e)?"Open region in AWS Athena":vO(e)?"Open console in Snowflake":"Open data in storage"}function bO(e){switch(e.type){case xe.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case xe.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);case xe.SNOWFLAKE:return!!(e.config.account&&e.config.warehouse);case xe.AWS_REDSHIFT:{const t=e.config;return t.connectionType===sr.SERVERLESS?!!(t.region&&t.database&&t.workgroupName):!!(t.region&&t.database&&t.clusterIdentifier)}default:return!1}}const SO=en({accessKeyId:gt().min(1,"Access Key ID is required"),secretAccessKey:gt().min(1,"Secret Access Key is required")}),mQ=en({authMethod:pr(zs.PASSWORD),username:gt().min(1,"Username is required"),password:gt().min(1,"Password is required")}),pQ=en({authMethod:pr(zs.KEY_PAIR),username:gt().min(1,"Username is required"),privateKey:gt().min(1,"Private Key is required"),privateKeyPassphrase:gt().optional()}),gQ=jx("authMethod",[mQ,pQ]),xQ=en({projectId:gt().min(1,"Project ID is required"),location:gt().min(1,"Location is required")}),yQ=en({region:gt().min(1,"Region is required"),outputBucket:gt().min(1,"Output Bucket is required")}),vQ=en({account:gt().min(1,"Account is required"),warehouse:gt().min(1,"Warehouse is required")}),bQ=en({connectionType:pr(sr.SERVERLESS),region:gt().min(1,"Region is required"),database:gt().min(1,"Database is required"),workgroupName:gt().min(1,"Workgroup Name is required")}),SQ=en({connectionType:pr(sr.PROVISIONED),region:gt().min(1,"Region is required"),database:gt().min(1,"Database is required"),clusterIdentifier:gt().min(1,"Cluster Identifier is required")}),CQ=jx("connectionType",[bQ,SQ]),Ax=en({title:gt().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),EQ=Ax.extend({type:pr(xe.GOOGLE_BIGQUERY),credentials:GD,config:xQ}),wQ=Ax.extend({type:pr(xe.AWS_ATHENA),credentials:SO,config:yQ}),RQ=Ax.extend({type:pr(xe.SNOWFLAKE),credentials:gQ,config:vQ}),jQ=Ax.extend({type:pr(xe.AWS_REDSHIFT),credentials:SO,config:CQ}),TQ=jx("type",[EQ,wQ,RQ,jQ]),CO=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_$]+|"[^"]+")';return new RegExp(`^[a-zA-Z0-9_$]+\\.${t}\\.${t}$`).test(e)},EO=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)},_Q=e=>e?CO(e)?"":"Invalid format. Expected: database.schema.object":"Fully qualified name is required",NQ=e=>e?EO(e)?"":"Invalid format. Expected: database.schema.table_* (with wildcards)":"Table pattern is required",wO=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_-]+|"[^"]+")',n=new RegExp(`^${t}\\.${t}$`),r=new RegExp(`^${t}\\.${t}\\.${t}$`);return n.test(e)||r.test(e)},RO=e=>{if(!e)return!1;const t='(?:[a-zA-Z0-9_-]+|"[^"]+")',n='(?:[a-zA-Z0-9_\\-*]+|"[^"]+")',r=new RegExp(`^${t}\\.${n}$`),s=new RegExp(`^${t}\\.${t}\\.${n}$`);return r.test(e)||s.test(e)},AQ=e=>e?wO(e)?"":"Invalid format. Expected: schema.object or database.schema.object":"Fully qualified name is required",DQ=e=>e?RO(e)?"":"Invalid format. Expected: schema.table_* or database.schema.table_* (with wildcards)":"Table pattern is required",OQ=(e,t)=>{if(!e)return!1;switch(t){case xe.GOOGLE_BIGQUERY:return hO(e);case xe.AWS_ATHENA:return pO(e);case xe.SNOWFLAKE:return CO(e);case xe.AWS_REDSHIFT:return wO(e);default:return!1}},IQ=(e,t)=>{if(!e)return!1;switch(t){case xe.GOOGLE_BIGQUERY:return mO(e);case xe.AWS_ATHENA:return gO(e);case xe.SNOWFLAKE:return EO(e);case xe.AWS_REDSHIFT:return RO(e);default:return!1}},MQ=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case xe.GOOGLE_BIGQUERY:return YX(e);case xe.AWS_ATHENA:return XX(e);case xe.SNOWFLAKE:return _Q(e);case xe.AWS_REDSHIFT:return AQ(e);default:return"Unsupported storage type"}},kQ=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case xe.GOOGLE_BIGQUERY:return ZX(e);case xe.AWS_ATHENA:return QX(e);case xe.SNOWFLAKE:return NQ(e);case xe.AWS_REDSHIFT:return DQ(e);default:return"Unsupported storage type"}},jO=e=>{switch(e){case xe.GOOGLE_BIGQUERY:return"project.dataset.table";case xe.AWS_ATHENA:return"database.table or catalog.database.table";case xe.SNOWFLAKE:return"database.schema.table";case xe.AWS_REDSHIFT:return"schema.table or database.schema.table";default:return""}},LQ=e=>{switch(e){case xe.GOOGLE_BIGQUERY:return"project.dataset.table_*";case xe.AWS_ATHENA:return"database.table_* or catalog.database.table_*";case xe.SNOWFLAKE:return"database.schema.table_*";case xe.AWS_REDSHIFT:return"schema.table_* or database.schema.table_*";default:return""}},TO=e=>{switch(e){case xe.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case xe.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";case xe.SNOWFLAKE:return"Enter the fully qualified name of the table (e.g., database.schema.table)";case xe.AWS_REDSHIFT:return"Enter the fully qualified name of the table (e.g., schema.table or database.schema.table)";default:return""}},PQ=e=>{switch(e){case xe.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case xe.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';case xe.SNOWFLAKE:return'Enter a pattern to match multiple tables (e.g., database.schema.table_* will match all tables starting with "table_")';case xe.AWS_REDSHIFT:return'Enter a pattern to match multiple tables (e.g., 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 UQ={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:""},zQ=e=>UQ[e],FQ={[Jn.SUCCESS]:{icon:Ch,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:VA,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:Eh,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:Or,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:Or,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 Vh({type:e=Jn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:i,colors:c}=FQ[e],u=f=>{const m="inline-flex items-center gap-1 text-sm",x=zQ(f),g=c[f];return se(m,x,g,s)};return a.jsxs("span",{className:u(t),children:[n&&a.jsx(i,{className:"h-4 w-4","data-testid":"icon"}),r]})}const _O=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,HQ=/[#&]gid=([0-9]+)/;function NO(e){return _O.test(e)}function VQ(e){const t=_O.exec(e);return t?t[2]:""}function $Q(e){const t=HQ.exec(e);return t?t[1]:"0"}function BQ(e){return{spreadsheetId:VQ(e),sheetId:parseInt($Q(e),10)}}function h2(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function GQ(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 c1(e){return GQ(e,"client_email")}const AO=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||{}),kr=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(kr||{}),Mn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(Mn||{}),Nn=(e=>(e.EDIT="edit",e.CREATE="create",e))(Nn||{});const qQ={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function KQ(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 m2({children:e}){const[t,n]=h.useReducer(KQ,qQ);return a.jsx(AO.Provider,{value:{state:t,dispatch:n},children:e})}function WQ(){const e=h.useContext(AO);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class YQ extends El{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 ei=new YQ,ZQ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class XQ{constructor(){ro(this,"pollingTimers",new Map);ro(this,"pollCounters",new Map);ro(this,"config",ZQ)}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 ei.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 jp=new XQ;var Oe=(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))(Oe||{}),Os=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(Os||{}),bo=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(bo||{});class QQ extends El{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 nc=new QQ,oa={types:{[Oe.GOOGLE_SHEETS]:{type:Oe.GOOGLE_SHEETS,displayName:"Google Sheets",icon:kW,status:Os.ACTIVE},[Oe.LOOKER_STUDIO]:{type:Oe.LOOKER_STUDIO,displayName:"Looker Studio",icon:LW,status:Os.ACTIVE},[Oe.EMAIL]:{type:Oe.EMAIL,displayName:"Email",icon:ZW,status:Os.CLOUD_ONLY},[Oe.SLACK]:{type:Oe.SLACK,displayName:"Slack",icon:HW,status:Os.CLOUD_ONLY},[Oe.MS_TEAMS]:{type:Oe.MS_TEAMS,displayName:"Microsoft Teams",icon:WW,status:Os.CLOUD_ONLY},[Oe.GOOGLE_CHAT]:{type:Oe.GOOGLE_CHAT,displayName:"Google Chat",icon:YW,status:Os.CLOUD_ONLY},[Oe.ODATA]:{type:Oe.ODATA,displayName:"OData",icon:PW,status:Os.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},JQ=en({deploymentUrl:gt().optional(),destinationId:gt().optional(),destinationSecretKey:gt().optional()}),eJ=en({to:bb(gt().email()).min(1)}),p2=en({title:gt().min(1,"Title is required"),type:Tx(Oe)}),tJ=p2.extend({type:pr(Oe.GOOGLE_SHEETS),credentials:GD}),nJ=p2.extend({type:pr(Oe.LOOKER_STUDIO),credentials:JQ.optional()}),Dx=p2.extend({credentials:eJ.optional()}),rJ=Dx.extend({type:pr(Oe.EMAIL)}),aJ=Dx.extend({type:pr(Oe.SLACK)}),sJ=Dx.extend({type:pr(Oe.MS_TEAMS)}),oJ=Dx.extend({type:pr(Oe.GOOGLE_CHAT)}),iJ=jx("type",[tJ,nJ,rJ,aJ,sJ,oJ]),DO=h.createContext(void 0);var sn=(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))(sn||{});const lJ={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function cJ(e,t){switch(t.type){case sn.FETCH_DESTINATIONS_START:case sn.FETCH_DESTINATION_START:case sn.CREATE_DESTINATION_START:case sn.UPDATE_DESTINATION_START:case sn.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case sn.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case sn.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case sn.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case sn.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 sn.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case sn.FETCH_DESTINATIONS_ERROR:case sn.FETCH_DESTINATION_ERROR:case sn.CREATE_DESTINATION_ERROR:case sn.UPDATE_DESTINATION_ERROR:case sn.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case sn.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case sn.CLEAR_ERROR:return{...e,error:null};default:return e}}function $h({children:e}){const[t,n]=h.useReducer(cJ,lJ);return a.jsx(DO.Provider,{value:{state:t,dispatch:n},children:e})}function uJ(){const e=h.useContext(DO);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Tp{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:bo.EMAIL_CREDENTIALS,to:s}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:bo.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===bo.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class dJ{mapFromDto(t){let n="";try{t.credentials.type===bo.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:Oe.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:bo.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Oe.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:bo.GOOGLE_SHEETS_CREDENTIALS}}}}class fJ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Oe.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:bo.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Oe.LOOKER_STUDIO,credentials:{type:bo.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===bo.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const OO={getMapper(e){switch(e){case Oe.GOOGLE_SHEETS:return new dJ;case Oe.LOOKER_STUDIO:return new fJ;case Oe.EMAIL:return new Tp(Oe.EMAIL);case Oe.SLACK:return new Tp(Oe.SLACK);case Oe.MS_TEAMS:return new Tp(Oe.MS_TEAMS);case Oe.GOOGLE_CHAT:return new Tp(Oe.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function Ou(e){return OO.getMapper(e.type).mapFromDto(e)}function Bh(){const{state:e,dispatch:t}=uJ(),n=h.useCallback(async()=>{t({type:sn.FETCH_DESTINATIONS_START});try{const x=(await nc.getDataDestinations()).map(Ou);t({type:sn.FETCH_DESTINATIONS_SUCCESS,payload:x})}catch(m){const x=m instanceof Error?m.message:"Failed to load destinations";t({type:sn.FETCH_DESTINATIONS_ERROR,payload:x}),De({event:"data_destination_error",category:"DataDestination",action:"ListError",error:x})}},[t]),r=h.useCallback(async m=>{try{const x=await nc.getDataDestinationById(m),g=Ou(x);t({type:sn.FETCH_DESTINATION_SUCCESS,payload:g})}catch(x){const g=x instanceof Error?x.message:"Failed to load destination";t({type:sn.FETCH_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"GetError",error:g})}},[t]),s=h.useCallback(async m=>{t({type:sn.CREATE_DESTINATION_START});try{const x=await nc.createDataDestination(m),g=Ou(x);return t({type:sn.CREATE_DESTINATION_SUCCESS,payload:g}),De({event:"data_destination_created",category:"DataDestination",action:"Create",label:g.type}),kt.success("Destination created"),g}catch(x){const g=x instanceof Error?x.message:"Failed to create destination";return t({type:sn.CREATE_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type,error:g}),null}},[t]),i=h.useCallback(async(m,x)=>{t({type:sn.UPDATE_DESTINATION_START});try{const g=await nc.updateDataDestination(m,x),y=Ou(g);return t({type:sn.UPDATE_DESTINATION_SUCCESS,payload:y}),De({event:"data_destination_updated",category:"DataDestination",action:"Update",label:y.type}),kt.success("Destination updated"),y}catch(g){const y=g instanceof Error?g.message:"Failed to update destination";return t({type:sn.UPDATE_DESTINATION_ERROR,payload:y}),De({event:"data_destination_error",category:"DataDestination",action:"UpdateError",error:y}),null}},[t]),c=h.useCallback(async m=>{t({type:sn.DELETE_DESTINATION_START});try{await nc.deleteDataDestination(m),t({type:sn.DELETE_DESTINATION_SUCCESS,payload:m}),De({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),kt.success("Destination deleted")}catch(x){const g=x instanceof Error?x.message:"Failed to delete destination";throw t({type:sn.DELETE_DESTINATION_ERROR,payload:g}),De({event:"data_destination_error",category:"DataDestination",action:"DeleteError",error:g}),x}},[t]),u=h.useCallback(()=>{t({type:sn.CLEAR_CURRENT_DESTINATION})},[t]),f=h.useCallback(async m=>{try{const x=await nc.rotateSecretKey(m),g=Ou(x);return De({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:g.type}),g}catch(x){const g=x instanceof Error?x.message:"Failed to rotate secret key";throw De({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",error:g}),console.error("Failed to rotate secret key:",x),x}},[]);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 hJ(e){const t=oa.getInfo(e.type),n=t.status!==Os.COMING_SOON;return{destinationInfo:t,isVisible:n}}function mJ(){const{dataMart:e}=Cs(),{fetchReportsByDataMartId:t}=ns(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Bh(),[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 g2(e){return JSON.stringify(e,null,2)}class pJ{mapFromDto(t){if(t.type!==kr.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:kr.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class gJ{mapFromDto(t){if(t.type!==kr.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:kr.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class xJ{mapFromDto(t){if(t.type!==kr.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:kr.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const yJ={getMapper(e){switch(e){case kr.GOOGLE_SHEETS_CONFIG:return new gJ;case kr.LOOKER_STUDIO_CONFIG:return new xJ;case kr.EMAIL_CONFIG:return new pJ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function vJ(e){return yJ.getMapper(e.type).mapFromDto(e)}function rc(e){const t=vJ(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:Ou(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 IO=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)},Ox=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")??"",x=s.get("second")??"";return`${i}-${c}-${u} ${f}:${m}:${x}`},Ru=e=>Ox(MO(e).toISOString()),MO=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},bJ=(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 kO(e){return JSON.parse(JSON.stringify(e))}function SJ(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 LO=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 CJ(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function EJ(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}const wJ=e=>e?e.split(",").map(t=>t.trim()).filter(Boolean):[];function ns(){const{state:e,dispatch:t}=WQ(),n=h.useCallback(async()=>{t({type:it.FETCH_DESTINATIONS_START});try{const E=await nc.getDataDestinations();t({type:it.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch destinations";t({type:it.FETCH_DESTINATIONS_ERROR,payload:R}),De({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=h.useCallback(async()=>{t({type:it.FETCH_REPORTS_START});try{const R=(await ei.getReportsByProject()).map(rc);t({type:it.FETCH_REPORTS_SUCCESS,payload:R})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch reports";t({type:it.FETCH_REPORTS_ERROR,payload:R}),De({event:"report_error",category:"Report",action:"ListError",error:R})}},[t]),s=h.useCallback(async(E,R)=>{R!=null&&R.silent||t({type:it.FETCH_REPORTS_START});try{const _=(await ei.getReportsByDataMartId(E,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(rc);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:_}),De({event:"report_error",category:"Report",action:"ListError",error:_})}},[t]),i=h.useCallback(async E=>{t({type:it.FETCH_REPORT_START});try{const R=await ei.getReportById(E),j=rc(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}),De({event:"report_error",category:"Report",action:"GetError",error:j})}},[t]),c=h.useCallback(async E=>{t({type:it.CREATE_REPORT_START});try{const R=await ei.createReport(E),j=rc(R);return t({type:it.CREATE_REPORT_SUCCESS,payload:j}),De({event:"report_created",category:"Report",action:"Create",label:j.dataDestination.type,details:j.title,context:j.dataMart.id}),kt.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}),De({event:"report_error",category:"Report",action:"CreateError",label:E.destinationConfig.type,error:j}),null}},[t]),u=h.useCallback(async(E,R)=>{t({type:it.UPDATE_REPORT_START});try{const j=await ei.updateReport(E,R),_=rc(j);return t({type:it.UPDATE_REPORT_SUCCESS,payload:_}),De({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type,value:_.title,context:_.dataMart.id,details:_.id}),kt.success("Report updated"),_}catch(j){const _=j instanceof Error?j.message:"Failed to update report";return t({type:it.UPDATE_REPORT_ERROR,payload:_}),De({event:"report_error",category:"Report",action:"UpdateError",error:_}),null}},[t]),f=h.useCallback(async E=>{t({type:it.DELETE_REPORT_START});try{await ei.deleteReport(E),t({type:it.DELETE_REPORT_SUCCESS,payload:E}),De({event:"report_deleted",category:"Report",action:"Delete",label:E}),kt.success("Report deleted")}catch(R){const j=R instanceof Error?R.message:"Failed to delete report";t({type:it.DELETE_REPORT_ERROR,payload:j}),De({event:"report_error",category:"Report",action:"DeleteError",label:E,error:j})}},[t]),m=h.useCallback(()=>{t({type:it.CLEAR_CURRENT_REPORT})},[t]),x=h.useCallback(()=>{t({type:it.CLEAR_ERROR})},[t]),g=h.useCallback(E=>{jp.stopPolling(E),t({type:it.STOP_POLLING_REPORT,payload:E})},[t]),y=h.useCallback(E=>{e.polledReportIds.includes(E)&&g(E),t({type:it.START_POLLING_REPORT,payload:E}),jp.startPolling(E,R=>{const j=rc(R);t({type:it.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,g]),v=h.useCallback(()=>{jp.stopAllPolling(),t({type:it.STOP_ALL_POLLING})},[t]),S=h.useCallback(E=>{jp.setConfig(E)},[]),b=h.useCallback(async E=>{try{g(E),await ei.runReport(E),await i(E),y(E),De({event:"report_run_started",category:"Report",action:"Run",label:E}),kt.success("Report run started")}catch(R){const j=R instanceof Error?R.message:"Failed to run report";De({event:"report_error",category:"Report",action:"RunError",error:j}),console.error("Failed to run report:",R)}},[i,y,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:b,startPollingReport:y,stopPollingReport:g,stopAllPolling:v,setPollingConfig:S,clearCurrentReport:m,clearError:x}}Mn.SUCCESS+"",Mn.SUCCESS,Mn.RUNNING+"",Mn.RUNNING,Mn.ERROR+"",Mn.ERROR,Mn.CANCELLED+"",Mn.CANCELLED;var u1,Ix="HoverCard",[PO]=Er(Ix,[No]),Mx=No(),[RJ,kx]=PO(Ix),UO=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:i,openDelay:c=700,closeDelay:u=300}=e,f=Mx(t),m=h.useRef(0),x=h.useRef(0),g=h.useRef(!1),y=h.useRef(!1),[v,S]=ca({prop:r,defaultProp:s??!1,onChange:i,caller:Ix}),b=h.useCallback(()=>{clearTimeout(x.current),m.current=window.setTimeout(()=>S(!0),c)},[c,S]),E=h.useCallback(()=>{clearTimeout(m.current),!g.current&&!y.current&&(x.current=window.setTimeout(()=>S(!1),u))},[u,S]),R=h.useCallback(()=>S(!1),[S]);return h.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(x.current)},[]),a.jsx(RJ,{scope:t,open:v,onOpenChange:S,onOpen:b,onClose:E,onDismiss:R,hasSelectionRef:g,isPointerDownOnContentRef:y,children:a.jsx(gd,{...f,children:n})})};UO.displayName=Ix;var zO="HoverCardTrigger",FO=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=kx(zO,n),i=Mx(n);return a.jsx(xd,{asChild:!0,...i,children:a.jsx(et.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Me(e.onPointerEnter,Dg(s.onOpen)),onPointerLeave:Me(e.onPointerLeave,Dg(s.onClose)),onFocus:Me(e.onFocus,s.onOpen),onBlur:Me(e.onBlur,s.onClose),onTouchStart:Me(e.onTouchStart,c=>c.preventDefault())})})});FO.displayName=zO;var x2="HoverCardPortal",[jJ,TJ]=PO(x2,{forceMount:void 0}),HO=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,i=kx(x2,t);return a.jsx(jJ,{scope:t,forceMount:n,children:a.jsx(qr,{present:n||i.open,children:a.jsx(Oc,{asChild:!0,container:s,children:r})})})};HO.displayName=x2;var Ag="HoverCardContent",VO=h.forwardRef((e,t)=>{const n=TJ(Ag,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,i=kx(Ag,e.__scopeHoverCard);return a.jsx(qr,{present:r||i.open,children:a.jsx(_J,{"data-state":i.open?"open":"closed",...s,onPointerEnter:Me(e.onPointerEnter,Dg(i.onOpen)),onPointerLeave:Me(e.onPointerLeave,Dg(i.onClose)),ref:t})})});VO.displayName=Ag;var _J=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:c,...u}=e,f=kx(Ag,n),m=Mx(n),x=h.useRef(null),g=vt(t,x),[y,v]=h.useState(!1);return h.useEffect(()=>{if(y){const S=document.body;return u1=S.style.userSelect||S.style.webkitUserSelect,S.style.userSelect="none",S.style.webkitUserSelect="none",()=>{S.style.userSelect=u1,S.style.webkitUserSelect=u1}}},[y]),h.useEffect(()=>{if(x.current){const S=()=>{v(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var E;((E=document.getSelection())==null?void 0:E.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",S),()=>{document.removeEventListener("pointerup",S),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),h.useEffect(()=>{x.current&&DJ(x.current).forEach(b=>b.setAttribute("tabindex","-1"))}),a.jsx(Dc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Me(i,S=>{S.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(Th,{...m,...u,onPointerDown:Me(u.onPointerDown,S=>{S.currentTarget.contains(S.target)&&v(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:g,style:{...u.style,userSelect:y?"text":void 0,WebkitUserSelect:y?"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)"}})})}),NJ="HoverCardArrow",AJ=h.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Mx(n);return a.jsx(_h,{...s,...r,ref:t})});AJ.displayName=NJ;function Dg(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 OJ=UO,IJ=FO,MJ=HO,kJ=VO;const Lx=({...e})=>a.jsx(OJ,{"data-slot":"hover-card",...e});Lx.displayName="HoverCard";const Px=h.forwardRef(({...e},t)=>a.jsx(IJ,{"data-slot":"hover-card-trigger",ref:t,...e}));Px.displayName="HoverCardTrigger";const Ux=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(kJ,{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})})});Ux.displayName="HoverCardContent";const y2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("border-border flex gap-4 border-b pb-4",e),...t}));y2.displayName="HoverCardHeader";const v2=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}));v2.displayName="HoverCardHeaderIcon";const b2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col space-y-1",e),...t}));b2.displayName="HoverCardHeaderText";const S2=h.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:se("text-md pt-1 leading-snug font-semibold",e),...t}));S2.displayName="HoverCardHeaderTitle";const C2=h.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));C2.displayName="HoverCardHeaderDescription";const E2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("flex flex-col",e),...t}));E2.displayName="HoverCardBody";const al=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}));al.displayName="HoverCardItem";const sl=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-muted-foreground text-sm",e),...t}));sl.displayName="HoverCardItemLabel";const ol=h.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:se("text-sm",e),...t}));ol.displayName="HoverCardItemValue";const w2=h.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:se("pt-4 pb-2",e),...t}));w2.displayName="HoverCardFooter";function zx(e){return e.type===kr.GOOGLE_SHEETS_CONFIG}function $O(e){return e.type===kr.LOOKER_STUDIO_CONFIG}function d1(e){return e.type===kr.EMAIL_CONFIG}function Gs({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)),x=Math.floor(m/7),g=Math.floor(m/30),y=Math.floor(m/365),v=b=>b.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),S=b=>b.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 b=v(e);return c?`Yesterday at ${b}`:`Tomorrow at ${b}`}if(m<7){const b=S(e),E=v(e);return c?`Last ${b} at ${E}`:`This ${b} at ${E}`}if(m<14){const b=S(e),E=v(e);return c?`Last ${b} at ${E}`:`Next ${b} at ${E}`}return x<4?c?x===2?"2 weeks ago":"3 weeks ago":x===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?y===1?"1 year ago":`${y} years ago`:y===1?"In 1 year":`In ${y} years`},[e]);return a.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const LJ=()=>{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}},PJ=ae.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=LJ(),i=h.useMemo(()=>t.lastRunStatus?{statusType:FJ(t.lastRunStatus),statusText:VJ(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(()=>oa.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=h.useMemo(()=>zx(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 x=h2(f.spreadsheetId,f.sheetId);window.open(x,"_blank","noopener,noreferrer")},[f]);return a.jsxs(Lx,{children:[a.jsx(Px,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Ux,{children:[a.jsxs(y2,{children:[a.jsx(v2,{children:a.jsx(u,{size:20})}),a.jsxs(b2,{children:[a.jsx(S2,{children:t.title||"Unnamed Report"}),a.jsxs(C2,{children:["Last modified ",a.jsx(Gs,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(E2,{children:[a.jsxs(al,{children:[a.jsx(sl,{children:"Last run status:"}),a.jsx(ol,{children:i?a.jsx(Vh,{type:i.statusType,variant:"ghost",children:i.statusText}):"Not run yet"})]}),a.jsxs(al,{children:[a.jsx(sl,{children:"Last run date:"}),a.jsx(ol,{children:t.lastRunDate?a.jsx(Gs,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(al,{children:[a.jsx(sl,{children:"Error message:"}),a.jsx(ol,{children:t.lastRunError})]}),a.jsxs(al,{children:[a.jsx(sl,{children:"Total runs:"}),a.jsxs(ol,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(w2,{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(ci,{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 Ja=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Ja||{});const UJ=e=>{switch(e){case Ir.DRAFT:return Jn.NEUTRAL;case Ir.PUBLISHED:return Jn.SUCCESS;default:return Jn.NEUTRAL}},zJ=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}},FJ=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}},HJ=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"}},VJ=e=>{switch(e){case Mn.SUCCESS:return"Success";case Mn.RUNNING:return"Running";case Mn.ERROR:return"Failed";default:return"Unknown"}},$J=e=>e?[qn.SUCCESS,qn.FAILED,qn.CANCELLED,qn.INTERRUPTED].includes(e):!0,BJ=e=>e?[Ja.SUCCESS,Ja.ERROR,Ja.CANCELLED].includes(e):!0,BO=e=>en({fullyQualifiedName:gt().min(1,"Fully qualified name is required").refine(t=>OQ(t,e),t=>({message:MQ(t,e)}))}),GJ=e=>en({pattern:gt().min(1,"Table pattern is required").refine(t=>IQ(t,e),t=>({message:kQ(t,e)}))}),qJ=e=>{const t=[];return e.status.code===Ir.PUBLISHED&&t.push(Xp.ALREADY_PUBLISHED),bO(e.storage)||t.push(Xp.INVALID_STORAGE),e.definition||t.push(Xp.MISSING_DEFINITION),t},KJ=e=>e.map(t=>WX[t]);function WJ(e){return e.map(t=>({id:t.id,title:t.title,status:fO.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 GO(){const{state:e,dispatch:t}=qX(),n=h.useCallback(async()=>{t({type:"SET_LOADING"});try{const i=await Tn.getDataMarts(),c=WJ(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),De({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}),De({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}}/**
782
+ * table-core
783
+ *
784
+ * Copyright (c) TanStack
785
+ *
786
+ * This source code is licensed under the MIT license found in the
787
+ * LICENSE.md file in the root directory of this source tree.
788
+ *
789
+ * @license MIT
790
+ */function il(e,t){return typeof e=="function"?e(t):e}function es(e,t){return n=>{t.setState(r=>({...r,[e]:il(n,r[e])}))}}function Fx(e){return e instanceof Function}function YJ(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ZJ(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((x,g)=>r[g]!==x)))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 x=Math.round((Date.now()-c)*100)/100,g=Math.round((Date.now()-m)*100)/100,y=g/16,v=(S,b)=>{for(S=String(S);S.length<b;)S=" "+S;return S};console.info(`%c⏱ ${v(g,5)} /${v(x,5)} ms`,`
791
+ font-size: .6rem;
792
+ font-weight: bold;
793
+ color: hsl(${Math.max(0,Math.min(120-120*y,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 XJ(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 QJ(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,x;if(u.accessorFn?x=u.accessorFn:f&&(f.includes(".")?x=y=>{let v=y;for(const b of f.split(".")){var S;v=(S=v)==null?void 0:S[b]}return v}:x=y=>y[u.accessorKey]),!m)throw new Error;let g={id:`${String(m)}`,accessorFn:x,parent:r,depth:n,columnDef:u,columns:[],getFlatColumns:lt(()=>[!0],()=>{var y;return[g,...(y=g.columns)==null?void 0:y.flatMap(v=>v.getFlatColumns())]},ct(e.options,"debugColumns")),getLeafColumns:lt(()=>[e._getOrderColumnsFn()],y=>{var v;if((v=g.columns)!=null&&v.length){let S=g.columns.flatMap(b=>b.getLeafColumns());return y(S)}return[g]},ct(e.options,"debugColumns"))};for(const y of e._features)y.createColumn==null||y.createColumn(g,e);return g}const Wr="debugHeaders";function A_(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 JJ={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(y=>y.id===g)).filter(Boolean))!=null?i:[],f=(c=s==null?void 0:s.map(g=>n.find(y=>y.id===g)).filter(Boolean))!=null?c:[],m=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(s!=null&&s.includes(g.id)));return _p(t,[...u,...m,...f],e)},ct(e.options,Wr)),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))),_p(t,n,e,"center")),ct(e.options,Wr)),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 _p(t,i,e,"left")},ct(e.options,Wr)),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 _p(t,i,e,"right")},ct(e.options,Wr)),e.getFooterGroups=lt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ct(e.options,Wr)),e.getLeftFooterGroups=lt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ct(e.options,Wr)),e.getCenterFooterGroups=lt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ct(e.options,Wr)),e.getRightFooterGroups=lt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ct(e.options,Wr)),e.getFlatHeaders=lt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,Wr)),e.getLeftFlatHeaders=lt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,Wr)),e.getCenterFlatHeaders=lt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,Wr)),e.getRightFlatHeaders=lt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ct(e.options,Wr)),e.getCenterLeafHeaders=lt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,Wr)),e.getLeftLeafHeaders=lt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,Wr)),e.getRightLeafHeaders=lt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ct(e.options,Wr)),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(x=>x.getLeafHeaders()).flat()},ct(e.options,Wr))}};function _p(e,t,n,r){var s,i;let c=0;const u=function(y,v){v===void 0&&(v=1),c=Math.max(c,v),y.filter(S=>S.getIsVisible()).forEach(S=>{var b;(b=S.columns)!=null&&b.length&&u(S.columns,v+1)},0)};u(e);let f=[];const m=(y,v)=>{const S={depth:v,id:[r,`${v}`].filter(Boolean).join("_"),headers:[]},b=[];y.forEach(E=>{const R=[...b].reverse()[0],j=E.column.depth===S.depth;let _,D=!1;if(j&&E.column.parent?_=E.column.parent:(_=E.column,D=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(E);else{const O=A_(n,_,{id:[r,v,_.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${b.filter(A=>A.column===_).length}`:void 0,depth:v,index:b.length});O.subHeaders.push(E),b.push(O)}S.headers.push(E),E.headerGroup=S}),f.push(S),v>0&&m(b,v-1)},x=t.map((y,v)=>A_(n,y,{depth:c,index:v}));m(x,c-1),f.reverse();const g=y=>y.filter(S=>S.column.getIsVisible()).map(S=>{let b=0,E=0,R=[0];S.subHeaders&&S.subHeaders.length?(R=[],g(S.subHeaders).forEach(_=>{let{colSpan:D,rowSpan:O}=_;b+=D,R.push(O)})):b=1;const j=Math.min(...R);return E=E+j,S.colSpan=b,S.rowSpan=E,{colSpan:b,rowSpan:E}});return g((s=(i=f[0])==null?void 0:i.headers)!=null?s:[]),f}const R2=(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:()=>ZJ(u.subRows,f=>f.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let f=[],m=u;for(;;){const x=m.getParentRow();if(!x)break;f.push(x),m=x}return f.reverse()},getAllCells:lt(()=>[e.getAllLeafColumns()],f=>f.map(m=>XJ(e,u,m,m.id)),ct(e.options,"debugRows")),_getAllCellsByColumnId:lt(()=>[u.getAllCells()],f=>f.reduce((m,x)=>(m[x.column.id]=x,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},eee={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()}}},qO=(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))};qO.autoRemove=e=>Fs(e);const KO=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};KO.autoRemove=e=>Fs(e);const WO=(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())};WO.autoRemove=e=>Fs(e);const YO=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};YO.autoRemove=e=>Fs(e);const ZO=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});ZO.autoRemove=e=>Fs(e)||!(e!=null&&e.length);const XO=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});XO.autoRemove=e=>Fs(e)||!(e!=null&&e.length);const QO=(e,t,n)=>e.getValue(t)===n;QO.autoRemove=e=>Fs(e);const JO=(e,t,n)=>e.getValue(t)==n;JO.autoRemove=e=>Fs(e);const j2=(e,t,n)=>{let[r,s]=n;const i=e.getValue(t);return i>=r&&i<=s};j2.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]};j2.autoRemove=e=>Fs(e)||Fs(e[0])&&Fs(e[1]);const ti={includesString:qO,includesStringSensitive:KO,equalsString:WO,arrIncludes:YO,arrIncludesAll:ZO,arrIncludesSome:XO,equals:QO,weakEquals:JO,inNumberRange:j2};function Fs(e){return e==null||e===""}const tee={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:es("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"?ti.includesString:typeof r=="number"?ti.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ti.equals:Array.isArray(r)?ti.arrIncludes:ti.weakEquals},e.getFilterFn=()=>{var n,r;return Fx(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:ti[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(x=>x.id===e.id),c=il(n,i?i.value:void 0);if(D_(s,c,e)){var u;return(u=r==null?void 0:r.filter(x=>x.id!==e.id))!=null?u:[]}const f={id:e.id,value:c};if(i){var m;return(m=r==null?void 0:r.map(x=>x.id===e.id?f:x))!=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=il(t,s))==null?void 0:i.filter(c=>{const u=n.find(f=>f.id===c.id);if(u){const f=u.getFilterFn();if(D_(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 D_(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const nee=(e,t,n)=>n.reduce((r,s)=>{const i=s.getValue(e);return r+(typeof i=="number"?i:0)},0),ree=(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},aee=(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},see=(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]},oee=(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},iee=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!YJ(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},lee=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),cee=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,uee=(e,t)=>t.length,f1={sum:nee,min:ree,max:aee,extent:see,mean:oee,median:iee,unique:lee,uniqueCount:cee,count:uee},dee={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:es("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 f1.sum;if(Object.prototype.toString.call(r)==="[object Date]")return f1.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Fx(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:f1[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 fee(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 hee={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:es("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=lt(n=>[Vf(t,n)],n=>n.findIndex(r=>r.id===e.id),ct(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Vf(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Vf(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(x=>x.id===f);m>-1&&i.push(u.splice(m,1)[0])}i=[...i,...u]}return fee(i,n,r)},ct(e.options,"debugTable"))}},h1=()=>({left:[],right:[]}),mee={getInitialState:e=>({columnPinning:h1(),...e}),getDefaultOptions:e=>({onColumnPinningChange:es("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,x;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((x=s==null?void 0:s.right)!=null?x:[]).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?h1():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:h1())},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 pee(e){return e||(typeof document<"u"?document:null)}const Np={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},m1=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),gee={getDefaultColumnDef:()=>Np,getInitialState:e=>({columnSizing:{},columnSizingInfo:m1(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:es("columnSizing",e),onColumnSizingInfoChange:es("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:Np.minSize,(r=i??e.columnDef.size)!=null?r:Np.size),(s=e.columnDef.maxSize)!=null?s:Np.maxSize)},e.getStart=lt(n=>[n,Vf(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,Vf(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(),p1(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=p1(i)?Math.round(i.touches[0].clientX):i.clientX,m={},x=(R,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(_=>{var D,O;const A=t.options.columnResizeDirection==="rtl"?-1:1,T=(j-((D=_==null?void 0:_.startOffset)!=null?D:0))*A,M=Math.max(T/((O=_==null?void 0:_.startSize)!=null?O:0),-.999999);return _.columnSizingStart.forEach(k=>{let[z,L]=k;m[z]=Math.round(Math.max(L+L*M,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...m})))},g=R=>x("move",R),y=R=>{x("end",R),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=pee(n),S={moveHandler:R=>g(R.clientX),upHandler:R=>{v==null||v.removeEventListener("mousemove",S.moveHandler),v==null||v.removeEventListener("mouseup",S.upHandler),y(R.clientX)}},b={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),g(R.touches[0].clientX),!1),upHandler:R=>{var j;v==null||v.removeEventListener("touchmove",b.moveHandler),v==null||v.removeEventListener("touchend",b.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),y((j=R.touches[0])==null?void 0:j.clientX)}},E=xee()?{passive:!1}:!1;p1(i)?(v==null||v.addEventListener("touchmove",b.moveHandler,E),v==null||v.addEventListener("touchend",b.upHandler,E)):(v==null||v.addEventListener("mousemove",S.moveHandler,E),v==null||v.addEventListener("mouseup",S.upHandler,E)),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?m1():(n=e.initialState.columnSizingInfo)!=null?n:m1())},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 Ap=null;function xee(){if(typeof Ap=="boolean")return Ap;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 Ap=e,Ap}function p1(e){return e.type==="touchstart"}const yee={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:es("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 Vf(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const vee={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()}}},bee={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:es("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=()=>ti.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Fx(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ti[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},See={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:es("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()}}}},_b=0,Nb=10,g1=()=>({pageIndex:_b,pageSize:Nb}),Cee={getInitialState:e=>({...e,pagination:{...g1(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:es("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=>il(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?g1():(s=e.initialState.pagination)!=null?s:g1())},e.setPageIndex=r=>{e.setPagination(s=>{let i=il(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?_b:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?s:_b)},e.resetPageSize=r=>{var s,i;e.setPageSize(r?Nb:(s=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?s:Nb)},e.setPageSize=r=>{e.setPagination(s=>{const i=Math.max(1,il(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=il(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}}},x1=()=>({top:[],bottom:[]}),Eee={getInitialState:e=>({rowPinning:x1(),...e}),getDefaultOptions:e=>({onRowPinningChange:es("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,x;if(n==="bottom"){var g,y;return{top:((g=f==null?void 0:f.top)!=null?g:[]).filter(b=>!(u!=null&&u.has(b))),bottom:[...((y=f==null?void 0:f.bottom)!=null?y:[]).filter(b=>!(u!=null&&u.has(b))),...Array.from(u)]}}if(n==="top"){var v,S;return{top:[...((v=f==null?void 0:f.top)!=null?v:[]).filter(b=>!(u!=null&&u.has(b))),...Array.from(u)],bottom:((S=f==null?void 0:f.bottom)!=null?S:[]).filter(b=>!(u!=null&&u.has(b)))}}return{top:((m=f==null?void 0:f.top)!=null?m:[]).filter(b=>!(u!=null&&u.has(b))),bottom:((x=f==null?void 0:f.bottom)!=null?x:[]).filter(b=>!(u!=null&&u.has(b)))}})},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?x1():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:x1())},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"))}},wee={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:es("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=>{Ab(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?y1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getFilteredSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?y1(e,n):{rows:[],flatRows:[],rowsById:{}},ct(e.options,"debugTable")),e.getGroupedSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?y1(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 Ab(u,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),u})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return T2(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)}}}},Ab=(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=>Ab(e,u.id,n,r,s))};function y1(e,t){const n=e.getState().rowSelection,r=[],s={},i=function(c,u){return c.map(f=>{var m;const x=T2(f,n);if(x&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:i(f.subRows)}),x)return f}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:s}}function T2(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()&&(T2(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 Ob=/([0-9]+)/gm,Ree=(e,t,n)=>e5(xl(e.getValue(n)).toLowerCase(),xl(t.getValue(n)).toLowerCase()),jee=(e,t,n)=>e5(xl(e.getValue(n)),xl(t.getValue(n))),Tee=(e,t,n)=>_2(xl(e.getValue(n)).toLowerCase(),xl(t.getValue(n)).toLowerCase()),_ee=(e,t,n)=>_2(xl(e.getValue(n)),xl(t.getValue(n))),Nee=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},Aee=(e,t,n)=>_2(e.getValue(n),t.getValue(n));function _2(e,t){return e===t?0:e>t?1:-1}function xl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function e5(e,t){const n=e.split(Ob).filter(Boolean),r=t.split(Ob).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 jf={alphanumeric:Ree,alphanumericCaseSensitive:jee,text:Tee,textCaseSensitive:_ee,datetime:Nee,basic:Aee},Dee={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:es("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 jf.datetime;if(typeof i=="string"&&(r=!0,i.split(Ob).length>1))return jf.alphanumeric}return r?jf.text:jf.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 Fx(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:jf[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=[],x,g=i?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?u?x="toggle":x="add":c!=null&&c.length&&f!==c.length-1?x="replace":u?x="toggle":x="replace",x==="toggle"&&(i||s||(x="remove")),x==="add"){var y;m=[...c,{id:e.id,desc:g}],m.splice(0,m.length-((y=t.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else x==="toggle"?m=c.map(v=>v.id===e.id?{...v,desc:g}:v):x==="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())}},Oee=[JJ,yee,hee,mee,eee,tee,vee,bee,Dee,dee,See,Cee,Eee,wee,gee];function Iee(e){var t,n;const r=[...Oee,...(t=e._features)!=null?t:[]];let s={_features:r};const i=s._features.reduce((y,v)=>Object.assign(y,v.getDefaultOptions==null?void 0:v.getDefaultOptions(s)),{}),c=y=>s.options.mergeOptions?s.options.mergeOptions(i,y):{...i,...y};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(y=>{var v;f=(v=y.getInitialState==null?void 0:y.getInitialState(f))!=null?v:f});const m=[];let x=!1;const g={_features:r,options:{...i,...e},initialState:f,_queue:y=>{m.push(y),x||(x=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();x=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{s.setState(s.initialState)},setOptions:y=>{const v=il(y,s.options);s.options=c(v)},getState:()=>s.options.state,setState:y=>{s.options.onStateChange==null||s.options.onStateChange(y)},_getRowId:(y,v,S)=>{var b;return(b=s.options.getRowId==null?void 0:s.options.getRowId(y,v,S))!=null?b:`${S?[S.id,v].join("."):v}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(y,v)=>{let S=(v?s.getPrePaginationRowModel():s.getRowModel()).rowsById[y];if(!S&&(S=s.getCoreRowModel().rowsById[y],!S))throw new Error;return S},_getDefaultColumnDef:lt(()=>[s.options.defaultColumn],y=>{var v;return y=(v=y)!=null?v:{},{header:S=>{const b=S.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:S=>{var b,E;return(b=(E=S.renderValue())==null||E.toString==null?void 0:E.toString())!=null?b:null},...s._features.reduce((S,b)=>Object.assign(S,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...y}},ct(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:lt(()=>[s._getColumnDefs()],y=>{const v=function(S,b,E){return E===void 0&&(E=0),S.map(R=>{const j=QJ(s,R,E,b),_=R;return j.columns=_.columns?v(_.columns,j,E+1):[],j})};return v(y)},ct(e,"debugColumns")),getAllFlatColumns:lt(()=>[s.getAllColumns()],y=>y.flatMap(v=>v.getFlatColumns()),ct(e,"debugColumns")),_getAllFlatColumnsById:lt(()=>[s.getAllFlatColumns()],y=>y.reduce((v,S)=>(v[S.id]=S,v),{}),ct(e,"debugColumns")),getAllLeafColumns:lt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(y,v)=>{let S=y.flatMap(b=>b.getLeafColumns());return v(S)},ct(e,"debugColumns")),getColumn:y=>s._getAllFlatColumnsById()[y]};Object.assign(s,g);for(let y=0;y<s._features.length;y++){const v=s._features[y];v==null||v.createTable==null||v.createTable(s)}return s}function Rl(){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 x=R2(e,e._getRowId(s[m],m,c),s[m],m,i,void 0,c==null?void 0:c.id);if(n.flatRows.push(x),n.rowsById[x.id]=x,u.push(x),e.options.getSubRows){var f;x.originalSubRows=e.options.getSubRows(s[m],m),(f=x.originalSubRows)!=null&&f.length&&(x.subRows=r(x.originalSubRows,i+1,x))}}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 kee(e,t,n){return n.options.filterFromLeafRows?Lee(e,t,n):Pee(e,t,n)}function Lee(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 x=[];for(let y=0;y<f.length;y++){var g;let v=f[y];const S=R2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(S.columnFilters=v.columnFilters,(g=v.subRows)!=null&&g.length&&m<c){if(S.subRows=u(v.subRows,m+1),v=S,t(v)&&!S.subRows.length){x.push(v),i[v.id]=v,s.push(v);continue}if(t(v)||S.subRows.length){x.push(v),i[v.id]=v,s.push(v);continue}}else v=S,t(v)&&(x.push(v),i[v.id]=v,s.push(v))}return x};return{rows:u(e),flatRows:s,rowsById:i}}function Pee(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 x=[];for(let y=0;y<f.length;y++){let v=f[y];if(t(v)){var g;if((g=v.subRows)!=null&&g.length&&m<c){const b=R2(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);b.subRows=u(v.subRows,m+1),v=b}x.push(v),s.push(v),i[v.id]=v}}return x};return{rows:u(e),flatRows:s,rowsById:i}}function Sd(){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 y=0;y<t.flatRows.length;y++)t.flatRows[y].columnFilters={},t.flatRows[y].columnFiltersMeta={};return t}const s=[],i=[];(n??[]).forEach(y=>{var v;const S=e.getColumn(y.id);if(!S)return;const b=S.getFilterFn();b&&s.push({id:y.id,filterFn:b,resolvedValue:(v=b.resolveFilterValue==null?void 0:b.resolveFilterValue(y.value))!=null?v:y.value})});const c=(n??[]).map(y=>y.id),u=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());r&&u&&f.length&&(c.push("__global__"),f.forEach(y=>{var v;i.push({id:y.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(r))!=null?v:r})}));let m,x;for(let y=0;y<t.flatRows.length;y++){const v=t.flatRows[y];if(v.columnFilters={},s.length)for(let S=0;S<s.length;S++){m=s[S];const b=m.id;v.columnFilters[b]=m.filterFn(v,b,m.resolvedValue,E=>{v.columnFiltersMeta[b]=E})}if(i.length){for(let S=0;S<i.length;S++){x=i[S];const b=x.id;if(x.filterFn(v,b,x.resolvedValue,E=>{v.columnFiltersMeta[b]=E})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const g=y=>{for(let v=0;v<c.length;v++)if(y.columnFilters[c[v]]===!1)return!1;return!0};return kee(t.rows,g,e)},ct(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Gh(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,x=m+s;c=c.slice(m,x);let g;t.options.paginateExpandedRows?g={rows:c,flatRows:u,rowsById:f}:g=Mee({rows:c,flatRows:u,rowsById:f}),g.flatRows=[];const y=v=>{g.flatRows.push(v),v.subRows.length&&v.subRows.forEach(y)};return g.rows.forEach(y),g},ct(t.options,"debugTable"))}function kc(){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(x=>({...x}));return m.sort((x,g)=>{for(let v=0;v<i.length;v+=1){var y;const S=i[v],b=c[S.id],E=b.sortUndefined,R=(y=S==null?void 0:S.desc)!=null?y:!1;let j=0;if(E){const _=x.getValue(S.id),D=g.getValue(S.id),O=_===void 0,A=D===void 0;if(O||A){if(E==="first")return O?-1:1;if(E==="last")return O?1:-1;j=O&&A?0:O?E:-E}}if(j===0&&(j=b.sortingFn(x,g,S.id)),j!==0)return R&&(j*=-1),b.invertSorting&&(j*=-1),j}return x.index-g.index}),m.forEach(x=>{var g;s.push(x),(g=x.subRows)!=null&&g.length&&(x.subRows=u(x.subRows))}),m};return{rows:u(n.rows),flatRows:s,rowsById:n.rowsById}},ct(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
794
+ * react-table
795
+ *
796
+ * Copyright (c) TanStack
797
+ *
798
+ * This source code is licensed under the MIT license found in the
799
+ * LICENSE.md file in the root directory of this source tree.
800
+ *
801
+ * @license MIT
802
+ */function id(e,t){return e?Uee(e)?h.createElement(e,t):e:null}function Uee(e){return zee(e)||typeof e=="function"||Fee(e)}function zee(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Fee(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function jl(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:Iee(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 Tl({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 _l({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:se("[&_tr]:border-b",e),...t})}function Nl({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 Al({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 Gr({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 Hee=Symbol("radix.slottable");function Vee(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Hee,t}var t5="AlertDialog",[$ee]=Er(t5,[v4]),bi=v4(),n5=e=>{const{__scopeAlertDialog:t,...n}=e,r=bi(t);return a.jsx(ax,{...r,...n,modal:!0})};n5.displayName=t5;var Bee="AlertDialogTrigger",Gee=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bi(n);return a.jsx(kV,{...s,...r,ref:t})});Gee.displayName=Bee;var qee="AlertDialogPortal",r5=e=>{const{__scopeAlertDialog:t,...n}=e,r=bi(t);return a.jsx(sx,{...r,...n})};r5.displayName=qee;var Kee="AlertDialogOverlay",a5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bi(n);return a.jsx(ox,{...s,...r,ref:t})});a5.displayName=Kee;var Ku="AlertDialogContent",[Wee,Yee]=$ee(Ku),Zee=Vee("AlertDialogContent"),s5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,i=bi(n),c=h.useRef(null),u=vt(t,c),f=h.useRef(null);return a.jsx(DV,{contentName:Ku,titleName:o5,docsSlug:"alert-dialog",children:a.jsx(Wee,{scope:n,cancelRef:f,children:a.jsxs(ix,{role:"alertdialog",...i,...s,ref:u,onOpenAutoFocus:Me(s.onOpenAutoFocus,m=>{var x;m.preventDefault(),(x=f.current)==null||x.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[a.jsx(Zee,{children:r}),a.jsx(Qee,{contentRef:c})]})})})});s5.displayName=Ku;var o5="AlertDialogTitle",i5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bi(n);return a.jsx(IS,{...s,...r,ref:t})});i5.displayName=o5;var l5="AlertDialogDescription",c5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bi(n);return a.jsx(MS,{...s,...r,ref:t})});c5.displayName=l5;var Xee="AlertDialogAction",u5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=bi(n);return a.jsx(lx,{...s,...r,ref:t})});u5.displayName=Xee;var d5="AlertDialogCancel",f5=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Yee(d5,n),i=bi(n),c=vt(t,s);return a.jsx(lx,{...i,...r,ref:c})});f5.displayName=d5;var Qee=({contentRef:e})=>{const t=`\`${Ku}\` requires a description for the component to be accessible for screen reader users.
803
+
804
+ You can add a description to the \`${Ku}\` by passing a \`${l5}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
805
+
806
+ 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 \`${Ku}\`. 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.
807
+
808
+ 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},Jee=n5,ete=r5,tte=a5,nte=s5,rte=u5,ate=f5,ste=i5,ote=c5;function h5({...e}){return a.jsx(Jee,{"data-slot":"alert-dialog",...e})}function ite({...e}){return a.jsx(ete,{"data-slot":"alert-dialog-portal",...e})}function lte({className:e,...t}){return a.jsx(tte,{"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 m5({className:e,...t}){return a.jsxs(ite,{children:[a.jsx(lte,{}),a.jsx(nte,{"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 p5({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 g5({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 x5({className:e,...t}){return a.jsx(ste,{"data-slot":"alert-dialog-title",className:se("text-lg font-semibold",e),...t})}function y5({className:e,...t}){return a.jsx(ote,{"data-slot":"alert-dialog-description",className:se("text-muted-foreground text-sm",e),...t})}function v5({className:e,...t}){return a.jsx(rte,{className:se(_S(),e),...t})}function b5({className:e,...t}){return a.jsx(ate,{className:se(_S({variant:"outline"}),e),...t})}const S5=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],C5={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:$e.CONNECTOR,icon:BW},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:$e.CONNECTOR,icon:GW},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:$e.CONNECTOR,icon:qW},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:$e.CONNECTOR,icon:KW},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:$e.CONNECTOR,icon:jS},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:$e.SQL,icon:RS},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:sg}},O_=S5.map(e=>({key:e,...C5[e]}));function cte(e){if(!e||!S5.includes(e))return;const t=e;return{key:t,...C5[t]}}function ute({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 dte({children:e,className:t="",...n}){return a.jsx("div",{className:se("pb-2",t),...n,children:e})}function fte({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 hte({children:e,className:t="",...n}){return a.jsx("p",{className:se("text-muted-foreground text-lg",t),...n,children:e})}function mte({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 pte({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 v1({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 I_({children:e,className:t="",...n}){return a.jsx("h3",{className:se("mb-4 text-xl font-medium",t),...n,children:e})}function b1({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-wrap items-center gap-4",t),...n,children:e})}function Dp({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(Xr,{to:e,target:c,children:m})}):a.jsx(we,{variant:r,size:s??f,className:i,...u,children:m})}function gte(){const{scope:e}=vi(),t=O_.filter(r=>r.definitionType===$e.CONNECTOR),n=O_.filter(r=>r.definitionType!==$e.CONNECTOR);return a.jsxs(ute,{children:[a.jsx(mte,{children:a.jsx($W,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(pte,{children:[a.jsxs(dte,{children:[a.jsx(fte,{children:"Let’s Build Your First Data Mart"}),a.jsx(hte,{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(v1,{children:[a.jsx(I_,{children:"Connect a data source"}),a.jsx(b1,{children:t.map(r=>a.jsx(Dp,{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(v1,{children:[a.jsx(I_,{children:"Use existing SQL or start from scratch"}),a.jsx(b1,{children:n.map((r,s)=>a.jsxs(a.Fragment,{children:[a.jsx(Dp,{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(v1,{separator:!1,children:a.jsxs(b1,{children:[a.jsx(Dp,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(BA,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(Dp,{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(LU,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function xte(){return a.jsx($r,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const ju={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},yte={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 Lc({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=ju.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=ju.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:i=ju.DEFAULT_EXCLUDED_COLUMNS}){const c=h.useMemo(()=>({SORTING:`${t}${ju.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${ju.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),u=h.useMemo(()=>yte.extractColumnIds(e),[e]),f=h.useMemo(()=>u.filter(b=>!s.includes(b)),[u,s]),m=h.useCallback(()=>{const b=xs.get(c.SORTING,"json");return b&&Array.isArray(b)&&b.length>0?b:[{id:f.includes(n)?n:f[0]??ju.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),x=h.useCallback(()=>{const b=xs.get(c.COLUMN_VISIBILITY,"json");if(b&&typeof b=="object"&&!Array.isArray(b)){const E={};for(const R of u)i.includes(R)||(E[R]=b[R]);return E}return r},[c.COLUMN_VISIBILITY,u,i,r]),[g,y]=h.useState(m),[v,S]=h.useState(x);return h.useEffect(()=>{g.length>0&&f.includes(g[0].id)&&xs.set(c.SORTING,g)},[g,f,c.SORTING]),h.useEffect(()=>{const b={};for(const E of u){if(i.includes(E))continue;const R=v[E];typeof R=="boolean"&&(b[E]=R)}xs.set(c.COLUMN_VISIBILITY,b)},[v,u,i,c.COLUMN_VISIBILITY]),{sorting:g,setSorting:y,columnVisibility:v,setColumnVisibility:S}}function vte({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var M;const{navigate:i,scope:c}=vi(),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:x}=Lc({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1,createdByUser:!1}}),[g,y]=h.useState([]),[v,S]=h.useState({}),[b,E]=h.useState(!1),[R,j]=h.useState(!1),_="data-mart-empty-state-onboarding-video-shown",{open:D}=f2();h.useEffect(()=>{!s&&t.length===0&&(xs.get(_,"boolean")||(D("video-3-getting-started-with-data-marts"),xs.set(_,!0)))},[s,t.length,D]);const O=async()=>{try{j(!0);const z=T.getSelectedRowModel().rows.map(L=>L.original.id);for(const L of z)await n(L);_n.success(`Successfully deleted ${String(z.length)} data mart${z.length!==1?"s":""}`),S({}),await r()}catch(k){console.error("Error deleting data marts:",k),_n.error("Failed to delete some data marts. Please try again.")}finally{j(!1),E(!1)}},A=Object.keys(v).length>0,T=jl({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(la,{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(la,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Rl(),getPaginationRowModel:Gh(),onSortingChange:f,getSortedRowModel:kc(),onColumnFiltersChange:y,getFilteredRowModel:Sd(),onColumnVisibilityChange:x,onRowSelectionChange:S,state:{sorting:u,columnFilters:g,columnVisibility:m,rowSelection:v},enableRowSelection:!0});return s?a.jsx("div",{children:a.jsx(xte,{})}):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:[A&&a.jsx(we,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{E(!0)},disabled:R,children:a.jsx(ts,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Ac,{className:"dm-card-toolbar-search-icon"}),a.jsx(dt,{placeholder:"Search by title",value:(M=T.getColumn("title"))==null?void 0:M.getFilterValue(),onChange:k=>{var z;return(z=T.getColumn("title"))==null?void 0:z.setFilterValue(k.target.value)},className:"dm-card-toolbar-search-input"})]})]}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsx(Xr,{to:c("/data-marts/create"),children:a.jsxs(we,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(ga,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Tl,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(_l,{className:"dm-card-table-header",children:T.getHeaderGroups().map(k=>a.jsx(Hn,{className:"dm-card-table-header-row",children:k.headers.map(z=>a.jsx(Al,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:z.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:z.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(z.getSize())}%`},children:z.isPlaceholder?null:id(z.column.columnDef.header,z.getContext())},z.id))},k.id))}),a.jsx(Nl,{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:z=>{if(z.target instanceof HTMLElement&&(z.target.closest('[role="checkbox"]')||z.target.closest(".actions-cell")||z.target.closest('[role="menuitem"]')||z.target.closest('[data-state="open"]')))return;const L=k.original.id;i(`/data-marts/${L}/data-setup`)},children:k.getVisibleCells().map(z=>a.jsx(Gr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${z.column.id==="actions"?"actions-cell":""} ${z.column.id==="createdAt"?"whitespace-nowrap":""}`,style:z.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:z.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(z.column.getSize())}%`},children:id(z.column.columnDef.cell,z.getContext())},z.id))},k.id)):a.jsx(Hn,{children:a.jsx(Gr,{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(h5,{open:b,onOpenChange:E,children:a.jsxs(m5,{children:[a.jsxs(p5,{children:[a.jsx(x5,{children:"Are you sure?"}),a.jsxs(y5,{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(g5,{children:[a.jsx(b5,{disabled:R,children:"Cancel"}),a.jsx(v5,{onClick:()=>{O()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):a.jsx(gte,{})}function E5({userProjection:e}){const{fullName:t,email:n,avatar:r}=e,s=t??n??"Unknown User",i=JD(t,n);return a.jsxs(Lx,{children:[a.jsx(Px,{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(Rb,{avatar:r,initials:i,displayName:s,size:qu.SMALL}),a.jsx("span",{className:"text-muted-foreground inline text-sm leading-tight","aria-label":s,children:s})]})}),a.jsx(Ux,{side:"top",align:"start",className:"w-max p-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Rb,{avatar:r,initials:i,displayName:s,size:qu.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 N2({...e}){return a.jsx(ax,{"data-slot":"dialog",...e})}function bte({...e}){return a.jsx(sx,{"data-slot":"dialog-portal",...e})}function Ste({className:e,...t}){return a.jsx(ox,{"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 A2({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(bte,{"data-slot":"dialog-portal",children:[a.jsx(Ste,{}),a.jsxs(ix,{"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(lx,{"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(hc,{}),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 Cte({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 O2({className:e,...t}){return a.jsx(IS,{"data-slot":"dialog-title",className:se("text-lg leading-none font-semibold",e),...t})}function I2({className:e,...t}){return a.jsx(MS,{"data-slot":"dialog-description",className:se("text-muted-foreground text-sm",e),...t})}const Ete=_c("",{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 Wu({className:e,variant:t,...n}){return t==="brand"?a.jsx(we,{variant:"default",className:se(Ete({variant:t}),e),...n}):a.jsx(we,{variant:t,className:e,...n})}const Cr=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:i,onConfirm:c,onCancel:u,variant:f="destructive",children:m})=>{const x=()=>{t(!1),u==null||u()};return a.jsx(N2,{open:e,onOpenChange:t,children:a.jsxs(A2,{children:[a.jsxs(D2,{children:[a.jsx(O2,{children:n}),a.jsx(I2,{children:r})]}),m,a.jsxs(Cte,{children:[i&&a.jsx(Wu,{variant:"secondary",onClick:x,children:i}),a.jsx(Wu,{variant:f,onClick:c,children:s})]})]})})},wte=({row:e,onDeleteSuccess:t})=>{const{scope:n}=vi(),[r,s]=h.useState(!1),[i,c]=h.useState(!1),{deleteDataMart:u,refreshList:f}=GO(),m=async()=>{try{await u(e.original.id),s(!1),await f(),t==null||t()}catch(x){console.error("Failed to delete data mart:",x)}};return a.jsxs("div",{className:"text-right",children:[a.jsxs(wr,{open:i,onOpenChange:c,children:[a.jsx(Rr,{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(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(jr,{align:"end",children:[a.jsx(Tt,{children:a.jsxs(Xr,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[a.jsx(dd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]})}),a.jsx(ua,{}),a.jsxs(Tt,{onClick:()=>{s(!0)},children:[a.jsx(ts,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(Cr,{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"})]})},M_={types:{[$e.SQL]:{type:$e.SQL,displayName:"SQL",icon:RS},[$e.TABLE]:{type:$e.TABLE,displayName:"Table",icon:qA},[$e.VIEW]:{type:$e.VIEW,displayName:"View",icon:HU},[$e.TABLE_PATTERN]:{type:$e.TABLE_PATTERN,displayName:"Pattern",icon:kP},[$e.CONNECTOR]:{type:$e.CONNECTOR,displayName:"Connector",icon:jS}},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 Ki={[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 br({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(Ju,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Es,{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(Ju,{className:"text-muted-foreground h-4 w-4"})})]})]})}function Cd({table:e,getColumnLabel:t}){return a.jsx("div",{className:"text-right",children:a.jsxs(wr,{children:[a.jsx(Rr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(jr,{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(Tt,{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(la,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:r})]})},n.id)})})]})})}const Rte=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:zn.TITLE,size:40,header:({column:n})=>a.jsx(br,{column:n,children:Ki[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}=M_.getInfo(r);return s}},id:zn.DEFINITION_TYPE,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Ki[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(Mc,{base64:i.logoBase64,size:18}),(i==null?void 0:i.displayName)??"Unknown"]})}default:{const{displayName:s,icon:i}=M_.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(br,{column:n,children:Ki[zn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:i,icon:c}=wl.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(br,{column:n,children:Ki[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(br,{column:n,children:Ki[zn.CREATED_BY_USER]}),cell:({row:n})=>{const r=n.original.createdByUser;return r?a.jsx(E5,{userProjection:r}):a.jsx("div",{className:"text-muted-foreground",children:"—"})}},{accessorKey:zn.STATUS,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Ki[zn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(Vh,{type:UJ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:zn.TRIGGERS_COUNT,size:15,header:({column:n})=>a.jsx(br,{column:n,children:Ki[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(br,{column:n,children:Ki[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(Cd,{table:n}),cell:({row:n})=>a.jsx(wte,{row:n,onDeleteSuccess:e})}];var vr=(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))(vr||{});const jte={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function Tte(e,t){switch(t.type){case vr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case vr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case vr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case vr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case vr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case vr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case vr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case vr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case vr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const w5=h.createContext(void 0);function ld({children:e}){const[t,n]=h.useReducer(Tte,jte);return a.jsx(w5.Provider,{value:{state:t,dispatch:n},children:e})}function _te(){const e=h.useContext(w5);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var Ms=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(Ms||{});class $f extends El{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 R5(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 Pc(){const{state:e,dispatch:t}=_te(),n=h.useMemo(()=>R5(e.connectors),[e.connectors]),r=h.useCallback(async()=>{t({type:vr.FETCH_CONNECTORS_START});try{const u=await new $f().getAvailableConnectors();t({type:vr.FETCH_CONNECTORS_SUCCESS,payload:u})}catch(c){const u=c instanceof Error?c.message:"Unknown error";t({type:vr.FETCH_CONNECTORS_ERROR,payload:u}),De({event:"connector_error",category:"Connector",action:"ListError",label:u})}},[t]),s=h.useCallback(async c=>{t({type:vr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new $f().getConnectorSpecification(c);t({type:vr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:vr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),De({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),i=h.useCallback(async c=>{t({type:vr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new $f().getConnectorFields(c);t({type:vr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(u){const f=u instanceof Error?u.message:"Unknown error";t({type:vr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),De({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 Nte=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=GO(),{connectors:i,fetchAvailableConnectors:c}=Pc();return h.useEffect(()=>{c()},[c]),h.useEffect(()=>{t()},[t]),a.jsx(vte,{columns:Rte({connectors:i}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function k_(){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(GX,{children:a.jsx(ld,{children:a.jsx(Nte,{})})})})]})}const j5=h.createContext(void 0),Tf=e=>{const t=qJ(e);return{...e,canPublish:t.length===0,validationErrors:t}};var Na=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(Na||{}),lh=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(lh||{}),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||{}),k2=(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))(k2||{}),L2=(e=>(e.SMALLINT="SMALLINT",e.INTEGER="INTEGER",e.BIGINT="BIGINT",e.DECIMAL="DECIMAL",e.NUMERIC="NUMERIC",e.REAL="REAL",e.DOUBLE_PRECISION="DOUBLE PRECISION",e.VARCHAR="VARCHAR",e.CHAR="CHAR",e.TEXT="TEXT",e.BPCHAR="BPCHAR",e.BOOLEAN="BOOLEAN",e.BOOL="BOOL",e.DATE="DATE",e.TIMESTAMP="TIMESTAMP",e.TIMESTAMPTZ="TIMESTAMPTZ",e.TIME="TIME",e.TIMETZ="TIMETZ",e.BYTEA="BYTEA",e.SUPER="SUPER",e.GEOMETRY="GEOMETRY",e.GEOGRAPHY="GEOGRAPHY",e))(L2||{});const Ate=(e,t)=>e!==$e.CONNECTOR||t===null?!0:t.fields.some(r=>r.status===Na.CONNECTED),T5={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:Tf(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Tf({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Tf({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Tf({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Tf({...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 T5;default:return e}}function Rs(){const e=h.useContext(j5);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class Ote{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:xe.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 Ite{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:xe.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:zs.KEY_PAIR,username:r.username??"",privateKey:r.privateKey??"",privateKeyPassphrase:r.privateKeyPassphrase}:{authMethod:zs.PASSWORD,username:r.username??"",password:r.password??""}:void 0;return{id:t.id,title:t.title,type:xe.SNOWFLAKE,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:s??{authMethod:zs.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===zs.PASSWORD?{password:r.password}:{privateKey:r.privateKey,privateKeyPassphrase:r.privateKeyPassphrase}}}return n}}class kte{mapFromDto(t){const n=t.config,r=t.credentials;let s=sr.SERVERLESS;n!=null&&n.clusterIdentifier&&(s=sr.PROVISIONED);const i=(n==null?void 0:n.connectionType)??s;return{id:t.id,title:t.title,type:xe.AWS_REDSHIFT,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:r?{accessKeyId:r.accessKeyId??"",secretAccessKey:r.secretAccessKey??""}:{accessKeyId:"",secretAccessKey:""},config:n?i===sr.SERVERLESS?{connectionType:sr.SERVERLESS,region:n.region,database:n.database,workgroupName:n.workgroupName??""}:{connectionType:sr.PROVISIONED,region:n.region,database:n.database,clusterIdentifier:n.clusterIdentifier??""}:{connectionType:sr.SERVERLESS,region:"",database:"",workgroupName:""}}}mapToUpdateRequest(t){const n=t.config,r={config:{connectionType:n.connectionType,region:n.region,database:n.database,...n.connectionType===sr.SERVERLESS?{workgroupName:n.workgroupName}:{clusterIdentifier:n.clusterIdentifier}}};return t.credentials&&(r.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),r}}const _5={getMapper(e){switch(e){case xe.GOOGLE_BIGQUERY:return new Ote;case xe.AWS_ATHENA:return new Ite;case xe.SNOWFLAKE:return new Mte;case xe.AWS_REDSHIFT:return new kte;default:throw new Error(`Unknown storage type: ${e}`)}}};function Qp(e){return _5.getMapper(e.type).mapFromDto(e)}function Lte(e){const t=_5.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function Pte(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Ute(e){return{type:e}}let Op=null;async function zte(){if(Op)return Op;const e=await Fte();return Op=R5(e),Op}async function Fte(){return await new $f().getAvailableConnectors()}async function Hte(e){const t=await zte();return t.length===0?null:t.find(r=>r.name===e)??null}function Vte(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function $te(e){return{sqlQuery:e.sqlQuery}}function Bte(e){return{sqlQuery:e.sqlQuery}}function Gte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function qte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Kte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Wte(e){return{fullyQualifiedName:e.fullyQualifiedName}}function Yte(e){return{pattern:e.pattern}}function Zte(e){return{pattern:e.pattern}}function Xte(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 Qte(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 Jte(e,t){if(!e||!t)return null;switch(e){case $e.SQL:return Bte(t);case $e.TABLE:return qte(t);case $e.VIEW:return Wte(t);case $e.TABLE_PATTERN:return Zte(t);case $e.CONNECTOR:{const n=Qte(t);return n.connector.info=await Hte(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function Tu(e){const t={id:e.id,title:e.title,description:e.description,status:fO.getInfo(e.status),storage:Qp(e.storage),definitionType:e.definitionType,definition:await Jte(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=Ate(t.definitionType,t.schema),t}function ene(e){return{id:e.id,title:e.title}}const tne=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}),L_=e=>e.runs.map(tne);function N5({children:e}){const[t,n]=h.useReducer(Dte,T5),r=h.useCallback(async A=>{try{n({type:"FETCH_DATA_MART_START"});const T=await Tn.getDataMartById(A),M=await Tu(T);n({type:"FETCH_DATA_MART_SUCCESS",payload:M}),i2({context:M.id,value:M.title})}catch(T){n({type:"FETCH_DATA_MART_ERROR",payload:mn(T)})}},[]),s=h.useCallback(async A=>{try{n({type:"CREATE_DATA_MART_START"});const T=await Tn.createDataMart(A),M=ene(T);return n({type:"CREATE_DATA_MART_SUCCESS",payload:M}),De({event:"data_mart_created",category:"DataMart",action:"Create",label:M.id,value:M.title}),kt.success("Data Mart created"),M}catch(T){const M=mn(T);throw n({type:"CREATE_DATA_MART_ERROR",payload:M}),De({event:"data_mart_error",category:"DataMart",action:"CreateError",value:A.title,error:M.message}),T}},[]),i=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_START"});const M=await Tn.updateDataMart(A,T),k=await Tu(M);n({type:"UPDATE_DATA_MART_SUCCESS",payload:k}),De({event:"data_mart_updated",category:"DataMart",action:"Update",label:k.id,value:k.title})}catch(M){const k=mn(M);n({type:"UPDATE_DATA_MART_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:A,value:T.title})}},[]),c=h.useCallback(async A=>{try{n({type:"DELETE_DATA_MART_START"}),await Tn.deleteDataMart(A),n({type:"DELETE_DATA_MART_SUCCESS"}),De({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:A}),kt.success("Data Mart deleted")}catch(T){const M=mn(T);n({type:"DELETE_DATA_MART_ERROR",payload:M}),De({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:A,error:M.message})}},[]),u=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await Tn.updateDataMartTitle(A,T),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:T}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:A,value:T}),kt.success("Title updated")}catch(M){const k=mn(M);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:A,error:k.message})}},[]),f=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await Tn.updateDataMartDescription(A,T),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:T??""}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription",label:A}),kt.success("Description updated")}catch(M){const k=mn(M);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:A,error:k.message})}},[]),m=h.useCallback(A=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:A})},[]),x=h.useCallback(async(A,T,M)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let k;switch(T){case $e.SQL:k={definitionType:T,definition:$te(M)};break;case $e.TABLE:k={definitionType:T,definition:Gte(M)};break;case $e.VIEW:k={definitionType:T,definition:Kte(M)};break;case $e.TABLE_PATTERN:k={definitionType:T,definition:Yte(M)};break;case $e.CONNECTOR:{const G=M;let B;for(const q of G.connector.source.configuration){const V=q;if(V._copiedFrom){B=V._copiedFrom.dataMartId;break}}k={definitionType:$e.CONNECTOR,definition:Xte(G),sourceDataMartId:B};break}default:throw new Error(`Unsupported definition type: ${String(T)}`)}const z=await Tn.updateDataMartDefinition(A,k),L=await Tu(z);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:T,definition:M}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:L}),De({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:T,context:L.id,value:L.title})}catch(k){const z=mn(k);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:z}),De({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:T,context:A,error:z.message})}},[]),g=h.useCallback(async A=>{try{n({type:"PUBLISH_DATA_MART_START"});const T=await Tn.publishDataMart(A),M=await Tu(T);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:M}),kt.success("Data Mart published"),De({event:"data_mart_published",category:"DataMart",action:"Publish",label:M.storage.type,context:M.id,value:M.title,details:M.definitionType??"No definition"})}catch(T){const M=mn(T);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:M}),De({event:"data_mart_error",category:"DataMart",action:"PublishError",label:A,error:M.message}),T}},[]),y=h.useCallback(async(A,T=5,M=0,k)=>{try{k!=null&&k.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const z=await Tn.getDataMartRuns(A,T,M,k!=null&&k.silent?{skipLoadingIndicator:!0}:void 0),L=L_(z);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:L}),L}catch(z){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:mn(z)}),z}},[]),v=h.useCallback(async(A,T,M=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const k=await Tn.getDataMartRuns(A,M,T),z=L_(k);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:z}),De({event:"data_mart_runs_loaded",category:"DataMart",action:"LoadMore",context:A}),z}catch(k){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:mn(k)}),k}},[]),S=h.useCallback(async A=>{const T=kt.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),De({event:"data_mart_run_started",category:"DataMart",action:"Run",label:"Manual",context:A.id}),await Tn.runDataMart(A.id,A.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(M){kt.dismiss(T);const k=mn(M);n({type:"RUN_DATA_MART_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"RunError",label:"Manual",context:A.id,error:k.message})}},[]),b=h.useCallback(async(A,T)=>{try{await Tn.cancelDataMartRun(A,T),await y(A),kt.success("Data Mart run canceled"),De({event:"data_mart_run_canceled",category:"DataMart",action:"CancelRun",label:"Manual"})}catch(M){const k=mn(M);n({type:"RUN_DATA_MART_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"CancelRunError",error:k.message})}},[y]),E=h.useCallback(async(A,T)=>{try{return await Tn.getDataMartRunById(A,T)}catch(M){const k=mn(M);throw De({event:"data_mart_error",category:"DataMart",action:"FetchRunDetailsError",error:k.message}),M}},[]),R=h.useCallback(async A=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const T=await Tn.actualizeDataMartSchema(A),M=await Tu(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:M}),kt.success("Output schema actualized"),De({event:"data_mart_schema_actualized",category:"DataMart",action:"ActualizeSchema",label:"Automatic"})}catch(T){const M=mn(T);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:M}),De({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",error:M.message})}},[]),j=h.useCallback(async(A,T)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const M=await Tn.updateDataMartSchema(A,{schema:T}),k=await Tu(M);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:k}),kt.success("Output schema updated"),De({event:"data_mart_schema_updated",category:"DataMart",action:"UpdateSchema",label:"Manual"})}catch(M){const k=mn(M);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:k}),De({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",error:k.message})}},[]),_=h.useCallback(()=>{n({type:"RESET"})},[]),D=h.useCallback(()=>t.error?t.error.message:null,[t.error]),O={...t,getDataMart:r,createDataMart:s,updateDataMart:i,deleteDataMart:c,updateDataMartTitle:u,updateDataMartDescription:f,updateDataMartStorage:m,updateDataMartDefinition:x,publishDataMart:g,runDataMart:S,cancelDataMartRun:b,actualizeDataMartSchema:R,updateDataMartSchema:j,getDataMartRuns:y,getDataMartRunById:E,loadMoreDataMartRuns:v,getErrorMessage:D,reset:_};return a.jsx(j5.Provider,{value:O,children:e})}var qh=e=>e.type==="checkbox",ic=e=>e instanceof Date,Ra=e=>e==null;const A5=e=>typeof e=="object";var mr=e=>!Ra(e)&&!Array.isArray(e)&&A5(e)&&!ic(e),D5=e=>mr(e)&&e.target?qh(e.target)?e.target.checked:e.target.value:e,nne=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,O5=(e,t)=>e.has(nne(t)),rne=e=>{const t=e.constructor&&e.constructor.prototype;return mr(t)&&t.hasOwnProperty("isPrototypeOf")},P2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function yr(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(!(P2&&(e instanceof Blob||r))&&(n||mr(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!rne(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=yr(e[s]));else return e;return t}var Hx=e=>/^\w*$/.test(e),Xn=e=>e===void 0,U2=e=>Array.isArray(e)?e.filter(Boolean):[],z2=e=>U2(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Pe=(e,t,n)=>{if(!t||!mr(e))return n;const r=(Hx(t)?[t]:z2(t)).reduce((s,i)=>Ra(s)?s:s[i],e);return Xn(r)||r===e?Xn(e[t])?n:e[t]:r},Ka=e=>typeof e=="boolean",Cn=(e,t,n)=>{let r=-1;const s=Hx(t)?[t]:z2(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=mr(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=f,e=e[u]}};const Og={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ks={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Xo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},F2=ae.createContext(null);F2.displayName="HookFormContext";const Ed=()=>ae.useContext(F2),I5=e=>{const{children:t,...n}=e;return ae.createElement(F2.Provider,{value:n},t)};var M5=(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]!==ks.all&&(t._proxyFormState[c]=!r||ks.all),n&&(n[c]=!0),e[c]}});return s};const H2=typeof window<"u"?ae.useLayoutEffect:ae.useEffect;function k5(e){const t=Ed(),{control:n=t.control,disabled:r,name:s,exact:i}=e||{},[c,u]=ae.useState(n._formState),f=ae.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return H2(()=>n._subscribe({name:s,formState:f.current,exact:i,callback:m=>{!r&&u({...n._formState,...m})}}),[s,r,i]),ae.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),ae.useMemo(()=>M5(c,n,f.current,!1),[c,n])}var Za=e=>typeof e=="string",Ib=(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=>Ra(e)||!A5(e);function Ls(e,t,n=new WeakSet){if(Mb(e)||Mb(t))return Object.is(e,t);if(ic(e)&&ic(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(ic(c)&&ic(u)||mr(c)&&mr(u)||Array.isArray(c)&&Array.isArray(u)?!Ls(c,u,n):!Object.is(c,u))return!1}}return!0}function ane(e){const t=Ed(),{control:n=t.control,name:r,defaultValue:s,disabled:i,exact:c,compute:u}=e||{},f=ae.useRef(s),m=ae.useRef(u),x=ae.useRef(void 0),g=ae.useRef(n),y=ae.useRef(r);m.current=u;const[v,S]=ae.useState(()=>{const D=n._getWatch(r,f.current);return m.current?m.current(D):D}),b=ae.useCallback(D=>{const O=Ib(r,n._names,D||n._formValues,!1,f.current);return m.current?m.current(O):O},[n._formValues,n._names,r]),E=ae.useCallback(D=>{if(!i){const O=Ib(r,n._names,D||n._formValues,!1,f.current);if(m.current){const A=m.current(O);Ls(A,x.current)||(S(A),x.current=A)}else S(O)}},[n._formValues,n._names,i,r]);H2(()=>((g.current!==n||!Ls(y.current,r))&&(g.current=n,y.current=r,E()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:D=>{E(D.values)}})),[n,c,r,E]),ae.useEffect(()=>n._removeUnmounted());const R=g.current!==n,j=y.current,_=ae.useMemo(()=>{if(i)return null;const D=!R&&!Ls(j,r);return R||D?b():null},[i,R,r,j,b]);return _!==null?_:v}function sne(e){const t=Ed(),{name:n,disabled:r,control:s=t.control,shouldUnregister:i,defaultValue:c,exact:u=!0}=e,f=O5(s._names.array,n),m=ae.useMemo(()=>Pe(s._formValues,n,Pe(s._defaultValues,n,c)),[s,n,c]),x=ane({control:s,name:n,defaultValue:m,exact:u}),g=k5({control:s,name:n,exact:u}),y=ae.useRef(e),v=ae.useRef(void 0),S=ae.useRef(s.register(n,{...e.rules,value:x,...Ka(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const b=ae.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]),E=ae.useCallback(D=>S.current.onChange({target:{value:D5(D),name:n},type:Og.CHANGE}),[n]),R=ae.useCallback(()=>S.current.onBlur({target:{value:Pe(s._formValues,n),name:n},type:Og.BLUR}),[n,s._formValues]),j=ae.useCallback(D=>{const O=Pe(s._fields,n);O&&D&&(O._f.ref={focus:()=>D.focus&&D.focus(),select:()=>D.select&&D.select(),setCustomValidity:A=>D.setCustomValidity(A),reportValidity:()=>D.reportValidity()})},[s._fields,n]),_=ae.useMemo(()=>({name:n,value:x,...Ka(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:E,onBlur:R,ref:j}),[n,r,g.disabled,E,R,j,x]);return ae.useEffect(()=>{const D=s._options.shouldUnregister||i,O=v.current;O&&O!==n&&!f&&s.unregister(O),s.register(n,{...y.current.rules,...Ka(y.current.disabled)?{disabled:y.current.disabled}:{}});const A=(T,M)=>{const k=Pe(s._fields,T);k&&k._f&&(k._f.mount=M)};if(A(n,!0),D){const T=yr(Pe(s._options.defaultValues,n,y.current.defaultValue));Cn(s._defaultValues,n,T),Xn(Pe(s._formValues,n))&&Cn(s._formValues,n,T)}return!f&&s.register(n),v.current=n,()=>{(f?D&&!s._state.action:D)?s.unregister(n):A(n,!1)}},[n,s,f,i]),ae.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),ae.useMemo(()=>({field:_,formState:g,fieldState:b}),[_,g,b])}const one=e=>e.render(sne(e));var V2=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Bf=e=>Array.isArray(e)?e:[e],P_=()=>{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 L5(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],i=t[r];if(s&&mr(s)&&i){const c=L5(s,i);mr(c)&&(n[r]=c)}else e[r]&&(n[r]=i)}return n}var ra=e=>mr(e)&&!Object.keys(e).length,$2=e=>e.type==="file",Ps=e=>typeof e=="function",Ig=e=>{if(!P2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P5=e=>e.type==="select-multiple",B2=e=>e.type==="radio",ine=e=>B2(e)||qh(e),S1=e=>Ig(e)&&e.isConnected;function lne(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 cne(e){for(const t in e)if(e.hasOwnProperty(t)&&!Xn(e[t]))return!1;return!0}function fr(e,t){const n=Array.isArray(t)?t:Hx(t)?[t]:z2(t),r=n.length===1?e:lne(e,n),s=n.length-1,i=n[s];return r&&delete r[i],s!==0&&(mr(r)&&ra(r)||Array.isArray(r)&&cne(r))&&fr(e,n.slice(0,-1)),e}var une=e=>{for(const t in e)if(Ps(e[t]))return!0;return!1};function U5(e){return Array.isArray(e)||mr(e)&&!une(e)}function kb(e,t={}){for(const n in e){const r=e[n];U5(r)?(t[n]=Array.isArray(r)?[]:{},kb(r,t[n])):Xn(r)||(t[n]=!0)}return t}function Iu(e,t,n){n||(n=kb(t));for(const r in e){const s=e[r];if(U5(s))Xn(t)||Mb(n[r])?n[r]=kb(s,Array.isArray(s)?[]:{}):Iu(s,Ra(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!Ls(s,i)}}return n}const U_={value:!1,isValid:!1},z_={value:!0,isValid:!0};var z5=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===""?z_:{value:e[0].value,isValid:!0}:z_:U_}return U_},F5=(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 F_={isValid:!1,value:null};var H5=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,F_):F_;function H_(e){const t=e.ref;return $2(t)?t.files:B2(t)?H5(e.refs).value:P5(t)?[...t.selectedOptions].map(({value:n})=>n):qh(t)?z5(e.refs).value:F5(Xn(t.value)?e.ref.value:t.value,e)}var dne=(e,t,n,r)=>{const s={};for(const i of e){const c=Pe(t,i);c&&Cn(s,i,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Mg=e=>e instanceof RegExp,_f=e=>Xn(e)?e:Mg(e)?e.source:mr(e)?Mg(e.value)?e.value.source:e.value:e,V_=e=>({isOnSubmit:!e||e===ks.onSubmit,isOnBlur:e===ks.onBlur,isOnChange:e===ks.onChange,isOnAll:e===ks.all,isOnTouch:e===ks.onTouched});const $_="AsyncFunction";var fne=e=>!!e&&!!e.validate&&!!(Ps(e.validate)&&e.validate.constructor.name===$_||mr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===$_)),hne=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),B_=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Gf=(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(Gf(u,t))break}else if(mr(u)&&Gf(u,t))break}}};function G_(e,t,n){const r=Pe(e,n);if(r||Hx(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 mne=(e,t,n,r)=>{n(e);const{name:s,...i}=e;return ra(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(c=>t[c]===(!r||ks.all))},pne=(e,t,n)=>!e||!t||e===t||Bf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),gne=(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,xne=(e,t)=>!U2(Pe(e,t)).length&&fr(e,t),yne=(e,t,n)=>{const r=Bf(Pe(e,n));return Cn(r,"root",t[n]),Cn(e,n,r),e};function q_(e,t,n="validate"){if(Za(e)||Array.isArray(e)&&e.every(Za)||Ka(e)&&!e)return{type:n,message:Za(e)?e:"",ref:t}}var _u=e=>mr(e)&&!Mg(e)?e:{value:e,message:""},K_=async(e,t,n,r,s,i)=>{const{ref:c,refs:u,required:f,maxLength:m,minLength:x,min:g,max:y,pattern:v,validate:S,name:b,valueAsNumber:E,mount:R}=e._f,j=Pe(n,b);if(!R||t.has(b))return{};const _=u?u[0]:c,D=G=>{s&&_.reportValidity&&(_.setCustomValidity(Ka(G)?"":G||""),_.reportValidity())},O={},A=B2(c),T=qh(c),M=A||T,k=(E||$2(c))&&Xn(c.value)&&Xn(j)||Ig(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,z=V2.bind(null,b,r,O),L=(G,B,q,V=Xo.maxLength,I=Xo.minLength)=>{const K=G?B:q;O[b]={type:G?V:I,message:K,ref:c,...z(G?V:I,K)}};if(i?!Array.isArray(j)||!j.length:f&&(!M&&(k||Ra(j))||Ka(j)&&!j||T&&!z5(u).isValid||A&&!H5(u).isValid)){const{value:G,message:B}=Za(f)?{value:!!f,message:f}:_u(f);if(G&&(O[b]={type:Xo.required,message:B,ref:_,...z(Xo.required,B)},!r))return D(B),O}if(!k&&(!Ra(g)||!Ra(y))){let G,B;const q=_u(y),V=_u(g);if(!Ra(j)&&!isNaN(j)){const I=c.valueAsNumber||j&&+j;Ra(q.value)||(G=I>q.value),Ra(V.value)||(B=I<V.value)}else{const I=c.valueAsDate||new Date(j),K=me=>new Date(new Date().toDateString()+" "+me),$=c.type=="time",ee=c.type=="week";Za(q.value)&&j&&(G=$?K(j)>K(q.value):ee?j>q.value:I>new Date(q.value)),Za(V.value)&&j&&(B=$?K(j)<K(V.value):ee?j<V.value:I<new Date(V.value))}if((G||B)&&(L(!!G,q.message,V.message,Xo.max,Xo.min),!r))return D(O[b].message),O}if((m||x)&&!k&&(Za(j)||i&&Array.isArray(j))){const G=_u(m),B=_u(x),q=!Ra(G.value)&&j.length>+G.value,V=!Ra(B.value)&&j.length<+B.value;if((q||V)&&(L(q,G.message,B.message),!r))return D(O[b].message),O}if(v&&!k&&Za(j)){const{value:G,message:B}=_u(v);if(Mg(G)&&!j.match(G)&&(O[b]={type:Xo.pattern,message:B,ref:c,...z(Xo.pattern,B)},!r))return D(B),O}if(S){if(Ps(S)){const G=await S(j,n),B=q_(G,_);if(B&&(O[b]={...B,...z(Xo.validate,B.message)},!r))return D(B.message),O}else if(mr(S)){let G={};for(const B in S){if(!ra(G)&&!r)break;const q=q_(await S[B](j,n),_,B);q&&(G={...q,...z(B,q.message)},D(q.message),r&&(O[b]=G))}if(!ra(G)&&(O[b]={ref:_,...G},!r))return O}}return D(!0),O};const vne={mode:ks.onSubmit,reValidateMode:ks.onChange,shouldFocusError:!0};function bne(e={}){let t={...vne,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ps(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=mr(t.defaultValues)||mr(t.values)?yr(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:yr(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 x={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...x};const y={array:P_(),state:P_()},v=t.criteriaMode===ks.all,S=Y=>re=>{clearTimeout(m),m=setTimeout(Y,re)},b=async Y=>{if(!t.disabled&&(x.isValid||g.isValid||Y)){const re=t.resolver?ra((await T()).errors):await k(r,!0);re!==n.isValid&&y.state.next({isValid:re})}},E=(Y,re)=>{!t.disabled&&(x.isValidating||x.validatingFields||g.isValidating||g.validatingFields)&&((Y||Array.from(u.mount)).forEach(ce=>{ce&&(re?Cn(n.validatingFields,ce,re):fr(n.validatingFields,ce))}),y.state.next({validatingFields:n.validatingFields,isValidating:!ra(n.validatingFields)}))},R=(Y,re=[],ce,Ie,je=!0,Te=!0)=>{if(Ie&&ce&&!t.disabled){if(c.action=!0,Te&&Array.isArray(Pe(r,Y))){const Ve=ce(Pe(r,Y),Ie.argA,Ie.argB);je&&Cn(r,Y,Ve)}if(Te&&Array.isArray(Pe(n.errors,Y))){const Ve=ce(Pe(n.errors,Y),Ie.argA,Ie.argB);je&&Cn(n.errors,Y,Ve),xne(n.errors,Y)}if((x.touchedFields||g.touchedFields)&&Te&&Array.isArray(Pe(n.touchedFields,Y))){const Ve=ce(Pe(n.touchedFields,Y),Ie.argA,Ie.argB);je&&Cn(n.touchedFields,Y,Ve)}(x.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Iu(s,i)),y.state.next({name:Y,isDirty:L(Y,re),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Cn(i,Y,re)},j=(Y,re)=>{Cn(n.errors,Y,re),y.state.next({errors:n.errors})},_=Y=>{n.errors=Y,y.state.next({errors:n.errors,isValid:!1})},D=(Y,re,ce,Ie)=>{const je=Pe(r,Y);if(je){const Te=Pe(i,Y,Xn(ce)?Pe(s,Y):ce);Xn(Te)||Ie&&Ie.defaultChecked||re?Cn(i,Y,re?Te:H_(je._f)):q(Y,Te),c.mount&&!c.action&&b()}},O=(Y,re,ce,Ie,je)=>{let Te=!1,Ve=!1;const bt={name:Y};if(!t.disabled){if(!ce||Ie){(x.isDirty||g.isDirty)&&(Ve=n.isDirty,n.isDirty=bt.isDirty=L(),Te=Ve!==bt.isDirty);const st=Ls(Pe(s,Y),re);Ve=!!Pe(n.dirtyFields,Y),st?fr(n.dirtyFields,Y):Cn(n.dirtyFields,Y,!0),bt.dirtyFields=n.dirtyFields,Te=Te||(x.dirtyFields||g.dirtyFields)&&Ve!==!st}if(ce){const st=Pe(n.touchedFields,Y);st||(Cn(n.touchedFields,Y,ce),bt.touchedFields=n.touchedFields,Te=Te||(x.touchedFields||g.touchedFields)&&st!==ce)}Te&&je&&y.state.next(bt)}return Te?bt:{}},A=(Y,re,ce,Ie)=>{const je=Pe(n.errors,Y),Te=(x.isValid||g.isValid)&&Ka(re)&&n.isValid!==re;if(t.delayError&&ce?(f=S(()=>j(Y,ce)),f(t.delayError)):(clearTimeout(m),f=null,ce?Cn(n.errors,Y,ce):fr(n.errors,Y)),(ce?!Ls(je,ce):je)||!ra(Ie)||Te){const Ve={...Ie,...Te&&Ka(re)?{isValid:re}:{},errors:n.errors,name:Y};n={...n,...Ve},y.state.next(Ve)}},T=async Y=>{E(Y,!0);const re=await t.resolver(i,t.context,dne(Y||u.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E(Y),re},M=async Y=>{const{errors:re}=await T(Y);if(Y)for(const ce of Y){const Ie=Pe(re,ce);Ie?Cn(n.errors,ce,Ie):fr(n.errors,ce)}else n.errors=re;return re},k=async(Y,re,ce={valid:!0})=>{for(const Ie in Y){const je=Y[Ie];if(je){const{_f:Te,...Ve}=je;if(Te){const bt=u.array.has(Te.name),st=je._f&&fne(je._f);st&&x.validatingFields&&E([Te.name],!0);const tn=await K_(je,u.disabled,i,v,t.shouldUseNativeValidation&&!re,bt);if(st&&x.validatingFields&&E([Te.name]),tn[Te.name]&&(ce.valid=!1,re))break;!re&&(Pe(tn,Te.name)?bt?yne(n.errors,tn,Te.name):Cn(n.errors,Te.name,tn[Te.name]):fr(n.errors,Te.name))}!ra(Ve)&&await k(Ve,re,ce)}}return ce.valid},z=()=>{for(const Y of u.unMount){const re=Pe(r,Y);re&&(re._f.refs?re._f.refs.every(ce=>!S1(ce)):!S1(re._f.ref))&&J(Y)}u.unMount=new Set},L=(Y,re)=>!t.disabled&&(Y&&re&&Cn(i,Y,re),!Ls(me(),s)),G=(Y,re,ce)=>Ib(Y,u,{...c.mount?i:Xn(re)?s:Za(Y)?{[Y]:re}:re},ce,re),B=Y=>U2(Pe(c.mount?i:s,Y,t.shouldUnregister?Pe(s,Y,[]):[])),q=(Y,re,ce={})=>{const Ie=Pe(r,Y);let je=re;if(Ie){const Te=Ie._f;Te&&(!Te.disabled&&Cn(i,Y,F5(re,Te)),je=Ig(Te.ref)&&Ra(re)?"":re,P5(Te.ref)?[...Te.ref.options].forEach(Ve=>Ve.selected=je.includes(Ve.value)):Te.refs?qh(Te.ref)?Te.refs.forEach(Ve=>{(!Ve.defaultChecked||!Ve.disabled)&&(Array.isArray(je)?Ve.checked=!!je.find(bt=>bt===Ve.value):Ve.checked=je===Ve.value||!!je)}):Te.refs.forEach(Ve=>Ve.checked=Ve.value===je):$2(Te.ref)?Te.ref.value="":(Te.ref.value=je,Te.ref.type||y.state.next({name:Y,values:yr(i)})))}(ce.shouldDirty||ce.shouldTouch)&&O(Y,je,ce.shouldTouch,ce.shouldDirty,!0),ce.shouldValidate&&ee(Y)},V=(Y,re,ce)=>{for(const Ie in re){if(!re.hasOwnProperty(Ie))return;const je=re[Ie],Te=Y+"."+Ie,Ve=Pe(r,Te);(u.array.has(Y)||mr(je)||Ve&&!Ve._f)&&!ic(je)?V(Te,je,ce):q(Te,je,ce)}},I=(Y,re,ce={})=>{const Ie=Pe(r,Y),je=u.array.has(Y),Te=yr(re);Cn(i,Y,Te),je?(y.array.next({name:Y,values:yr(i)}),(x.isDirty||x.dirtyFields||g.isDirty||g.dirtyFields)&&ce.shouldDirty&&y.state.next({name:Y,dirtyFields:Iu(s,i),isDirty:L(Y,Te)})):Ie&&!Ie._f&&!Ra(Te)?V(Y,Te,ce):q(Y,Te,ce),B_(Y,u)&&y.state.next({...n,name:Y}),y.state.next({name:c.mount?Y:void 0,values:yr(i)})},K=async Y=>{c.mount=!0;const re=Y.target;let ce=re.name,Ie=!0;const je=Pe(r,ce),Te=st=>{Ie=Number.isNaN(st)||ic(st)&&isNaN(st.getTime())||Ls(st,Pe(i,ce,st))},Ve=V_(t.mode),bt=V_(t.reValidateMode);if(je){let st,tn;const or=re.type?H_(je._f):D5(Y),Vn=Y.type===Og.BLUR||Y.type===Og.FOCUS_OUT,Lr=!hne(je._f)&&!t.resolver&&!Pe(n.errors,ce)&&!je._f.deps||gne(Vn,Pe(n.touchedFields,ce),n.isSubmitted,bt,Ve),ea=B_(ce,u,Vn);Cn(i,ce,or),Vn?(!re||!re.readOnly)&&(je._f.onBlur&&je._f.onBlur(Y),f&&f(0)):je._f.onChange&&je._f.onChange(Y);const pn=O(ce,or,Vn),ir=!ra(pn)||ea;if(!Vn&&y.state.next({name:ce,type:Y.type,values:yr(i)}),Lr)return(x.isValid||g.isValid)&&(t.mode==="onBlur"?Vn&&b():Vn||b()),ir&&y.state.next({name:ce,...ea?{}:pn});if(!Vn&&ea&&y.state.next({...n}),t.resolver){const{errors:kn}=await T([ce]);if(Te(or),Ie){const Qs=G_(n.errors,r,ce),Ia=G_(kn,r,Qs.name||ce);st=Ia.error,ce=Ia.name,tn=ra(kn)}}else E([ce],!0),st=(await K_(je,u.disabled,i,v,t.shouldUseNativeValidation))[ce],E([ce]),Te(or),Ie&&(st?tn=!1:(x.isValid||g.isValid)&&(tn=await k(r,!0)));Ie&&(je._f.deps&&(!Array.isArray(je._f.deps)||je._f.deps.length>0)&&ee(je._f.deps),A(ce,tn,st,pn))}},$=(Y,re)=>{if(Pe(n.errors,re)&&Y.focus)return Y.focus(),1},ee=async(Y,re={})=>{let ce,Ie;const je=Bf(Y);if(t.resolver){const Te=await M(Xn(Y)?Y:je);ce=ra(Te),Ie=Y?!je.some(Ve=>Pe(Te,Ve)):ce}else Y?(Ie=(await Promise.all(je.map(async Te=>{const Ve=Pe(r,Te);return await k(Ve&&Ve._f?{[Te]:Ve}:Ve)}))).every(Boolean),!(!Ie&&!n.isValid)&&b()):Ie=ce=await k(r);return y.state.next({...!Za(Y)||(x.isValid||g.isValid)&&ce!==n.isValid?{}:{name:Y},...t.resolver||!Y?{isValid:ce}:{},errors:n.errors}),re.shouldFocus&&!Ie&&Gf(r,$,Y?je:u.mount),Ie},me=(Y,re)=>{let ce={...c.mount?i:s};return re&&(ce=L5(re.dirtyFields?n.dirtyFields:n.touchedFields,ce)),Xn(Y)?ce:Za(Y)?Pe(ce,Y):Y.map(Ie=>Pe(ce,Ie))},U=(Y,re)=>({invalid:!!Pe((re||n).errors,Y),isDirty:!!Pe((re||n).dirtyFields,Y),error:Pe((re||n).errors,Y),isValidating:!!Pe(n.validatingFields,Y),isTouched:!!Pe((re||n).touchedFields,Y)}),F=Y=>{Y&&Bf(Y).forEach(re=>fr(n.errors,re)),y.state.next({errors:Y?n.errors:{}})},H=(Y,re,ce)=>{const Ie=(Pe(r,Y,{_f:{}})._f||{}).ref,je=Pe(n.errors,Y)||{},{ref:Te,message:Ve,type:bt,...st}=je;Cn(n.errors,Y,{...st,...re,ref:Ie}),y.state.next({name:Y,errors:n.errors,isValid:!1}),ce&&ce.shouldFocus&&Ie&&Ie.focus&&Ie.focus()},W=(Y,re)=>Ps(Y)?y.state.subscribe({next:ce=>"values"in ce&&Y(G(void 0,re),ce)}):G(Y,re,!0),Q=Y=>y.state.subscribe({next:re=>{pne(Y.name,re.name,Y.exact)&&mne(re,Y.formState||x,On,Y.reRenderRoot)&&Y.callback({values:{...i},...n,...re,defaultValues:s})}}).unsubscribe,le=Y=>(c.mount=!0,g={...g,...Y.formState},Q({...Y,formState:g})),J=(Y,re={})=>{for(const ce of Y?Bf(Y):u.mount)u.mount.delete(ce),u.array.delete(ce),re.keepValue||(fr(r,ce),fr(i,ce)),!re.keepError&&fr(n.errors,ce),!re.keepDirty&&fr(n.dirtyFields,ce),!re.keepTouched&&fr(n.touchedFields,ce),!re.keepIsValidating&&fr(n.validatingFields,ce),!t.shouldUnregister&&!re.keepDefaultValue&&fr(s,ce);y.state.next({values:yr(i)}),y.state.next({...n,...re.keepDirty?{isDirty:L()}:{}}),!re.keepIsValid&&b()},ie=({disabled:Y,name:re})=>{(Ka(Y)&&c.mount||Y||u.disabled.has(re))&&(Y?u.disabled.add(re):u.disabled.delete(re))},ye=(Y,re={})=>{let ce=Pe(r,Y);const Ie=Ka(re.disabled)||Ka(t.disabled);return Cn(r,Y,{...ce||{},_f:{...ce&&ce._f?ce._f:{ref:{name:Y}},name:Y,mount:!0,...re}}),u.mount.add(Y),ce?ie({disabled:Ka(re.disabled)?re.disabled:t.disabled,name:Y}):D(Y,!0,re.value),{...Ie?{disabled:re.disabled||t.disabled}:{},...t.progressive?{required:!!re.required,min:_f(re.min),max:_f(re.max),minLength:_f(re.minLength),maxLength:_f(re.maxLength),pattern:_f(re.pattern)}:{},name:Y,onChange:K,onBlur:K,ref:je=>{if(je){ye(Y,re),ce=Pe(r,Y);const Te=Xn(je.value)&&je.querySelectorAll&&je.querySelectorAll("input,select,textarea")[0]||je,Ve=ine(Te),bt=ce._f.refs||[];if(Ve?bt.find(st=>st===Te):Te===ce._f.ref)return;Cn(r,Y,{_f:{...ce._f,...Ve?{refs:[...bt.filter(S1),Te,...Array.isArray(Pe(s,Y))?[{}]:[]],ref:{type:Te.type,name:Y}}:{ref:Te}}}),D(Y,!1,void 0,Te)}else ce=Pe(r,Y,{}),ce._f&&(ce._f.mount=!1),(t.shouldUnregister||re.shouldUnregister)&&!(O5(u.array,Y)&&c.action)&&u.unMount.add(Y)}}},Ee=()=>t.shouldFocusError&&Gf(r,$,u.mount),He=Y=>{Ka(Y)&&(y.state.next({disabled:Y}),Gf(r,(re,ce)=>{const Ie=Pe(r,ce);Ie&&(re.disabled=Ie._f.disabled||Y,Array.isArray(Ie._f.refs)&&Ie._f.refs.forEach(je=>{je.disabled=Ie._f.disabled||Y}))},0,!1))},Re=(Y,re)=>async ce=>{let Ie;ce&&(ce.preventDefault&&ce.preventDefault(),ce.persist&&ce.persist());let je=yr(i);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:Te,values:Ve}=await T();n.errors=Te,je=yr(Ve)}else await k(r);if(u.disabled.size)for(const Te of u.disabled)fr(je,Te);if(fr(n.errors,"root"),ra(n.errors)){y.state.next({errors:{}});try{await Y(je,ce)}catch(Te){Ie=Te}}else re&&await re({...n.errors},ce),Ee(),setTimeout(Ee);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ra(n.errors)&&!Ie,submitCount:n.submitCount+1,errors:n.errors}),Ie)throw Ie},Ke=(Y,re={})=>{Pe(r,Y)&&(Xn(re.defaultValue)?I(Y,yr(Pe(s,Y))):(I(Y,re.defaultValue),Cn(s,Y,yr(re.defaultValue))),re.keepTouched||fr(n.touchedFields,Y),re.keepDirty||(fr(n.dirtyFields,Y),n.isDirty=re.defaultValue?L(Y,yr(Pe(s,Y))):L()),re.keepError||(fr(n.errors,Y),x.isValid&&b()),y.state.next({...n}))},nt=(Y,re={})=>{const ce=Y?yr(Y):s,Ie=yr(ce),je=ra(Y),Te=je?s:Ie;if(re.keepDefaultValues||(s=ce),!re.keepValues){if(re.keepDirtyValues){const Ve=new Set([...u.mount,...Object.keys(Iu(s,i))]);for(const bt of Array.from(Ve))Pe(n.dirtyFields,bt)?Cn(Te,bt,Pe(i,bt)):I(bt,Pe(Te,bt))}else{if(P2&&Xn(Y))for(const Ve of u.mount){const bt=Pe(r,Ve);if(bt&&bt._f){const st=Array.isArray(bt._f.refs)?bt._f.refs[0]:bt._f.ref;if(Ig(st)){const tn=st.closest("form");if(tn){tn.reset();break}}}}if(re.keepFieldsRef)for(const Ve of u.mount)I(Ve,Pe(Te,Ve));else r={}}i=t.shouldUnregister?re.keepDefaultValues?yr(s):{}:yr(Te),y.array.next({values:{...Te}}),y.state.next({values:{...Te}})}u={mount:re.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!x.isValid||!!re.keepIsValid||!!re.keepDirtyValues||!t.shouldUnregister&&!ra(Te),c.watch=!!t.shouldUnregister,c.action=!1,re.keepErrors||(n.errors={}),y.state.next({submitCount:re.keepSubmitCount?n.submitCount:0,isDirty:je?!1:re.keepDirty?n.isDirty:!!(re.keepDefaultValues&&!Ls(Y,s)),isSubmitted:re.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:je?{}:re.keepDirtyValues?re.keepDefaultValues&&i?Iu(s,i):n.dirtyFields:re.keepDefaultValues&&Y?Iu(s,Y):re.keepDirty?n.dirtyFields:{},touchedFields:re.keepTouched?n.touchedFields:{},errors:re.keepErrors?n.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Gt=(Y,re)=>nt(Ps(Y)?Y(i):Y,re),Ft=(Y,re={})=>{const ce=Pe(r,Y),Ie=ce&&ce._f;if(Ie){const je=Ie.refs?Ie.refs[0]:Ie.ref;je.focus&&(je.focus(),re.shouldSelect&&Ps(je.select)&&je.select())}},On=Y=>{n={...n,...Y}},ke={control:{register:ye,unregister:J,getFieldState:U,handleSubmit:Re,setError:H,_subscribe:Q,_runSchema:T,_focusError:Ee,_getWatch:G,_getDirty:L,_setValid:b,_setFieldArray:R,_setDisabledField:ie,_setErrors:_,_getFieldArray:B,_reset:nt,_resetDefaultValues:()=>Ps(t.defaultValues)&&t.defaultValues().then(Y=>{Gt(Y,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:z,_disableForm:He,_subjects:y,_proxyFormState:x,get _fields(){return r},get _formValues(){return i},get _state(){return c},set _state(Y){c=Y},get _defaultValues(){return s},get _names(){return u},set _names(Y){u=Y},get _formState(){return n},get _options(){return t},set _options(Y){t={...t,...Y}}},subscribe:le,trigger:ee,register:ye,handleSubmit:Re,watch:W,setValue:I,getValues:me,reset:Gt,resetField:Ke,clearErrors:F,unregister:J,setError:H,setFocus:Ft,getFieldState:U};return{...ke,formControl:ke}}function Do(e={}){const t=ae.useRef(void 0),n=ae.useRef(void 0),[r,s]=ae.useState({isDirty:!1,isValidating:!1,isLoading:Ps(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:Ps(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Ps(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...u}=bne(e);t.current={...u,formState:r}}const i=t.current.control;return i._options=e,H2(()=>{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]),ae.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),ae.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),ae.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),ae.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),ae.useEffect(()=>{if(i._proxyFormState.isDirty){const c=i._getDirty();c!==r.isDirty&&i._subjects.state.next({isDirty:c})}},[i,r.isDirty]),ae.useEffect(()=>{var c;e.values&&!Ls(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]),ae.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=M5(r,i),t.current}var Sne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Cne=Sne.reduce((e,t)=>{const n=SS(`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}},{}),Ene="Label",V5=h.forwardRef((e,t)=>a.jsx(Cne.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())}}));V5.displayName=Ene;var wne=V5;function Aa({className:e,...t}){return a.jsx(wne,{"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 Dl=I5,$5=h.createContext({}),yt=({...e})=>a.jsx($5.Provider,{value:{name:e.name},children:a.jsx(one,{...e})}),Kh=()=>{const e=h.useContext($5),t=h.useContext(B5),{getFieldState:n}=Ed(),r=k5({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}},B5=h.createContext({});function ht({className:e="",...t}){const n=h.useId();return a.jsx(B5.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 ut({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:i,formItemId:c}=Kh();return a.jsxs(Aa,{"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(wt,{...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(Or,{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 mt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=Kh();return a.jsx(bh,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function Jt({className:e,...t}){const{formDescriptionId:n}=Kh();return a.jsx("div",{"data-slot":"form-description",id:n,className:se("text-muted-foreground text-sm",e),...t})}function St({className:e,...t}){const{error:n,formMessageId:r}=Kh(),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 Ol({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 Uc({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 Mr({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 Rne({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:i="vertical",className:c=""}){const{formItemId:u}=Kh();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 jne({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(Rne,{value:i.value,label:i.label,checked:t===i.value,onChange:c=>n(c.target.value),disabled:i.disabled,orientation:r},i.value))})}const Si=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}));Si.displayName="AppForm";function W_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Lb(e){const t=Tne(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(Nne);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function Tne(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=Dne(s),u=Ane(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 _ne=Symbol("radix.slottable");function Nne(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_ne}function Ane(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 Dne(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 One(e){const t=e+"CollectionProvider",[n,r]=Er(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:E,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=Lb(u),m=ae.forwardRef((b,E)=>{const{scope:R,children:j}=b,_=i(u,R),D=vt(E,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=Lb(x),v=ae.forwardRef((b,E)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=vt(E,D),A=i(x,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(y,{[g]:"",ref:O,children:j})});v.displayName=x;function S(b){const E=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}function G2(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 Ine=[" ","Enter","ArrowUp","ArrowDown"],Mne=[" ","Enter"],Sc="Select",[Vx,$x,kne]=One(Sc),[wd]=Er(Sc,[kne,No]),Bx=No(),[Lne,Il]=wd(Sc),[Pne,Une]=wd(Sc),G5=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:c,defaultValue:u,onValueChange:f,dir:m,name:x,autoComplete:g,disabled:y,required:v,form:S}=e,b=Bx(t),[E,R]=h.useState(null),[j,_]=h.useState(null),[D,O]=h.useState(!1),A=Dh(m),[T,M]=ca({prop:r,defaultProp:s??!1,onChange:i,caller:Sc}),[k,z]=ca({prop:c,defaultProp:u,onChange:f,caller:Sc}),L=h.useRef(null),G=E?S||!!E.closest("form"):!0,[B,q]=h.useState(new Set),V=Array.from(B).map(I=>I.props.value).join(";");return a.jsx(gd,{...b,children:a.jsxs(Lne,{required:v,scope:t,trigger:E,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:D,onValueNodeHasChildrenChange:O,contentId:er(),value:k,onValueChange:z,open:T,onOpenChange:M,dir:A,triggerPointerDownPosRef:L,disabled:y,children:[a.jsx(Vx.Provider,{scope:t,children:a.jsx(Pne,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(I=>{q(K=>new Set(K).add(I))},[]),onNativeOptionRemove:h.useCallback(I=>{q(K=>{const $=new Set(K);return $.delete(I),$})},[]),children:n})}),G?a.jsxs(pI,{"aria-hidden":!0,required:v,tabIndex:-1,name:x,autoComplete:g,value:k,onChange:I=>z(I.target.value),disabled:y,form:S,children:[k===void 0?a.jsx("option",{value:""}):null,Array.from(B)]},V):null]})})};G5.displayName=Sc;var q5="SelectTrigger",K5=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=Bx(n),c=Il(q5,n),u=c.disabled||r,f=vt(t,c.onTriggerChange),m=$x(n),x=h.useRef("touch"),[g,y,v]=xI(b=>{const E=m().filter(_=>!_.disabled),R=E.find(_=>_.value===c.value),j=yI(E,b,R);j!==void 0&&c.onValueChange(j.value)}),S=b=>{u||(c.onOpenChange(!0),v()),b&&(c.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return a.jsx(xd,{asChild:!0,...i,children:a.jsx(et.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":gI(c.value)?"":void 0,...s,ref:f,onClick:Me(s.onClick,b=>{b.currentTarget.focus(),x.current!=="mouse"&&S(b)}),onPointerDown:Me(s.onPointerDown,b=>{x.current=b.pointerType;const E=b.target;E.hasPointerCapture(b.pointerId)&&E.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(S(b),b.preventDefault())}),onKeyDown:Me(s.onKeyDown,b=>{const E=g.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&y(b.key),!(E&&b.key===" ")&&Ine.includes(b.key)&&(S(),b.preventDefault())})})})});K5.displayName=q5;var W5="SelectValue",Y5=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:c="",...u}=e,f=Il(W5,n),{onValueNodeHasChildrenChange:m}=f,x=i!==void 0,g=vt(t,f.onValueNodeChange);return Br(()=>{m(x)},[m,x]),a.jsx(et.span,{...u,ref:g,style:{pointerEvents:"none"},children:gI(f.value)?a.jsx(a.Fragment,{children:c}):i})});Y5.displayName=W5;var zne="SelectIcon",Z5=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return a.jsx(et.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});Z5.displayName=zne;var Fne="SelectPortal",X5=e=>a.jsx(Oc,{asChild:!0,...e});X5.displayName=Fne;var Cc="SelectContent",Q5=h.forwardRef((e,t)=>{const n=Il(Cc,e.__scopeSelect),[r,s]=h.useState();if(Br(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?Us.createPortal(a.jsx(J5,{scope:e.__scopeSelect,children:a.jsx(Vx.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(eI,{...e,ref:t})});Q5.displayName=Cc;var Ds=10,[J5,Ml]=wd(Cc),Hne="SelectContentImpl",Vne=Lb("SelectContent.RemoveScroll"),eI=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:c,side:u,sideOffset:f,align:m,alignOffset:x,arrowPadding:g,collisionBoundary:y,collisionPadding:v,sticky:S,hideWhenDetached:b,avoidCollisions:E,...R}=e,j=Il(Cc,n),[_,D]=h.useState(null),[O,A]=h.useState(null),T=vt(t,J=>D(J)),[M,k]=h.useState(null),[z,L]=h.useState(null),G=$x(n),[B,q]=h.useState(!1),V=h.useRef(!1);h.useEffect(()=>{if(_)return nx(_)},[_]),ex();const I=h.useCallback(J=>{const[ie,...ye]=G().map(Re=>Re.ref.current),[Ee]=ye.slice(-1),He=document.activeElement;for(const Re of J)if(Re===He||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===ie&&O&&(O.scrollTop=0),Re===Ee&&O&&(O.scrollTop=O.scrollHeight),Re==null||Re.focus(),document.activeElement!==He))return},[G,O]),K=h.useCallback(()=>I([M,_]),[I,M,_]);h.useEffect(()=>{B&&K()},[B,K]);const{onOpenChange:$,triggerPointerDownPosRef:ee}=j;h.useEffect(()=>{if(_){let J={x:0,y:0};const ie=Ee=>{var He,Re;J={x:Math.abs(Math.round(Ee.pageX)-(((He=ee.current)==null?void 0:He.x)??0)),y:Math.abs(Math.round(Ee.pageY)-(((Re=ee.current)==null?void 0:Re.y)??0))}},ye=Ee=>{J.x<=10&&J.y<=10?Ee.preventDefault():_.contains(Ee.target)||$(!1),document.removeEventListener("pointermove",ie),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ye,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ye,{capture:!0})}}},[_,$,ee]),h.useEffect(()=>{const J=()=>$(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[$]);const[me,U]=xI(J=>{const ie=G().filter(He=>!He.disabled),ye=ie.find(He=>He.ref.current===document.activeElement),Ee=yI(ie,J,ye);Ee&&setTimeout(()=>Ee.ref.current.focus())}),F=h.useCallback((J,ie,ye)=>{const Ee=!V.current&&!ye;(j.value!==void 0&&j.value===ie||Ee)&&(k(J),Ee&&(V.current=!0))},[j.value]),H=h.useCallback(()=>_==null?void 0:_.focus(),[_]),W=h.useCallback((J,ie,ye)=>{const Ee=!V.current&&!ye;(j.value!==void 0&&j.value===ie||Ee)&&L(J)},[j.value]),Q=r==="popper"?Pb:tI,le=Q===Pb?{side:u,sideOffset:f,align:m,alignOffset:x,arrowPadding:g,collisionBoundary:y,collisionPadding:v,sticky:S,hideWhenDetached:b,avoidCollisions:E}:{};return a.jsx(J5,{scope:n,content:_,viewport:O,onViewportChange:A,itemRefCallback:F,selectedItem:M,onItemLeave:H,itemTextRefCallback:W,focusSelectedItem:K,selectedItemText:z,position:r,isPositioned:B,searchRef:me,children:a.jsx(Rh,{as:Vne,allowPinchZoom:!0,children:a.jsx(wh,{asChild:!0,trapped:j.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Me(s,J=>{var ie;(ie=j.trigger)==null||ie.focus({preventScroll:!0}),J.preventDefault()}),children:a.jsx(Dc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:a.jsx(Q,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:J=>J.preventDefault(),...R,...le,onPlaced:()=>q(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Me(R.onKeyDown,J=>{const ie=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!ie&&J.key.length===1&&U(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let Ee=G().filter(He=>!He.disabled).map(He=>He.ref.current);if(["ArrowUp","End"].includes(J.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const He=J.target,Re=Ee.indexOf(He);Ee=Ee.slice(Re+1)}setTimeout(()=>I(Ee)),J.preventDefault()}})})})})})})});eI.displayName=Hne;var $ne="SelectItemAlignedPosition",tI=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Il(Cc,n),c=Ml(Cc,n),[u,f]=h.useState(null),[m,x]=h.useState(null),g=vt(t,T=>x(T)),y=$x(n),v=h.useRef(!1),S=h.useRef(!0),{viewport:b,selectedItem:E,selectedItemText:R,focusSelectedItem:j}=c,_=h.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&b&&E&&R){const T=i.trigger.getBoundingClientRect(),M=m.getBoundingClientRect(),k=i.valueNode.getBoundingClientRect(),z=R.getBoundingClientRect();if(i.dir!=="rtl"){const He=z.left-M.left,Re=k.left-He,Ke=T.left-Re,nt=T.width+Ke,Gt=Math.max(nt,M.width),Ft=window.innerWidth-Ds,On=W_(Re,[Ds,Math.max(Ds,Ft-Gt)]);u.style.minWidth=nt+"px",u.style.left=On+"px"}else{const He=M.right-z.right,Re=window.innerWidth-k.right-He,Ke=window.innerWidth-T.right-Re,nt=T.width+Ke,Gt=Math.max(nt,M.width),Ft=window.innerWidth-Ds,On=W_(Re,[Ds,Math.max(Ds,Ft-Gt)]);u.style.minWidth=nt+"px",u.style.right=On+"px"}const L=y(),G=window.innerHeight-Ds*2,B=b.scrollHeight,q=window.getComputedStyle(m),V=parseInt(q.borderTopWidth,10),I=parseInt(q.paddingTop,10),K=parseInt(q.borderBottomWidth,10),$=parseInt(q.paddingBottom,10),ee=V+I+B+$+K,me=Math.min(E.offsetHeight*5,ee),U=window.getComputedStyle(b),F=parseInt(U.paddingTop,10),H=parseInt(U.paddingBottom,10),W=T.top+T.height/2-Ds,Q=G-W,le=E.offsetHeight/2,J=E.offsetTop+le,ie=V+I+J,ye=ee-ie;if(ie<=W){const He=L.length>0&&E===L[L.length-1].ref.current;u.style.bottom="0px";const Re=m.clientHeight-b.offsetTop-b.offsetHeight,Ke=Math.max(Q,le+(He?H:0)+Re+K),nt=ie+Ke;u.style.height=nt+"px"}else{const He=L.length>0&&E===L[0].ref.current;u.style.top="0px";const Ke=Math.max(W,V+b.offsetTop+(He?F:0)+le)+ye;u.style.height=Ke+"px",b.scrollTop=ie-W+b.offsetTop}u.style.margin=`${Ds}px 0`,u.style.minHeight=me+"px",u.style.maxHeight=G+"px",r==null||r(),requestAnimationFrame(()=>v.current=!0)}},[y,i.trigger,i.valueNode,u,m,b,E,R,i.dir,r]);Br(()=>_(),[_]);const[D,O]=h.useState();Br(()=>{m&&O(window.getComputedStyle(m).zIndex)},[m]);const A=h.useCallback(T=>{T&&S.current===!0&&(_(),j==null||j(),S.current=!1)},[_,j]);return a.jsx(Gne,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:a.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:a.jsx(et.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});tI.displayName=$ne;var Bne="SelectPopperPosition",Pb=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Ds,...i}=e,c=Bx(n);return a.jsx(Th,{...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)"}})});Pb.displayName=Bne;var[Gne,q2]=wd(Cc,{}),Ub="SelectViewport",nI=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Ml(Ub,n),c=q2(Ub,n),u=vt(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(Vx.Slot,{scope:n,children:a.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Me(s.onScroll,m=>{const x=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:y}=c;if(y!=null&&y.current&&g){const v=Math.abs(f.current-x.scrollTop);if(v>0){const S=window.innerHeight-Ds*2,b=parseFloat(g.style.minHeight),E=parseFloat(g.style.height),R=Math.max(b,E);if(R<S){const j=R+v,_=Math.min(S,j),D=j-_;g.style.height=_+"px",g.style.bottom==="0px"&&(x.scrollTop=D>0?D:0,g.style.justifyContent="flex-end")}}}f.current=x.scrollTop})})})]})});nI.displayName=Ub;var rI="SelectGroup",[qne,Kne]=wd(rI),aI=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=er();return a.jsx(qne,{scope:n,id:s,children:a.jsx(et.div,{role:"group","aria-labelledby":s,...r,ref:t})})});aI.displayName=rI;var sI="SelectLabel",Wne=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Kne(sI,n);return a.jsx(et.div,{id:s.id,...r,ref:t})});Wne.displayName=sI;var kg="SelectItem",[Yne,oI]=wd(kg),iI=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...c}=e,u=Il(kg,n),f=Ml(kg,n),m=u.value===r,[x,g]=h.useState(i??""),[y,v]=h.useState(!1),S=vt(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,s)}),b=er(),E=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(Yne,{scope:n,value:r,disabled:s,textId:b,isSelected:m,onItemTextChange:h.useCallback(j=>{g(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:a.jsx(Vx.ItemSlot,{scope:n,value:r,disabled:s,textValue:x,children:a.jsx(et.div,{role:"option","aria-labelledby":b,"data-highlighted":y?"":void 0,"aria-selected":m&&y,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:S,onFocus:Me(c.onFocus,()=>v(!0)),onBlur:Me(c.onBlur,()=>v(!1)),onClick:Me(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:Me(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:Me(c.onPointerDown,j=>{E.current=j.pointerType}),onPointerMove:Me(c.onPointerMove,j=>{var _;E.current=j.pointerType,s?(_=f.onItemLeave)==null||_.call(f):E.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Me(c.onKeyDown,j=>{var D;((D=f.searchRef)==null?void 0:D.current)!==""&&j.key===" "||(Mne.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});iI.displayName=kg;var Uf="SelectItemText",lI=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,c=Il(Uf,n),u=Ml(Uf,n),f=oI(Uf,n),m=Une(Uf,n),[x,g]=h.useState(null),y=vt(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=x==null?void 0:x.textContent,S=h.useMemo(()=>a.jsx("option",{value:f.value,disabled:f.disabled,children:v},f.value),[f.disabled,f.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:E}=m;return Br(()=>(b(S),()=>E(S)),[b,E,S]),a.jsxs(a.Fragment,{children:[a.jsx(et.span,{id:f.textId,...i,ref:y}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?Us.createPortal(i.children,c.valueNode):null]})});lI.displayName=Uf;var cI="SelectItemIndicator",uI=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return oI(cI,n).isSelected?a.jsx(et.span,{"aria-hidden":!0,...r,ref:t}):null});uI.displayName=cI;var zb="SelectScrollUpButton",dI=h.forwardRef((e,t)=>{const n=Ml(zb,e.__scopeSelect),r=q2(zb,e.__scopeSelect),[s,i]=h.useState(!1),c=vt(t,r.onScrollButtonChange);return Br(()=>{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(hI,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});dI.displayName=zb;var Fb="SelectScrollDownButton",fI=h.forwardRef((e,t)=>{const n=Ml(Fb,e.__scopeSelect),r=q2(Fb,e.__scopeSelect),[s,i]=h.useState(!1),c=vt(t,r.onScrollButtonChange);return Br(()=>{if(n.viewport&&n.isPositioned){let u=function(){const m=f.scrollHeight-f.clientHeight,x=Math.ceil(f.scrollTop)<m;i(x)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?a.jsx(hI,{...e,ref:c,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});fI.displayName=Fb;var hI=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Ml("SelectScrollButton",n),c=h.useRef(null),u=$x(n),f=h.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return h.useEffect(()=>()=>f(),[f]),Br(()=>{var x;const m=u().find(g=>g.ref.current===document.activeElement);(x=m==null?void 0:m.ref.current)==null||x.scrollIntoView({block:"nearest"})},[u]),a.jsx(et.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Me(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Me(s.onPointerMove,()=>{var m;(m=i.onItemLeave)==null||m.call(i),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Me(s.onPointerLeave,()=>{f()})})}),Zne="SelectSeparator",mI=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(et.div,{"aria-hidden":!0,...r,ref:t})});mI.displayName=Zne;var Hb="SelectArrow",Xne=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Bx(n),i=Il(Hb,n),c=Ml(Hb,n);return i.open&&c.position==="popper"?a.jsx(_h,{...s,...r,ref:t}):null});Xne.displayName=Hb;var Qne="SelectBubbleInput",pI=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=vt(r,s),c=G2(t);return h.useEffect(()=>{const u=s.current;if(!u)return;const f=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&x){const g=new Event("change",{bubbles:!0});x.call(u,t),u.dispatchEvent(g)}},[c,t]),a.jsx(et.select,{...n,style:{...n3,...n.style},ref:i,defaultValue:t})});pI.displayName=Qne;function gI(e){return e===""||e===void 0}function xI(e){const t=Vs(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 yI(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=Jne(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 Jne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ere=G5,tre=K5,nre=Y5,rre=Z5,are=X5,sre=Q5,ore=nI,ire=aI,lre=iI,cre=lI,ure=uI,dre=dI,fre=fI,hre=mI;function fa({...e}){return a.jsx(ere,{"data-slot":"select",...e})}function Gx({...e}){return a.jsx(ire,{"data-slot":"select-group",...e})}function ha({...e}){return a.jsx(nre,{"data-slot":"select-value",...e})}function ma({className:e,size:t="default",children:n,...r}){return a.jsxs(tre,{"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(rre,{asChild:!0,children:a.jsx(Es,{className:"size-4 opacity-50"})})]})}function pa({className:e,children:t,position:n="popper",...r}){return a.jsx(are,{children:a.jsxs(sre,{"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(mre,{}),a.jsx(ore,{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(pre,{})]})})}function Gn({className:e,children:t,...n}){return a.jsxs(lre,{"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(ure,{children:a.jsx(la,{className:"size-4"})})}),a.jsx(cre,{children:t})]})}function vI({className:e,...t}){return a.jsx(hre,{"data-slot":"select-separator",className:se("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function mre({className:e,...t}){return a.jsx(dre,{"data-slot":"select-scroll-up-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Ju,{className:"size-4"})})}function pre({className:e,...t}){return a.jsx(fre,{"data-slot":"select-scroll-down-button",className:se("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Es,{className:"size-4"})})}const gre=en({title:gt().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:gt().min(1,"Storage is required")});function xre(){const{createDataMart:e,isLoading:t,error:n}=Rs();return{handleCreate:h.useCallback(async s=>{try{return await e(s)}catch(i){return console.error(i),null}},[e]),isSubmitting:t,serverError:n}}function yre(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:x,getDataMartRuns:g,loadMoreDataMartRuns:y,reset:v,dataMart:S,isLoading:b,error:E,getErrorMessage:R,runs:j}=Rs();return h.useEffect(()=>(e?t(e):v(),()=>{v()}),[e,t,v]),{dataMart:S,isLoading:b,error:E,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:i,updateDataMartSchema:c,actualizeDataMartSchema:u,publishDataMart:f,runDataMart:m,cancelDataMartRun:x,getDataMartRuns:g,loadMoreDataMartRuns:y,runs:j,getDataMart:t}}const Y_=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Pe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Vb=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?Y_(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>Y_(s,n,e))}},Z_=(e,t)=>{t.shouldUseNativeValidation&&Vb(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(vre(t.names||Object.keys(e),r)){const c=Object.assign({},Pe(n,r));Cn(c,"root",i),Cn(n,r,c)}else Cn(n,r,i)}return n},vre=(e,t)=>{const n=X_(t);return e.some(r=>X_(r).match(`^${n}\\.\\d+`))};function X_(e){return e.replace(/\]|\[/g,"")}function bI(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 x in c.prototype)x in u||Object.defineProperty(u,x,{value:c.prototype[x].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 x of m._zod.deferred)x();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 bre extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Sre={};function SI(e){return Sre}function Cre(e,t){return typeof t=="bigint"?t.toString():t}const CI=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ip(e){return typeof e=="string"?e:e==null?void 0:e.message}function EI(e,t,n){var s,i,c,u,f,m;const r={...e,path:e.path??[]};if(!e.message){const x=Ip((c=(i=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:i.error)==null?void 0:c.call(i,e))??Ip((u=t==null?void 0:t.error)==null?void 0:u.call(t,e))??Ip((f=n.customError)==null?void 0:f.call(n,e))??Ip((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=x}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const wI=(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,Cre,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ere=bI("$ZodError",wI),RI=bI("$ZodError",wI,{Parent:Error}),wre=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 bre;if(c.issues.length){const u=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>EI(f,i,SI())));throw CI(u,s==null?void 0:s.callee),u}return c.value},Rre=wre(RI),jre=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=>EI(f,i,SI())));throw CI(u,s==null?void 0:s.callee),u}return c.value},Tre=jre(RI);function Q_(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function _re(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(x){return x.errors.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=V2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Nre(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(x){return x.forEach(function(g){return e.push(g)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=V2(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Ci(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(Q_(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return i.shouldUseNativeValidation&&Vb({},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:Z_(_re(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(Q_(function(){return Promise.resolve((n.mode==="sync"?Rre:Tre)(e,r,t)).then(function(c){return i.shouldUseNativeValidation&&Vb({},i),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(u){return u instanceof Ere})(c))return{values:{},errors:Z_(Nre(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 jI=h.createContext(void 0);function Are(){const e=h.useContext(jI);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var on=(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))(on||{});const Dre={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function Ore(e,t){switch(t.type){case on.FETCH_STORAGES_START:case on.FETCH_STORAGE_START:case on.CREATE_STORAGE_START:case on.UPDATE_STORAGE_START:return{...e,error:null};case on.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case on.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case on.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case on.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case on.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 on.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case on.FETCH_STORAGES_ERROR:case on.FETCH_STORAGE_ERROR:case on.CREATE_STORAGE_ERROR:case on.UPDATE_STORAGE_ERROR:case on.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case on.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case on.CLEAR_ERROR:return{...e,error:null};default:return e}}function K2({children:e}){const[t,n]=h.useReducer(Ore,Dre);return a.jsx(jI.Provider,{value:{state:t,dispatch:n},children:e})}class Ire extends El{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 Nf=new Ire;function qx(){const{state:e,dispatch:t}=Are(),n=h.useCallback(async()=>{t({type:on.FETCH_STORAGES_START});try{const f=await Nf.getDataStorages();t({type:on.FETCH_STORAGES_SUCCESS,payload:f.map(Pte)})}catch(f){throw t({type:on.FETCH_STORAGES_ERROR,payload:mn(f)}),f}},[t]),r=h.useCallback(async f=>{try{const m=await Nf.getDataStorageById(f),x=Qp(m);t({type:on.FETCH_STORAGE_SUCCESS,payload:x})}catch(m){throw t({type:on.FETCH_STORAGE_ERROR,payload:mn(m)}),m}},[t]),s=h.useCallback(async f=>{t({type:on.CREATE_STORAGE_START});try{const m=Ute(f),x=await Nf.createDataStorage(m),g=Qp(x);return t({type:on.CREATE_STORAGE_SUCCESS,payload:g}),De({event:"data_storage_created",category:"DataStorage",action:"Create",label:g.type,details:g.title}),kt.success("Storage created"),g}catch(m){return t({type:on.CREATE_STORAGE_ERROR,payload:mn(m)}),null}},[t]),i=h.useCallback(async(f,m)=>{t({type:on.UPDATE_STORAGE_START});try{const x=Lte(m),g=await Nf.updateDataStorage(f,x),y=Qp(g);return t({type:on.UPDATE_STORAGE_SUCCESS,payload:y}),De({event:"data_storage_updated",category:"DataStorage",action:"Update",label:y.type,context:y.id}),kt.success("Storage updated"),y}catch(x){return t({type:on.UPDATE_STORAGE_ERROR,payload:mn(x)}),null}},[t]),c=h.useCallback(async f=>{t({type:on.DELETE_STORAGE_START});try{await Nf.deleteDataStorage(f),t({type:on.DELETE_STORAGE_SUCCESS,payload:f}),De({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),kt.success("Storage deleted")}catch(m){throw t({type:on.DELETE_STORAGE_ERROR,payload:mn(m)}),m}},[t]),u=h.useCallback(()=>{t({type:on.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 TI=({isOpen:e,onClose:t,onSelect:n,isCreatingDataStorage:r})=>{const{trigger:s,isLocked:i}=FZ(n,1e3);return a.jsx(N2,{open:e,onOpenChange:t,children:a.jsxs(A2,{className:"sm:max-w-sm",children:[a.jsxs(D2,{children:[a.jsx(O2,{children:"New Storage"}),a.jsx(I2,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:wl.getAllTypes().map(c=>{const u=c.icon,f=c.status===ni.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(Dr,{variant:"secondary",children:"Coming soon"})]},c.type)})})]})})};function Mre({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=xre(),{dataStorages:i,loading:c,fetchDataStorages:u,createDataStorage:f,getDataStorageById:m}=qx(),[x,g]=h.useState(!1),[y,v]=h.useState(!1);h.useEffect(()=>{u()},[u]);const S=Do({resolver:Ci(gre),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async j=>{const _=await n(j);_&&t&&t(_)},E=()=>{g(!0)},R=async j=>{v(!0);try{const _=await f(j);_!=null&&_.id&&(await m(_.id),S.setValue("storageId",_.id))}catch(_){console.error("Failed to create storage:",_)}g(!1),v(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Dl,{...S,children:a.jsxs(Si,{onSubmit:j=>{S.handleSubmit(b)(j)},children:[a.jsxs(Ol,{variant:"light",children:[s&&a.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),a.jsx(yt,{control:S.control,name:"title",render:({field:j})=>a.jsxs(ht,{children:[a.jsx(ut,{children:"Title"}),a.jsx(mt,{children:a.jsx(dt,{id:"title",placeholder:"Enter title",...j,disabled:r})}),a.jsx(St,{})]})}),a.jsx(yt,{control:S.control,name:"storageId",render:({field:j})=>a.jsxs(ht,{children:[a.jsx(ut,{children:"Storage"}),a.jsx(mt,{children:a.jsxs(fa,{onValueChange:_=>{_==="create_new"?E():j.onChange(_)},value:j.value,disabled:r||c,children:[a.jsx(ma,{className:"w-full",children:a.jsx(ha,{placeholder:"Select a storage"})}),a.jsx(pa,{children:a.jsxs(Gx,{children:[c&&a.jsx(Gn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&i.map(_=>{const D=wl.getInfo(_.type).icon;return a.jsx(Gn,{value:_.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(D,{size:20}),a.jsx("span",{children:_.title})]})},_.id)}),!c&&i.length>0&&a.jsx(vI,{}),a.jsx(Gn,{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(ga,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(St,{})]})})]}),a.jsxs(Uc,{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(TI,{isOpen:x,onClose:()=>{g(!1)},onSelect:j=>R(j),isCreatingDataStorage:y})]})}function _I({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 x=async()=>{if(i.trim()===""){c(e);return}if(i.trim()!==e)try{f(!0),await t(i.trim())}catch(y){c(e),console.error(y)}finally{f(!1)}},g=y=>{if(y.key==="Enter"&&!y.shiftKey){if(y.preventDefault(),i.trim()===""){kt.error(r),c(e);return}x()}else y.key==="Escape"&&c(e)};return a.jsx("h2",{className:se("m-0 cursor-pointer p-0 hover:opacity-80",n),children:a.jsx(Ao,{ref:m,value:i,onChange:y=>{c(y.target.value);const v=y.target;v.style.height="auto",v.style.height=`${String(v.scrollHeight)}px`},onBlur:()=>void x(),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 ac=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(ac||{}),NI=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(NI||{}),Kx="Tabs",[kre]=Er(Kx,[px]),AI=px(),[Lre,W2]=kre(Kx),DI=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:c="horizontal",dir:u,activationMode:f="automatic",...m}=e,x=Dh(u),[g,y]=ca({prop:r,onChange:s,defaultProp:i??"",caller:Kx});return a.jsx(Lre,{scope:n,baseId:er(),value:g,onValueChange:y,orientation:c,dir:x,activationMode:f,children:a.jsx(et.div,{dir:x,"data-orientation":c,...m,ref:t})})});DI.displayName=Kx;var OI="TabsList",II=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=W2(OI,n),c=AI(n);return a.jsx(v3,{asChild:!0,...c,orientation:i.orientation,dir:i.dir,loop:r,children:a.jsx(et.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});II.displayName=OI;var MI="TabsTrigger",kI=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,c=W2(MI,n),u=AI(n),f=UI(c.baseId,r),m=zI(c.baseId,r),x=r===c.value;return a.jsx(b3,{asChild:!0,...u,focusable:!s,active:x,children:a.jsx(et.button,{type:"button",role:"tab","aria-selected":x,"aria-controls":m,"data-state":x?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...i,ref:t,onMouseDown:Me(e.onMouseDown,g=>{!s&&g.button===0&&g.ctrlKey===!1?c.onValueChange(r):g.preventDefault()}),onKeyDown:Me(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&c.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const g=c.activationMode!=="manual";!x&&!s&&g&&c.onValueChange(r)})})})});kI.displayName=MI;var LI="TabsContent",PI=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...c}=e,u=W2(LI,n),f=UI(u.baseId,r),m=zI(u.baseId,r),x=r===u.value,g=h.useRef(x);return h.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),a.jsx(qr,{present:s||x,children:({present:y})=>a.jsx(et.div,{"data-state":x?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!y,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:y&&i})})});PI.displayName=LI;function UI(e,t){return`${e}-trigger-${t}`}function zI(e,t){return`${e}-content-${t}`}var Pre=DI,Ure=II,zre=kI,Fre=PI;function Wx({className:e,...t}){return a.jsx(Pre,{"data-slot":"tabs",className:se("flex flex-col gap-2",e),...t})}function Yx({className:e,...t}){return a.jsx(Ure,{"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 Ec({className:e,...t}){return a.jsx(zre,{"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 Hre({className:e,...t}){return a.jsx(Fre,{"data-slot":"tabs-content",className:se("flex-1 outline-none",e),...t})}var Zx="Collapsible",[Vre,FI]=Er(Zx),[$re,Y2]=Vre(Zx),HI=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:c,...u}=e,[f,m]=ca({prop:r,defaultProp:s??!1,onChange:c,caller:Zx});return a.jsx($re,{scope:n,disabled:i,contentId:er(),open:f,onOpenToggle:h.useCallback(()=>m(x=>!x),[m]),children:a.jsx(et.div,{"data-state":J2(f),"data-disabled":i?"":void 0,...u,ref:t})})});HI.displayName=Zx;var VI="CollapsibleTrigger",Z2=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=Y2(VI,n);return a.jsx(et.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":J2(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Me(e.onClick,s.onOpenToggle)})});Z2.displayName=VI;var X2="CollapsibleContent",Q2=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Y2(X2,e.__scopeCollapsible);return a.jsx(qr,{present:n||s.open,children:({present:i})=>a.jsx(Bre,{...r,ref:t,present:i})})});Q2.displayName=X2;var Bre=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,c=Y2(X2,n),[u,f]=h.useState(r),m=h.useRef(null),x=vt(t,m),g=h.useRef(0),y=g.current,v=h.useRef(0),S=v.current,b=c.open||u,E=h.useRef(b),R=h.useRef(void 0);return h.useEffect(()=>{const j=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(j)},[]),Br(()=>{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,E.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),a.jsx(et.div,{"data-state":J2(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!b,...i,ref:x,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":S?`${S}px`:void 0,...e.style},children:b&&s})});function J2(e){return e?"open":"closed"}var $I=HI,Gre=Z2,qre=Q2;const Kre=$I,Wre=Z2,Yre=Q2;function Zre({children:e,className:t="",...n}){return a.jsx("div",{className:se("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function Xre({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 Qre({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 io({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 Jre({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(Wx,{value:s,onValueChange:i,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(aa,{required:c,tooltip:u,className:"w-full",children:e}),r.length>1&&a.jsx(Yx,{children:r.map(m=>a.jsx(Ec,{value:m.value,children:m.label},m.value))})]}),t]})})}function BI({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,i]=h.useState(n);return a.jsxs(Kre,{open:s,onOpenChange:i,"data-slot":"wizard-collapsible",className:se("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(Wre,{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(Da,{className:se("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),a.jsx(Yre,{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 aa({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...i}){return a.jsxs(Aa,{"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(wt,{...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(wt,{...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(Or,{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 ri({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 go({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(Xr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ci,{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(Xr,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(ci,{className:"h-4 w-4"})]})})]})}function ii({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:se("space-y-4",t),...n,children:e})}function eae({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 tae({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(wt,{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 GI({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 qI({type:e,id:t,name:n,value:r,label:s,checked:i,selected:c=!1,disabled:u=!1,tooltip:f,rightIcon:m,onChange:x,className:g="",...y}){const v=b=>{x&&x(e==="checkbox"?b.target.checked:b.target.value)},S=h.useRef(null);return a.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:b=>{if(u)return;const E=b.target;E.tagName==="INPUT"||E.tagName==="LABEL"||E.closest("label")||S.current&&S.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:S,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"),...y}),s&&a.jsx(aa,{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(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Or,{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 eC({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($r,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function J_(e){const t=nae(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(aae);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function nae(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=oae(s),u=sae(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 rae=Symbol("radix.slottable");function aae(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rae}function sae(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 oae(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 iae(e){const t=e+"CollectionProvider",[n,r]=Er(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=b=>{const{scope:E,children:R}=b,j=ae.useRef(null),_=ae.useRef(new Map).current;return a.jsx(s,{scope:E,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const u=e+"CollectionSlot",f=J_(u),m=ae.forwardRef((b,E)=>{const{scope:R,children:j}=b,_=i(u,R),D=vt(E,_.collectionRef);return a.jsx(f,{ref:D,children:j})});m.displayName=u;const x=e+"CollectionItemSlot",g="data-radix-collection-item",y=J_(x),v=ae.forwardRef((b,E)=>{const{scope:R,children:j,..._}=b,D=ae.useRef(null),O=vt(E,D),A=i(x,R);return ae.useEffect(()=>(A.itemMap.set(D,{ref:D,..._}),()=>void A.itemMap.delete(D))),a.jsx(y,{[g]:"",ref:O,children:j})});v.displayName=x;function S(b){const E=i(e+"CollectionConsumer",b);return ae.useCallback(()=>{const j=E.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${g}]`));return Array.from(E.itemMap.values()).sort((A,T)=>_.indexOf(A.ref.current)-_.indexOf(T.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:v},S,r]}var Xs="Accordion",lae=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[tC,cae,uae]=iae(Xs),[Xx]=Er(Xs,[uae,FI]),nC=FI(),KI=ae.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return a.jsx(tC.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(mae,{...i,ref:t}):a.jsx(hae,{...s,ref:t})})});KI.displayName=Xs;var[WI,dae]=Xx(Xs),[YI,fae]=Xx(Xs,{collapsible:!1}),hae=ae.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...c}=e,[u,f]=ca({prop:n,defaultProp:r??"",onChange:s,caller:Xs});return a.jsx(WI,{scope:e.__scopeAccordion,value:ae.useMemo(()=>u?[u]:[],[u]),onItemOpen:f,onItemClose:ae.useCallback(()=>i&&f(""),[i,f]),children:a.jsx(YI,{scope:e.__scopeAccordion,collapsible:i,children:a.jsx(ZI,{...c,ref:t})})})}),mae=ae.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[c,u]=ca({prop:n,defaultProp:r??[],onChange:s,caller:Xs}),f=ae.useCallback(x=>u((g=[])=>[...g,x]),[u]),m=ae.useCallback(x=>u((g=[])=>g.filter(y=>y!==x)),[u]);return a.jsx(WI,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:m,children:a.jsx(YI,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(ZI,{...i,ref:t})})})}),[pae,Qx]=Xx(Xs),ZI=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...c}=e,u=ae.useRef(null),f=vt(u,t),m=cae(n),g=Dh(s)==="ltr",y=Me(e.onKeyDown,v=>{var M;if(!lae.includes(v.key))return;const S=v.target,b=m().filter(k=>{var z;return!((z=k.ref.current)!=null&&z.disabled)}),E=b.findIndex(k=>k.ref.current===S),R=b.length;if(E===-1)return;v.preventDefault();let j=E;const _=0,D=R-1,O=()=>{j=E+1,j>D&&(j=_)},A=()=>{j=E-1,j<_&&(j=D)};switch(v.key){case"Home":j=_;break;case"End":j=D;break;case"ArrowRight":i==="horizontal"&&(g?O():A());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(g?A():O());break;case"ArrowUp":i==="vertical"&&A();break}const T=j%R;(M=b[T].ref.current)==null||M.focus()});return a.jsx(pae,{scope:n,disabled:r,direction:s,orientation:i,children:a.jsx(tC.Slot,{scope:n,children:a.jsx(et.div,{...c,"data-orientation":i,ref:f,onKeyDown:r?void 0:y})})})}),Lg="AccordionItem",[gae,rC]=Xx(Lg),XI=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,i=Qx(Lg,n),c=dae(Lg,n),u=nC(n),f=er(),m=r&&c.value.includes(r)||!1,x=i.disabled||e.disabled;return a.jsx(gae,{scope:n,open:m,disabled:x,triggerId:f,children:a.jsx($I,{"data-orientation":i.orientation,"data-state":r6(m),...u,...s,ref:t,disabled:x,open:m,onOpenChange:g=>{g?c.onItemOpen(r):c.onItemClose(r)}})})});XI.displayName=Lg;var QI="AccordionHeader",JI=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Qx(Xs,n),i=rC(QI,n);return a.jsx(et.h3,{"data-orientation":s.orientation,"data-state":r6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});JI.displayName=QI;var $b="AccordionTrigger",e6=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Qx(Xs,n),i=rC($b,n),c=fae($b,n),u=nC(n);return a.jsx(tC.ItemSlot,{scope:n,children:a.jsx(Gre,{"aria-disabled":i.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...u,...r,ref:t})})});e6.displayName=$b;var t6="AccordionContent",n6=ae.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Qx(Xs,n),i=rC(t6,n),c=nC(n);return a.jsx(qre,{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}})});n6.displayName=t6;function r6(e){return e?"open":"closed"}var xae=KI,yae=XI,vae=JI,bae=e6,Sae=n6;const aC={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(zA,{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}},a6=h.createContext("default");function Bt({variant:e="default",...t}){return a.jsx(a6.Provider,{value:e,children:a.jsx(xae,{"data-slot":"accordion",...t})})}function sC(e){const t=h.useContext(a6);return e??t??"default"}function _t({className:e,variant:t,...n}){const r=sC(t),{itemClass:s}=aC[r];return a.jsx(yae,{"data-slot":"accordion-item",className:se(s,e),...n})}function Nt({className:e,children:t,variant:n,...r}){const s=sC(n),{triggerClass:i,icon:c,chevronClass:u,headerClass:f}=aC[s];return a.jsx(vae,{className:f,children:a.jsxs(bae,{"data-slot":"accordion-trigger",className:se(i,e),...r,children:[c,t,a.jsx(Es,{className:u,"aria-hidden":"true"})]})})}function At({className:e,children:t,variant:n,...r}){const s=sC(n),{contentClass:i,contentInnerClass:c}=aC[s];return a.jsx(Sae,{"data-slot":"accordion-content",className:se(i,e),...r,children:a.jsx("div",{className:c,children:t})})}function $t({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(ci,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function eN(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"connector-state-details",children:[a.jsx(Nt,{children:"What’s connector state?"}),a.jsxs(At,{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($t,{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 Cae({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(BI,{title:"State Info",children:c.length===0?a.jsxs(ht,{children:[a.jsx(ut,{children:"Connector state"}),a.jsx(mt,{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(Jt,{children:a.jsx(eN,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:u,index:f})=>{const m=u.at||"",x=m?Ox(MO(m).toISOString()):"—",g=u.state,y=(()=>{try{return JSON.stringify(g,null,2)}catch{return typeof g=="string"?g:'"—"'}})();return a.jsxs(ht,{children:[a.jsx(ut,{tooltip:`Created at ${x}`,children:`Connector state of configuration #${String(f+1)}`}),a.jsx(mt,{children:a.jsx(FD,{value:y,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(Jt,{children:a.jsx(eN,{})})]},u._id)})})})}function Eae({configuration:e,onClose:t,onSubmit:n}){const[r,s]=h.useState(new Set),i=h.useId(),c=Do({defaultValues:{runType:ac.INCREMENTAL}}),{loading:u,loadingSpecification:f,connectorSpecification:m,fetchConnectorSpecification:x}=Pc(),{dataMart:g}=Rs(),y=h.useCallback(async E=>{!r.has(E)&&!f&&(s(R=>new Set(R).add(E)),await x(E))},[r,f,x]);h.useEffect(()=>{e!=null&&e.connector.source.name&&y(e.connector.source.name)},[e,u,y]);const v=E=>{n&&n(E)},S=()=>{t&&t()},b=E=>{if(!E)return"text";switch(E){case Ms.DATE:return"date";case Ms.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):m?a.jsx(Dl,{...c,children:a.jsxs(Si,{id:i,noValidate:!0,onSubmit:E=>void c.handleSubmit(v)(E),children:[a.jsxs(Ol,{children:[a.jsxs(Mr,{title:"General",children:[a.jsx(yt,{control:c.control,name:"runType",render:({field:E})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),a.jsx(mt,{children:a.jsxs(a.Fragment,{children:[a.jsx(jne,{options:[{value:ac.INCREMENTAL,label:"Incremental load"},{value:ac.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:E.value,onChange:E.onChange,orientation:"horizontal"}),a.jsx(Jt,{children:c.watch("runType")===ac.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")===ac.INCREMENTAL&&a.jsx(Cae,{configuration:e,connectorState:(g==null?void 0:g.connectorState)??null})]}),c.watch("runType")===ac.MANUAL_BACKFILL&&a.jsx(Mr,{title:"Run configuration",children:m.filter(E=>{var R;return(R=E.attributes)==null?void 0:R.includes(NI.MANUAL_BACKFILL)}).map(E=>a.jsx(yt,{control:c.control,name:`data.${E.name}`,render:()=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:E.description,children:E.title??E.name}),a.jsx(mt,{children:a.jsx(dt,{id:E.name,placeholder:E.description,type:b(E.requiredType),defaultValue:typeof E.default=="string"||typeof E.default=="number"?E.default.toString():void 0,...c.register(`data.${E.name}`,{required:!0})})}),a.jsx(St,{})]},E.name)}))})]}),a.jsxs(Uc,{children:[a.jsx(we,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(we,{type:"button",variant:"outline",onClick:S,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function kl(e,t){h.useEffect(()=>(e?GZ(0,600):jb(),()=>{jb()}),[e,0,600])}function wae({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return kl(e),a.jsx(mi,{open:e,onOpenChange:t,children:a.jsxs(pi,{children:[a.jsx(gi,{children:a.jsx(xi,{children:"Manual Run"})}),a.jsx(Eae,{configuration:n,onClose:t,onSubmit:r})]})})}function s6({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(ld,{children:a.jsx(wae,{isOpen:s,onClose:()=>{i(!1)},configuration:t,onSubmit:u})})]})}const Rae=1e3;function jae(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 x=h.useCallback(E=>{f.current&&r(E)},[]),g=h.useCallback(E=>{f.current&&i(E)},[]),y=h.useCallback((E,R)=>{const j=E instanceof Error?E.message:"Schema actualization failed";kt.dismiss(R),g(j),x(!1),c.current=null,u.current=null,kt.error(j,{duration:void 0,id:R})},[g,x]),v=h.useCallback(async()=>{var R;const E=c.current;if((R=u.current)==null||R.abort(),E){kt.dismiss(E);try{await Tn.abortSchemaActualizeTrigger(e,E)}catch{}}c.current=null,u.current=null,x(!1)},[e,x]),S=h.useCallback(async(E,R)=>{var _;const j=D=>D===Ja.SUCCESS||D===Ja.ERROR||D===Ja.CANCELLED;for(;!R.aborted&&c.current===E;)try{const D=await Tn.getSchemaActualizeTriggerStatus(e,E);if(j(D)){try{const O=await Tn.getSchemaActualizeTriggerResponse(e,E);if(kt.dismiss(E),O.success)(_=m.current)==null||_.call(m),kt.success("Output schema actualized",{duration:void 0,id:E});else{const A=O.error??"Schema actualization failed";g(A),kt.error(A,{duration:void 0,id:E})}}catch(O){const A=O instanceof Error?O.message:"Schema actualization failed";kt.dismiss(E),g(A),kt.error(A,{duration:void 0,id:E})}x(!1),c.current=null,u.current=null;return}await new Promise(O=>setTimeout(O,Rae))}catch(D){y(D,E)}},[e,g,x,y]),b=h.useCallback(async()=>{c.current&&await v(),g(null),x(!0);try{const{triggerId:E}=await Tn.createSchemaActualizeTrigger(e);kt.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:E}),c.current=E;const R=new AbortController;u.current=R;try{await S(E,R.signal)}catch(j){y(j,E)}}catch(E){x(!1),g(E instanceof Error?E.message:"Failed to start schema actualization")}},[e,v,S,g,x,y]);return h.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const E=c.current;(R=u.current)==null||R.abort(),E&&(kt.dismiss(E),Tn.abortSchemaActualizeTrigger(e,E).catch(()=>{})),c.current=null,u.current=null}),[e]),{run:b,isLoading:n,cancel:v,error:s}}function Tae({id:e}){const{navigate:t}=vi(),{user:n}=yi(),{flags:r}=yd(),{dataMart:s,deleteDataMart:i,updateDataMartTitle:c,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:x,publishDataMart:g,runDataMart:y,cancelDataMartRun:v,getDataMartRuns:S,loadMoreDataMartRuns:b,isLoading:E,error:R,getErrorMessage:j,runs:_,getDataMart:D}=yre(e),[O,A]=h.useState(!1),[T,M]=h.useState(!1),{id:k="",canPublish:z=!1,canActualizeSchema:L=!1,status:G={code:null,displayName:"",description:""},title:B="",definition:q=null,definitionType:V=null,validationErrors:I=[]}=s??{},K=h.useCallback(()=>{k&&D(k)},[k,D]),{run:$,isLoading:ee}=jae(k,K),me=h.useCallback(async()=>{L&&await $()},[L,$]),U=r==null?void 0:r.INSIGHTS_ENABLED_PROJECT_IDS,F=(n==null?void 0:n.projectId)??"",H=F.length>0&&wJ(U??"").includes(F),W=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},...H?[{name:"Insights",path:"insights"}]:[],{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],Q=h.useCallback(async ie=>{k&&await c(k,ie)},[k,c]),le=h.useCallback(async()=>{if(k){M(!0);try{await g(k),me()}catch(ie){console.log(ie instanceof Error?ie.message:"Failed to publish Data Mart")}finally{M(!1)}}},[k,g,me]),J=h.useCallback(async ie=>{if(k){if(G.code!==Ir.PUBLISHED){_n.error("Manual run is only available for published Data Marts");return}await y({id:k,payload:ie})}},[k,G,y]);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(Wu,{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(NP,{className:"h-5 w-5"})}),a.jsx(_I,{title:B,onUpdate:Q,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(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Vh,{type:G.code===Ir.PUBLISHED?Jn.SUCCESS:Jn.NEUTRAL,variant:"subtle",children:G.displayName})})}),a.jsx(jt,{children:G.code===Ir.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),G.code===Ir.DRAFT&&a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{children:a.jsxs(Wu,{variant:"default",onClick:()=>{le()},disabled:T||!z,className:"ml-2 flex items-center gap-1",children:[a.jsx(Ch,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!z&&a.jsxs(jt,{children:[a.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),I.length>0&&a.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:KJ(I).map((ie,ye)=>a.jsx("li",{children:ie},ye))})]})]})]}),a.jsxs(wr,{children:[a.jsx(Rr,{asChild:!0,children:a.jsx(Wu,{variant:"ghost",children:a.jsx(LA,{className:"h-5 w-5"})})}),a.jsxs(jr,{align:"end",children:[V===$e.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(s6,{configuration:q??null,onManualRun:ie=>{J({runType:ie.runType,data:ie.data})},children:a.jsxs(Tt,{onClick:ie=>{ie.preventDefault()},children:[a.jsx(Jg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(ua,{})]}),a.jsxs(Tt,{onClick:()=>{A(!0)},children:[a.jsx(ts,{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:W.map(ie=>a.jsx(vh,{to:ie.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:ie.name},ie.name))})}),a.jsx("div",{className:"pt-4",children:a.jsx(yS,{context:{dataMart:s,isLoading:E,error:R,getErrorMessage:j,updateDataMartDescription:u,updateDataMartDefinition:f,actualizeDataMartSchema:m,updateDataMartSchema:x,runDataMart:y,cancelDataMartRun:v,getDataMartRuns:S,loadMoreDataMartRuns:b,runs:_,getDataMart:D,runSchemaActualization:me,isSchemaActualizationLoading:ee}})}),a.jsx(Cr,{open:O,onOpenChange:A,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),A(!1),t("/data-marts")}catch(ie){console.error("Failed to delete Data Mart:",ie)}})()}})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx($r,{className:"h-16 w-full"},0),Array.from({length:3}).map((ie,ye)=>a.jsx($r,{className:"h-48 w-full"},ye+1))]})}function _ae({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),[x,g]=h.useState(!1),y=h.useRef(null);h.useEffect(()=>{u(e??"")},[e]),h.useEffect(()=>{if(y.current&&f){y.current.focus();const R=y.current.value.length;y.current.setSelectionRange(R,R),v(y.current)}},[f]);const v=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},S=R=>{u(R.target.value),v(R.target)},b=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)}},E=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),b()):R.key==="Escape"&&(R.preventDefault(),u(e??""),m(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(Ao,{ref:y,value:c,onChange:S,onBlur:()=>void b(),onKeyDown:E,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":x}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:i,minWidth:s},disabled:x}),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 Nae(){const{dataMart:e,updateDataMartDescription:t}=Cs(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx(_ae,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function tN(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 Aae(e){if(Array.isArray(e))return e}function Dae(e,t,n){return(t=Uae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oae(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(x){m=!0,s=x}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return u}}function Iae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
809
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nN(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 rN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nN(Object(n),!0).forEach(function(r){Dae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mae(e,t){if(e==null)return{};var n,r,s=kae(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 kae(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 Lae(e,t){return Aae(e)||Oae(e,t)||zae(e,t)||Iae()}function Pae(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 Uae(e){var t=Pae(e,"string");return typeof t=="symbol"?t:t+""}function zae(e,t){if(e){if(typeof e=="string")return tN(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)?tN(e,t):void 0}}function Fae(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aN(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 sN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aN(Object(n),!0).forEach(function(r){Fae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hae(){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 zf(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 Pg(e){return{}.toString.call(e).includes("Object")}function Vae(e){return!Object.keys(e).length}function ch(e){return typeof e=="function"}function $ae(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bae(e,t){return Pg(t)||dl("changeType"),Object.keys(t).some(function(n){return!$ae(e,n)})&&dl("changeField"),t}function Gae(e){ch(e)||dl("selectorType")}function qae(e){ch(e)||Pg(e)||dl("handlerType"),Pg(e)&&Object.values(e).some(function(t){return!ch(t)})&&dl("handlersType")}function Kae(e){e||dl("initialIsRequired"),Pg(e)||dl("initialType"),Vae(e)&&dl("initialContent")}function Wae(e,t){throw new Error(e[t]||e.default)}var Yae={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"},dl=zf(Wae)(Yae),Mp={changes:Bae,selector:Gae,handler:qae,initial:Kae};function Zae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Mp.initial(e),Mp.handler(t);var n={current:e},r=zf(Jae)(n,t),s=zf(Qae)(n),i=zf(Mp.changes)(e),c=zf(Xae)(n);function u(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(x){return x};return Mp.selector(m),m(n.current)}function f(m){Hae(r,s,i,c)(m)}return[u,f]}function Xae(e,t){return ch(t)?t(e.current):t}function Qae(e,t){return e.current=sN(sN({},e.current),t),t}function Jae(e,t,n){return ch(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 ese={create:Zae},tse={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function nse(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 rse(e){return{}.toString.call(e).includes("Object")}function ase(e){return e||oN("configIsRequired"),rse(e)||oN("configType"),e.urls?(sse(),{paths:{vs:e.urls.monacoBase}}):e}function sse(){console.warn(o6.deprecation)}function ose(e,t){throw new Error(e[t]||e.default)}var o6={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!
810
+ You are using deprecated way of configuration.
811
+
812
+ Instead of using
813
+ monaco.config({ urls: { monacoBase: '...' } })
814
+ use
815
+ monaco.config({ paths: { vs: '...' } })
816
+
817
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
818
+ `},oN=nse(ose)(o6),ise={config:ase},lse=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 i6(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],i6(e[n],t[n]))}),rN(rN({},e),t)}var cse={type:"cancelation",msg:"operation is manually canceled"};function C1(e){var t=!1,n=new Promise(function(r,s){e.then(function(i){return t?s(cse):r(i)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var use=["monaco"],dse=ese.create({config:tse,isInitialized:!1,resolve:null,reject:null,monaco:null}),l6=Lae(dse,2),Wh=l6[0],Jx=l6[1];function fse(e){var t=ise.config(e),n=t.monaco,r=Mae(t,use);Jx(function(s){return{config:i6(s.config,r),monaco:n}})}function hse(){var e=Wh(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Jx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),C1(E1);if(window.monaco&&window.monaco.editor)return c6(window.monaco),e.resolve(window.monaco),C1(E1);lse(mse,gse)(xse)}return C1(E1)}function mse(e){return document.body.appendChild(e)}function pse(e){var t=document.createElement("script");return e&&(t.src=e),t}function gse(e){var t=Wh(function(r){var s=r.config,i=r.reject;return{config:s,reject:i}}),n=pse("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function xse(){var e=Wh(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;c6(r),e.resolve(r)},function(n){e.reject(n)})}function c6(e){Wh().monaco||Jx({monaco:e})}function yse(){return Wh(function(e){var t=e.monaco;return t})}var E1=new Promise(function(e,t){return Jx({resolve:e,reject:t})}),u6={config:fse,init:hse,__getMonacoInstance:yse},vse={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},w1=vse,bse={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Sse=bse;function Cse({children:e}){return ae.createElement("div",{style:Sse.container},e)}var Ese=Cse,wse=Ese;function Rse({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:i,wrapperProps:c}){return ae.createElement("section",{style:{...w1.wrapper,width:e,height:t},...c},!n&&ae.createElement(wse,null,r),ae.createElement("div",{ref:s,style:{...w1.fullWidth,...!n&&w1.hide},className:i}))}var jse=Rse,d6=h.memo(jse);function Tse(e){h.useEffect(e,[])}var f6=Tse;function _se(e,t,n=!0){let r=h.useRef(!0);h.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Wa=_se;function qf(){}function Fu(e,t,n,r){return Nse(e,r)||Ase(e,t,n,r)}function Nse(e,t){return e.editor.getModel(h6(e,t))}function Ase(e,t,n,r){return e.editor.createModel(t,n,r?h6(e,r):void 0)}function h6(e,t){return e.Uri.parse(t)}function Dse({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:x="Loading...",options:g={},height:y="100%",width:v="100%",className:S,wrapperProps:b={},beforeMount:E=qf,onMount:R=qf}){let[j,_]=h.useState(!1),[D,O]=h.useState(!0),A=h.useRef(null),T=h.useRef(null),M=h.useRef(null),k=h.useRef(R),z=h.useRef(E),L=h.useRef(!1);f6(()=>{let V=u6.init();return V.then(I=>(T.current=I)&&O(!1)).catch(I=>(I==null?void 0:I.type)!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>A.current?q():V.cancel()}),Wa(()=>{if(A.current&&T.current){let V=A.current.getOriginalEditor(),I=Fu(T.current,e||"",r||n||"text",i||"");I!==V.getModel()&&V.setModel(I)}},[i],j),Wa(()=>{if(A.current&&T.current){let V=A.current.getModifiedEditor(),I=Fu(T.current,t||"",s||n||"text",c||"");I!==V.getModel()&&V.setModel(I)}},[c],j),Wa(()=>{let V=A.current.getModifiedEditor();V.getOption(T.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],j),Wa(()=>{var V,I;(I=(V=A.current)==null?void 0:V.getModel())==null||I.original.setValue(e||"")},[e],j),Wa(()=>{let{original:V,modified:I}=A.current.getModel();T.current.editor.setModelLanguage(V,r||n||"text"),T.current.editor.setModelLanguage(I,s||n||"text")},[n,r,s],j),Wa(()=>{var V;(V=T.current)==null||V.editor.setTheme(m)},[m],j),Wa(()=>{var V;(V=A.current)==null||V.updateOptions(g)},[g],j);let G=h.useCallback(()=>{var K;if(!T.current)return;z.current(T.current);let V=Fu(T.current,e||"",r||n||"text",i||""),I=Fu(T.current,t||"",s||n||"text",c||"");(K=A.current)==null||K.setModel({original:V,modified:I})},[n,t,s,e,r,i,c]),B=h.useCallback(()=>{var V;!L.current&&M.current&&(A.current=T.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...g}),G(),(V=T.current)==null||V.editor.setTheme(m),_(!0),L.current=!0)},[g,m,G]);h.useEffect(()=>{j&&k.current(A.current,T.current)},[j]),h.useEffect(()=>{!D&&!j&&B()},[D,j,B]);function q(){var I,K,$,ee;let V=(I=A.current)==null?void 0:I.getModel();u||((K=V==null?void 0:V.original)==null||K.dispose()),f||(($=V==null?void 0:V.modified)==null||$.dispose()),(ee=A.current)==null||ee.dispose()}return ae.createElement(d6,{width:v,height:y,isEditorReady:j,loading:x,_ref:M,className:S,wrapperProps:b})}var Ose=Dse;h.memo(Ose);function Ise(e){let t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}var Mse=Ise,kp=new Map;function kse({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:i,theme:c="light",line:u,loading:f="Loading...",options:m={},overrideServices:x={},saveViewState:g=!0,keepCurrentModel:y=!1,width:v="100%",height:S="100%",className:b,wrapperProps:E={},beforeMount:R=qf,onMount:j=qf,onChange:_,onValidate:D=qf}){let[O,A]=h.useState(!1),[T,M]=h.useState(!0),k=h.useRef(null),z=h.useRef(null),L=h.useRef(null),G=h.useRef(j),B=h.useRef(R),q=h.useRef(),V=h.useRef(r),I=Mse(i),K=h.useRef(!1),$=h.useRef(!1);f6(()=>{let U=u6.init();return U.then(F=>(k.current=F)&&M(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>z.current?me():U.cancel()}),Wa(()=>{var F,H,W,Q;let U=Fu(k.current,e||r||"",t||s||"",i||n||"");U!==((F=z.current)==null?void 0:F.getModel())&&(g&&kp.set(I,(H=z.current)==null?void 0:H.saveViewState()),(W=z.current)==null||W.setModel(U),g&&((Q=z.current)==null||Q.restoreViewState(kp.get(i))))},[i],O),Wa(()=>{var U;(U=z.current)==null||U.updateOptions(m)},[m],O),Wa(()=>{!z.current||r===void 0||(z.current.getOption(k.current.editor.EditorOption.readOnly)?z.current.setValue(r):r!==z.current.getValue()&&($.current=!0,z.current.executeEdits("",[{range:z.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),z.current.pushUndoStop(),$.current=!1))},[r],O),Wa(()=>{var F,H;let U=(F=z.current)==null?void 0:F.getModel();U&&s&&((H=k.current)==null||H.editor.setModelLanguage(U,s))},[s],O),Wa(()=>{var U;u!==void 0&&((U=z.current)==null||U.revealLine(u))},[u],O),Wa(()=>{var U;(U=k.current)==null||U.editor.setTheme(c)},[c],O);let ee=h.useCallback(()=>{var U;if(!(!L.current||!k.current)&&!K.current){B.current(k.current);let F=i||n,H=Fu(k.current,r||e||"",t||s||"",F||"");z.current=(U=k.current)==null?void 0:U.editor.create(L.current,{model:H,automaticLayout:!0,...m},x),g&&z.current.restoreViewState(kp.get(F)),k.current.editor.setTheme(c),u!==void 0&&z.current.revealLine(u),A(!0),K.current=!0}},[e,t,n,r,s,i,m,x,g,c,u]);h.useEffect(()=>{O&&G.current(z.current,k.current)},[O]),h.useEffect(()=>{!T&&!O&&ee()},[T,O,ee]),V.current=r,h.useEffect(()=>{var U,F;O&&_&&((U=q.current)==null||U.dispose(),q.current=(F=z.current)==null?void 0:F.onDidChangeModelContent(H=>{$.current||_(z.current.getValue(),H)}))},[O,_]),h.useEffect(()=>{if(O){let U=k.current.editor.onDidChangeMarkers(F=>{var W;let H=(W=z.current.getModel())==null?void 0:W.uri;if(H&&F.find(Q=>Q.path===H.path)){let Q=k.current.editor.getModelMarkers({resource:H});D==null||D(Q)}});return()=>{U==null||U.dispose()}}return()=>{}},[O,D]);function me(){var U,F;(U=q.current)==null||U.dispose(),y?g&&kp.set(i,z.current.saveViewState()):(F=z.current.getModel())==null||F.dispose(),z.current.dispose()}return ae.createElement(d6,{width:v,height:S,isEditorReady:O,loading:f,_ref:L,className:b,wrapperProps:E})}var Lse=kse,m6=h.memo(Lse);function Pse({initialValue:e,onChange:t}){const[n,r]=h.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=Hh();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(m6,{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 Bb({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(Da,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var iN=1,Use=.9,zse=.8,Fse=.17,R1=.1,j1=.999,Hse=.9999,Vse=.99,$se=/[\\\/_+.#"@\[\(\{&]/,Bse=/[\\\/_+.#"@\[\(\{&]/g,Gse=/[\s-]/,p6=/[\s-]/g;function Gb(e,t,n,r,s,i,c){if(i===t.length)return s===e.length?iN:Vse;var u=`${s},${i}`;if(c[u]!==void 0)return c[u];for(var f=r.charAt(i),m=n.indexOf(f,s),x=0,g,y,v,S;m>=0;)g=Gb(e,t,n,r,m+1,i+1,c),g>x&&(m===s?g*=iN:$se.test(e.charAt(m-1))?(g*=zse,v=e.slice(s,m-1).match(Bse),v&&s>0&&(g*=Math.pow(j1,v.length))):Gse.test(e.charAt(m-1))?(g*=Use,S=e.slice(s,m-1).match(p6),S&&s>0&&(g*=Math.pow(j1,S.length))):(g*=Fse,s>0&&(g*=Math.pow(j1,m-s))),e.charAt(m)!==t.charAt(i)&&(g*=Hse)),(g<R1&&n.charAt(m-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(m-1)!==r.charAt(i))&&(y=Gb(e,t,n,r,m+1,i+2,c),y*R1>g&&(g=y*R1)),g>x&&(x=g),m=n.indexOf(f,m+1);return c[u]=x,x}function lN(e){return e.toLowerCase().replace(p6," ")}function qse(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Gb(e,t,lN(e),lN(t),0,0,{})}var Af='[cmdk-group=""]',T1='[cmdk-group-items=""]',Kse='[cmdk-group-heading=""]',g6='[cmdk-item=""]',cN=`${g6}:not([aria-disabled="true"])`,qb="cmdk-item-select",Mu="data-value",Wse=(e,t,n)=>qse(e,t,n),x6=h.createContext(void 0),Yh=()=>h.useContext(x6),y6=h.createContext(void 0),oC=()=>h.useContext(y6),v6=h.createContext(void 0),b6=h.forwardRef((e,t)=>{let n=ku(()=>{var F,H;return{search:"",value:(H=(F=e.value)!=null?F:e.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=ku(()=>new Set),s=ku(()=>new Map),i=ku(()=>new Map),c=ku(()=>new Set),u=S6(e),{label:f,children:m,value:x,onValueChange:g,filter:y,shouldFilter:v,loop:S,disablePointerSelection:b=!1,vimBindings:E=!0,...R}=e,j=er(),_=er(),D=er(),O=h.useRef(null),A=soe();wc(()=>{if(x!==void 0){let F=x.trim();n.current.value=F,T.emit()}},[x]),wc(()=>{A(6,B)},[]);let T=h.useMemo(()=>({subscribe:F=>(c.current.add(F),()=>c.current.delete(F)),snapshot:()=>n.current,setState:(F,H,W)=>{var Q,le,J,ie;if(!Object.is(n.current[F],H)){if(n.current[F]=H,F==="search")G(),z(),A(1,L);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ye=document.getElementById(D);ye?ye.focus():(Q=document.getElementById(j))==null||Q.focus()}if(A(7,()=>{var ye;n.current.selectedItemId=(ye=q())==null?void 0:ye.id,T.emit()}),W||A(5,B),((le=u.current)==null?void 0:le.value)!==void 0){let ye=H??"";(ie=(J=u.current).onValueChange)==null||ie.call(J,ye);return}}T.emit()}},emit:()=>{c.current.forEach(F=>F())}}),[]),M=h.useMemo(()=>({value:(F,H,W)=>{var Q;H!==((Q=i.current.get(F))==null?void 0:Q.value)&&(i.current.set(F,{value:H,keywords:W}),n.current.filtered.items.set(F,k(H,W)),A(2,()=>{z(),T.emit()}))},item:(F,H)=>(r.current.add(F),H&&(s.current.has(H)?s.current.get(H).add(F):s.current.set(H,new Set([F]))),A(3,()=>{G(),z(),n.current.value||L(),T.emit()}),()=>{i.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let W=q();A(4,()=>{G(),(W==null?void 0:W.getAttribute("id"))===F&&L(),T.emit()})}),group:F=>(s.current.has(F)||s.current.set(F,new Set),()=>{i.current.delete(F),s.current.delete(F)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:j,inputId:D,labelId:_,listInnerRef:O}),[]);function k(F,H){var W,Q;let le=(Q=(W=u.current)==null?void 0:W.filter)!=null?Q:Wse;return F?le(F,n.current.search,H):0}function z(){if(!n.current.search||u.current.shouldFilter===!1)return;let F=n.current.filtered.items,H=[];n.current.filtered.groups.forEach(Q=>{let le=s.current.get(Q),J=0;le.forEach(ie=>{let ye=F.get(ie);J=Math.max(ye,J)}),H.push([Q,J])});let W=O.current;V().sort((Q,le)=>{var J,ie;let ye=Q.getAttribute("id"),Ee=le.getAttribute("id");return((J=F.get(Ee))!=null?J:0)-((ie=F.get(ye))!=null?ie:0)}).forEach(Q=>{let le=Q.closest(T1);le?le.appendChild(Q.parentElement===le?Q:Q.closest(`${T1} > *`)):W.appendChild(Q.parentElement===W?Q:Q.closest(`${T1} > *`))}),H.sort((Q,le)=>le[1]-Q[1]).forEach(Q=>{var le;let J=(le=O.current)==null?void 0:le.querySelector(`${Af}[${Mu}="${encodeURIComponent(Q[0])}"]`);J==null||J.parentElement.appendChild(J)})}function L(){let F=V().find(W=>W.getAttribute("aria-disabled")!=="true"),H=F==null?void 0:F.getAttribute(Mu);T.setState("value",H||void 0)}function G(){var F,H,W,Q;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let le=0;for(let J of r.current){let ie=(H=(F=i.current.get(J))==null?void 0:F.value)!=null?H:"",ye=(Q=(W=i.current.get(J))==null?void 0:W.keywords)!=null?Q:[],Ee=k(ie,ye);n.current.filtered.items.set(J,Ee),Ee>0&&le++}for(let[J,ie]of s.current)for(let ye of ie)if(n.current.filtered.items.get(ye)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=le}function B(){var F,H,W;let Q=q();Q&&(((F=Q.parentElement)==null?void 0:F.firstChild)===Q&&((W=(H=Q.closest(Af))==null?void 0:H.querySelector(Kse))==null||W.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function q(){var F;return(F=O.current)==null?void 0:F.querySelector(`${g6}[aria-selected="true"]`)}function V(){var F;return Array.from(((F=O.current)==null?void 0:F.querySelectorAll(cN))||[])}function I(F){let H=V()[F];H&&T.setState("value",H.getAttribute(Mu))}function K(F){var H;let W=q(),Q=V(),le=Q.findIndex(ie=>ie===W),J=Q[le+F];(H=u.current)!=null&&H.loop&&(J=le+F<0?Q[Q.length-1]:le+F===Q.length?Q[0]:Q[le+F]),J&&T.setState("value",J.getAttribute(Mu))}function $(F){let H=q(),W=H==null?void 0:H.closest(Af),Q;for(;W&&!Q;)W=F>0?roe(W,Af):aoe(W,Af),Q=W==null?void 0:W.querySelector(cN);Q?T.setState("value",Q.getAttribute(Mu)):K(F)}let ee=()=>I(V().length-1),me=F=>{F.preventDefault(),F.metaKey?ee():F.altKey?$(1):K(1)},U=F=>{F.preventDefault(),F.metaKey?I(0):F.altKey?$(-1):K(-1)};return h.createElement(et.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:F=>{var H;(H=R.onKeyDown)==null||H.call(R,F);let W=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||W))switch(F.key){case"n":case"j":{E&&F.ctrlKey&&me(F);break}case"ArrowDown":{me(F);break}case"p":case"k":{E&&F.ctrlKey&&U(F);break}case"ArrowUp":{U(F);break}case"Home":{F.preventDefault(),I(0);break}case"End":{F.preventDefault(),ee();break}case"Enter":{F.preventDefault();let Q=q();if(Q){let le=new Event(qb);Q.dispatchEvent(le)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:ioe},f),ey(e,F=>h.createElement(y6.Provider,{value:T},h.createElement(x6.Provider,{value:M},F))))}),Yse=h.forwardRef((e,t)=>{var n,r;let s=er(),i=h.useRef(null),c=h.useContext(v6),u=Yh(),f=S6(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;wc(()=>{if(!m)return u.item(s,c==null?void 0:c.id)},[m]);let x=C6(s,i,[e.value,e.children,i],e.keywords),g=oC(),y=yl(A=>A.value&&A.value===x.current),v=yl(A=>m||u.filter()===!1?!0:A.search?A.filtered.items.get(s)>0:!0);h.useEffect(()=>{let A=i.current;if(!(!A||e.disabled))return A.addEventListener(qb,S),()=>A.removeEventListener(qb,S)},[v,e.onSelect,e.disabled]);function S(){var A,T;b(),(T=(A=f.current).onSelect)==null||T.call(A,x.current)}function b(){g.setState("value",x.current,!0)}if(!v)return null;let{disabled:E,value:R,onSelect:j,forceMount:_,keywords:D,...O}=e;return h.createElement(et.div,{ref:Qr(i,t),...O,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!y,"data-disabled":!!E,"data-selected":!!y,onPointerMove:E||u.getDisablePointerSelection()?void 0:b,onClick:E?void 0:S},e.children)}),Zse=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(),x=Yh(),g=yl(v=>s||x.filter()===!1?!0:v.search?v.filtered.groups.has(c):!0);wc(()=>x.group(c),[]),C6(c,u,[e.value,e.heading,f]);let y=h.useMemo(()=>({id:c,forceMount:s}),[s]);return h.createElement(et.div,{ref:Qr(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),ey(e,v=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},h.createElement(v6.Provider,{value:y},v))))}),Xse=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),i=yl(c=>!c.search);return!n&&!i?null:h.createElement(et.div,{ref:Qr(s,t),...r,"cmdk-separator":"",role:"separator"})}),Qse=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,i=oC(),c=yl(m=>m.search),u=yl(m=>m.selectedItemId),f=Yh();return h.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),h.createElement(et.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)}})}),Jse=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,i=h.useRef(null),c=h.useRef(null),u=yl(m=>m.selectedItemId),f=Yh();return h.useEffect(()=>{if(c.current&&i.current){let m=c.current,x=i.current,g,y=new ResizeObserver(()=>{g=requestAnimationFrame(()=>{let v=m.offsetHeight;x.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return y.observe(m),()=>{cancelAnimationFrame(g),y.unobserve(m)}}},[]),h.createElement(et.div,{ref:Qr(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:f.listId},ey(e,m=>h.createElement("div",{ref:Qr(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),eoe=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:c,...u}=e;return h.createElement(ax,{open:n,onOpenChange:r},h.createElement(sx,{container:c},h.createElement(ox,{"cmdk-overlay":"",className:s}),h.createElement(ix,{"aria-label":e.label,"cmdk-dialog":"",className:i},h.createElement(b6,{ref:t,...u}))))}),toe=h.forwardRef((e,t)=>yl(n=>n.filtered.count===0)?h.createElement(et.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),noe=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...i}=e;return h.createElement(et.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},ey(e,c=>h.createElement("div",{"aria-hidden":!0},c)))}),Rd=Object.assign(b6,{List:Jse,Item:Yse,Input:Qse,Group:Zse,Separator:Xse,Dialog:eoe,Empty:toe,Loading:noe});function roe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function aoe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function S6(e){let t=h.useRef(e);return wc(()=>{t.current=e}),t}var wc=typeof window>"u"?h.useEffect:h.useLayoutEffect;function ku(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function yl(e){let t=oC(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function C6(e,t,n,r=[]){let s=h.useRef(),i=Yh();return wc(()=>{var c;let u=(()=>{var m;for(let x of n){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(m=x.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(Mu,u),s.current=u}),s}var soe=()=>{let[e,t]=h.useState(),n=ku(()=>new Map);return wc(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function ooe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ey({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(ooe(t),{ref:t.ref},n(t.props.children)):n(t)}var ioe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function iC({className:e,...t}){return a.jsx(Rd,{"data-slot":"command",className:se("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function lC({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(Ac,{className:"size-4 shrink-0 opacity-50"}),a.jsx(Rd.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 E6({className:e,...t}){return a.jsx(Rd.List,{"data-slot":"command-list",className:se("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function w6({...e}){return a.jsx(Rd.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function R6({className:e,...t}){return a.jsx(Rd.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 cC({className:e,...t}){return a.jsx(Rd.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 loe(e){const t=coe(e),n=h.forwardRef((r,s)=>{const{children:i,...c}=r,u=h.Children.toArray(i),f=u.find(doe);if(f){const m=f.props.children,x=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,x):null})}return a.jsx(t,{...c,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function coe(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const c=hoe(s),u=foe(i,s.props);return s.type!==h.Fragment&&(u.ref=r?Qr(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 uoe=Symbol("radix.slottable");function doe(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uoe}function foe(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 hoe(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="Popover",[j6]=Er(ty,[No]),Zh=No(),[moe,Ll]=j6(ty),T6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:c=!1}=e,u=Zh(t),f=h.useRef(null),[m,x]=h.useState(!1),[g,y]=ca({prop:r,defaultProp:s??!1,onChange:i,caller:ty});return a.jsx(gd,{...u,children:a.jsx(moe,{scope:t,contentId:er(),triggerRef:f,open:g,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(v=>!v),[y]),hasCustomAnchor:m,onCustomAnchorAdd:h.useCallback(()=>x(!0),[]),onCustomAnchorRemove:h.useCallback(()=>x(!1),[]),modal:c,children:n})})};T6.displayName=ty;var _6="PopoverAnchor",poe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ll(_6,n),i=Zh(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:u}=s;return h.useEffect(()=>(c(),()=>u()),[c,u]),a.jsx(xd,{...i,...r,ref:t})});poe.displayName=_6;var N6="PopoverTrigger",A6=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ll(N6,n),i=Zh(n),c=vt(t,s.triggerRef),u=a.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":k6(s.open),...r,ref:c,onClick:Me(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:a.jsx(xd,{asChild:!0,...i,children:u})});A6.displayName=N6;var uC="PopoverPortal",[goe,xoe]=j6(uC,{forceMount:void 0}),D6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,i=Ll(uC,t);return a.jsx(goe,{scope:t,forceMount:n,children:a.jsx(qr,{present:n||i.open,children:a.jsx(Oc,{asChild:!0,container:s,children:r})})})};D6.displayName=uC;var cd="PopoverContent",O6=h.forwardRef((e,t)=>{const n=xoe(cd,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,i=Ll(cd,e.__scopePopover);return a.jsx(qr,{present:r||i.open,children:i.modal?a.jsx(voe,{...s,ref:t}):a.jsx(boe,{...s,ref:t})})});O6.displayName=cd;var yoe=loe("PopoverContent.RemoveScroll"),voe=h.forwardRef((e,t)=>{const n=Ll(cd,e.__scopePopover),r=h.useRef(null),s=vt(t,r),i=h.useRef(!1);return h.useEffect(()=>{const c=r.current;if(c)return nx(c)},[]),a.jsx(Rh,{as:yoe,allowPinchZoom:!0,children:a.jsx(I6,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Me(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),i.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Me(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:Me(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),boe=h.forwardRef((e,t)=>{const n=Ll(cd,e.__scopePopover),r=h.useRef(!1),s=h.useRef(!1);return a.jsx(I6,{...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()}})}),I6=h.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:x,...g}=e,y=Ll(cd,n),v=Zh(n);return ex(),a.jsx(wh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:a.jsx(Dc,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:x,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>y.onOpenChange(!1),children:a.jsx(Th,{"data-state":k6(y.open),role:"dialog",id:y.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)"}})})})}),M6="PopoverClose",Soe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Ll(M6,n);return a.jsx(et.button,{type:"button",...r,ref:t,onClick:Me(e.onClick,()=>s.onOpenChange(!1))})});Soe.displayName=M6;var Coe="PopoverArrow",Eoe=h.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Zh(n);return a.jsx(_h,{...s,...r,ref:t})});Eoe.displayName=Coe;function k6(e){return e?"open":"closed"}var woe=T6,Roe=A6,joe=D6,Toe=O6;function dC({...e}){return a.jsx(woe,{"data-slot":"popover",...e})}function fC({...e}){return a.jsx(Roe,{"data-slot":"popover-trigger",...e})}function hC({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(joe,{children:a.jsx(Toe,{"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 mC({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,x]=h.useState(""),g=h.useMemo(()=>{const S={};return e.forEach(b=>{const E=b.group??"";Object.prototype.hasOwnProperty.call(S,E)||(S[E]=[]),S[E].push(b)}),S},[e]),y=e.find(S=>S.value===t),v=h.useCallback(S=>{n(S),requestAnimationFrame(()=>{x(""),f(!1)})},[n]);return a.jsxs(dC,{open:u,onOpenChange:f,modal:!0,children:[a.jsx(fC,{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:[y?y.label:r,a.jsx(wS,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(hC,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(iC,{children:[a.jsx(lC,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:x}),a.jsx(w6,{children:s}),Object.entries(g).map(([S,b])=>a.jsx(R6,{heading:S,children:b.map(E=>a.jsxs(cC,{value:E.value,onSelect:()=>{v(E.value)},keywords:[E.label],children:[a.jsx(la,{className:se("mr-2 h-4 w-4",t===E.value?"opacity-100":"opacity-0")}),E.label]},E.value))},S||"default"))]})})]})}function _oe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"service-account-details",children:[a.jsx(Nt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(At,{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($t,{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 Noe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"project-id-details",children:[a.jsx(Nt,{children:"How do I find my Project ID?"}),a.jsxs(At,{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($t,{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 Aoe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"gbq-location-details",children:[a.jsx(Nt,{children:"How do I find my dataset location?"}),a.jsxs(At,{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($t,{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")!==xe.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?LO(i):null;return a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{title:"Connection Settings",children:[a.jsx(yt,{control:e.control,name:"config.projectId",render:({field:u})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),a.jsx(mt,{children:a.jsx(dt,{...u,placeholder:"Enter a Project Id"})}),a.jsx(Jt,{children:a.jsx(Noe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"config.location",render:({field:u})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),a.jsx(mt,{children:a.jsx(mC,{options:JX,value:u.value,onValueChange:u.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(Jt,{children:a.jsx(Aoe,{})}),a.jsx(St,{})]})})]}),a.jsx(Mr,{title:"Authentication",children:a.jsx(yt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(ht,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{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(mt,{children:!t&&c?a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx($t,{href:c.url,children:c.email})}),a.jsx(jt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Ao,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(Jt,{children:a.jsx(_oe,{})}),a.jsx(St,{})]})})})]})};function Ooe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"athena-region-details",children:[a.jsx(Nt,{children:"How do I find my Athena region?"}),a.jsxs(At,{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($t,{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 Ioe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"athena-output-bucket-details",children:[a.jsx(Nt,{children:"How do I find a bucket?"}),a.jsxs(At,{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($t,{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(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"athena-access-key-id-details",children:[a.jsx(Nt,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(At,{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($t,{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(NS,{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($t,{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 koe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"athena-secret-access-key-details",children:[a.jsx(Nt,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(At,{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($t,{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 Loe=({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")!==xe.AWS_ATHENA?null:a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{title:"Connection Settings",children:[a.jsx(yt,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),a.jsx(mt,{children:a.jsx(dt,{...r,placeholder:"Enter a region"})}),a.jsx(Jt,{children:a.jsx(Ooe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"config.outputBucket",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),a.jsx(mt,{children:a.jsx(dt,{...r,placeholder:"Enter an output bucket"})}),a.jsx(Jt,{children:a.jsx(Ioe,{})}),a.jsx(St,{})]})})]}),a.jsxs(Mr,{title:"Authentication",children:[a.jsx(yt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(mt,{children:a.jsx(dt,{...r,placeholder:"Enter an access key id"})}),a.jsx(Jt,{children:a.jsx(Moe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(mt,{children:a.jsx(dt,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(Jt,{children:a.jsx(koe,{})}),a.jsx(St,{})]})})]})]})};function Poe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"snowflake-account-details",children:[a.jsx(Nt,{children:"How do I find my Snowflake account identifier?"}),a.jsxs(At,{children:[a.jsxs("p",{className:"mb-2",children:["To find the region and locator for your account, see"," ",a.jsx($t,{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($t,{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($t,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",children:"OWOX Snowflake documentation"}),"."]})]})]})})}function Uoe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"snowflake-warehouse-details",children:[a.jsx(Nt,{children:"How do I find my Snowflake warehouse?"}),a.jsxs(At,{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 zoe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"snowflake-auth-method-details",children:[a.jsx(Nt,{children:"Which authentication method should I choose?"}),a.jsxs(At,{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($t,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"key pair authentication"}),"."]})]})]})]})]})})}function Foe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"snowflake-username-details",children:[a.jsx(Nt,{children:"How do I find my Snowflake username?"}),a.jsxs(At,{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 Hoe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"snowflake-password-details",children:[a.jsx(Nt,{children:"How do I manage my Snowflake password?"}),a.jsxs(At,{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($t,{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 Voe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"snowflake-keypair-details",children:[a.jsx(Nt,{children:"How do I set up key pair authentication?"}),a.jsxs(At,{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($t,{className:"underline",href:"https://docs.snowflake.com/en/user-guide/key-pair-auth.html",children:"Snowflake's key pair authentication documentation"}),"."]})]})]})})}function $oe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"snowflake-passphrase-details",children:[a.jsx(Nt,{children:"What is a passphrase and when do I need it?"}),a.jsxs(At,{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 Boe=({form:e})=>{const t=e.watch("credentials.authMethod");return e.watch("type")!==xe.SNOWFLAKE?null:a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{title:"Connection Settings",children:[a.jsx(yt,{control:e.control,name:"config.account",render:({field:n})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Enter your Snowflake account identifier",children:"Account"}),a.jsx(mt,{children:a.jsx(dt,{...n,placeholder:"e.g., xy12345.us-east-1"})}),a.jsx(Jt,{children:a.jsx(Poe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"config.warehouse",render:({field:n})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Specify the Snowflake warehouse to use for query execution",children:"Warehouse"}),a.jsx(mt,{children:a.jsx(dt,{...n,placeholder:"Enter warehouse name"})}),a.jsx(Jt,{children:a.jsx(Uoe,{})}),a.jsx(St,{})]})})]}),a.jsxs(Mr,{title:"Authentication",children:[a.jsx(yt,{control:e.control,name:"credentials.authMethod",render:({field:n})=>a.jsxs(ht,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{children:"Authentication Method"}),a.jsx(Wx,{value:n.value,onValueChange:n.onChange,children:a.jsxs(Yx,{children:[a.jsx(Ec,{value:zs.PASSWORD,children:"Username & Password"}),a.jsx(Ec,{value:zs.KEY_PAIR,children:"Key Pair"})]})})]}),a.jsx(Jt,{children:a.jsx(zoe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"credentials.username",render:({field:n})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Your Snowflake username",children:"Username"}),a.jsx(mt,{children:a.jsx(dt,{...n,placeholder:"Enter username"})}),a.jsx(Jt,{children:a.jsx(Foe,{})}),a.jsx(St,{})]})}),t===zs.PASSWORD&&a.jsx(yt,{control:e.control,name:"credentials.password",render:({field:n})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Your Snowflake password",children:"Password"}),a.jsx(mt,{children:a.jsx(dt,{...n,type:"password",placeholder:"Enter password"})}),a.jsx(Jt,{children:a.jsx(Hoe,{})}),a.jsx(St,{})]})}),t===zs.KEY_PAIR&&a.jsxs(a.Fragment,{children:[a.jsx(yt,{control:e.control,name:"credentials.privateKey",render:({field:n})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Paste your private key in PEM format",children:"Private Key"}),a.jsx(mt,{children:a.jsx(Ao,{...n,placeholder:`-----BEGIN PRIVATE KEY-----
819
+ ...
820
+ -----END PRIVATE KEY-----`,rows:6})}),a.jsx(Jt,{children:a.jsx(Voe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"credentials.privateKeyPassphrase",render:({field:n})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Enter the passphrase if your private key is encrypted",children:"Passphrase (Optional)"}),a.jsx(mt,{children:a.jsx(dt,{...n,type:"password",value:n.value??"",placeholder:"Enter passphrase if key is encrypted"})}),a.jsx(Jt,{children:a.jsx($oe,{})}),a.jsx(St,{})]})})]})]})]})};function Goe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"redshift-region-details",children:[a.jsx(Nt,{children:"What is the AWS region?"}),a.jsxs(At,{children:[a.jsx("p",{className:"mb-2",children:"The AWS region is the geographic location where your Redshift cluster or Serverless workgroup is hosted."}),a.jsx("p",{className:"mb-2",children:"Common examples:"}),a.jsxs("ul",{className:"list-inside list-disc space-y-1 text-sm",children:[a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"us-east-1"})," - US East (N. Virginia)"]}),a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"us-west-2"})," - US West (Oregon)"]}),a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"eu-west-1"})," - Europe (Ireland)"]}),a.jsxs("li",{children:[a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"ap-southeast-1"})," - Asia Pacific (Singapore)"]})]}),a.jsxs("p",{className:"mt-2 text-sm",children:["You can find your region in the"," ",a.jsx($t,{className:"underline",href:"https://console.aws.amazon.com/redshift/",children:"AWS Redshift Console"}),"."]})]})]})})}function qoe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"redshift-workgroup-details",children:[a.jsx(Nt,{children:"What is a Redshift Serverless workgroup?"}),a.jsxs(At,{children:[a.jsxs("p",{className:"mb-2",children:["A workgroup is a collection of compute resources in Redshift Serverless. Use this field if you're using ",a.jsx("strong",{children:"Redshift Serverless"}),"."]}),a.jsxs("p",{className:"mb-2",children:["You can find your workgroup name in the"," ",a.jsx($t,{className:"underline",href:"https://console.aws.amazon.com/redshiftv2/home#serverless-dashboard",children:"Redshift Serverless Console"}),"."]}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.jsx("strong",{children:"Note:"})," You must provide either a workgroup name (for Serverless) OR a cluster identifier (for provisioned clusters), but not both."]})]})]})})}function Koe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"redshift-cluster-details",children:[a.jsx(Nt,{children:"What is a cluster identifier?"}),a.jsxs(At,{children:[a.jsxs("p",{className:"mb-2",children:["A cluster identifier is the unique name of your"," ",a.jsx("strong",{children:"provisioned Redshift cluster"}),". Use this field if you're using a traditional Redshift cluster (not Serverless)."]}),a.jsxs("p",{className:"mb-2",children:["You can find your cluster identifier in the"," ",a.jsx($t,{className:"underline",href:"https://console.aws.amazon.com/redshiftv2/home#clusters",children:"Redshift Clusters Console"}),"."]}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.jsx("strong",{children:"Note:"})," You must provide either a cluster identifier (for provisioned clusters) OR a workgroup name (for Serverless), but not both."]})]})]})})}function Woe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"redshift-database-details",children:[a.jsx(Nt,{children:"What is the database name?"}),a.jsxs(At,{children:[a.jsx("p",{className:"mb-2",children:"The database name is the name of the database you want to connect to within your Redshift cluster or workgroup."}),a.jsxs("p",{className:"mb-2",children:["Every Redshift cluster/workgroup has at least one database. The default database is often named ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"dev"}),", but you may have created custom databases."]}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"This field is required for all authentication methods."})]})]})})}function Yoe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"redshift-access-key-details",children:[a.jsx(Nt,{children:"What is an AWS Access Key ID?"}),a.jsxs(At,{children:[a.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS security credentials. It's used together with the Secret Access Key to authenticate AWS API requests."}),a.jsxs("p",{className:"mb-2",children:["Access keys are typically 20 characters long and start with"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"AKIA"})," or"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"ASIA"})," (for temporary credentials)."]}),a.jsxs("p",{className:"text-sm",children:["You can create access keys in the"," ",a.jsx($t,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"AWS IAM Console"}),"."]})]})]})})}function Zoe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"redshift-secret-key-details",children:[a.jsx(Nt,{children:"What is an AWS Secret Access Key?"}),a.jsxs(At,{children:[a.jsx("p",{className:"mb-2",children:"The Secret Access Key is the private part of your AWS security credentials. It's used together with the Access Key ID to sign and authenticate AWS API requests."}),a.jsx("p",{className:"mb-2",children:"Secret Access Keys are typically 40 characters long and are only shown once when created. If you lose it, you'll need to create a new access key pair."}),a.jsxs("p",{className:"text-muted-foreground text-sm",children:[a.jsx("strong",{children:"Security warning:"})," Keep your secret access key secure and never share it publicly. It will be stored encrypted."]})]})]})})}const Xoe=({form:e})=>{const[t,n]=h.useState("");return h.useEffect(()=>{const r=e.getValues("config.connectionType"),s=e.watch("type");r===void 0&&s===xe.AWS_REDSHIFT&&e.setValue("config.connectionType",sr.SERVERLESS,{shouldDirty:!1})},[e]),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")!==xe.AWS_REDSHIFT?null:a.jsxs(a.Fragment,{children:[a.jsxs(Mr,{title:"Connection Settings",children:[a.jsx(yt,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Enter the AWS region where your Redshift service is active",children:"Region"}),a.jsx(mt,{children:a.jsx(dt,{...r,placeholder:"Enter a region"})}),a.jsx(Jt,{children:a.jsx(Goe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"config.database",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"The database name to connect to",children:"Database"}),a.jsx(mt,{children:a.jsx(dt,{...r,placeholder:"Enter database name"})}),a.jsx(Jt,{children:a.jsx(Woe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"config.connectionType",render:({field:r})=>{const s=r.value??sr.SERVERLESS;return a.jsxs(ht,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{tooltip:s===sr.SERVERLESS?"Workgroup name for Redshift Serverless":"Cluster identifier for provisioned Redshift cluster",children:s===sr.SERVERLESS?"Workgroup Name":"Cluster Identifier"}),a.jsx(Wx,{value:s,onValueChange:r.onChange,children:a.jsxs(Yx,{children:[a.jsx(Ec,{value:sr.SERVERLESS,children:"Serverless"}),a.jsx(Ec,{value:sr.PROVISIONED,children:"Provisioned"})]})})]}),a.jsx(mt,{children:s===sr.SERVERLESS?a.jsx(dt,{...e.register("config.workgroupName"),placeholder:"Enter workgroup name"}):a.jsx(dt,{...e.register("config.clusterIdentifier"),placeholder:"Enter cluster identifier"})}),a.jsx(Jt,{children:s===sr.SERVERLESS?a.jsx(qoe,{}):a.jsx(Koe,{})}),a.jsx(St,{})]})}})]}),a.jsxs(Mr,{title:"Authentication",children:[a.jsx(yt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(mt,{children:a.jsx(dt,{...r,placeholder:"Enter an access key id"})}),a.jsx(Jt,{children:a.jsx(Yoe,{})}),a.jsx(St,{})]})}),a.jsx(yt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(mt,{children:a.jsx(dt,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(Jt,{children:a.jsx(Zoe,{})}),a.jsx(St,{})]})})]})]})},Qoe=()=>a.jsx(a.Fragment,{children:a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,className:"mt-2",children:a.jsxs(_t,{value:"snowflake-setup",children:[a.jsx(Nt,{children:"How do I get started with Snowflake?"}),a.jsxs(At,{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($t,{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(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"bigquery-api-details",children:[a.jsx(Nt,{children:"How do I enable the BigQuery API?"}),a.jsxs(At,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx($t,{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 eie(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"athena-api-details",children:[a.jsx(Nt,{children:"How do I activate Athena API?"}),a.jsxs(At,{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($t,{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 tie(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"redshift-storage-details",children:[a.jsx(Nt,{children:"What is AWS Redshift?"}),a.jsxs(At,{children:[a.jsx("p",{className:"mb-2",children:"Amazon Redshift is a fast, fully managed cloud data warehouse that makes it simple and cost-effective to analyze data using standard SQL and existing business intelligence tools."}),a.jsx("p",{className:"mb-2",children:"Redshift supports two deployment options:"}),a.jsxs("ul",{className:"mb-2 list-inside list-disc space-y-1 text-sm",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Redshift Serverless:"})," Automatically scales compute capacity and you only pay for what you use"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Provisioned Clusters:"})," Traditional clusters where you provision and manage compute nodes"]})]}),a.jsxs("p",{className:"text-sm",children:["Learn more in the"," ",a.jsx($t,{className:"underline",href:"https://docs.aws.amazon.com/redshift/latest/mgmt/welcome.html",children:"AWS Redshift Documentation"}),"."]})]})]})})}function nie({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=Do({resolver:Ci(TQ),defaultValues:e}),{watch:i,control:c,formState:{isDirty:u,isSubmitting:f}}=s,m=i("type");ae.useEffect(()=>{r==null||r(u)},[u,r]);const x=async g=>{const{dirtyFields:y}=s.formState,v=kO(g);return y.credentials||delete v.credentials,t(v)};return a.jsx(Dl,{...s,children:a.jsxs(Si,{onSubmit:g=>{s.handleSubmit(x)(g)},noValidate:!0,children:[a.jsxs(Ol,{children:[a.jsxs(Mr,{title:"General",children:[a.jsx(yt,{control:c,name:"title",render:({field:g})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),a.jsx(mt,{children:a.jsx(dt,{...g,placeholder:"Storage title"})}),a.jsx(St,{})]})}),a.jsx(yt,{control:c,name:"type",render:({field:g})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),a.jsx(mt,{children:a.jsxs(fa,{value:g.value,onValueChange:g.onChange,disabled:!!e,children:[a.jsx(ma,{className:"w-full",children:a.jsx(ha,{placeholder:"Select a storage type"})}),a.jsx(pa,{children:a.jsx(Gx,{children:wl.getAllTypes().map(({type:y,displayName:v,icon:S,status:b})=>a.jsx(Gn,{value:y,disabled:b===ni.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(S,{size:20}),v]})},y))})})]})}),a.jsxs(Jt,{children:[m===xe.GOOGLE_BIGQUERY&&a.jsx(Joe,{}),m===xe.AWS_ATHENA&&a.jsx(eie,{}),m===xe.SNOWFLAKE&&a.jsx(Qoe,{}),m===xe.AWS_REDSHIFT&&a.jsx(tie,{})]}),a.jsx(St,{})]})})]}),m===xe.GOOGLE_BIGQUERY&&a.jsx(Doe,{form:s}),m===xe.AWS_ATHENA&&a.jsx(Loe,{form:s}),m===xe.SNOWFLAKE&&a.jsx(Boe,{form:s}),m===xe.AWS_REDSHIFT&&a.jsx(Xoe,{form:s})]}),a.jsxs(Uc,{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 zc(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 L6({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=qx();kl(e);const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:x}=zc(t),g=async v=>{if(n){const S=await s(n.id,v);S&&(r(S),x())}},y=h.useRef(!1);return h.useEffect(()=>{const v=n?"Edit":"Create";e&&!y.current?(De({event:"data_storage_config_open",category:"DataStorage",action:v,label:n==null?void 0:n.type}),y.current=!0):!e&&y.current&&(De({event:"data_storage_config_close",category:"DataStorage",action:v,label:n==null?void 0:n.type}),y.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(mi,{open:e,onOpenChange:v=>{v||u()},children:a.jsxs(pi,{children:[a.jsxs(gi,{children:[a.jsx(xi,{children:"Configure Storage Provider"}),a.jsx(bl,{children:"Customize settings for your storage provider"})]}),a.jsx(nie,{initialData:n??void 0,onSubmit:g,onCancel:u,onDirtyChange:m})]})}),a.jsx(Cr,{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 rie=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=h.useState(!1),s=wl.getInfo(e.type),i=()=>{r(!0)},c=()=>{r(!1)},u=()=>{const f=bO(e);if(De({event:"data_storage_configuration_loaded",category:"DataMart",action:f?"ValidStorage":"InvalidStorage",label:e.type}),!f)return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(Eh,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(g,y)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:y})]}),x=(g,y,v)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[g,":"]})," ",a.jsx($t,{href:v,onClick:S=>{S.stopPropagation()},children:y})]});switch(e.type){case xe.GOOGLE_BIGQUERY:{const g=e.config.projectId,y=e.config.location,v=`https://console.cloud.google.com/bigquery?project=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[x("Project ID",g,v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",y)]})}case xe.AWS_ATHENA:{const g=e.config.region,y=e.config.outputBucket,v=`https://s3.console.aws.amazon.com/s3/buckets/${y}?region=${g}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",g),a.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Bucket",y,v)]})}case xe.SNOWFLAKE:{const g=e.config.account,y=e.config.warehouse;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[x("Account",g,"https://app.snowflake.com/"),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Warehouse",y)]})}case xe.AWS_REDSHIFT:{const g=e.config,y=g.region,v=g.database;let S,b;g.connectionType===sr.SERVERLESS?(S=g.workgroupName,b="Workgroup"):(S=g.clusterIdentifier,b="Cluster");const E=`https://${y}.console.aws.amazon.com/redshiftv2/home?region=${y}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",y),a.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Database",v),a.jsx("span",{className:"text-muted-foreground",children:"•"}),x(b,S,E)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(Bb,{title:e.title,icon:s.icon,subtitle:u(),onClick:i}),a.jsx(K2,{children:a.jsx(L6,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function aie({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(Aa,{className:"text-foreground",children:"Definition Type"}),a.jsxs(fa,{value:n??"",onValueChange:u=>{s(u)},children:[a.jsx(ma,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:a.jsx(ha,{placeholder:"Select definition type",children:n&&((c=i.find(u=>u.type===n))==null?void 0:c.label)})}),a.jsx(pa,{children:a.jsx(Gx,{children:i.map(u=>a.jsxs(Gn,{value:u.type,children:[u.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:u.description})]},u.type))})})]})]})}const sie=en({definitionType:pr($e.SQL),definition:en({sqlQuery:gt().min(1,"SQL query is required")})}),oie=e=>{const t=BO(e);return en({definitionType:pr($e.TABLE),definition:t})},iie=e=>{const t=BO(e);return en({definitionType:pr($e.VIEW),definition:t})},lie=e=>{const t=GJ(e);return en({definitionType:pr($e.TABLE_PATTERN),definition:t})},cie=en({definitionType:pr($e.CONNECTOR),definition:en({connector:en({source:en({name:gt().min(1,"Connector name is required"),configuration:bb(TY(RY())).min(1,"At least one configuration is required"),node:gt().min(1,"Node is required"),fields:bb(gt()).min(1,"At least one field is required")}),storage:en({fullyQualifiedName:gt().min(1,"fully qualified name is required")})})})}),uie=(e,t)=>{if(!e)return en({definitionType:_Y(Tx($e)),definition:en({}).optional()});switch(e){case $e.SQL:return sie;case $e.TABLE:return oie(t);case $e.VIEW:return iie(t);case $e.TABLE_PATTERN:return lie(t);case $e.CONNECTOR:return cie;default:return en({})}};function die({control:e}){return a.jsx(yt,{control:e,name:"definition.sqlQuery",render:({field:t})=>a.jsxs(ht,{className:"dm-card-block",children:[a.jsx(ut,{className:"text-foreground",children:"SQL Query"}),a.jsx(mt,{children:a.jsx(Pse,{initialValue:t.value?{sqlQuery:t.value}:void 0,onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(St,{})]})})}function fie({control:e,storageType:t}){const n=jO(t),r=TO(t);return a.jsx(yt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(ht,{className:"dm-card-block",children:[a.jsx(ut,{children:"Fully Qualified Table Name"}),a.jsx(mt,{children:a.jsx(dt,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(Jt,{className:"text-muted-foreground/75",children:r}),a.jsx(St,{})]})})}function hie({control:e,storageType:t}){const n=jO(t),r=TO(t);return a.jsx(yt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>a.jsxs(ht,{className:"dm-card-block",children:[a.jsx(ut,{children:"Fully Qualified View Name"}),a.jsx(mt,{children:a.jsx(dt,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(Jt,{className:"text-muted-foreground/75",children:r}),a.jsx(St,{})]})})}function mie({control:e,storageType:t}){const n=LQ(t),r=PQ(t);return a.jsx(yt,{control:e,name:"definition.pattern",render:({field:s})=>a.jsxs(ht,{className:"dm-card-block",children:[a.jsx(ut,{children:"Table Pattern"}),a.jsx(mt,{children:a.jsx(dt,{placeholder:n,value:s.value,onChange:s.onChange,className:"dm-card-formcontrol"})}),a.jsx(Jt,{className:"text-muted-foreground/75",children:r}),a.jsx(St,{})]})})}const pC=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{}}},pie=_c("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 gC({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:se(pie({variant:t}),e),...n})}function P6({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 xC({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 gie({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:i}){return n?a.jsx(eC,{variant:"grid"}):r?a.jsxs(gC,{variant:"destructive",children:[a.jsx(Sh,{className:"h-4 w-4"}),a.jsx(xC,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(ii,{children:[a.jsx(ri,{title:"Choose Connector",children:a.jsx(eae,{children:e.map(c=>a.jsx(tae,{icon:c.logoBase64?a.jsx(Mc,{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(go,{icon:a.jsx(Jf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function xie({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:i,onBack:c,onFinish:u,nextLabel:f="Next",backLabel:m="Back",finishLabel:x="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:x})}):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(YP,{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:x}):a.jsxs(we,{variant:"default",onClick:i,disabled:!n||s,children:[f,a.jsx(Da,{className:"h-4 w-4"})]})})]})}function uc({connector:e,size:t=24,variant:n="compact"}){return a.jsx(go,{icon:a.jsx(Mc,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function Yu({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(Xr,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(ci,{className:"h-4 w-4"})]})})})}const Kb="**********";function yie({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(dt,{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(Aa,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(aa,{htmlFor:c,required:e.required,tooltip:e.description,children:i})})]})}function vie({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(dt,{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 bie({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:i}=e,c=e.title??e.name;return a.jsx(Ao,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
821
+ `):Array.isArray(i)?i.join(`
822
+ `):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:u=>{const f=u.target.value.split(`
823
+ `).filter(m=>m.trim());n(r,f)}})}function Sie({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 x=new Date(m);return isNaN(x.getTime())?"":x.toISOString().split("T")[0]}catch{return""}};return a.jsx(dt,{id:r,name:r,type:"date",value:t[r]||u(i)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function Cie({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,i=e.title??e.name;return a.jsx(dt,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${i.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function Eie({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:i,default:c}=e;return a.jsx(Ao,{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 wie({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const i=e.title??e.name,c=r&&!s;return a.jsx(dt,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?Kb: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 Rie({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(mC,{options:f,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:i??`Select ${u.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function jie(){const e=h.useRef(new $f),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 Df=null;function Tie({appId:e,scope:t,onSuccess:n,onError:r,disabled:s=!1,children:i}){const[c,u]=h.useState(!1),[f,m]=h.useState(!1),[x,g]=h.useState(null);h.useEffect(()=>{if(window.FB){m(!0);return}if(document.getElementById("facebook-jssdk")){const E=setInterval(()=>{window.FB&&(m(!0),clearInterval(E))},100);return()=>{clearInterval(E)}}if(!e)return;if(Df&&Df!==e){console.warn("Facebook SDK already initialized with different appId");return}Df??(Df=e),window.fbAsyncInit=function(){window.FB&&Df&&(window.FB.init({appId:Df,cookie:!0,xfbml:!0,version:"v23.0"}),m(!0))};const b=document.createElement("script");b.id="facebook-jssdk",b.src="https://connect.facebook.net/en_US/sdk.js",b.async=!0,b.defer=!0,b.crossOrigin="anonymous",document.body.appendChild(b)},[e]);const y=()=>{if(!window.FB||!f){const b=new Error("Facebook SDK not loaded or not ready");g(b.message),r==null||r(b);return}u(!0),g(null),window.FB.login(b=>{var E;if(b.status==="connected"&&b.authResponse){const{accessToken:R,expiresIn:j,userID:_}=b.authResponse;(E=window.FB)==null||E.api("/me?fields=name,email",D=>{const O={accessToken:R,expiresIn:j,userID:_,userName:D.name,userEmail:D.email};n(O),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,S=()=>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:y,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"})}),S()]}),x&&a.jsx("div",{className:"mt-1 text-xs text-red-600",children:x})]})}function _ie({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(Tie,{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 U6({specification:e,option:t,configuration:n,onValueChange:r,connectorName:s,onSecretEditToggle:i,secretEditing:c={},isEditingExisting:u=!1}){const[f,m]=h.useState(!1),[x,g]=h.useState(null),[y,v]=h.useState(null),[S,b]=h.useState(null),E=h.useMemo(()=>{const B=n[e.name],q=t!=null&&t.value&&B?B[t.value]:B;return q==null?void 0:q._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 q=B[t.value];return q&&typeof q=="object"&&!Array.isArray(q)?q:{}}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(V=>V in B&&B[V]!==void 0&&B[V]!==""))},[j,t]),[D,O]=h.useState(_);h.useEffect(()=>{const B="_source_credential_id"in j,q=(t==null?void 0:t.items)&&Object.keys(t.items).some(V=>V in j&&j[V]!==void 0&&j[V]!=="");B&&D?O(!1):q&&!D&&O(!0)},[j,t,D]);const A=(B,q)=>{if(!(t!=null&&t.value))return;const V=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...V,[t.value]:{...typeof V[t.value]=="object"&&V[t.value]!==null?V[t.value]:{},[B]:q}})},{checkStatus:T,getSettings:M,exchangeCredentials:k}=jie(),z=async B=>{try{m(!0),b(null);const q=await k(s,B,R),V=n[e.name];t?r(e.name,{...V,[t.value]:{_source_credential_id:q.credentialId}}):r(e.name,{_source_credential_id:q.credentialId})}catch(q){const V=q instanceof Error?q.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",q),b(V)}finally{m(!1)}};h.useEffect(()=>{if(!E){g(null),m(!1);return}let B=!1;return(async()=>{try{m(!0);const V=await T(s,E);B||g(V)}catch(V){B||(console.error("Failed to validate credentials:",V),g({valid:!1}))}finally{B||m(!1)}})(),()=>{B=!0}},[E,s,T]),h.useEffect(()=>{(async()=>{try{const q=await M(s,R);v(q)}catch(q){console.error("Failed to fetch settings:",q),v(null)}})()},[s,R,M]);const L=!!(y!=null&&y.isEnabled);if((D||!L)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([B,q])=>{const V=Array.isArray(q.attributes)?q.attributes.includes("SECRET")&&j[B]!==void 0:!1,I=c[e.name]??!1;return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(aa,{htmlFor:B,required:q.required,tooltip:q.description,className:"mb-2 justify-start",children:q.title??B}),V&&u&&i&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!I)},children:I?"Cancel":"Edit"})]}),yC({specification:{...q,name:B},configuration:j,onValueChange:(K,$)=>{A(K,$)},flags:{isEditingExisting:u,isSecret:V,isSecretEditing:I},connectorName:s})]},B)}),L&&a.jsx(we,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),O(!1),m(!1)},className:"px-0",children:"Back to OAuth"})]});const G=(()=>{switch(s){case"FacebookMarketing":return a.jsx(_ie,{isLoading:f,status:x,settings:y,onOAuthSuccess:z});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[G,S&&a.jsx("div",{className:"text-destructive text-sm",children:S}),(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]:{}}),O(!0)},className:"px-0",children:"Manually"})]})}function yC({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(U6,{specification:e,configuration:t,onValueChange:n,connectorName:s});if(u)return a.jsx(wie,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:m});if(c&&c.length>0)return a.jsx(Rie,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(i){case Ms.BOOLEAN:return a.jsx(yie,{specification:e,configuration:t,onValueChange:n});case Ms.NUMBER:return a.jsx(vie,{specification:e,configuration:t,onValueChange:n});case Ms.ARRAY:return a.jsx(bie,{specification:e,configuration:t,onValueChange:n});case Ms.OBJECT:return a.jsx(Eie,{specification:e,configuration:t,onValueChange:n});case Ms.DATE:return a.jsx(Sie,{specification:e,configuration:t,onValueChange:n});case Ms.STRING:default:return a.jsx(Cie,{specification:e,configuration:t,onValueChange:n})}}function Nie({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:i,onSecretEditToggle:c,connectorName:u}){return a.jsxs(io,{children:[e.requiredType!==Ms.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(aa,{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"})]}),yC({specification:e,configuration:t,onValueChange:i,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r},connectorName:u})]},e.name)}function Aie({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:i,connectorName:c}){const u=h.useMemo(()=>{var v,S;const y=t[e.name];if(y&&typeof y=="object"){const b=Object.keys(y);if(b.length>0)return b[0]}return((S=(v=e.oneOf)==null?void 0:v[0])==null?void 0:S.value)??""},[t,e.name,e.oneOf]),[f,m]=h.useState(u);if(h.useEffect(()=>{m(u)},[u]),h.useEffect(()=>{if(f){const y=t[e.name];y&&typeof y=="object"&&f in y||n(e.name,{[f]:{}})}},[f,e.name]),!e.oneOf)return null;const x=y=>{m(y)},g=(y,v,S)=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[y]:{...typeof b[y]=="object"&&b[y]!==null?b[y]:{},[v]:S}})};return a.jsx(Jre,{label:e.title??e.name,options:e.oneOf.map(y=>({value:y.value,label:y.label})),value:f,onValueChange:x,children:e.oneOf.map(y=>{const v=y.attributes&&Array.isArray(y.attributes)&&y.attributes.includes("OAUTH_FLOW");return a.jsx(Hre,{value:y.value,children:v?a.jsx(U6,{specification:e,option:y,configuration:t,onValueChange:n,connectorName:c,onSecretEditToggle:i,secretEditing:{[e.name]:s},isEditingExisting:r}):Object.entries(y.items).map(([S,b])=>{const E=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},R=Array.isArray(b.attributes)&&Object.keys(E)[0]===y.value?b.attributes.includes("SECRET"):!1,j=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},_=typeof j[y.value]=="object"&&j[y.value]!==null?j[y.value]:{};return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(aa,{htmlFor:S,required:b.required,tooltip:b.description,className:"mb-2 justify-start",children:S}),R&&r&&a.jsx(we,{variant:"ghost",size:"sm",type:"button",onClick:()=>{i(e.name,!s)},children:s?"Cancel":"Edit"})]}),yC({specification:{...b,name:S},configuration:_,onValueChange:(D,O)=>{g(y.value,D,O)},flags:{isEditingExisting:r,isSecret:R,isSecretEditing:s},connectorName:c})]},S)})},y.value)})},e.name)}function uN(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===Ms.OBJECT?a.jsx(Aie,{specification:u,configuration:t,onValueChange:n,isEditingExisting:i,isSecretEditing:m,onSecretEditToggle:r,connectorName:c},u.name):a.jsx(Nie,{specification:u,configuration:t,isEditingExisting:i,isSecret:f,isSecretEditing:m,onValueChange:n,onSecretEditToggle:r,connectorName:c},u.name)})}function dN({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:i,isEditingExisting:c,connectorName:u}){return e?a.jsx(BI,{title:e,children:uN(t,n,r,s,i,c,u)}):uN(t,n,r,s,i,c,u)}function Die({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 y=await Tn.getDataMartsByConnectorName(e);s(y)}catch{s([])}finally{c(!1)}},[e]);h.useEffect(()=>{u&&m()},[u,m]);const x=(y,v)=>{const S=v._id;if(!S){console.error("Configuration does not have _id field");return}t({dataMartId:y.id,dataMartTitle:y.title,configId:S,configuration:v}),f(!1)},g=y=>{const S=[],b=R=>{if(!n)return!0;const j=n.find(_=>_.name===R);return(j==null?void 0:j.required)??!1},E=(R,j,_=0,D=!0)=>{if(R.startsWith("_")||D&&_===0&&!b(R))return;let O=null;if(j==null)O="N/A";else if(typeof j=="string")O=j;else if(typeof j=="number"||typeof j=="boolean")O=String(j);else if(Array.isArray(j))O=JSON.stringify(j);else if(typeof j=="object"){S.push({key:R,value:"{",indent:_}),Object.entries(j).forEach(([A,T])=>{E(A,T,_+1,!1)}),S.push({key:"",value:"}",indent:_});return}else O=JSON.stringify(j);S.push({key:R,value:O,indent:_})};for(const[R,j]of Object.entries(y))E(R,j);return a.jsx("div",{className:"space-y-1 font-mono text-xs",children:S.map(({key:R,value:j,indent:_},D)=>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})]},D))})};return a.jsx(Xa,{children:a.jsxs(wr,{open:u,onOpenChange:f,children:[a.jsx(Rr,{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(Da,{className:se("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",u&&"rotate-90")})]})}),a.jsx(jr,{side:"bottom",align:"end",className:"w-72",children:i?a.jsx(Tt,{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(bz,{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(y=>{const S=y.definition.connector.source.configuration;return S.length===0?null:S.length===1?a.jsxs(wt,{delayDuration:300,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs(Tt,{onSelect:()=>{x(y,S[0])},children:[a.jsx(sg,{className:"text-foreground h-4 w-4"}),y.title]})}),a.jsx(jt,{side:"right",className:"max-w-sm",children:g(S[0])})]},y.id):a.jsxs(yx,{children:[a.jsxs(vx,{className:"flex items-center gap-2",children:[a.jsx(sg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:y.title})]}),a.jsx(bx,{children:S.map((b,E)=>a.jsxs(wt,{delayDuration:300,children:[a.jsx(Rt,{asChild:!0,children:a.jsxs(Tt,{onSelect:()=>{x(y,b)},children:["Configuration ",E+1]})}),a.jsx(jt,{side:"right",className:"max-w-sm",children:g(b)})]},E))})]},y.id)})})]})})]})})}function fN({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),x=h.useRef(!1),[g,y]=h.useState({});h.useEffect(()=>{if(t){x.current=!0;const A={...s??{}};t.forEach(T=>{const M=Array.isArray(T.attributes)?T.attributes.includes("SECRET"):!1;A[T.name]===void 0&&T.default!==void 0&&(A[T.name]=T.default),c&&M&&(A[T.name]=Kb)}),f(A),m.current=!0,setTimeout(()=>{x.current=!1},0)}},[t,s,c]),h.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(x.current=!0,f({...s}),setTimeout(()=>{x.current=!1},0))},[s]),h.useEffect(()=>{m.current&&!x.current&&Object.keys(u).length>0&&(n==null||n(u))},[u,n]);const v=(A,T)=>{f(M=>({...M,[A]:T}))},S=h.useCallback(A=>!(A==null||typeof A=="string"&&A.trim()===""||typeof A=="number"&&isNaN(A)||Array.isArray(A)&&A.length===0),[]),b=h.useCallback((A,T)=>{var k,z;if(typeof A!="object"||A===null)return S(A);if((k=T.attributes)!=null&&k.includes("OAUTH_FLOW")&&"_source_credential_id"in A)return!0;const M=(z=T.oneOf)==null?void 0:z.filter(L=>L.value===Object.keys(A)[0]);return M?M.every(L=>{var G;if((G=L.attributes)!=null&&G.includes("OAUTH_FLOW")){const B=A[L.value];if(typeof B=="object"&&B!==null){if("_source_credential_id"in B)return!0;const q=Object.entries(L.items).filter(([,V])=>V.required);if(q.length>0)return q.every(([V])=>{const I=B[V];return S(I)})}return!1}return Object.entries(L.items).every(([,B])=>L.value in A?b(A[L.value],B):!1)}):S(A[T.name])},[S]),E=h.useCallback((A,T)=>{const M=T.filter(G=>G.required&&G.oneOf),k=M.length===0?!0:M.some(G=>b(A[G.name],G)),L=T.filter(G=>G.required&&G.name!=="Fields").every(G=>S(A[G.name]));return k&&L},[S,b]),R=(A,T)=>{y(M=>({...M,[A]:T})),f(T?M=>({...M,[A]:""}):M=>({...M,[A]:Kb}))},j=A=>{const T={...u};Object.entries(A.configuration).forEach(([M,k])=>{["_id","_copiedFrom"].includes(M)||(T[M]=k)}),T._copiedFrom={dataMartId:A.dataMartId,dataMartTitle:A.dataMartTitle,configId:A.configId},f(T)};if(h.useEffect(()=>{if(t&&r){const A=E(u,t);r(A)}},[u,t,r,E]),i)return a.jsx(eC,{variant:"list"});if(!t||t.length===0)return a.jsxs(ii,{children:[a.jsx(uc,{connector:e}),a.jsx(go,{icon:a.jsx(Jf,{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(Yu,{label:"Need configuration?"})]});const _=[...t].filter(A=>{var T;return A.name!=="Fields"&&!((T=A.attributes)!=null&&T.includes("HIDE_IN_CONFIG_FORM"))}).sort((A,T)=>{const M=k=>{const z=k.default!=null&&k.default!=="";return k.required&&!z?1:k.required&&z?2:!k.required&&!z?3:4};return M(A)-M(T)}),D=_.filter(A=>{var T;return!((T=A.attributes)!=null&&T.includes("ADVANCED"))}),O=_.filter(A=>{var T;return(T=A.attributes)==null?void 0:T.includes("ADVANCED")});return a.jsx(a.Fragment,{children:a.jsxs(ii,{children:[a.jsx(uc,{connector:e}),a.jsxs(ri,{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(Die,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),D.length>0&&a.jsx(dN,{items:D,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name}),O.length>0&&a.jsx(dN,{collapsibleTitle:"Advanced Settings",items:O,configuration:u,onValueChange:v,onSecretEditToggle:R,secretEditing:g,isEditingExisting:c,connectorName:e.name})]})]})})}function Oie({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(eC,{variant:"list"}):!t||t.length===0?a.jsxs(ii,{children:[a.jsx(uc,{connector:e}),a.jsx(go,{icon:a.jsx(Jf,{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(Yu,{label:"Missing some data?"})]}):a.jsxs(ii,{children:[a.jsx(uc,{connector:e}),a.jsxs(ri,{title:c,children:[a.jsx(GI,{children:t.map(u=>a.jsx(qI,{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(Xr,{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(Da,{className:"h-3 w-3"})]})]}),selected:n===u.name},u.name))}),a.jsx(Yu,{label:"Missing some data?"})]})]})}var lo=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(lo||{});function hN({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const i=h.useRef(null),[c,u]=h.useState(""),[f,m]=h.useState(lo.ORIGINAL),x=t==null?void 0:t.find(R=>R.name===n),g=h.useMemo(()=>(x==null?void 0:x.fields)??[],[x==null?void 0:x.fields]),y=h.useMemo(()=>(x==null?void 0:x.uniqueKeys)??[],[x==null?void 0:x.uniqueKeys]),v=h.useMemo(()=>{const R=new Map;return g.forEach((j,_)=>R.set(j.name,_)),R},[g]),S=h.useMemo(()=>{const R=g.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),j=(_,D)=>{const O=y.includes(_.name),A=y.includes(D.name);if(O&&!A)return-1;if(!O&&A)return 1;if(f===lo.ASC)return _.name.localeCompare(D.name);if(f===lo.DESC)return D.name.localeCompare(_.name);const T=v.get(_.name)??0,M=v.get(D.name)??0;return T-M};return[...R].sort(j)},[g,c,y,f,v]),b=g.map(R=>R.name),E=r.filter(R=>b.includes(R)).length;return h.useEffect(()=>{if(y.length>0){const R=y.filter(j=>g.some(_=>_.name===j)&&!r.includes(j));R.length>0&&R.forEach(j=>{s(j,!0)})}},[n,y,g,r,s]),h.useEffect(()=>{const R=j=>{const D=(j.ctrlKey||j.metaKey)&&j.shiftKey&&j.key.toLowerCase()==="a",O=document.activeElement.tagName;if(!(O==="INPUT"||O==="TEXTAREA")&&D){j.preventDefault();const A=g.map(k=>k.name),M=A.filter(k=>!r.includes(k)).length>0;A.forEach(k=>{s(k,M)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[g,r,s]),!n||!t?a.jsxs(ii,{children:[a.jsx(uc,{connector:e}),a.jsx(go,{icon:a.jsx(Jf,{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(Yu,{label:"Need fields?"})]}):g.length?a.jsx(ii,{children:a.jsxs(a.Fragment,{children:[a.jsx(uc,{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(Ac,{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(hc,{className:"h-4 w-4"})})]}),a.jsxs(wr,{children:[a.jsx(Rr,{asChild:!0,children:a.jsxs(we,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===lo.ASC&&a.jsx(dT,{className:"text-muted-foreground h-4 w-4"}),f===lo.DESC&&a.jsx(uT,{className:"text-muted-foreground h-4 w-4"}),f===lo.ORIGINAL&&a.jsx(fT,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(jr,{align:"end",children:[a.jsxs(Tt,{onSelect:()=>{m(lo.ASC)},children:[a.jsx(dT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(Tt,{onSelect:()=>{m(lo.DESC)},children:[a.jsx(uT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(Tt,{onSelect:()=>{m(lo.ORIGINAL)},children:[a.jsx(fT,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(ri,{title:`Selected ${String(E)} of ${String(b.length)} fields for "${n}" data`,children:[a.jsxs(GI,{children:[S.map(R=>{const j=y.includes(R.name);return a.jsx(qI,{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(Q1,{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(Q1,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),S.length===0&&c&&a.jsxs("div",{className:"text-muted-foreground p-8 text-center text-sm",children:['No fields match "',c,'"']})]}),a.jsx(Yu,{label:"Need another field?"})]})]})}):a.jsxs(ii,{children:[a.jsx(uc,{connector:e}),a.jsx(go,{icon:a.jsx(Jf,{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(Yu,{label:"Need fields?"})]})}const z6=h.createContext(void 0),F6={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Iie(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 F6;default:return e}}class Mie extends El{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 fo=new Mie;var Fn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(Fn||{});const ll={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class Wb{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 ei.getReportById(n.reportId),s=rc(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 kie{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 _1={getMapper(e){switch(e){case Fn.REPORT_RUN:return new Wb;case Fn.CONNECTOR_RUN:return new kie;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Of={mapFromDto(e){return _1.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 Wb().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 Wb,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 _1.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return _1.getMapper(e.type).mapToUpdateRequest(e)}};function Lie({children:e}){const[t,n]=h.useReducer(Iie,F6),{dataMart:r}=Rs(),{fetchAvailableConnectors:s}=Pc();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 S=await fo.getScheduledTriggers(v),b=await Of.mapFromDtoListWithReportData(S,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:b})}catch(S){const b=S instanceof Error?S.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:b}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:b})}},[r,s]),c=h.useCallback(async(v,S)=>{n({type:"FETCH_TRIGGERS_START"});try{const E=(await fo.getScheduledTriggers(v)).filter(j=>j.type===S),R=await Of.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(b){const E=b instanceof Error?b.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:E}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:E})}},[r]),u=h.useCallback(async(v,S)=>{n({type:"FETCH_TRIGGER_START"});try{const b=await fo.getScheduledTrigger(v,S),E=await Of.mapFromDtoWithReportData(b,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:E})}catch(b){const E=b instanceof Error?b.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:E}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:E})}},[r]),f=h.useCallback(async(v,S,b,E,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:S,cronExpression:b,timeZone:E,isActive:R,triggerConfig:j},D=await fo.createScheduledTrigger(v,_),O=await Of.mapFromDtoWithReportData(D,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:O}),De({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:S}),_n.success("Trigger created"),O}catch(_){const D=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:D}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:D}),_}},[r]),m=h.useCallback(async(v,S,b,E,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:b,timeZone:E,isActive:R},_=await fo.updateScheduledTrigger(v,S,j),D=await Of.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:D}),De({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:D.type}),_n.success("Trigger updated")}catch(j){const _=j instanceof Error?j.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),j}},[r]),x=h.useCallback(async(v,S)=>{n({type:"DELETE_TRIGGER_START"});try{await fo.deleteScheduledTrigger(v,S),n({type:"DELETE_TRIGGER_SUCCESS",payload:S}),De({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:S}),_n.success("Trigger deleted")}catch(b){const E=b instanceof Error?b.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:E}),De({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:E}),b}},[]),g=h.useCallback(v=>{n({type:"SELECT_TRIGGER",payload:v})},[]),y=h.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(z6.Provider,{value:{...t,getScheduledTriggers:i,getScheduledTriggersByType:c,getScheduledTrigger:u,createScheduledTrigger:f,updateScheduledTrigger:m,deleteScheduledTrigger:x,selectScheduledTrigger:g,reset:y},children:e})}function H6(){const e=h.useContext(z6);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function Pie(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:i,deleteScheduledTrigger:c,selectScheduledTrigger:u,reset:f,triggers:m,selectedTrigger:x,isLoading:g,error:y}=H6();return h.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:m,selectedTrigger:x,isLoading:g,error:y,getScheduledTriggers:v=>t(v),getScheduledTriggersByType:(v,S)=>n(v,S),getScheduledTrigger:(v,S)=>r(v,S),createScheduledTrigger:(v,S,b,E,R,j)=>s(v,S,b,E,R,j),updateScheduledTrigger:(v,S,b,E,R)=>i(v,S,b,E,R),deleteScheduledTrigger:(v,S)=>c(v,S),selectScheduledTrigger:u}}const Uie=en({type:pr(ll.SCHEDULED_REPORT_RUN),reportId:gt().min(1,"Report ID is required")}),zie=wY(),Fie=en({type:Tx(Fn),cronExpression:gt().min(1,"Cron expression is required"),timeZone:gt().min(1,"Time zone is required"),isActive:EY(),triggerConfig:jY([Uie,zie])});function Hie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=Do({resolver:Ci(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:ll.SCHEDULED_REPORT_RUN,reportId:t??""}}});h.useEffect(()=>{t&&s.getValues("type")===Fn.REPORT_RUN&&s.setValue("triggerConfig",{type:ll.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),h.useEffect(()=>{n&&(s.setValue("type",n),n===Fn.REPORT_RUN?s.setValue("triggerConfig",{type:ll.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:ll.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 Vie=[Oe.GOOGLE_SHEETS,Oe.EMAIL,Oe.SLACK,Oe.MS_TEAMS,Oe.GOOGLE_CHAT];function $ie({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=ns(),{dataMart:i}=Rs();h.useEffect(()=>{i&&s(i.id)},[s,i]);const c=r.filter(u=>Vie.includes(u.dataDestination.type));return a.jsxs(fa,{value:e,onValueChange:t,disabled:n,children:[a.jsx(ma,{className:"w-full",children:a.jsx(ha,{placeholder:"Select a report"})}),a.jsx(pa,{children:c.map(u=>{const f=oa.getInfo(u.dataDestination.type).icon;return a.jsx(Gn,{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 ny="Switch",[Bie]=Er(ny),[Gie,qie]=Bie(ny),V6=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f="on",onCheckedChange:m,form:x,...g}=e,[y,v]=h.useState(null),S=vt(t,_=>v(_)),b=h.useRef(!1),E=y?x||!!y.closest("form"):!0,[R,j]=ca({prop:s,defaultProp:i??!1,onChange:m,caller:ny});return a.jsxs(Gie,{scope:n,checked:R,disabled:u,children:[a.jsx(et.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":q6(R),"data-disabled":u?"":void 0,disabled:u,value:f,...g,ref:S,onClick:Me(e.onClick,_=>{j(D=>!D),E&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),E&&a.jsx(G6,{control:y,bubbles:!b.current,name:r,value:f,checked:R,required:c,disabled:u,form:x,style:{transform:"translateX(-100%)"}})]})});V6.displayName=ny;var $6="SwitchThumb",B6=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=qie($6,n);return a.jsx(et.span,{"data-state":q6(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});B6.displayName=$6;var Kie="SwitchBubbleInput",G6=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const c=h.useRef(null),u=vt(c,i),f=G2(n),m=HS(t);return h.useEffect(()=>{const x=c.current;if(!x)return;const g=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(g,"checked").set;if(f!==n&&v){const S=new Event("click",{bubbles:r});v.call(x,n),x.dispatchEvent(S)}},[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}})});G6.displayName=Kie;function q6(e){return e?"checked":"unchecked"}var Wie=V6,Yie=B6;function vC({className:e,...t}){return a.jsx(Wie,{"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(Yie,{"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 Zie(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 Yb(e,t="UTC"){const n=Zie(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),x=!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:x,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(y=>Number.parseInt(y.trim())).filter(y=>!isNaN(y)&&y>=0&&y<=6);if(g.length>0)return{type:"weekly",time:x,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(y=>Number.parseInt(y.trim())).filter(y=>!isNaN(y)&&y>=1&&y<=31);if(g.length>0)return{type:"monthly",time:x,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 K6({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 y=t.includes(g)?t.filter(v=>v!==g):[...t,g].sort((v,S)=>v-S);n(y)},m=(g,y)=>{y.preventDefault(),y.stopPropagation(),n(t.filter(v=>v!==g))},x=()=>{if(t.length===0)return a.jsx("span",{className:"text-muted-foreground text-sm",children:r});const g=t.map(y=>e.find(v=>v.value===y)).filter(Boolean);return g.length<=i?a.jsx("div",{className:"flex flex-wrap gap-1",children:g.map(y=>a.jsxs(Dr,{variant:"secondary",className:"h-5 text-xs",children:[y.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(y.value,v),children:a.jsx(hc,{className:"h-2 w-2"})})]},y.value))}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(Dr,{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:y=>m(g[0].value,y),children:a.jsx(hc,{className:"h-2 w-2"})})]}),g.length>1&&a.jsxs(Dr,{variant:"outline",className:"h-5 text-xs",children:["+",g.length-1]})]})};return a.jsxs(dC,{open:c,onOpenChange:u,modal:!0,children:[a.jsx(fC,{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:x()}),a.jsx(wS,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx(hC,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(iC,{className:"h-full overflow-visible",children:[a.jsx(lC,{placeholder:s,className:"h-8"}),a.jsxs(E6,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(w6,{children:"No items found."}),a.jsx(R6,{className:"h-full overflow-visible",children:e.map(g=>a.jsxs(cC,{value:g.value.toString(),onSelect:()=>f(g.value),className:"text-sm",children:[a.jsx(la,{className:se("mr-2 h-3 w-3",t.includes(g.value)?"opacity-100":"opacity-0")}),g.label]},g.value))})]})]})})]})}const W6=[{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"}],Lp=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function Y6(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=W6.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 Xie(e,t,n=!0){const r=Yb(e,t);return Y6(r,n)}const Qie=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),Zb=[5,10,15,30],Xb=[1,2,3,4,6,8,12],Jie=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Type"}),a.jsxs(fa,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[a.jsx(ma,{className:"w-full",children:a.jsx(ha,{})}),a.jsxs(pa,{children:[a.jsx(Gn,{value:"daily",children:"Daily"}),a.jsx(Gn,{value:"weekly",children:"Weekly"}),a.jsx(Gn,{value:"monthly",children:"Monthly"}),a.jsx(Gn,{value:"interval",children:"Interval"})]})]})]}),ele=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Time"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(dt,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),mN=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Aa,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(mC,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),tle=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(K6,{options:W6,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),nle=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(K6,{options:Qie,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),rle=({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(Aa,{children:"Type"}),a.jsxs(fa,{value:e,onValueChange:i=>{n(i)},disabled:s,children:[a.jsx(ma,{className:"w-full",children:a.jsx(ha,{})}),a.jsxs(pa,{children:[a.jsx(Gn,{value:"minutes",children:"Minutes"}),a.jsx(Gn,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Aa,{children:"Every"}),a.jsxs(fa,{value:t.toString(),onValueChange:i=>{r(Number.parseInt(i)||1)},disabled:s,children:[a.jsx(ma,{className:"w-full",children:a.jsx(ha,{})}),a.jsx(pa,{children:(e==="minutes"?Zb:Xb).map(i=>a.jsxs(Gn,{value:i.toString(),children:[i," ",e==="minutes"?"min":"hr"]},i))})]})]})]}),ale=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Aa,{className:"text-sm",children:"Cron Expression"}),a.jsx(dt,{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 Qb({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),[x,g]=h.useState(t??Lp()),[y,v]=h.useState(!1),S=h.useMemo(()=>oX.getTimezonesWithOffset().map(V=>({value:V.identifier,label:V.displayName,offset:V.offsetString,isDST:V.isDST})),[]),[b,E]=h.useState(()=>Yb(e,x)),[R,j]=h.useState(""),[_,D]=h.useState("");h.useEffect(()=>{m(n)},[n]),h.useEffect(()=>{const V=t??Lp();g(V)},[t]),h.useEffect(()=>{if(e){const V=Yb(e,x);E(V)}},[e,x]);const O=V=>{const[I,K]=V.time.split(":").map(Number);switch(V.type){case"daily":return`${String(K)} ${String(I)} * * *`;case"weekly":return`${String(K)} ${String(I)} * * ${V.weekdays.join(",")}`;case"monthly":return`${String(K)} ${String(I)} ${V.monthDays.join(",")} * *`;case"interval":return V.intervalType==="minutes"?`*/${String(V.intervalValue)} * * * *`:`0 */${String(V.intervalValue)} * * *`;case"custom":return V.customCron;default:return`${String(K)} ${String(I)} * * *`}},A=h.useCallback(V=>{E(I=>{if(I.intervalType===V)return console.log("Type unchanged, skipping update"),I;const $=(V==="minutes"?Zb:Xb)[0];return{...I,intervalType:V,intervalValue:$}})},[]),T=h.useCallback(V=>{E(I=>(I.intervalType==="minutes"?Zb:Xb).includes(V)?{...I,intervalValue:V}:I)},[]),M=h.useMemo(()=>V=>Y6(V,f),[f]);h.useEffect(()=>{const V=O(b);j(V),D(M(b))},[b,f,x,M]);const k=h.useRef(""),z=h.useRef(""),L=h.useRef(!1);h.useEffect(()=>{const V=O(b);r&&(k.current!==V||z.current!==x||L.current!==f)&&(r({cron:V,timezone:x,enabled:f}),k.current=V,z.current=x,L.current=f)},[b,x,f,r]);const G=V=>{m(V)},B=V=>{g(V),E(I=>({...I,timezone:V}))},q=["daily","weekly","monthly"].includes(b.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(Aa,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:f?"Enabled":"Disabled"}),a.jsx(vC,{id:"schedule-enabled",checked:f,onCheckedChange:G})]})})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${f?"":"opacity-50"}`,children:[a.jsx(Jie,{value:b.type,onChange:V=>{E(I=>({...I,type:V}))},disabled:!f}),b.type!=="custom"&&b.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(ele,{value:b.time,onChange:V=>{E(I=>({...I,time:V}))},disabled:!f}),q&&a.jsx(mN,{value:x,onChange:B,disabled:!f,timezones:S})]}),(b.type==="interval"||b.type==="custom")&&a.jsx(mN,{value:x,onChange:B,disabled:!f,timezones:S}),b.type==="weekly"&&a.jsx(tle,{value:b.weekdays,onChange:V=>{E(I=>({...I,weekdays:V}))},disabled:!f}),b.type==="monthly"&&a.jsx(nle,{value:b.monthDays,onChange:V=>{E(I=>({...I,monthDays:V}))},disabled:!f}),b.type==="interval"&&a.jsx(rle,{intervalType:b.intervalType,intervalValue:b.intervalValue,onTypeChange:A,onValueChange:T,disabled:!f}),b.type==="custom"&&a.jsx(ale,{value:b.customCron,onChange:V=>{E(I=>({...I,customCron:V}))},disabled:!f})]}),i&&a.jsxs(a.Fragment,{children:[a.jsx(NS,{className:"my-3"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!y)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($A,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),y?a.jsx(Ju,{className:"text-muted-foreground h-4 w-4"}):a.jsx(Es,{className:"text-muted-foreground h-4 w-4"})]}),y&&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(Dr,{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(Dr,{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(Dr,{variant:"outline",className:"text-xs",children:x})]}),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&&q&&x!==Lp()&&a.jsxs(gC,{className:"border-amber-200 bg-amber-50",children:[a.jsx(Sh,{className:"h-4 w-4"}),a.jsx(P6,{children:"Time Zone"}),a.jsxs(xC,{children:["Schedule runs in ",x," (not your local ",Lp()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(we,{className:"w-full",disabled:!f,children:"Save Schedule"})]})]})}function sle(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"trigger-type-options-description-details",children:[a.jsx(Nt,{children:"How do I choose a type?"}),a.jsxs(At,{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 ole(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"trigger-type-change-description-details",children:[a.jsx(Nt,{children:"How do I change the trigger type?"}),a.jsx(At,{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 ile(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"report-change-description-details",children:[a.jsx(Nt,{children:"How do I change a report?"}),a.jsx(At,{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 lle(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"report-select-description-details",children:[a.jsx(Nt,{children:"How do I choose the report?"}),a.jsxs(At,{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 cle({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:i}){const[c,u]=h.useState(!1),{form:f,handleTypeChange:m,handleSubmit:x,isDirty:g}=Hie({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async E=>{u(!0);try{await r(E)}finally{u(!1)}}});h.useEffect(()=>{i==null||i(g)},[g,i]);const{control:y,watch:v}=f,b=v("type")===Fn.REPORT_RUN;return a.jsx(Dl,{...f,children:a.jsxs(Si,{onSubmit:E=>void x(E),noValidate:!1,children:[a.jsxs(Ol,{children:[a.jsx(yt,{control:y,name:"type",render:({field:E})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),a.jsxs(fa,{onValueChange:R=>{E.onChange(R),m(R)},defaultValue:E.value,disabled:!!n||!!e||!!v("triggerConfig.reportId"),children:[a.jsx(mt,{children:a.jsx(ma,{className:"w-full",children:a.jsx(ha,{placeholder:"Select trigger type"})})}),a.jsxs(pa,{children:[a.jsx(Gn,{value:Fn.REPORT_RUN,children:"Report Run"}),a.jsx(Gn,{value:Fn.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(Jt,{children:e?a.jsx(ole,{}):a.jsx(sle,{})}),a.jsx(St,{})]})}),b&&a.jsx(yt,{control:y,name:"triggerConfig.reportId",render:({field:E})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),a.jsx(mt,{children:a.jsx(m2,{children:a.jsx($ie,{value:E.value,onChange:E.onChange,disabled:!!t||!!e})})}),a.jsx(Jt,{children:e!=null&&e.triggerConfig?a.jsx(ile,{}):a.jsx(lle,{})}),a.jsx(St,{})]})}),a.jsx(Qb,{showPreview:!1,cron:v("cronExpression"),timezone:v("timeZone"),enabled:v("isActive"),onChange:E=>{f.setValue("cronExpression",E.cron,{shouldDirty:!0}),f.setValue("timeZone",E.timezone,{shouldDirty:!0}),f.setValue("isActive",E.enabled,{shouldDirty:!0})},className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4"})]}),a.jsxs(Uc,{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 ule({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=h.useMemo(()=>Xie(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 dle({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(wr,{open:r,onOpenChange:s,children:[a.jsx(Rr,{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(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(jr,{align:"end",children:[a.jsxs(Tt,{onClick:()=>{t(e.id)},children:[a.jsx(dd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),a.jsx(ua,{}),a.jsxs(Tt,{onClick:()=>{c(!0)},children:[a.jsx(ts,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(Cr,{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 fle({connector:e}){const{connectors:t}=Pc(),n=Vte(e,t);return a.jsx(a.Fragment,{children:n})}function Z6({connector:e}){return a.jsx(fle,{connector:e})}function hle(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 mle=e=>{const{connectors:t}=Pc();return h.useMemo(()=>t.find(n=>n.name===e),[t,e])},ple=ae.memo(function({connector:t,children:n}){const r=mle(t.source.name),{dataMart:s,runs:i,getDataMartRuns:c}=Rs();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(Mc,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=h.useCallback(()=>{s!=null&&s.storage&&fQ(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=h.useMemo(()=>hle(i),[i]),x=h.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:zJ(m.lastRunStatus),statusText:HJ(m.lastRunStatus),date:m.lastRunDate},[m]),g=h.useMemo(()=>(s==null?void 0:s.storage)&&hQ(s.storage),[s]),y=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(Lx,{children:[a.jsx(Px,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Ux,{children:[a.jsxs(y2,{children:[a.jsx(v2,{children:u}),a.jsxs(b2,{children:[a.jsx(S2,{children:a.jsx(Z6,{connector:t})}),a.jsx(C2,{children:y})]})]}),a.jsxs(E2,{children:[a.jsxs(al,{children:[a.jsx(sl,{children:"Last run status:"}),a.jsx(ol,{children:x?a.jsx(Vh,{type:x.statusType,variant:"ghost",children:x.statusText}):"Not run yet"})]}),a.jsxs(al,{children:[a.jsx(sl,{children:"Last run date:"}),a.jsx(ol,{children:x?a.jsx(Gs,{date:x.date}):"Never run"})]}),a.jsxs(al,{children:[a.jsx(sl,{children:"Total runs:"}),a.jsxs(ol,{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(w2,{children:a.jsxs(we,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[g,a.jsx(ci,{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 gle(e){const t=e.triggerConfig,n=oa.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(PJ,{report:t.report,children:a.jsx(Or,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function xle(e){var s;const t=e.triggerConfig,{connector:n}=t.connector,r=(s=n.info)!=null&&s.logoBase64?a.jsx(Mc,{base64:n.info.logoBase64,className:"h-4 w-4",size:16}):a.jsx(fc,{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(Z6,{connector:n}),a.jsx(ple,{connector:n,children:a.jsx(Or,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function yle({trigger:e}){switch(e.type){case Fn.REPORT_RUN:return gle(e);case Fn.CONNECTOR_RUN:return xle(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function vle({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(Dr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>a.jsx(yle,{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(ule,{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(Gs,{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(Gs,{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(Vh,{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(Cd,{table:n}),cell:({row:n})=>a.jsx(dle,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function ble({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 bC({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){kl(e);const{createScheduledTrigger:i,updateScheduledTrigger:c,selectedTrigger:u}=H6(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:x,confirmClose:g,handleFormDirtyChange:y,handleFormSubmitSuccess:v}=zc(t),S=!!u,b=h.useMemo(()=>u?{type:u.type,cronExpression:u.cronExpression,timeZone:u.timeZone,isActive:u.isActive,triggerConfig:u.type===Fn.REPORT_RUN?{type:ll.SCHEDULED_REPORT_RUN,reportId:u.triggerConfig.reportId}:null}:void 0,[u]),E=async j=>{S?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=S?"Edit":"Create",_=(u==null?void 0:u.type)??s;e&&!R.current?(De({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:j,label:_}),R.current=!0):!e&&R.current&&(De({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:j,label:_}),R.current=!1)},[e,S,u,s]),a.jsxs(a.Fragment,{children:[a.jsx(mi,{open:e,onOpenChange:j=>{j||x()},children:a.jsxs(pi,{children:[a.jsxs(gi,{children:[a.jsxs(xi,{children:[S?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(bl,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx(cle,{preSelectedReportId:r,preSelectedType:s,initialData:b,onSubmit:E,onCancel:x,onDirtyChange:y})]})}),a.jsx(Cr,{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 Sle({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(()=>vle({onEditTrigger:n,onDeleteTrigger:u}),[n,u]),{sorting:m,setSorting:x,columnVisibility:g,setColumnVisibility:y}=Lc({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),v=jl({data:e,columns:f,getCoreRowModel:Rl(),getPaginationRowModel:Gh(),onSortingChange:x,getSortedRowModel:kc(),getFilteredRowModel:Sd(),state:{sorting:m,columnVisibility:g},onColumnVisibilityChange:y,enableGlobalFilter:!0,enableColumnResizing:!1}),S=h.useCallback(()=>{v.previousPage()},[v]),b=h.useCallback(()=>{v.nextPage()},[v]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Tl,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(_l,{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(Al,{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(Nl,{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((_,D)=>a.jsx(Gr,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":D+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(Gr,{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(ble,{table:v,onPreviousClick:S,onNextClick:b}),a.jsx(bC,{isOpen:s,onClose:c,dataMartId:t})]})}function Cle({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=Pie(e),[i,c]=h.useState(!1);h.useEffect(()=>{s&&c(!0)},[s]);const u=x=>{const g=t.find(y=>y.id===x);g&&r(g)},f=()=>{c(!1),r(null)},m=async x=>{try{await n(e,x)}catch(g){console.error("Error deleting trigger:",g)}};return a.jsxs(a.Fragment,{children:[a.jsx(Sle,{triggers:t,dataMartId:e,onEditTrigger:u,onDeleteTrigger:x=>void m(x)}),a.jsx(bC,{isOpen:i,onClose:f,dataMartId:e})]})}function SC(){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(ES,{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 Wi(e){return e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}function gs(e){return e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Ele(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,className:"text-sm",children:a.jsxs(_t,{value:"redshift-schema-permissions",children:[a.jsx(Nt,{className:"text-sm",children:"How to grant permissions for schema creation?"}),a.jsxs(At,{children:[a.jsx("p",{className:"mb-2",children:"You need to grant permissions to the IAM user who will be used to upload data."}),a.jsx("p",{className:"mb-2 text-sm font-medium",children:"Grant permissions:"}),a.jsx("pre",{className:"bg-muted overflow-x-auto rounded p-2 text-xs",children:a.jsx("code",{children:'GRANT CREATE ON DATABASE <DATABASE_NAME> TO "IAM:<USERNAME_IN_IAM>";'})}),a.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["Replace ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"<DATABASE_NAME>"})," with your database name and"," ",a.jsx("code",{className:"bg-muted rounded px-1 py-0.5",children:"<USERNAME_IN_IAM>"})," with your IAM username."]}),a.jsxs("p",{className:"mt-2 text-sm",children:["You can find your IAM username in the"," ",a.jsx($t,{className:"underline",href:"https://console.aws.amazon.com/iam/",children:"AWS IAM Console"})," ","under the ",a.jsx("strong",{children:"Users"})," tab."]})]})]})})}function wle({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,x]=h.useState(""),[g,y]=h.useState(""),[v,S]=h.useState(null),[b,E]=h.useState(null),[R,j]=h.useState(null),_=h.useRef(!1),D=h.useRef(!1),O=(z,L=!1)=>z.trim()?L&&z.startsWith('"')&&z.endsWith('"')?z.slice(1,-1)?null:"Quoted identifier cannot be empty":/^[A-Za-z][A-Za-z0-9_]*$/.test(z)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",A=h.useCallback((z,L,G,B,q,V)=>{let I;if(e===xe.SNOWFLAKE&&q){const $=Wi(q),ee=Wi(L);I=`${z}.${$}.${ee}`}else if(e===xe.AWS_REDSHIFT)if(!q||!L)I="";else{const $=Wi(q),ee=Wi(L);I=`${$}.${ee}`}else I=`${z}.${L}`;const K=e===xe.SNOWFLAKE?!!(z&&q&&L&&G===null&&V===null&&B===null):e===xe.AWS_REDSHIFT?!!(q&&L&&V===null&&B===null):!!(z&&L&&G===null&&B===null);s({fullyQualifiedName:I,isValid:K})},[s,e]);h.useEffect(()=>{let z="",L="",G="";if(t!=null&&t.fullyQualifiedName){const ee=t.fullyQualifiedName.match(/(?:[^."]+|"[^"]*")+/g)??[];if(e===xe.SNOWFLAKE&&ee.length===3){const me=ee[0],U=ee[1],F=ee[2];me&&U&&F&&(z=me,L=gs(U),G=gs(F))}else if(e===xe.AWS_REDSHIFT){if(ee.length===2){const me=ee[0],U=ee[1];me&&U&&(L=gs(me),G=gs(U))}else if(ee.length===3){const me=ee[1],U=ee[2];me&&U&&(L=gs(me),G=gs(U))}}else if(ee.length>=2){const me=ee[0],U=ee[1];me&&U&&(z=me,G=U)}}else z=`${c}_owox`,e===xe.SNOWFLAKE?L="PUBLIC":e===xe.AWS_REDSHIFT&&(L=`${c}_owox`),G=i;const B=e===xe.AWS_REDSHIFT?null:O(z),q=e===xe.SNOWFLAKE||e===xe.AWS_REDSHIFT&&L?O(L,!0):null,V=O(G,e===xe.SNOWFLAKE||e===xe.AWS_REDSHIFT);f(z),_.current||(x(L),E(q)),D.current||(y(G),j(V)),S(B);const I=e===xe.SNOWFLAKE&&L?`${z}.${Wi(L)}.${Wi(G)}`:e===xe.AWS_REDSHIFT?L&&G?`${Wi(L)}.${Wi(G)}`:"":`${z}.${G}`,K=e===xe.SNOWFLAKE?!!(z&&L&&G&&B===null&&q===null&&V===null):e===xe.AWS_REDSHIFT?!!(L&&G&&q===null&&V===null):!!(z&&G&&B===null&&V===null);!_.current&&!D.current&&((t==null?void 0:t.fullyQualifiedName)!==I||t.isValid!==K)&&A(z,G,B,V,L,q)},[t,i,c,e,A]);const T=z=>{f(z);const L=O(z);S(L),A(z,g,L,R,m,b)},M=z=>{_.current=!0,x(z);const L=O(z,!0);E(L),A(u,g,v,R,z,L)},k=z=>{D.current=!0,y(z);const L=O(z,e===xe.SNOWFLAKE||e===xe.AWS_REDSHIFT);j(L),A(u,z,v,L,m,b)};return a.jsxs(ii,{children:[e===xe.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(go,{icon:a.jsx(LD,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(ri,{title:"Choose where to store your data",children:[a.jsxs(io,{children:[a.jsx(aa,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),a.jsx(dt,{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:z=>{T(z.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(io,{children:[a.jsx(aa,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(dt,{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:z=>{k(z.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===xe.AWS_ATHENA&&a.jsxs(a.Fragment,{children:[a.jsx(go,{icon:a.jsx(PD,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(ri,{title:"Choose where to store your data",children:[a.jsxs(io,{children:[a.jsx(aa,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),a.jsx(dt,{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:z=>{T(z.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(io,{children:[a.jsx(aa,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(dt,{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:z=>{k(z.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===xe.SNOWFLAKE&&a.jsxs(a.Fragment,{children:[a.jsx(go,{icon:a.jsx(UD,{}),title:"Snowflake",docUrl:"https://docs.owox.com/docs/storages/supported-storages/snowflake/",variant:"compact"}),a.jsxs(ri,{title:"Choose where to store your data",children:[a.jsxs(io,{children:[a.jsx(aa,{required:!0,htmlFor:"snowflake-database-name",tooltip:"Enter database name for Snowflake where the connector data will be stored.",children:"Database name"}),a.jsx(dt,{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:z=>{T(z.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(io,{children:[a.jsx(aa,{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(dt,{type:"text",id:"snowflake-schema-name",placeholder:"PUBLIC",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"snowflake-schema-name-error":void 0,onChange:z=>{M(z.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"}),b&&a.jsx("p",{id:"snowflake-schema-name-error",className:"text-destructive text-sm",children:b})]}),a.jsxs(io,{children:[a.jsx(aa,{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(dt,{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:z=>{k(z.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})]})]})]}),e===xe.AWS_REDSHIFT&&a.jsxs(a.Fragment,{children:[a.jsx(go,{icon:a.jsx(zD,{}),title:"AWS Redshift",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-redshift/",variant:"compact"}),a.jsxs(ri,{title:"Choose where to store your data",children:[a.jsxs(io,{children:[a.jsx(aa,{required:!0,htmlFor:"redshift-schema-name",tooltip:"Enter schema name for Redshift where the connector data will be stored. Identifiers will be quoted automatically to preserve case sensitivity.",children:"Schema name"}),a.jsx(dt,{type:"text",id:"redshift-schema-name",placeholder:"public",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"redshift-schema-name-error":void 0,onChange:z=>{M(z.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."}),a.jsx(Ele,{}),b&&a.jsx("p",{id:"redshift-schema-name-error",className:"text-destructive text-sm",children:b})]}),a.jsxs(io,{children:[a.jsx(aa,{required:!0,htmlFor:"redshift-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(dt,{type:"text",id:"redshift-table-name",placeholder:"my_table",autoComplete:"off",className:"box-border w-full",value:g,"aria-invalid":!!R,"aria-describedby":R?"redshift-table-name-error":void 0,onChange:z=>{k(z.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. Identifiers will be quoted automatically to preserve case sensitivity."}),R&&a.jsx("p",{id:"redshift-table-name-error",className:"text-destructive text-sm",children:R})]})]})]}),a.jsx(ri,{title:"Schedule updates",children:a.jsx(SC,{})})]})}function Rle({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),[x,g]=h.useState(null),[y,v]=h.useState(""),[S,b]=h.useState([]),[E,R]=h.useState(1),[j,_]=h.useState({}),[D,O]=h.useState(!1),[A,T]=h.useState(new Set),[M,k]=h.useState(new Set),{connectors:z,connectorSpecification:L,connectorFields:G,loading:B,loadingSpecification:q,loadingFields:V,error:I,fetchAvailableConnectors:K,fetchConnectorSpecification:$,fetchConnectorFields:ee}=Pc();h.useEffect(()=>{u==null||u(f)},[f,u]);const[me,U]=h.useState(null),F=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]),H=F.length,W=h.useCallback(async ke=>{!A.has(ke)&&!q&&(T(Y=>new Set(Y).add(ke)),await $(ke))},[A,q,$]),Q=h.useCallback(async ke=>{M.has(ke)||(k(Y=>new Set(Y).add(ke)),await ee(ke))},[M,ee]);h.useEffect(()=>{if(!c||x||z.length===0)return;const ke=z.find(Y=>Y.name===c);ke&&(g(ke),R(i??2),W(ke.name),!n&&s!=="fields-only"&&Q(ke.name))},[c,z,x,i,n,s,W,Q]),h.useEffect(()=>{if(z.length===0&&!B&&K(),r&&z.length>0&&!x){const{source:ke,storage:Y}=r;v(ke.node),b(ke.fields),_(ke.configuration[0]||{}),U({fullyQualifiedName:Y.fullyQualifiedName,isValid:!0});const re=z.find(ce=>ce.name===ke.name);re&&(g(re),W(re.name),!n&&s!=="fields-only"&&Q(re.name),s==="fields-only"&&Q(re.name))}if(n&&z.length>0&&!x&&!r){const ke=z[0];g(ke),W(ke.name)}},[s,r,z,n,B,K,W,Q,x]);const le=ke=>{g(ke),_({}),O(!1),m(!0),T(Y=>{const re=new Set(Y);return re.delete(ke.name),re}),W(ke.name),Q(ke.name),De({event:"connector_setup",category:ke.name,action:"connector_selected",label:ke.displayName})},J=ke=>{v(ke),b([]),m(!0)},ie=(ke,Y)=>{b(Y?re=>re.includes(ke)?re:[...re,ke]:re=>re.filter(ce=>ce!==ke)),m(!0)},ye=(ke,Y)=>{b(Y?re=>{const ce=ke.filter(Ie=>!re.includes(Ie));return[...re,...ce]}:re=>re.filter(ce=>!ke.includes(ce))),m(!0)},Ee=ke=>{U(ke),m(!0)},He=h.useCallback(ke=>{_(ke),m(!0)},[]),Re=h.useCallback(ke=>{O(ke)},[]);h.useEffect(()=>{L&&(L.some(Y=>Y.required&&Y.name!=="Fields")||O(!0))},[L]),h.useEffect(()=>{var Y;const ke=((Y=F[E-1])==null?void 0:Y.title)??`Step ${String(E)}`;x&&De({event:"connector_setup",category:x.name,action:"step",label:ke})},[E,x]);const Ke=()=>{E<H&&R(E+1)},nt=()=>{E>1&&R(E-1)},Gt=()=>{if(n)return x!==null&&D;if(s==="fields-only")switch(E){case 1:return S.length>0;default:return!1}switch(E){case 1:return x!==null;case 2:return D;case 3:return y!=="";case 4:return S.length>0;case 5:return me!==null&&me.fullyQualifiedName!==""&&me.isValid;default:return!1}},Ft=()=>E>1,On=(ke,Y)=>{if(!ke)return Y;const re=ke.find(ce=>ce.name===Y);return(re==null?void 0:re.destinationName)??Y},vn=()=>{if(n&&E===1)return L&&x?a.jsx(fN,{connector:x,connectorSpecification:L,onConfigurationChange:He,onValidationChange:Re,initialConfiguration:j,loading:q,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(E){case 1:return x&&y&&G?a.jsx(hN,{connector:x,connectorFields:G,selectedField:y,selectedFields:S,onFieldToggle:ie,onSelectAllFields:ye}):null;default:return null}switch(E){case 1:return a.jsx(gie,{connectors:z,selectedConnector:x,loading:B,error:I,onConnectorSelect:le,onConnectorDoubleClick:()=>{R(ke=>ke<H?ke+1:ke)}});case 2:return x&&L?a.jsx(fN,{connector:x,connectorSpecification:L,onConfigurationChange:He,onValidationChange:Re,initialConfiguration:j,loading:q,isEditingExisting:!1}):null;case 3:return x&&G?a.jsx(Oie,{connectorFields:G,connector:x,selectedField:y,connectorName:x.displayName,loading:V,onFieldSelect:J}):null;case 4:return x&&y&&G?a.jsx(hN,{connector:x,connectorFields:G,selectedField:y,selectedFields:S,onFieldToggle:ie,onSelectAllFields:ye}):null;case 5:return y&&G?a.jsx(wle,{dataStorageType:t,destinationName:On(G,y),connectorName:(x==null?void 0:x.displayName)??"",target:me,onTargetChange:Ee}):null;default:return null}};return a.jsxs(Zre,{children:[a.jsx(Xre,{children:vn()}),a.jsx(Qre,{variant:"horizontal",children:a.jsx(xie,{currentStep:E,totalSteps:H,canGoNext:Gt(),canGoBack:Ft(),isLoading:q||V,onNext:Ke,onBack:nt,onFinish:()=>{n&&x?(e({source:{name:x.name,configuration:[j],node:(r==null?void 0:r.source.node)??y,fields:(r==null?void 0:r.source.fields)??S},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}),De({event:"connector_setup",category:x.name,action:"created",label:"configuration-only"})):s==="fields-only"&&r?(e({source:{...r.source,fields:S},storage:r.storage}),De({event:"connector_setup",category:r.source.name,action:"created",label:"fields-only"})):x&&me&&(e({source:{name:x.name,configuration:[j],node:y,fields:S},storage:{fullyQualifiedName:me.fullyQualifiedName}}),De({event:"connector_setup",category:x.name,action:"created",label:"full"})),m(!1)}})})]})}function X6({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:x,handleClose:g,confirmClose:y,handleFormDirtyChange:v,handleFormSubmitSuccess:S}=zc(t);return kl(e),a.jsxs(a.Fragment,{children:[a.jsx(mi,{open:e,onOpenChange:b=>{b||g()},children:a.jsxs(pi,{children:[a.jsxs(gi,{children:[a.jsx(xi,{children:c==="fields-only"?"Connector Fields":i!=null&&i.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(bl,{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(Rle,{onSubmit:b=>{r(b),S()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:i,mode:c,initialStep:u,preselectedConnector:f,onDirtyChange:v})]})}),a.jsx(Cr,{open:m,onOpenChange:x,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:y,variant:"destructive"})]})}const CC=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:i,isOpen:c,onClose:u})=>{const[f,m]=h.useState(!1),[x,g]=h.useState(1),[y,v]=h.useState();h.useEffect(()=>{c!==void 0&&m(c)},[c]);const S=()=>{v(void 0),g(1),m(!0)},b=()=>{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:S,style:{cursor:"pointer"},children:n}),a.jsx(ld,{children:a.jsx(X6,{isOpen:f,onClose:b,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:x,preselectedConnector:y})})]})};function jle({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return a.jsx(CC,{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(jS,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(Da,{className:"h-6 w-6"})]})})}const Tle=e=>{switch(e){case xe.GOOGLE_BIGQUERY:return"Google BigQuery";case xe.AWS_ATHENA:return"AWS Athena";case xe.SNOWFLAKE:return"Snowflake";case xe.AWS_REDSHIFT:return"AWS Redshift";default:return e}},Lu=e=>typeof e=="object"&&"connector"in e,If=e=>{if(!Lu(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 _le({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:s,dataStorage:i}){const c=wl.getInfo(i.type),{connectors:u,fetchAvailableConnectors:f}=Pc();h.useEffect(()=>{f()},[f]);const m=S=>{const b=u.find(E=>E.name===S);if(b!=null&&b.logoBase64)return()=>a.jsx(Mc,{base64:b.logoBase64,size:24})},x=()=>{const S=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:S}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs(wt,{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(Da,{className:"h-3 w-3"})]})}),a.jsx(jt,{children:"Edit connector configuration"})]})]})},g=(S,b,E)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[S,":"]})," ",a.jsx($t,{href:E,onClick:R=>{R.stopPropagation()},children:b})]}),y=()=>{switch(i.type){case xe.GOOGLE_BIGQUERY:{const S=i.config.projectId,b=t.connector.storage.fullyQualifiedName,E=b.split(".")[0],R=b.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${S}&ws=!1m4!1m3!3m2!1s${S}!2s${E}`,_=`https://console.cloud.google.com/bigquery?project=${S}&ws=!1m4!1m3!3m2!1s${S}!2s${E}!3s${R}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Dataset",E,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,_),a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Or,{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 xe.AWS_ATHENA:{const S=i.config.region,b=t.connector.storage.fullyQualifiedName,[E,R]=b.split("."),j=`https://console.aws.amazon.com/athena/home?region=${S}#/query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",E,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",R,j),a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Or,{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 xe.SNOWFLAKE:{const S=i.config.account,E=t.connector.storage.fullyQualifiedName.split("."),R=E[0],j=E[1],_=E[2],D=`https://${S}.snowflakecomputing.com`,O=`${D}/#/data/databases/${R}`,A=`${D}/#/data/databases/${R}/schemas/${j}`,T=`${D}/#/data/databases/${R}/schemas/${j}/table/${_}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g("Database",R,O),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",gs(j),A),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",gs(_),T),a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Or,{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"})]})]})}case xe.AWS_REDSHIFT:{const S=i.config,E=t.connector.storage.fullyQualifiedName.split(".");let R,j;E.length===3?(R=gs(E[1]),j=gs(E[2])):(R=gs(E[0]),j=gs(E[1]));const _=S.connectionType===sr.SERVERLESS?`Workgroup: ${S.workgroupName}`:`Cluster: ${S.clusterIdentifier}`,D=`https://console.aws.amazon.com/redshiftv2/home?region=${S.region}#query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Region:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:S.region})]}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs("span",{children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Database:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:S.database})]}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[_.split(":")[0],":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:_.split(":")[1].trim()})]}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Schema",R,D),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Table",j,D),a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx(Or,{className:"h-4 w-4"})}),a.jsx(jt,{children:"The 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(CC,{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(Bb,{icon:m(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:x(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),a.jsx(Bb,{title:Tle(i.type),icon:c.icon,subtitle:y(),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(wt,{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(ts,{className:"h-4 w-4"})})})}),!v()&&a.jsx(jt,{children:"Remove last configuration only after adding a new one."})]})})]})}function Nle({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(CC,{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(ga,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function Ale({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:i,runDataMart:c}=Cs(),{setValue:u,getValues:f,trigger:m}=Ed(),[x,g]=h.useState(!1),[y,v]=h.useState(!1);h.useEffect(()=>{r&&v(!0)},[r]);const S=(i==null?void 0:i.status)??Ir.DRAFT,b=async q=>{u("definition",q,{shouldDirty:!0,shouldTouch:!0}),await m("definition")&&s&&s()},E=async q=>{const V=q.source,I=q.storage;await b({connector:{source:V,storage:I}})},R=async q=>{if(i){if(i.status.code!==Ir.PUBLISHED){kt.error("Manual run is only available for published data marts");return}await c({id:i.id,payload:q})}},j=q=>async V=>{const K=f().definition;if(typeof K=="object"&&Lu(K)){const $=[...K.connector.source.configuration];$[q]=V.source.configuration[0]||{};const ee={connector:{...K.connector,source:{...K.connector.source,configuration:$}}};await b(ee)}},_=async q=>{const I=f().definition;if(typeof I=="object"&&Lu(I)){const K={connector:{...I.connector,source:{...I.connector.source,fields:q.source.fields}}};await b(K)}g(!1)},D=q=>{R({runType:q.runType,data:q.data})},O=q=>{const V=q.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(Cz,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(V),")"]})]})},[A,T]=h.useState(null),[M,k]=h.useState(!1),z=q=>{T(q),k(!0)},L=async()=>{A!==null&&(await G(A),T(null),k(!1))},G=async q=>{const I=f().definition;if(Lu(I)&&I.connector.source.configuration.length<=1){const K=pC($e.CONNECTOR);await b(K)}if(typeof I=="object"&&Lu(I)&&I.connector.source.configuration.length>1){const K={...I.connector.source,configuration:I.connector.source.configuration.filter((ee,me)=>me!==q)},$={connector:{...I.connector,source:K}};await b($)}},B=async q=>{const I=f().definition;if(Lu(I)){const K={...I.connector.source,configuration:[...I.connector.source.configuration,q]},$={connector:{...I.connector,source:K}};await b($)}};return a.jsxs(a.Fragment,{children:[a.jsx(yt,{control:e,name:"definition",render:({field:q})=>a.jsxs(ht,{className:"dark:bg-white/2",children:[a.jsx(mt,{children:a.jsx("div",{className:"space-y-3",children:!If(q.value)||S===Ir.DRAFT?a.jsx(jle,{storageType:t,onSetupConnector:V=>{E(V),v(!1)},preset:n,isOpen:y,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(Nle,{storageType:t,onAddConfiguration:V=>void B(V),existingConnector:If(q.value)?{source:q.value.connector.source,storage:q.value.connector.storage}:void 0}),If(q.value)&&O(q.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:i&&i.definitionType===$e.CONNECTOR&&a.jsx(s6,{configuration:i.definition,onManualRun:D,children:a.jsxs(we,{variant:"outline",children:[a.jsx(Jg,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:If(q.value)&&(i!=null&&i.storage)?q.value.connector.source.configuration.map((V,I)=>{const K=q.value;return a.jsx(ld,{children:a.jsx(_le,{configIndex:I,connectorDef:K,dataStorage:i.storage,onRemoveConfiguration:$=>{z($)},onUpdateConfiguration:$=>j($),dataMartStatus:typeof S=="object"?S.code:S,totalConfigurations:K.connector.source.configuration.length},I)},I)}):null})]})})}),a.jsx(St,{})]})}),a.jsx(ld,{children:a.jsx(X6,{isOpen:x,onClose:()=>{g(!1)},onSubmit:q=>void _(q),dataStorageType:t,existingConnector:If(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(Cr,{open:M,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:()=>{L()},onCancel:()=>{T(null)},variant:"destructive"})]})}function Dle({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=Ed(),[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(die,{control:s}),e===$e.TABLE&&a.jsx(fie,{control:s,storageType:t}),e===$e.VIEW&&a.jsx(hie,{control:s,storageType:t}),e===$e.TABLE_PATTERN&&a.jsx(mie,{control:s,storageType:t}),e===$e.CONNECTOR&&a.jsx(Ale,{control:s,storageType:t,preset:n,autoOpen:i,saveDataMartDefinition:r})]})}function Q6(){const[e]=lP(),t=e.get("preset");return h.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return cte(n)},[t])}function Ole(e,t){const[n,r]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const Ile=1e3,Mle=[Ja.SUCCESS,Ja.ERROR,Ja.CANCELLED];function kle(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:y}=i.current;if(g){y==null||y.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,y)=>{for(;!y.aborted&&c(g);)try{const v=await Tn.getSqlDryRunTriggerStatus(e,g);if(Mle.includes(v)){const S=await Tn.getSqlDryRunTriggerResponse(e,g);s({isValid:S.isValid,error:S.error??void 0,bytes:S.bytes}),n(!1),i.current={triggerId:null,abortController:null};return}await new Promise(S=>setTimeout(S,Ile))}catch(v){u(v),i.current={triggerId:null,abortController:null};return}},[e,c,u]),x=h.useCallback(async g=>{await f(),n(!0),s(null);try{const{triggerId:y}=await Tn.createSqlDryRunTrigger(e,g),v=new AbortController;i.current={triggerId:y,abortController:v},await m(y,v.signal)}catch(y){u(y)}},[e,f,m,u]);return h.useEffect(()=>()=>{const{triggerId:g,abortController:y}=i.current;y==null||y.abort(),g&&Tn.abortSqlDryRunTrigger(e,g).catch(()=>{})},[e]),{validateSql:x,isLoading:t,result:r,cancel:f}}const Lle=300;function Ple({sql:e,dataMartId:t,debounceDelay:n=Lle,className:r="",onValidationStateChange:s}){const i=Ole(e.trim(),n),{validateSql:c,isLoading:u,result:f,cancel:m}=kle(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 x=()=>u?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(Nc,{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(rU,{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(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(fc,{className:"h-3 w-3 text-gray-600"}),a.jsx("span",{className:"text-xs text-gray-600",children:SJ(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(og,{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(fc,{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:x()})}const Ule={isValid:null,isLoading:!1,error:null},zle=(e,t)=>{if(e!==$e.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},Fle=e=>pC(e);function Hle({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:s,runSchemaActualization:i}=Cs(),c=Q6();if(!r)throw new Error("Data mart not found");const{definition:u,id:f,storage:{type:m}}=r,[,x]=h.useState(Ule),[g,y]=h.useState(!1),v=h.useCallback(()=>{if(!e)return;const B={definitionType:e,definition:pC(e)};return u?{definitionType:e,definition:u}:B},[e,u]),S=h.useCallback(()=>{if(!e)return;const B=uie(e,m);return Ci(B)},[e,m]),b=Do({resolver:S(),defaultValues:v(),mode:"onChange"}),{handleSubmit:E,reset:R,watch:j,formState:{isDirty:_,isValid:D}}=b,O=j("definition"),A=zle(e,O);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:Fle(c.definitionType)};R(B)}},[c,e,t,R,n]);const T=h.useCallback(B=>{x({isLoading:B.isLoading,isValid:B.isValid,error:B.error})},[]),M=h.useCallback(B=>{n(B)},[n]),k=h.useCallback(async B=>{if(e&&f)try{await s(f,B.definitionType,B.definition),y(!0),R(B)}catch(q){console.error("Failed to update data mart definition:",q)}},[f,e,s,R]);h.useEffect(()=>{g&&(y(!1),i==null||i())},[g,i]);const z=h.useCallback(B=>{B==null||B.preventDefault(),E(k)(B)},[E,k]),L=h.useCallback(()=>{R(v())},[R,v]),G=()=>e?a.jsxs("form",{onSubmit:z,className:"space-y-4",children:[a.jsx(Dle,{definitionType:e,storageType:m,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:z}),e!==$e.CONNECTOR&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(we,{variant:"default",type:"submit",disabled:!D||!_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:L,disabled:!_,children:"Discard"}),e===$e.SQL&&A&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(Ple,{sql:A,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return a.jsx(I5,{...b,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(aie,{initialType:e,onTypeSelect:M}),G()]})})}function Vle(e){switch(e){case xe.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case xe.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};case xe.SNOWFLAKE:return{type:"snowflake-data-mart-schema",fields:[]};case xe.AWS_REDSHIFT:return{type:"redshift-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function J6(e){return e.type==="bigquery-data-mart-schema"}function eM(e){return e.type==="athena-data-mart-schema"}function tM(e){return e.type==="snowflake-data-mart-schema"}function pN(e){return e!==null&&typeof e=="object"&&"mode"in e}function gN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function xN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function nM(e){return e.type==="redshift-data-mart-schema"}function yN(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e&&!("mode"in e)}function $le(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function N1(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Ble(e){const t=N1(e),[n,r]=h.useState(t),[s,i]=h.useState(!1);h.useEffect(()=>{const f=N1(e);r(f),i(!1)},[e]);const c=h.useCallback(f=>{n?J6(n)&&f.every(pN)?(r({...n,fields:f}),i(!0)):eM(n)&&f.every(gN)?(r({...n,fields:f}),i(!0)):tM(n)&&f.every(xN)?(r({...n,fields:f}),i(!0)):nM(n)&&f.every(yN)&&(r({...n,fields:f}),i(!0)):f.length>0&&(pN(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),i(!0)):gN(f[0])?(r({type:"athena-data-mart-schema",fields:f}),i(!0)):xN(f[0])?(r({type:"snowflake-data-mart-schema",fields:f}),i(!0)):yN(f[0])&&(r({type:"redshift-data-mart-schema",fields:f}),i(!0)))},[n]),u=h.useCallback(()=>{const f=N1(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 qle(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 rM(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=>rM(c,t)):!1}function aM(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 x=aM(s.fields,t,c);x.length>0&&(r.includes(c)||r.push(c),r.push(...x))}}),r}function Kle(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return rM(r,s)}function Wle(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 Yle(e){const[t,n]=h.useState(new Set),[r,s]=h.useState(null),i=h.useRef(""),c=h.useMemo(()=>{const S=b=>b.some(E=>E.type===ar.RECORD||E.type===ar.STRUCT||E.fields&&S(E.fields));return S(e)},[e]),u=h.useCallback(S=>{n(b=>{const E=new Set(b);return E.has(S)?E.delete(S):E.add(S),E})},[]),f=h.useCallback(()=>{const S=[],b=(E,R="")=>{E.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(S.push(D),b(j.fields,D))})};b(e),n(E=>S.every(j=>E.has(j))?new Set:new Set(S))},[e]),m=h.useMemo(()=>{const S=[],b=(E,R="",j=0)=>{E.forEach((_,D)=>{const O=R?`${R}.${String(D)}`:String(D),A=_.type===ar.RECORD||_.type===ar.STRUCT;S.push({..._,path:O,level:j}),A&&_.fields&&t.has(O)&&b(_.fields,O,j+1)})};return b(e),S},[e,t]),x=h.useCallback(S=>{if(S!==i.current)if(i.current=S,S){r===null&&s(new Set(t));const E=aM(e,S).filter(R=>{const j=R.split(".").map(Number);let _=e,D;for(let O=0;O<j.length;O++){if(D=_[j[O]],!D)return!1;if((D.type===ar.RECORD||D.type===ar.STRUCT)&&D.fields&&D.fields.length>0)return!0;O<j.length-1&&(_=D.fields??[])}return!1});n(R=>{const j=new Set(R);return E.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),s(null))},[e,t,r]),g=h.useCallback(S=>{const b=m[S];return b.type===ar.RECORD||b.type===ar.STRUCT},[m]),y=h.useMemo(()=>e.map(S=>({...S,fields:void 0})),[e]),v=h.useMemo(()=>{const S=[],b=(E,R="")=>{E.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===ar.RECORD||j.type===ar.STRUCT)&&j.fields&&j.fields.length>0&&(S.push(D),b(j.fields,D))})};return b(e),S.length===0?!1:S.every(E=>t.has(E))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:u,toggleAllRecords:f,flattenedFields:m,handleSearchChange:x,isRecordType:g,topLevelFields:y,allExpanded:v}}function Zle(e,t,n,r){const s=h.useCallback((f,m)=>{if(n){const x=[...e],g=t[f].path;if(!g)x[f]={...x[f],...m};else{const y=g.split(".").map(Number);let v=x,S;for(let E=0;E<y.length-1;E++)S=v[y[E]],v=S.fields??[];const b=y[y.length-1];v[b]&&(v[b]={...v[b],...m})}n(x)}},[e,t,n]),i=h.useCallback(()=>{if(n){const f={name:"",type:ar.STRING,mode:lh.NULLABLE,isPrimaryKey:!1,status:Na.DISCONNECTED};n([...e,f])}},[e,n]),c=h.useCallback(f=>{if(n){const m=[...e],x=t[f].path;if(!x)m.splice(f,1);else{const g=x.split(".").map(Number);let y=m,v;for(let b=0;b<g.length-1;b++)v=y[g[b]],y=v.fields??[];const S=g[g.length-1];y.splice(S,1)}n(m)}},[e,t,n]),u=h.useCallback(f=>{var m,x;if(n&&r){const g=[...e],y=t[f].path,v={name:"",type:ar.STRING,mode:lh.NULLABLE,isPrimaryKey:!1,status:Na.DISCONNECTED};if(!y)(m=g[f]).fields??(m.fields=[]),g[f].fields.push(v);else{const S=y.split(".").map(Number);let b=g;for(let E=0;E<S.length;E++){const R=S[E];E===S.length-1?((x=b[R]).fields??(x.fields=[]),b[R].fields.push(v)):b=b[R].fields??[]}}n(g)}},[e,t,n,r]);return{updateField:s,handleAddRow:i,handleDeleteRow:c,handleAddNestedField:u}}function ry(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 y=Number(i.id),v=Number(c.id),S=[...e],[b]=S.splice(y,1);S.splice(v,0,b),t(S);return}const u=n.findIndex((y,v)=>(y.path??String(v))===i.id),f=n.findIndex((y,v)=>(y.path??String(v))===c.id);if(u===-1||f===-1)return;const m=n[u].path,x=n[f].path,g=[...e];if(!m&&!x){const[y]=g.splice(u,1);g.splice(f,0,y),t(g);return}if(m&&x){const y=m.split(".").map(Number),v=x.split(".").map(Number);if(y.length===v.length&&y.slice(0,-1).join(".")===v.slice(0,-1).join(".")){let S=g;for(let j=0;j<y.length-1;j++)S=S[y[j]].fields??[];const b=y[y.length-1],E=v[v.length-1],[R]=S.splice(b,1);S.splice(E,0,R),t(g)}}},[e,n,t])}}function Xle(){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 ay=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function EC(e){return"nodeType"in e}function Oa(e){var t,n;return e?jd(e)?e:EC(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function wC(e){const{Document:t}=Oa(e);return e instanceof t}function Xh(e){return jd(e)?!1:e instanceof Oa(e).HTMLElement}function sM(e){return e instanceof Oa(e).SVGElement}function Td(e){return e?jd(e)?e.document:EC(e)?wC(e)?e:Xh(e)||sM(e)?e.ownerDocument:document:document:document}const To=ay?h.useLayoutEffect:h.useEffect;function RC(e){const t=h.useRef(e);return To(()=>{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 Qle(){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 uh(e,t){t===void 0&&(t=[e]);const n=h.useRef(e);return To(()=>{n.current!==e&&(n.current=e)},t),n}function Qh(e,t){const n=h.useRef();return h.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ug(e){const t=RC(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 Jb(e){const t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}let A1={};function Jh(e,t){return h.useMemo(()=>{if(t)return t;const n=A1[e]==null?0:A1[e]+1;return A1[e]=n,e+"-"+n},[e,t])}function oM(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 x=i[f];x!=null&&(i[f]=x+e*m)}return i},{...t})}}const Zu=oM(1),zg=oM(-1);function Jle(e){return"clientX"in e&&"clientY"in e}function jC(e){if(!e)return!1;const{KeyboardEvent:t}=Oa(e.target);return t&&e instanceof t}function ece(e){if(!e)return!1;const{TouchEvent:t}=Oa(e.target);return t&&e instanceof t}function eS(e){if(ece(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 Jle(e)?{x:e.clientX,y:e.clientY}:null}const dh=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[dh.Translate.toString(e),dh.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),vN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function tce(e){return e.matches(vN)?e:e.querySelector(vN)}const nce={display:"none"};function rce(e){let{id:t,value:n}=e;return ae.createElement("div",{id:t,style:nce},n)}function ace(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 ae.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function sce(){const[e,t]=h.useState("");return{announce:h.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const iM=h.createContext(null);function oce(e){const t=h.useContext(iM);h.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ice(){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 lce={draggable:`
824
+ To pick up a draggable item, press the space bar.
825
+ While dragging, use the arrow keys to move the item.
826
+ Press space again to drop the item in its new position, or press escape to cancel.
827
+ `},cce={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 uce(e){let{announcements:t=cce,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=lce}=e;const{announce:i,announcement:c}=sce(),u=Jh("DndLiveRegion"),[f,m]=h.useState(!1);if(h.useEffect(()=>{m(!0)},[]),oce(h.useMemo(()=>({onDragStart(g){let{active:y}=g;i(t.onDragStart({active:y}))},onDragMove(g){let{active:y,over:v}=g;t.onDragMove&&i(t.onDragMove({active:y,over:v}))},onDragOver(g){let{active:y,over:v}=g;i(t.onDragOver({active:y,over:v}))},onDragEnd(g){let{active:y,over:v}=g;i(t.onDragEnd({active:y,over:v}))},onDragCancel(g){let{active:y,over:v}=g;i(t.onDragCancel({active:y,over:v}))}}),[i,t])),!f)return null;const x=ae.createElement(ae.Fragment,null,ae.createElement(rce,{id:r,value:s.draggable}),ae.createElement(ace,{id:u,announcement:c}));return n?Us.createPortal(x,n):x}var Sr;(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"})(Sr||(Sr={}));function Fg(){}function sy(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function oy(){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 qs=Object.freeze({x:0,y:0});function dce(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function fce(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function hce(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function mce(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function bN(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 iy=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=bN(t,t.left,t.top),i=[];for(const c of r){const{id:u}=c,f=n.get(u);if(f){const m=dce(bN(f),s);i.push({id:u,data:{droppableContainer:c,value:m}})}}return i.sort(fce)};function pce(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,x=c*u,g=x/(f+m-x);return Number(g.toFixed(4))}return 0}const gce=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=pce(u,t);f>0&&s.push({id:c,data:{droppableContainer:i,value:f}})}}return s.sort(hce)};function xce(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function lM(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:qs}function yce(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 vce=yce(1);function bce(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 Sce(e,t,n){const r=bce(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)),x=s?e.width/s:e.width,g=i?e.height/i:e.height;return{width:x,height:g,top:m,right:f+x,bottom:m+g,left:f}}const Cce={ignoreTransform:!1};function _d(e,t){t===void 0&&(t=Cce);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:x}=Oa(e).getComputedStyle(e);m&&(n=Sce(n,m,x))}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 SN(e){return _d(e,{ignoreTransform:!0})}function Ece(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function wce(e,t){return t===void 0&&(t=Oa(e).getComputedStyle(e)),t.position==="fixed"}function Rce(e,t){t===void 0&&(t=Oa(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 TC(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(wC(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Xh(s)||sM(s)||n.includes(s))return n;const i=Oa(e).getComputedStyle(s);return s!==e&&Rce(s,i)&&n.push(s),wce(s,i)?n:r(s.parentNode)}return e?r(e):n}function cM(e){const[t]=TC(e,1);return t??null}function D1(e){return!ay||!e?null:jd(e)?e:EC(e)?wC(e)||e===Td(e).scrollingElement?window:Xh(e)?e:null:null}function uM(e){return jd(e)?e.scrollX:e.scrollLeft}function dM(e){return jd(e)?e.scrollY:e.scrollTop}function tS(e){return{x:uM(e),y:dM(e)}}var Ar;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ar||(Ar={}));function fM(e){return!ay||!e?!1:e===document.scrollingElement}function hM(e){const t={x:0,y:0},n=fM(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 jce={x:.2,y:.2};function Tce(e,t,n,r,s){let{top:i,left:c,right:u,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=jce);const{isTop:m,isBottom:x,isLeft:g,isRight:y}=hM(e),v={x:0,y:0},S={x:0,y:0},b={height:t.height*s.y,width:t.width*s.x};return!m&&i<=t.top+b.height?(v.y=Ar.Backward,S.y=r*Math.abs((t.top+b.height-i)/b.height)):!x&&f>=t.bottom-b.height&&(v.y=Ar.Forward,S.y=r*Math.abs((t.bottom-b.height-f)/b.height)),!y&&u>=t.right-b.width?(v.x=Ar.Forward,S.x=r*Math.abs((t.right-b.width-u)/b.width)):!g&&c<=t.left+b.width&&(v.x=Ar.Backward,S.x=r*Math.abs((t.left+b.width-c)/b.width)),{direction:v,speed:S}}function _ce(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 mM(e){return e.reduce((t,n)=>Zu(t,tS(n)),qs)}function Nce(e){return e.reduce((t,n)=>t+uM(n),0)}function Ace(e){return e.reduce((t,n)=>t+dM(n),0)}function Dce(e,t){if(t===void 0&&(t=_d),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);cM(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Oce=[["x",["left","right"],Nce],["y",["top","bottom"],Ace]];class _C{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=TC(n),s=mM(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,u]of Oce)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=u(r),x=s[i]-m;return this.rect[f]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Kf{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 Ice(e){const{EventTarget:t}=Oa(e);return e instanceof t?e:Td(e)}function O1(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 ps;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ps||(ps={}));function CN(e){e.preventDefault()}function Mce(e){e.stopPropagation()}var yn;(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"})(yn||(yn={}));const pM={start:[yn.Space,yn.Enter],cancel:[yn.Esc],end:[yn.Space,yn.Enter,yn.Tab]},kce=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case yn.Right:return{...n,x:n.x+25};case yn.Left:return{...n,x:n.x-25};case yn.Down:return{...n,y:n.y+25};case yn.Up:return{...n,y:n.y-25}}};class gM{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 Kf(Td(n)),this.windowListeners=new Kf(Oa(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ps.Resize,this.handleCancel),this.windowListeners.add(ps.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ps.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Dce(r),n(qs)}handleKeyDown(t){if(jC(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=pM,coordinateGetter:c=kce,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,x=m?{x:m.left,y:m.top}:qs;this.referenceCoordinates||(this.referenceCoordinates=x);const g=c(t,{active:n,context:r.current,currentCoordinates:x});if(g){const y=zg(g,x),v={x:0,y:0},{scrollableAncestors:S}=r.current;for(const b of S){const E=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:D,maxScroll:O,minScroll:A}=hM(b),T=_ce(b),M={x:Math.min(E===yn.Right?T.right-T.width/2:T.right,Math.max(E===yn.Right?T.left:T.left+T.width/2,g.x)),y:Math.min(E===yn.Down?T.bottom-T.height/2:T.bottom,Math.max(E===yn.Down?T.top:T.top+T.height/2,g.y))},k=E===yn.Right&&!j||E===yn.Left&&!_,z=E===yn.Down&&!D||E===yn.Up&&!R;if(k&&M.x!==g.x){const L=b.scrollLeft+y.x,G=E===yn.Right&&L<=O.x||E===yn.Left&&L>=A.x;if(G&&!y.y){b.scrollTo({left:L,behavior:u});return}G?v.x=b.scrollLeft-L:v.x=E===yn.Right?b.scrollLeft-O.x:b.scrollLeft-A.x,v.x&&b.scrollBy({left:-v.x,behavior:u});break}else if(z&&M.y!==g.y){const L=b.scrollTop+y.y,G=E===yn.Down&&L<=O.y||E===yn.Up&&L>=A.y;if(G&&!y.x){b.scrollTo({top:L,behavior:u});return}G?v.y=b.scrollTop-L:v.y=E===yn.Down?b.scrollTop-O.y:b.scrollTop-A.y,v.y&&b.scrollBy({top:-v.y,behavior:u});break}}this.handleMove(t,Zu(zg(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()}}gM.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=pM,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 EN(e){return!!(e&&"distance"in e)}function wN(e){return!!(e&&"delay"in e)}class NC{constructor(t,n,r){var s;r===void 0&&(r=Ice(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=Td(c),this.documentListeners=new Kf(this.document),this.listeners=new Kf(r),this.windowListeners=new Kf(Oa(c)),this.initialCoordinates=(s=eS(i))!=null?s:qs,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(ps.Resize,this.handleCancel),this.windowListeners.add(ps.DragStart,CN),this.windowListeners.add(ps.VisibilityChange,this.handleCancel),this.windowListeners.add(ps.ContextMenu,CN),this.documentListeners.add(ps.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(wN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(EN(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(ps.Click,Mce,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ps.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=eS(t))!=null?n:qs,m=zg(s,f);if(!r&&u){if(EN(u)){if(u.tolerance!=null&&O1(m,u.tolerance))return this.handleCancel();if(O1(m,u.distance))return this.handleStart()}if(wN(u)&&O1(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===yn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Lce={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Nd extends NC{constructor(t){const{event:n}=t,r=Td(n.target);super(t,Lce,r)}}Nd.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 Pce={move:{name:"mousemove"},end:{name:"mouseup"}};var nS;(function(e){e[e.RightClick=2]="RightClick"})(nS||(nS={}));class Uce extends NC{constructor(t){super(t,Pce,Td(t.event.target))}}Uce.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===nS.RightClick?!1:(r==null||r({event:n}),!0)}}];const I1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class zce extends NC{constructor(t){super(t,I1)}static setup(){return window.addEventListener(I1.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(I1.move.name,t)};function t(){}}}zce.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 Wf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Wf||(Wf={}));var Hg;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Hg||(Hg={}));function Fce(e){let{acceleration:t,activator:n=Wf.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:c=5,order:u=Hg.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:x,delta:g,threshold:y}=e;const v=Vce({delta:g,disabled:!i}),[S,b]=Qle(),E=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),j=h.useMemo(()=>{switch(n){case Wf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Wf.DraggableRect:return s}},[n,s,f]),_=h.useRef(null),D=h.useCallback(()=>{const A=_.current;if(!A)return;const T=E.current.x*R.current.x,M=E.current.y*R.current.y;A.scrollBy(T,M)},[]),O=h.useMemo(()=>u===Hg.TreeOrder?[...m].reverse():m,[u,m]);h.useEffect(()=>{if(!i||!m.length||!j){b();return}for(const A of O){if((r==null?void 0:r(A))===!1)continue;const T=m.indexOf(A),M=x[T];if(!M)continue;const{direction:k,speed:z}=Tce(A,M,j,t,y);for(const L of["x","y"])v[L][k[L]]||(z[L]=0,k[L]=0);if(z.x>0||z.y>0){b(),_.current=A,S(D,c),E.current=z,R.current=k;return}}E.current={x:0,y:0},R.current={x:0,y:0},b()},[t,D,r,b,i,c,JSON.stringify(j),JSON.stringify(v),S,m,O,x,JSON.stringify(y)])}const Hce={x:{[Ar.Backward]:!1,[Ar.Forward]:!1},y:{[Ar.Backward]:!1,[Ar.Forward]:!1}};function Vce(e){let{delta:t,disabled:n}=e;const r=Jb(t);return Qh(s=>{if(n||!r||!s)return Hce;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ar.Backward]:s.x[Ar.Backward]||i.x===-1,[Ar.Forward]:s.x[Ar.Forward]||i.x===1},y:{[Ar.Backward]:s.y[Ar.Backward]||i.y===-1,[Ar.Forward]:s.y[Ar.Forward]||i.y===1}}},[n,t,r])}function $ce(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Qh(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function Bce(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 fh;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(fh||(fh={}));var rS;(function(e){e.Optimized="optimized"})(rS||(rS={}));const RN=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,x=h.useRef(e),g=E(),y=uh(g),v=h.useCallback(function(R){R===void 0&&(R=[]),!y.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[y]),S=h.useRef(null),b=Qh(R=>{if(g&&!n)return RN;if(!R||R===RN||x.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 D=_.node.current,O=D?new _C(f(D),D):null;_.rect.current=O,O&&j.set(_.id,O)}return j}return R},[e,i,n,g,f]);return h.useEffect(()=>{x.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"||S.current!==null||(S.current=setTimeout(()=>{v(),S.current=null},u))},[u,g,v,...r]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:i!=null};function E(){switch(m){case fh.Always:return!1;case fh.BeforeDragging:return n;default:return!n}}}function xM(e,t){return Qh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function qce(e,t){return xM(e,t)}function Kce(e){let{callback:t,disabled:n}=e;const r=RC(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 ly(e){let{callback:t,disabled:n}=e;const r=RC(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 Wce(e){return new _C(_d(e),e)}function jN(e,t,n){t===void 0&&(t=Wce);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 x=t(e);return JSON.stringify(f)===JSON.stringify(x)?f:x})}const c=Kce({callback(f){if(e)for(const m of f){const{type:x,target:g}=m;if(x==="childList"&&g instanceof HTMLElement&&g.contains(e)){i();break}}}}),u=ly({callback:i});return To(()=>{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 Yce(e){const t=xM(e);return lM(e,t)}const TN=[];function Zce(e){const t=h.useRef(e),n=Qh(r=>e?r&&r!==TN&&e&&t.current&&e.parentNode===t.current.parentNode?r:TC(e):TN,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function Xce(e){const[t,n]=h.useState(null),r=h.useRef(e),s=h.useCallback(i=>{const c=D1(i.target);c&&n(u=>u?(u.set(c,tS(c)),new Map(u)):null)},[]);return h.useEffect(()=>{const i=r.current;if(e!==i){c(i);const u=e.map(f=>{const m=D1(f);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,tS(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=D1(f);m==null||m.removeEventListener("scroll",s)})}},[s,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>Zu(i,c),qs):mM(e):qs,[e,t])}function _N(e,t){t===void 0&&(t=[]);const n=h.useRef(null);return h.useEffect(()=>{n.current=null},t),h.useEffect(()=>{const r=e!==qs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?zg(e,n.current):qs}function Qce(e){h.useEffect(()=>{if(!ay)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 Jce(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 yM(e){return h.useMemo(()=>e?Ece(e):null,[e])}const NN=[];function eue(e,t){t===void 0&&(t=_d);const[n]=e,r=yM(n?Oa(n):null),[s,i]=h.useState(NN);function c(){i(()=>e.length?e.map(f=>fM(f)?r:new _C(t(f),f)):NN)}const u=ly({callback:c});return To(()=>{u==null||u.disconnect(),c(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),s}function tue(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Xh(t)?t:e}function nue(e){let{measure:t}=e;const[n,r]=h.useState(null),s=h.useCallback(m=>{for(const{target:x}of m)if(Xh(x)){r(g=>{const y=t(x);return g?{...g,width:y.width,height:y.height}:y});break}},[t]),i=ly({callback:s}),c=h.useCallback(m=>{const x=tue(m);i==null||i.disconnect(),x&&(i==null||i.observe(x)),r(x?t(x):null)},[t,i]),[u,f]=Ug(c);return h.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const rue=[{sensor:Nd,options:{}},{sensor:gM,options:{}}],aue={current:{}},Jp={draggable:{measure:SN},droppable:{measure:SN,strategy:fh.WhileDragging,frequency:rS.Optimized},dragOverlay:{measure:_d}};class Yf 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 sue={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Yf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Jp,measureDroppableContainers:Fg,windowRect:null,measuringScheduled:!1},oue={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fg,draggableNodes:new Map,over:null,measureDroppableContainers:Fg},cy=h.createContext(oue),vM=h.createContext(sue);function iue(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Yf}}}function lue(e,t){switch(t.type){case Sr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Sr.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 Sr.DragEnd:case Sr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Sr.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Yf(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Sr.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 Yf(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case Sr.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new Yf(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function cue(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=h.useContext(cy),i=Jb(r),c=Jb(n==null?void 0:n.id);return h.useEffect(()=>{if(!t&&!r&&i&&c!=null){if(!jC(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 x of[f.current,m.current]){if(!x)continue;const g=tce(x);if(g){g.focus();break}}})}},[r,t,s,c,i]),null}function uue(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function due(e){return h.useMemo(()=>({draggable:{...Jp.draggable,...e==null?void 0:e.draggable},droppable:{...Jp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Jp.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 fue(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;To(()=>{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 x=n(m),g=lM(x,r);if(c||(g.x=0),u||(g.y=0),i.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const y=cM(m);y&&y.scrollBy({top:g.y,left:g.x})}},[t,c,u,r,n])}const bM=h.createContext({...qs,scaleX:1,scaleY:1});var Xi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Xi||(Xi={}));const uy=h.memo(function(t){var n,r,s,i;let{id:c,accessibility:u,autoScroll:f=!0,children:m,sensors:x=rue,collisionDetection:g=gce,measuring:y,modifiers:v,...S}=t;const b=h.useReducer(lue,void 0,iue),[E,R]=b,[j,_]=ice(),[D,O]=h.useState(Xi.Uninitialized),A=D===Xi.Initialized,{draggable:{active:T,nodes:M,translate:k},droppable:{containers:z}}=E,L=T!=null?M.get(T):null,G=h.useRef({initial:null,translated:null}),B=h.useMemo(()=>{var En;return T!=null?{id:T,data:(En=L==null?void 0:L.data)!=null?En:aue,rect:G}:null},[T,L]),q=h.useRef(null),[V,I]=h.useState(null),[K,$]=h.useState(null),ee=uh(S,Object.values(S)),me=Jh("DndDescribedBy",c),U=h.useMemo(()=>z.getEnabled(),[z]),F=due(y),{droppableRects:H,measureDroppableContainers:W,measuringScheduled:Q}=Gce(U,{dragging:A,dependencies:[k.x,k.y],config:F.droppable}),le=$ce(M,T),J=h.useMemo(()=>K?eS(K):null,[K]),ie=js(),ye=qce(le,F.draggable.measure);fue({activeNode:T!=null?M.get(T):null,config:ie.layoutShiftCompensation,initialRect:ye,measure:F.draggable.measure});const Ee=jN(le,F.draggable.measure,ye),He=jN(le?le.parentElement:null),Re=h.useRef({activatorEvent:null,active:null,activeNode:le,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ke=z.getNodeFor((n=Re.current.over)==null?void 0:n.id),nt=nue({measure:F.dragOverlay.measure}),Gt=(r=nt.nodeRef.current)!=null?r:le,Ft=A?(s=nt.rect)!=null?s:Ee:null,On=!!(nt.nodeRef.current&&nt.rect),vn=Yce(On?null:Ee),ke=yM(Gt?Oa(Gt):null),Y=Zce(A?Ke??le:null),re=eue(Y),ce=uue(v,{transform:{x:k.x-vn.x,y:k.y-vn.y,scaleX:1,scaleY:1},activatorEvent:K,active:B,activeNodeRect:Ee,containerNodeRect:He,draggingNodeRect:Ft,over:Re.current.over,overlayNodeRect:nt.rect,scrollableAncestors:Y,scrollableAncestorRects:re,windowRect:ke}),Ie=J?Zu(J,k):null,je=Xce(Y),Te=_N(je),Ve=_N(je,[Ee]),bt=Zu(ce,Te),st=Ft?vce(Ft,ce):null,tn=B&&st?g({active:B,collisionRect:st,droppableRects:H,droppableContainers:U,pointerCoordinates:Ie}):null,or=mce(tn,"id"),[Vn,Lr]=h.useState(null),ea=On?ce:Zu(ce,Ve),pn=xce(ea,(i=Vn==null?void 0:Vn.rect)!=null?i:null,Ee),ir=h.useRef(null),kn=h.useCallback((En,In)=>{let{sensor:Ze,options:Zt}=In;if(q.current==null)return;const nn=M.get(q.current);if(!nn)return;const Xt=En.nativeEvent,$n=new Ze({active:q.current,activeNode:nn,event:Xt,options:Zt,context:Re,onAbort(rn){if(!M.get(rn))return;const{onDragAbort:Z}=ee.current,te={id:rn};Z==null||Z(te),j({type:"onDragAbort",event:te})},onPending(rn,Tr,Z,te){if(!M.get(rn))return;const{onDragPending:Ce}=ee.current,Ae={id:rn,constraint:Tr,initialCoordinates:Z,offset:te};Ce==null||Ce(Ae),j({type:"onDragPending",event:Ae})},onStart(rn){const Tr=q.current;if(Tr==null)return;const Z=M.get(Tr);if(!Z)return;const{onDragStart:te}=ee.current,fe={activatorEvent:Xt,active:{id:Tr,data:Z.data,rect:G}};Us.unstable_batchedUpdates(()=>{te==null||te(fe),O(Xi.Initializing),R({type:Sr.DragStart,initialCoordinates:rn,active:Tr}),j({type:"onDragStart",event:fe}),I(ir.current),$(Xt)})},onMove(rn){R({type:Sr.DragMove,coordinates:rn})},onEnd:an(Sr.DragEnd),onCancel:an(Sr.DragCancel)});ir.current=$n;function an(rn){return async function(){const{active:Z,collisions:te,over:fe,scrollAdjustedTranslate:Ce}=Re.current;let Ae=null;if(Z&&Ce){const{cancelDrop:Ge}=ee.current;Ae={activatorEvent:Xt,active:Z,collisions:te,delta:Ce,over:fe},rn===Sr.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(Ae))&&(rn=Sr.DragCancel)}q.current=null,Us.unstable_batchedUpdates(()=>{R({type:rn}),O(Xi.Uninitialized),Lr(null),I(null),$(null),ir.current=null;const Ge=rn===Sr.DragEnd?"onDragEnd":"onDragCancel";if(Ae){const Fe=ee.current[Ge];Fe==null||Fe(Ae),j({type:Ge,event:Ae})}})}}},[M]),Qs=h.useCallback((En,In)=>(Ze,Zt)=>{const nn=Ze.nativeEvent,Xt=M.get(Zt);if(q.current!==null||!Xt||nn.dndKit||nn.defaultPrevented)return;const $n={active:Xt};En(Ze,In.options,$n)===!0&&(nn.dndKit={capturedBy:In.sensor},q.current=Zt,kn(Ze,In))},[M,kn]),Ia=Bce(x,Qs);Qce(x),To(()=>{Ee&&D===Xi.Initializing&&O(Xi.Initialized)},[Ee,D]),h.useEffect(()=>{const{onDragMove:En}=ee.current,{active:In,activatorEvent:Ze,collisions:Zt,over:nn}=Re.current;if(!In||!Ze)return;const Xt={active:In,activatorEvent:Ze,collisions:Zt,delta:{x:bt.x,y:bt.y},over:nn};Us.unstable_batchedUpdates(()=>{En==null||En(Xt),j({type:"onDragMove",event:Xt})})},[bt.x,bt.y]),h.useEffect(()=>{const{active:En,activatorEvent:In,collisions:Ze,droppableContainers:Zt,scrollAdjustedTranslate:nn}=Re.current;if(!En||q.current==null||!In||!nn)return;const{onDragOver:Xt}=ee.current,$n=Zt.get(or),an=$n&&$n.rect.current?{id:$n.id,rect:$n.rect.current,data:$n.data,disabled:$n.disabled}:null,rn={active:En,activatorEvent:In,collisions:Ze,delta:{x:nn.x,y:nn.y},over:an};Us.unstable_batchedUpdates(()=>{Lr(an),Xt==null||Xt(rn),j({type:"onDragOver",event:rn})})},[or]),To(()=>{Re.current={activatorEvent:K,active:B,activeNode:le,collisionRect:st,collisions:tn,droppableRects:H,draggableNodes:M,draggingNode:Gt,draggingNodeRect:Ft,droppableContainers:z,over:Vn,scrollableAncestors:Y,scrollAdjustedTranslate:bt},G.current={initial:Ft,translated:st}},[B,le,tn,st,M,Gt,Ft,H,z,Vn,Y,bt]),Fce({...ie,delta:k,draggingRect:st,pointerCoordinates:Ie,scrollableAncestors:Y,scrollableAncestorRects:re});const ta=h.useMemo(()=>({active:B,activeNode:le,activeNodeRect:Ee,activatorEvent:K,collisions:tn,containerNodeRect:He,dragOverlay:nt,draggableNodes:M,droppableContainers:z,droppableRects:H,over:Vn,measureDroppableContainers:W,scrollableAncestors:Y,scrollableAncestorRects:re,measuringConfiguration:F,measuringScheduled:Q,windowRect:ke}),[B,le,Ee,K,tn,He,nt,M,z,H,Vn,W,Y,re,F,Q,ke]),Ma=h.useMemo(()=>({activatorEvent:K,activators:Ia,active:B,activeNodeRect:Ee,ariaDescribedById:{draggable:me},dispatch:R,draggableNodes:M,over:Vn,measureDroppableContainers:W}),[K,Ia,B,Ee,R,me,M,Vn,W]);return ae.createElement(iM.Provider,{value:_},ae.createElement(cy.Provider,{value:Ma},ae.createElement(vM.Provider,{value:ta},ae.createElement(bM.Provider,{value:pn},m)),ae.createElement(cue,{disabled:(u==null?void 0:u.restoreFocus)===!1})),ae.createElement(uce,{...u,hiddenTextDescribedById:me}));function js(){const En=(V==null?void 0:V.autoScrollEnabled)===!1,In=typeof f=="object"?f.enabled===!1:f===!1,Ze=A&&!En&&!In;return typeof f=="object"?{...f,enabled:Ze}:{enabled:Ze}}}),hue=h.createContext(null),AN="button",mue="Draggable";function pue(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Jh(mue),{activators:c,activatorEvent:u,active:f,activeNodeRect:m,ariaDescribedById:x,draggableNodes:g,over:y}=h.useContext(cy),{role:v=AN,roleDescription:S="draggable",tabIndex:b=0}=s??{},E=(f==null?void 0:f.id)===t,R=h.useContext(E?bM:hue),[j,_]=Ug(),[D,O]=Ug(),A=Jce(c,t),T=uh(n);To(()=>(g.set(t,{id:t,key:i,node:j,activatorNode:D,data:T}),()=>{const k=g.get(t);k&&k.key===i&&g.delete(t)}),[g,t]);const M=h.useMemo(()=>({role:v,tabIndex:b,"aria-disabled":r,"aria-pressed":E&&v===AN?!0:void 0,"aria-roledescription":S,"aria-describedby":x.draggable}),[r,v,b,E,S,x.draggable]);return{active:f,activatorEvent:u,activeNodeRect:m,attributes:M,isDragging:E,listeners:r?void 0:A,node:j,over:y,setNodeRef:_,setActivatorNodeRef:O,transform:R}}function gue(){return h.useContext(vM)}const xue="Droppable",yue={timeout:25};function vue(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Jh(xue),{active:c,dispatch:u,over:f,measureDroppableContainers:m}=h.useContext(cy),x=h.useRef({disabled:n}),g=h.useRef(!1),y=h.useRef(null),v=h.useRef(null),{disabled:S,updateMeasurementsFor:b,timeout:E}={...yue,...s},R=uh(b??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},E)},[E]),_=ly({callback:j,disabled:S||!c}),D=h.useCallback((M,k)=>{_&&(k&&(_.unobserve(k),g.current=!1),M&&_.observe(M))},[_]),[O,A]=Ug(D),T=uh(t);return h.useEffect(()=>{!_||!O.current||(_.disconnect(),g.current=!1,_.observe(O.current))},[O,_]),h.useEffect(()=>(u({type:Sr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:O,rect:y,data:T}}),()=>u({type:Sr.UnregisterDroppable,key:i,id:r})),[r]),h.useEffect(()=>{n!==x.current.disabled&&(u({type:Sr.SetDroppableDisabled,id:r,key:i,disabled:n}),x.current.disabled=n)},[r,i,n,u]),{active:c,rect:y,isOver:(f==null?void 0:f.id)===r,node:O,over:f,setNodeRef:A}}function SM(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function bue(e,t){return e.reduce((n,r,s)=>{const i=t.get(r);return i&&(n[s]=i),n},Array(e.length))}function Pp(e){return e!==null&&e>=0}function Sue(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 Cue(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const CM=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const i=SM(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}},Up={scaleX:1,scaleY:1},dy=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,...Up}:null}const f=Eue(i,s,n);return s>n&&s<=c?{x:0,y:-u.height-f,...Up}:s<n&&s>=c?{x:0,y:u.height+f,...Up}:{x:0,y:0,...Up}};function Eue(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 EM="Sortable",wM=ae.createContext({activeIndex:-1,containerId:EM,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:CM,disabled:{draggable:!1,droppable:!1}});function fy(e){let{children:t,id:n,items:r,strategy:s=CM,disabled:i=!1}=e;const{active:c,dragOverlay:u,droppableRects:f,over:m,measureDroppableContainers:x}=gue(),g=Jh(EM,n),y=u.rect!==null,v=h.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),S=c!=null,b=c?v.indexOf(c.id):-1,E=m?v.indexOf(m.id):-1,R=h.useRef(v),j=!Sue(v,R.current),_=E!==-1&&b===-1||j,D=Cue(i);To(()=>{j&&S&&x(v)},[j,v,S,x]),h.useEffect(()=>{R.current=v},[v]);const O=h.useMemo(()=>({activeIndex:b,containerId:g,disabled:D,disableTransforms:_,items:v,overIndex:E,useDragOverlay:y,sortedRects:bue(v,f),strategy:s}),[b,g,D.draggable,D.droppable,_,v,E,f,y,s]);return ae.createElement(wM.Provider,{value:O},t)}const wue=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return SM(n,r,s).indexOf(t)},Rue=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},jue={duration:200,easing:"ease"},RM="transform",Tue=dh.Transition.toString({property:RM,duration:0,easing:"linear"}),_ue={roleDescription:"sortable"};function Nue(e){let{disabled:t,index:n,node:r,rect:s}=e;const[i,c]=h.useState(null),u=h.useRef(n);return To(()=>{if(!t&&n!==u.current&&r.current){const f=s.current;if(f){const m=_d(r.current,{ignoreTransform:!0}),x={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(x.x||x.y)&&c(x)}}n!==u.current&&(u.current=n)},[t,n,r,s]),h.useEffect(()=>{i&&c(null)},[i]),i}function Aue(e){let{animateLayoutChanges:t=Rue,attributes:n,disabled:r,data:s,getNewIndex:i=wue,id:c,strategy:u,resizeObserverConfig:f,transition:m=jue}=e;const{items:x,containerId:g,activeIndex:y,disabled:v,disableTransforms:S,sortedRects:b,overIndex:E,useDragOverlay:R,strategy:j}=h.useContext(wM),_=Due(r,v),D=x.indexOf(c),O=h.useMemo(()=>({sortable:{containerId:g,index:D,items:x},...s}),[g,s,D,x]),A=h.useMemo(()=>x.slice(x.indexOf(c)),[x,c]),{rect:T,node:M,isOver:k,setNodeRef:z}=vue({id:c,data:O,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...f}}),{active:L,activatorEvent:G,activeNodeRect:B,attributes:q,setNodeRef:V,listeners:I,isDragging:K,over:$,setActivatorNodeRef:ee,transform:me}=pue({id:c,data:O,attributes:{..._ue,...n},disabled:_.draggable}),U=Xle(z,V),F=!!L,H=F&&!S&&Pp(y)&&Pp(E),W=!R&&K,Q=W&&H?me:null,J=H?Q??(u??j)({rects:b,activeNodeRect:B,activeIndex:y,overIndex:E,index:D}):null,ie=Pp(y)&&Pp(E)?i({id:c,items:x,activeIndex:y,overIndex:E}):D,ye=L==null?void 0:L.id,Ee=h.useRef({activeId:ye,items:x,newIndex:ie,containerId:g}),He=x!==Ee.current.items,Re=t({active:L,containerId:g,isDragging:K,isSorting:F,id:c,index:D,items:x,newIndex:Ee.current.newIndex,previousItems:Ee.current.items,previousContainerId:Ee.current.containerId,transition:m,wasDragging:Ee.current.activeId!=null}),Ke=Nue({disabled:!Re,index:D,node:M,rect:T});return h.useEffect(()=>{F&&Ee.current.newIndex!==ie&&(Ee.current.newIndex=ie),g!==Ee.current.containerId&&(Ee.current.containerId=g),x!==Ee.current.items&&(Ee.current.items=x)},[F,ie,g,x]),h.useEffect(()=>{if(ye===Ee.current.activeId)return;if(ye&&!Ee.current.activeId){Ee.current.activeId=ye;return}const Gt=setTimeout(()=>{Ee.current.activeId=ye},50);return()=>clearTimeout(Gt)},[ye]),{active:L,activeIndex:y,attributes:q,data:O,rect:T,index:D,newIndex:ie,items:x,isOver:k,isSorting:F,isDragging:K,listeners:I,node:M,overIndex:E,over:$,setNodeRef:U,setActivatorNodeRef:ee,setDroppableNodeRef:z,setDraggableNodeRef:V,transform:Ke??J,transition:nt()};function nt(){if(Ke||He&&Ee.current.newIndex===D)return Tue;if(!(W&&!jC(G)||!m)&&(F||Re))return dh.Transition.toString({...m,property:RM})}}function Due(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}}yn.Down,yn.Right,yn.Up,yn.Left;function Xu({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),[x,g]=h.useState(e),y=h.useRef(null),v=j=>{g(j.target.value)},S=()=>{n&&x!==e&&n(x.trim()),m(!1)},b=()=>{g(e),m(!1)},E=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),S()):j.key==="Escape"&&(j.preventDefault(),b())},R=j=>{m(j),j?(g(e),setTimeout(()=>{y.current&&y.current.focus()},0)):b()};return a.jsxs(dC,{open:f,onOpenChange:R,children:[a.jsx(fC,{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(hC,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(Ao,{ref:y,value:x,onChange:v,onKeyDown:E,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:b,className:"h-7 cursor-pointer px-2 text-xs",children:u}),a.jsx(we,{size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function Oue({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(JP,{className:"h-4 w-4"}):a.jsx(wS,{className:"h-4 w-4"})})}function Iue({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(Es,{className:"h-4 w-4"}):a.jsx(Da,{className:"h-4 w-4"})})}function Mue({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(UA,{className:"h-4 w-4 text-gray-400"})})}function hy({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,transition:c,isDragging:u}=Aue({id:e}),f={transform:dh.Transform.toString(i),transition:c,opacity:u?.75:1},m=h.Children.toArray(t),x=[a.jsx(Gr,{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(Mue,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return a.jsx(Hn,{ref:s,style:f,className:"group",children:x})}function jM({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(wr,{children:[a.jsx(Rr,{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(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(jr,{align:"end",children:[u&&a.jsxs(Tt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[a.jsx(ga,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&a.jsx(ua,{}),f&&a.jsxs(Tt,{onClick:()=>{i(!0)},children:[a.jsx(ts,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(Cr,{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 kue({mode:e,onModeChange:t}){const n=Object.values(lh),r=s=>{t&&t(s)};return a.jsxs(fa,{value:e,onValueChange:r,children:[a.jsx(ma,{className:"h-90 cursor-pointer",size:"sm",children:a.jsx(ha,{placeholder:"Select field mode"})}),a.jsx(pa,{className:"max-h-[300px]",children:n.map(s=>a.jsx(Gn,{value:s,children:s},s))})]})}var my="Checkbox",[Lue]=Er(my),[Pue,AC]=Lue(my);function Uue(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:i,form:c,name:u,onCheckedChange:f,required:m,value:x="on",internal_do_not_use_render:g}=e,[y,v]=ca({prop:n,defaultProp:s??!1,onChange:f,caller:my}),[S,b]=h.useState(null),[E,R]=h.useState(null),j=h.useRef(!1),_=S?!!c||!!S.closest("form"):!0,D={checked:y,disabled:i,setChecked:v,control:S,setControl:b,name:u,form:c,value:x,hasConsumerStoppedPropagationRef:j,required:m,defaultChecked:fl(s)?!1:s,isFormControl:_,bubbleInput:E,setBubbleInput:R};return a.jsx(Pue,{scope:t,...D,children:zue(g)?g(D):r})}var TM="CheckboxTrigger",_M=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:i,value:c,disabled:u,checked:f,required:m,setControl:x,setChecked:g,hasConsumerStoppedPropagationRef:y,isFormControl:v,bubbleInput:S}=AC(TM,e),b=vt(s,x),E=h.useRef(f);return h.useEffect(()=>{const R=i==null?void 0:i.form;if(R){const j=()=>g(E.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[i,g]),a.jsx(et.button,{type:"button",role:"checkbox","aria-checked":fl(f)?"mixed":f,"aria-required":m,"data-state":MM(f),"data-disabled":u?"":void 0,disabled:u,value:c,...r,ref:b,onKeyDown:Me(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Me(n,R=>{g(j=>fl(j)?!0:!j),S&&v&&(y.current=R.isPropagationStopped(),y.current||R.stopPropagation())})})});_M.displayName=TM;var NM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:c,disabled:u,value:f,onCheckedChange:m,form:x,...g}=e;return a.jsx(Uue,{__scopeCheckbox:n,checked:s,defaultChecked:i,disabled:u,required:c,onCheckedChange:m,name:r,form:x,value:f,internal_do_not_use_render:({isFormControl:y})=>a.jsxs(a.Fragment,{children:[a.jsx(_M,{...g,ref:t,__scopeCheckbox:n}),y&&a.jsx(IM,{__scopeCheckbox:n})]})})});NM.displayName=my;var AM="CheckboxIndicator",DM=h.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,i=AC(AM,n);return a.jsx(qr,{present:r||fl(i.checked)||i.checked===!0,children:a.jsx(et.span,{"data-state":MM(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});DM.displayName=AM;var OM="CheckboxBubbleInput",IM=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:i,defaultChecked:c,required:u,disabled:f,name:m,value:x,form:g,bubbleInput:y,setBubbleInput:v}=AC(OM,e),S=vt(n,v),b=G2(i),E=HS(r);h.useEffect(()=>{const j=y;if(!j)return;const _=window.HTMLInputElement.prototype,O=Object.getOwnPropertyDescriptor(_,"checked").set,A=!s.current;if(b!==i&&O){const T=new Event("click",{bubbles:A});j.indeterminate=fl(i),O.call(j,fl(i)?!1:i),j.dispatchEvent(T)}},[y,b,i,s]);const R=h.useRef(fl(i)?!1:i);return a.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:u,disabled:f,name:m,value:x,form:g,...t,tabIndex:-1,ref:S,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});IM.displayName=OM;function zue(e){return typeof e=="function"}function fl(e){return e==="indeterminate"}function MM(e){return fl(e)?"indeterminate":e?"checked":"unchecked"}function Fue({className:e,...t}){return a.jsx(NM,{"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(DM,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(la,{className:"size-3.5"})})})}function kM({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return a.jsx(Fue,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const DN={[Na.CONNECTED]:{icon:Ch,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[Na.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Eh,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[Na.DISCONNECTED]:{icon:xz,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function LM({status:e}){if(!(e in DN))return null;const t=DN[e],{icon:n,color:r,label:s,description:i}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(Xa,{children:a.jsxs(wt,{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 py({type:e,storageType:t,onTypeChange:n}){const r=t===xe.GOOGLE_BIGQUERY?Object.values(ar):t===xe.AWS_ATHENA?Object.values(M2):t===xe.SNOWFLAKE?Object.values(k2):Object.values(L2),s=i=>{n&&(t===xe.GOOGLE_BIGQUERY||t===xe.AWS_ATHENA||xe.SNOWFLAKE,n(i))};return a.jsxs(fa,{value:e,onValueChange:s,children:[a.jsx(ma,{className:"cursor-pointer",size:"sm",children:a.jsx(ha,{placeholder:"Select field type"})}),a.jsx(pa,{className:"max-h-[300px]",children:r.map(i=>a.jsx(Gn,{value:i,children:i},i))})]})}function Hue({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(wr,{children:[a.jsx(Rr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(Tt,{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(la,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function Vue({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 x=h.useCallback(g=>{const y=g.target.value;f(y);const v=setTimeout(()=>{r(y)},s);return()=>{clearTimeout(v)}},[r,s]);return a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Ac,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),a.jsx(dt,{id:e,placeholder:t,value:u,onChange:x,className:i??"dm-card-toolbar-search-input","aria-label":c??t})]})}function $ue({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(Vue,{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(LM,{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(ga,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const Bue={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function ON(e,t={}){const n=Bue[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}=Cs(),x=t,g=i,y=u,{columnVisibility:v,setColumnVisibility:S}=qle(x),b=jl({data:e,columns:x,getCoreRowModel:Rl(),getFilteredRowModel:Sd(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:v},onColumnVisibilityChange:S,enableGlobalFilter:!0,globalFilterFn:Kle,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:E,onChange:R,searchValue:j}=Wle(b),_=h.useRef("");h.useEffect(()=>{s&&j!==_.current&&(_.current=j,s(j))},[j,s]);const D=h.useMemo(()=>{const T={[Na.CONNECTED]:0,[Na.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[Na.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($ue,{table:b,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:E,onFilterChange:R,statusCounts:D,disabled:m}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(Tl,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(_l,{className:"dm-card-table-header",children:b.getHeaderGroups().map(T=>a.jsx(Hn,{className:"dm-card-table-header-row",children:T.headers.map(M=>a.jsx(Al,{className:"bg-secondary dark:bg-background",style:ON(M.column.id,{width:M.getSize()!==0?M.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:M.isPlaceholder?null:typeof M.column.columnDef.header=="function"?M.column.columnDef.header(M.getContext()):M.column.columnDef.header},M.id))},T.id))}),a.jsx(Nl,{className:"dm-card-table-body",children:b.getRowModel().rows.length?a.jsx(g,{...c,children:b.getRowModel().rows.map(T=>a.jsx(y,{id:f?f(T):T.index,row:T,children:T.getVisibleCells().map(M=>a.jsx(Gr,{className:"bg-background dark:bg-muted",style:ON(M.column.id,{width:M.column.getSize()!==0?M.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:M.column.columnDef.cell&&typeof M.column.columnDef.cell=="function"?M.column.columnDef.cell(M.getContext()):null},M.id))},T.id))}):a.jsx(Hn,{children:a.jsx(Gr,{colSpan:x.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(ga,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function gy({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:i=[],fieldsForStatusCount:c,onSearchChange:u,nameColumnHeader:f,nameColumnCell:m,primaryKeyColumnCell:x,aliasColumnCell:g,descriptionColumnCell:y,actionsColumnCell:v,dragContext:S,dragContextProps:b,rowComponent:E,getRowId:R}){const j=h.useCallback((T,M)=>{if(t){const k=[...e];k[T]={...k[T],...M},t(k)}},[e,t]),_=h.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),D=h.useCallback(T=>{if(t){const M=[...e];M.splice(T,1),t(M)}},[e,t]),O=h.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>a.jsx(LM,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(wt,{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(Xu,{value:$le(T.getValue("name")),onValueChange:M=>{j(T.index,{name:M})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(wt,{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})=>x?x({row:T,updateField:j}):a.jsx(kM,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:M=>{j(T.index,{isPrimaryKey:M})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(wt,{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(Xu,{value:T.getValue("alias"),onValueChange:M=>{j(T.index,{alias:M})},placeholder:"-"})},{accessorKey:"description",header:()=>a.jsxs(wt,{children:[a.jsx(Rt,{className:"cursor-default",children:"Description"}),a.jsx(jt,{children:"Detailed information about the field"})]}),cell:({row:T})=>y?y({row:T,updateField:j}):a.jsx(Xu,{value:T.getValue("description"),onValueChange:M=>{j(T.index,{description:M})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:T})=>a.jsx(Hue,{table:T}),cell:({row:T,table:M})=>v?v({row:T,table:M}):a.jsx(jM,{row:T,onDeleteRow:t?D:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,D,t,f,m,x,g,y,v]),A=h.useMemo(()=>{const M={accessorKey:"type",header:()=>a.jsxs(wt,{children:[a.jsx(Rt,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(jt,{children:"Data type of the field"})]}),size:80,cell:z=>s({row:z.row,updateField:j}),enableHiding:!1},k=[...O];if(k.splice(3,0,M),i.length>0){const z=[...i];z.sort((L,G)=>{const B=L.columnIndex??1/0,q=G.columnIndex??1/0;return B-q}),z.forEach(L=>{if(L.columnIndex!==void 0){const G=Math.min(Math.max(0,L.columnIndex),k.length);k.splice(G,0,L)}else k.splice(k.length-1,0,L)})}return k},[O,s,j,i]);return a.jsx(Gue,{fields:e,columns:A,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:u,dragContext:S,dragContextProps:b,rowComponent:E,getRowId:R})}function que({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:i,flattenedFields:c,handleSearchChange:u,isRecordType:f,topLevelFields:m,allExpanded:x}=Yle(e),{updateField:g,handleDeleteRow:y,handleAddNestedField:v,handleAddRow:S}=Zle(e,c,t,L=>L),b=h.useCallback(()=>({name:"",type:ar.STRING,mode:lh.NULLABLE,isPrimaryKey:!1,status:Na.DISCONNECTED}),[]),E=h.useCallback(({row:L})=>a.jsx(py,{type:L.getValue("type"),storageType:xe.GOOGLE_BIGQUERY,onTypeChange:G=>{g(L.index,{type:G})}}),[g]),R=h.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(wt,{children:[a.jsx(Rt,{className:"cursor-default pl-[12px]",children:"Mode"}),a.jsx(jt,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
828
+ NULLABLE - field can be NULL
829
+ REQUIRED - field cant be NULL
830
+ REPEATED - field is an Array of Type`})]}),size:80,cell:({row:L})=>a.jsx(kue,{mode:L.getValue("mode"),onModeChange:G=>{g(L.index,{mode:G})}}),columnIndex:4}],[g]),j=h.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(Oue,{isAllExpanded:x,onToggle:i}),a.jsxs(wt,{children:[a.jsx(Rt,{className:"cursor-default",children:"Name"}),a.jsx(jt,{children:"Field name in the output schema"})]})]}),[r,x,i]),_=h.useCallback(({row:L})=>{const G=c[L.index],q=(G.type===ar.RECORD||G.type===ar.STRUCT)&&G.fields&&G.fields.length>0,V=G.path??"",I=G.level??0,K=n.has(V);return a.jsxs("div",{className:"flex items-center",children:[I>0&&a.jsx("div",{style:{width:`${String(I*16-(q?4:0))}px`},className:"flex-shrink-0"}),q?a.jsx(Iue,{isExpanded:K,onToggle:()=>{s(V)},ariaLabel:K?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(Xu,{value:L.getValue("name"),onValueChange:$=>{g(L.index,{name:$})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,g]),D=h.useCallback(({row:L})=>{const G=c[L.index],B=G.type===ar.RECORD||G.type===ar.STRUCT;return(G.level??0)===0&&!B?a.jsx(kM,{isPrimaryKey:L.getValue("isPrimaryKey"),onPrimaryKeyChange:V=>{g(L.index,{isPrimaryKey:V})}}):a.jsx("div",{})},[c,g]),O=h.useCallback(({row:L})=>a.jsx(Xu,{value:L.getValue("description"),onValueChange:G=>{g(L.index,{description:G})},minRows:5,placeholder:"-"}),[g]),A=h.useCallback(({row:L})=>a.jsx(Xu,{value:L.getValue("alias"),onValueChange:G=>{g(L.index,{alias:G})},placeholder:"-"}),[g]),T=h.useCallback(({row:L})=>a.jsx(jM,{row:L,onDeleteRow:t?y:void 0,onAddNestedField:t?v:void 0,isRecordType:f}),[t,y,v,f]),{handleDragEnd:M}=ry(e,t,c),k=h.useCallback(L=>{const G=c[L.index];return G.path??String(c.indexOf(G))},[c]),z=oy(sy(Nd,{activationConstraint:{distance:5}}));return a.jsx(uy,{sensors:z,collisionDetection:iy,onDragEnd:M,children:a.jsx(gy,{fields:c,onFieldsChange:t,onAddRow:S,createNewField:b,renderTypeCell:E,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:u,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:D,aliasColumnCell:A,descriptionColumnCell:O,actionsColumnCell:T,dragContext:fy,dragContextProps:{items:c.map(L=>L.path??String(c.indexOf(L))),strategy:dy},rowComponent:hy,getRowId:k})})}function Kue({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:M2.STRING,isPrimaryKey:!1,status:Na.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(py,{type:c.getValue("type"),storageType:xe.AWS_ATHENA,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=ry(e,t),i=oy(sy(Nd,{activationConstraint:{distance:5}}));return a.jsx(uy,{sensors:i,collisionDetection:iy,onDragEnd:s,children:a.jsx(gy,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:fy,dragContextProps:{items:e.map((c,u)=>u),strategy:dy},rowComponent:hy})})}function Wue({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:k2.VARCHAR,isPrimaryKey:!1,status:Na.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(py,{type:c.getValue("type"),storageType:xe.SNOWFLAKE,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=ry(e,t),i=oy(sy(Nd,{activationConstraint:{distance:5}}));return a.jsx(uy,{sensors:i,collisionDetection:iy,onDragEnd:s,children:a.jsx(gy,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:fy,dragContextProps:{items:e.map((c,u)=>u),strategy:dy},rowComponent:hy})})}function Yue({fields:e,onFieldsChange:t}){const n=h.useCallback(()=>({name:"",type:L2.VARCHAR,isPrimaryKey:!1,status:Na.DISCONNECTED}),[]),r=h.useCallback(({row:c,updateField:u})=>a.jsx(py,{type:c.getValue("type"),storageType:xe.AWS_REDSHIFT,onTypeChange:f=>{u(c.index,{type:f})}}),[]),{handleDragEnd:s}=ry(e,t),i=oy(sy(Nd,{activationConstraint:{distance:5}}));return a.jsx(uy,{sensors:i,collisionDetection:iy,onDragEnd:s,children:a.jsx(gy,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:fy,dragContextProps:{items:e.map((c,u)=>u),strategy:dy},rowComponent:hy})})}function Zue({schema:e,storageType:t,onFieldsChange:n}){const r=h.useMemo(()=>{if(!e){const s=Vle(t);return n(s.fields),s}return e},[e,t,n]);return J6(r)?a.jsx(que,{fields:r.fields,onFieldsChange:n}):eM(r)?a.jsx(Kue,{fields:r.fields,onFieldsChange:n}):tM(r)?a.jsx(Wue,{fields:r.fields,onFieldsChange:n}):nM(r)?a.jsx(Yue,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function Xue({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:s,runSchemaActualization:i,isSchemaActualizationLoading:c}=Cs(),{id:u="",schema:f}=t??{},{schema:m,isDirty:x,updateSchema:g,resetSchema:y}=Ble(f),{operationStatus:v,startSaveOperation:S}=Gle(r,s);h.useEffect(()=>{v==="success"&&y()},[v,y]);const b=h.useCallback(D=>{g(D)},[g]),E=h.useCallback(()=>{u&&m&&(S(),n(u,m).then(()=>{i==null||i()}))},[u,m,S,n,i]),R=h.useCallback(()=>{i==null||i()},[i]),j=h.useCallback(()=>{y()},[y]),_=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx(Zue,{schema:m,storageType:t.storage.type,onFieldsChange:b}),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:E,disabled:!x||_,children:"Save"}),a.jsx(we,{type:"button",variant:"ghost",onClick:j,disabled:!x||_,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 Que(){const e=Xg(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(N5,{children:a.jsx(Tae,{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 Jue({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 ede({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 tde({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:se("leading-none font-semibold",e),...t})}function nde({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:se("text-muted-foreground text-sm",e),...t})}function rde({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:se("px-6",e),...t})}function ade({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 DC=h.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function So({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=h.useContext(DC);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(tde,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(nde,{className:se("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&a.jsx(Xa,{children:a.jsxs(wt,{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(Or,{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})})]})})]})}So.displayName="CollapsibleCardHeaderTitle";function em({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})}em.displayName="CollapsibleCardHeaderActions";function Co({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=h.useContext(DC);let s,i;return h.Children.forEach(e,c=>{if(h.isValidElement(c))switch(c.type){case So:s=c;break;case em:i=c;break}}),a.jsxs(ede,{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(Es,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}Co.displayName="CollapsibleCardHeader";function Eo({children:e}){return a.jsx(rde,{className:"px-4 pt-1",children:e})}Eo.displayName="CollapsibleCardContent";function li({left:e,right:t}){return a.jsxs(ade,{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})]})}li.displayName="CollapsibleCardFooter";const IN="collapsed-card-";function hl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:i,name:c}){const u=c?xs.get(`${IN}${c}`,"boolean")??s:s,[f,m]=h.useState(u);h.useEffect(()=>{c&&xs.set(`${IN}${c}`,f)},[f,c]);const x=()=>{const b=!f;m(b),i==null||i(b)};let g,y,v;h.Children.forEach(e,b=>{if(h.isValidElement(b))switch(b.type){case Co:g=b;break;case Eo:y=b;break;case li:v=b;break}});const S={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(DC.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:x},children:a.jsxs(Jue,{className:se(S[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:[y,v]})})]})})}function sde(){const{dataMart:e,updateDataMartStorage:t}=Rs(),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(hl,{collapsible:!0,name:"data-storage",children:[a.jsx(Co,{children:a.jsx(So,{icon:fc,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(Eo,{children:(e==null?void 0:e.storage)&&a.jsx(rie,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx(li,{})]}),a.jsxs(hl,{collapsible:!0,name:"input-source",children:[a.jsx(Co,{children:a.jsx(So,{icon:RS,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(Eo,{children:e&&a.jsx(Hle,{definitionType:r,initialDefinitionType:n,setDefinitionType:s})}),a.jsx(li,{})]}),a.jsxs(hl,{collapsible:!0,name:"output-schema",children:[a.jsx(Co,{children:a.jsx(So,{icon:uU,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(Eo,{children:e&&a.jsx(Xue,{definitionType:r})}),a.jsx(li,{})]})]})}function ode({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:x,runReport:g}=ns(),y=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await x(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,x,t,e.original.id,e.original.dataMart.id]),S=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),b=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]),E=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(wr,{open:i,onOpenChange:c,children:[a.jsx(Rr,{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":y,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(Ws,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(jr,{id:y,align:"end",role:"menu",children:[a.jsxs(Tt,{onClick:R=>{R.stopPropagation(),S()},role:"menuitem",children:[a.jsx(dd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),zx(e.original.destinationConfig)&&a.jsxs(a.Fragment,{children:[a.jsx(ua,{}),a.jsxs(Tt,{onClick:R=>{R.stopPropagation(),b()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Jg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(Tt,{asChild:!0,children:a.jsxs("a",{href:h2(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[a.jsx(TU,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),a.jsx(ua,{}),a.jsxs(Tt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(ts,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Cr,{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 ide={[Mn.SUCCESS]:{icon:Ch,color:"text-green-500",label:"Success"},[Mn.ERROR]:{icon:og,color:"text-red-500",label:"Fail"},[Mn.RUNNING]:{icon:Nc,color:"text-primary animate-spin",label:"In progress"},[Mn.CANCELLED]:{icon:og,color:"text-gray-500",label:"Cancelled"}};function PM({status:e,error:t}){if(!e)return null;const n=ide[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(Xa,{children:a.jsxs(wt,{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 cl=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(cl||{});const lde={[cl.TITLE]:"Title",[cl.LAST_RUN_DATE]:"Last Run Date",[cl.LAST_RUN_STATUS]:"Last Run Status"},cde=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:cl.TITLE,header:({column:n})=>a.jsx(br,{column:n,children:lde[cl.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:cl.LAST_RUN_DATE,header:({column:n})=>a.jsx(br,{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(Gs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:cl.LAST_RUN_STATUS,header:({column:n})=>a.jsx(br,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(PM,{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(Cd,{table:n}),cell:({row:n})=>a.jsx(ode,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function ude({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=ns(),s=h.useMemo(()=>n.filter(y=>y.dataDestination.type===Oe.GOOGLE_SHEETS&&y.dataDestination.id===e.id),[n,e.id]);h.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const i=h.useMemo(()=>cde({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:u,columnVisibility:f,setColumnVisibility:m}=Lc({columns:i,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),x=jl({data:s,columns:i,getCoreRowModel:Rl(),onSortingChange:u,getSortedRowModel:kc(),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(Tl,{id:g,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(_l,{className:"dm-card-table-header",children:x.getHeaderGroups().map(y=>a.jsx(Hn,{className:"dm-card-table-header-row",children:y.headers.map(v=>a.jsx(Al,{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))},y.id))}),a.jsx(Nl,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map((y,v)=>a.jsx(Hn,{onClick:()=>{const S=n.find(b=>b.id===y.original.id);S&&t(S)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:y.getVisibleCells().map((S,b)=>a.jsx(Gr,{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":b+1,children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},y.id)):a.jsx(Hn,{children:a.jsx(Gr,{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 dde({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:x,runReport:g}=ns(),y=`actions-menu-${e.original.id}`,v=h.useCallback(async()=>{try{await m(e.original.id),await x(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[m,x,t,e.original.id,e.original.dataMart.id]),S=h.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),b=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]),E=h.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(wr,{open:i,onOpenChange:c,children:[a.jsx(Rr,{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":y,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(Ws,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(jr,{id:y,align:"end",role:"menu",children:[a.jsxs(Tt,{onClick:R=>{R.stopPropagation(),S()},role:"menuitem",children:[a.jsx(dd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(ua,{}),a.jsxs(Tt,{onClick:R=>{R.stopPropagation(),b()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(Jg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(ua,{}),a.jsxs(Tt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(ts,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Cr,{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 M1({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(Ju,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(Es,{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(Ju,{className:"text-muted-foreground h-4 w-4"})})]})]})}var ul=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(ul||{});const UM={[ul.TITLE]:"Title",[ul.LAST_RUN_DATE]:"Last Run Date",[ul.LAST_RUN_STATUS]:"Last Run Status"};function fde({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(wr,{children:[a.jsx(Rr,{asChild:!0,children:a.jsx(we,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=UM[t.id]||t.id;return a.jsx(Tt,{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(la,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const hde=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:ul.TITLE,header:({column:n})=>a.jsx(M1,{column:n,children:UM[ul.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:ul.LAST_RUN_DATE,header:({column:n})=>a.jsx(M1,{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(Gs,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:ul.LAST_RUN_STATUS,header:({column:n})=>a.jsx(M1,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(PM,{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(fde,{table:n}),cell:({row:n})=>a.jsx(dde,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function mde({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:s}=ns(),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(()=>hde({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:u,setSorting:f,columnVisibility:m,setColumnVisibility:x}=Lc({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),g=jl({data:i,columns:c,getCoreRowModel:Rl(),onSortingChange:f,getSortedRowModel:kc(),state:{sorting:u,columnVisibility:m},onColumnVisibilityChange:x}),y=`email-reports-table-${t.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Tl,{id:y,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(_l,{className:"dm-card-table-header",children:g.getHeaderGroups().map(v=>a.jsx(Hn,{className:"dm-card-table-header-row",children:v.headers.map(S=>a.jsx(Al,{style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},scope:"col",children:S.isPlaceholder?null:typeof S.column.columnDef.header=="function"?S.column.columnDef.header(S.getContext()):S.column.columnDef.header},S.id))},v.id))}),a.jsx(Nl,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((v,S)=>a.jsx(Hn,{onClick:()=>{const b=r.find(E=>E.id===v.original.id);b&&n(b)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":S+1,children:v.getVisibleCells().map((b,E)=>a.jsx(Gr,{className:`px-6 whitespace-normal ${b.column.id==="actions"?"actions-cell":""}`,style:b.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(b.column.getSize())}%`},role:"cell","aria-colindex":E+1,children:typeof b.column.columnDef.cell=="function"?b.column.columnDef.cell(b.getContext()):b.column.columnDef.cell},b.id))},v.id)):a.jsx(Hn,{children:a.jsx(Gr,{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 pde({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 gde({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 xde({children:e,className:t,...n}){return a.jsx("div",{className:se("text-md font-medium",t),...n,children:e})}function yde({children:e,className:t,...n}){return a.jsx("div",{className:se("text-muted-foreground text-sm",t),...n,children:e})}function vde({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(wt,{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(Nc,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(vC,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(jt,{children:u})]})}function bde({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(Da,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Sde(e){const{dataMart:t}=Cs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:i}=ns(),[c,u]=h.useState(!1),f=h.useMemo(()=>n.find(v=>v.dataDestination.type===Oe.LOOKER_STUDIO&&v.dataDestination.id===e.id),[n,e.id]),m=h.useMemo(()=>(t==null?void 0:t.status.code)===Ir.PUBLISHED,[t==null?void 0:t.status.code]),x=h.useMemo(()=>!!f,[f]),g=h.useMemo(()=>x?"Available in Looker Studio":"Not available in Looker Studio",[x]),y=h.useCallback(async v=>{if(!(!t||!m)){u(!0);try{if(v){const S={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:kr.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(S),await i(t.id)}else f&&(await s(f.id),await i(t.id))}catch(S){console.error("Failed to toggle Looker Studio report:",S)}finally{u(!1)}}},[t,m,e,f,r,s,i]);return{existingReport:f,isLoading:c,isEnabled:m,isChecked:x,dynamicTitle:g,handleSwitchChange:y}}function Cde({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:i,isChecked:c,dynamicTitle:u,handleSwitchChange:f}=Sde(e),m=h.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(pde,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[a.jsx(vde,{checked:c,disabled:!i,loading:s,onCheckedChange:x=>void f(x),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(gde,{children:[a.jsx(xde,{children:u}),a.jsx(yde,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===Mn.SUCCESS&&"successfully ",a.jsx(Gs,{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(bde,{})]})}function Ede(){const{scope:e}=vi();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(CS,{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(Xr,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(Da,{className:"h-4 w-4"})]})})]})})}function wde(){const[e,t]=h.useState(!1),[n,r]=h.useState(Nn.CREATE),[s,i]=h.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Nn.CREATE),i(null),t(!0),De({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(Nn.EDIT),i(m),t(!0),De({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),i(null),De({event:"report_close",category:"Report",action:n===Nn.EDIT?"Edit":"Create",label:"ReportForm"})}}}const Rde=[Oe.GOOGLE_SHEETS,Oe.EMAIL,Oe.SLACK,Oe.MS_TEAMS,Oe.GOOGLE_CHAT];function jde({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=hJ(e),{isOpen:s,mode:i,editingReport:c,handleAddReport:u,handleEditReport:f,handleCloseModal:m}=wde();return r?a.jsxs(a.Fragment,{children:[a.jsxs(hl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(Co,{children:[a.jsx(So,{icon:n.icon,children:e.title}),a.jsx(em,{children:Rde.includes(e.type)&&a.jsx(Tde,{dataMartStatus:t,onAddReport:u})})]}),a.jsx(Eo,{children:a.jsx(Afe,{destination:e,onEditReport:f})}),a.jsx(li,{})]}),a.jsx(Nfe,{destination:e,isOpen:s,onClose:m,mode:i,initialReport:c})]}):null}function Tde({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===Ir.DRAFT;return a.jsxs(wt,{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(ga,{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 _de({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 Nde=en({title:gt().min(1,"Title is required"),documentUrl:gt().refine(NO,"Enter a valid Google Sheets URL"),dataDestinationId:gt().min(1,"Destination is required")});function Ade({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:x,createReport:g,error:y,clearError:v}=ns();h.useEffect(()=>{f&&y&&(u(y),m(!1))},[y,f]);const S=Do({resolver:Ci(Nde),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&zx(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:b,handleSubmit:E,formState:R,reset:j}=S,{errors:_,isDirty:D}=R,O=h.useCallback(async A=>{try{u(null),v(),m(!0);const{spreadsheetId:T,sheetId:M}=BQ(A.documentUrl);if(!T){u("Invalid Google Sheets URL");return}let k;if(t===Nn.CREATE)k=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:{type:kr.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:M}});else{if(!e){u("Initial report is required for edit mode");return}k=await x(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:{type:kr.GOOGLE_SHEETS_CONFIG,spreadsheetId:T,sheetId:M}})}if(!k||y){u(y??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(k))}catch(z){console.error("onAfterSubmit failed",z)}s==null||s()}catch(T){console.error("Error submitting form:",T),u("An error occurred while submitting the form")}},[t,e,n,g,x,r,s,v,y]);return{form:S,register:b,handleSubmit:E,errors:_,isDirty:D,reset:j,formError:c,isSubmitting:f,setFormError:u,getValues:S.getValues,onSubmit:O}}function Dde(e){return e.type===ll.SCHEDULED_REPORT_RUN}function Ode(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 MN=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,kN="0 9 * * *";function Ide(e){return{id:e.id,cron:e.cronExpression,timezone:e.timeZone,enabled:e.isActive,lastRun:e.lastRunTimestamp??null,nextRun:e.nextRunTimestamp??null}}async function LN(e,t){return(await fo.getScheduledTriggers(e)).filter(s=>s.type===Fn.REPORT_RUN&&Dde(s.triggerConfig)&&s.triggerConfig.reportId===t).map(Ide)}const OC=h.forwardRef(({dataMartId:e,reportId:t,onDirtyChange:n},r)=>{const[s,i]=h.useState([]),[c,u]=h.useState([]),f=h.useRef(!1),[m,x]=h.useState(null);h.useEffect(()=>{let b=!1;async function E(){if(!e||!t){u([]),i([]),f.current=!0,n==null||n(!1);return}try{const R=await LN(e,t);b||(u(R),i(R),f.current=!0,n==null||n(!1))}catch{b||(u([]),i([]),f.current=!0,n==null||n(!1))}}return E(),()=>{b=!0}},[e,t,n]),h.useEffect(()=>{f.current&&(n==null||n(!Ode(s,c)))},[s,c,n]),h.useImperativeHandle(r,()=>({persist:async b=>{const E=c.filter(O=>O.id!==null),R=s.filter(O=>O.id!==null),j=new Map(E.map(O=>[O.id,O])),_=new Map(R.map(O=>[O.id,O]));for(const[O]of j.entries())_.get(O)||await fo.deleteScheduledTrigger(e,O);for(const[O,A]of _.entries()){const T=j.get(O);T&&(T.cron!==A.cron||T.timezone!==A.timezone||T.enabled!==A.enabled)&&await fo.updateScheduledTrigger(e,O,{cronExpression:A.cron,timeZone:A.timezone,isActive:A.enabled})}const D=s.filter(O=>!O.id);for(const O of D)await fo.createScheduledTrigger(e,{type:Fn.REPORT_RUN,cronExpression:O.cron,timeZone:O.timezone,isActive:O.enabled,triggerConfig:{type:ll.SCHEDULED_REPORT_RUN,reportId:b}});try{const O=await LN(e,b);u(O),i(O),n==null||n(!1)}catch{u(s.map(O=>({...O}))),n==null||n(!1)}}}),[e,s,c,n]);const g=()=>{i(b=>[...b,{id:null,cron:kN,timezone:MN(),enabled:!0}])},y=b=>{i(E=>E.filter((R,j)=>j!==b))},v=(b,E)=>{i(R=>R.map((j,_)=>_===b?{...j,...E}:j))},S=s.length>0;return a.jsxs("div",{className:"flex flex-col gap-4",children:[S?s.map((b,E)=>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(Aa,{htmlFor:`trigger-enabled-${String(E)}`,className:"text-sm font-normal",children:b.enabled?"Enabled":"Disabled"}),a.jsx(vC,{id:`trigger-enabled-${String(E)}`,checked:b.enabled,onCheckedChange:R=>{v(E,{enabled:R})}})]}),a.jsx("div",{children:a.jsx(we,{variant:"ghost",size:"sm",type:"button","aria-label":"Delete trigger",onClick:()=>{x(E)},children:a.jsx(ts,{className:"h-4 w-4","aria-hidden":"true"})})})]}),a.jsx(Qb,{cron:b.cron,timezone:b.timezone,enabled:b.enabled,onChange:v.bind(null,E),showPreview:!1,showSaveButton:!1,hideEnableSwitch:!0}),(b.lastRun??b.nextRun)&&a.jsxs("div",{className:"text-muted-foreground mt-3 grid gap-1 text-xs sm:grid-cols-2",children:[b.lastRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Last run: "}),a.jsx(Gs,{date:new Date(b.lastRun)})]}),b.nextRun&&a.jsxs("div",{children:[a.jsx("span",{className:"text-foreground/80 font-medium",children:"Next run: "}),a.jsx(Gs,{date:new Date(b.nextRun)})]})]}),m===E&&a.jsx(h5,{open:m===E,onOpenChange:R=>{R||x(null)},children:a.jsxs(m5,{children:[a.jsxs(p5,{children:[a.jsx(x5,{children:"Delete trigger?"}),a.jsx(y5,{children:"This action will remove this schedule from the report."})]}),a.jsxs(g5,{children:[a.jsx(b5,{onClick:()=>{x(null)},children:"Cancel"}),a.jsx(v5,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{y(E),x(null)},children:"Delete"})]})]})})]},`${b.id??"new"}:${String(E)}`)):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(Qb,{cron:kN,timezone:MN(),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"})})]}),S&&a.jsx("div",{children:a.jsx(we,{variant:"outline",type:"button",onClick:g,children:"+ Add trigger"})})]})});OC.displayName="ReportSchedulesInlineList";function Mde(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"service-account-details",children:[a.jsx(Nt,{children:"How do I get a correct document link?"}),a.jsxs(At,{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 k1(e){return"serviceAccount"in e}function zM({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(Xa,{children:a.jsxs(wt,{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(la,{className:"h-4 w-4 text-green-500"}):a.jsx(ed,{className:"h-4 w-4"})]})}),a.jsx(jt,{children:a.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const kde=_c("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 Lde({className:e,orientation:t,...n}){return a.jsx("div",{role:"group","data-slot":"button-group","data-orientation":t,className:se(kde({orientation:t}),e),...n})}const FM=({mode:e,isSubmitting:t,isDirty:n,triggersDirty:r,onRunAndSave:s,onCancel:i})=>{const c=t||!(n||r),u=e===Nn.CREATE?"Create & Run report":n||r?"Save & Run report":"Run report";return a.jsxs(Uc,{children:[a.jsxs(Lde,{className:"w-full",children:[a.jsx(we,{variant:"default",type:"submit",disabled:c,className:"flex-1",children:e===Nn.CREATE?"Create new report":"Save changes to report"}),a.jsxs(wr,{children:[a.jsx(Rr,{asChild:!0,children:a.jsx(we,{variant:"default",type:"button",disabled:c,"aria-label":"More actions",className:"group",children:a.jsx(Es,{className:"size-4 transition-transform duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})})}),a.jsx(jr,{align:"end",side:"top",children:a.jsx(Tt,{onClick:s,disabled:t,children:u})})]})]}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,disabled:t,children:"Cancel"})]})},Pde=h.forwardRef(({initialReport:e,mode:t=Nn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="google-sheets-edit-form",m="google-sheets-title-input",x="google-sheets-document-url-input",g="google-sheets-data-destination-select",{dataMart:y}=Cs(),{scope:v}=vi(),{dataDestinations:S,fetchDataDestinations:b,loading:E}=Bh(),[R,j]=h.useState([]);h.useEffect(()=>{y&&b()},[y,b]),h.useEffect(()=>{if(S.length>0){const I=S.filter(K=>K.type===Oe.GOOGLE_SHEETS);j(I)}},[S]),_de({elementId:m,isOpen:!0,delay:150});const _=h.useRef(null),D=h.useRef(!1),[O,A]=h.useState(!1),{runReport:T}=ns(),{isDirty:M,reset:k,form:z,isSubmitting:L,formError:G,onSubmit:B}=Ade({initialReport:e,mode:t,dataMartId:(y==null?void 0:y.id)??"",onAfterSubmit:async I=>{var K;try{await((K=_.current)==null?void 0:K.persist(I.id))}catch($){console.error("Failed to persist schedule for report",$)}if(D.current)try{await T(I.id)}catch($){throw console.error("Failed to run report",$),$}finally{D.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(G)},[G,r]),h.useEffect(()=>{if(t===Nn.EDIT&&e&&zx(e.destinationConfig))k({title:e.title,documentUrl:h2(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===Nn.CREATE){const I=(c==null?void 0:c.id)??"";k({title:"",documentUrl:"",dataDestinationId:I})}},[e,t,k,c]),h.useEffect(()=>{n==null||n(M||O)},[M,O,n]);const q=z.watch("documentUrl"),V=q&&NO(q.trim());return a.jsx(Dl,{...z,children:a.jsxs(Si,{id:f,ref:u,noValidate:!0,onSubmit:I=>void z.handleSubmit(B)(I),children:[a.jsxs(Ol,{children:[a.jsxs(Mr,{title:"General",children:[a.jsx(yt,{control:z.control,name:"title",render:({field:I})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(mt,{children:a.jsx(dt,{id:m,placeholder:"Enter a report title",...I})}),a.jsx(St,{})]})}),a.jsx(yt,{control:z.control,name:"dataDestinationId",render:({field:I})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(fa,{onValueChange:I.onChange,value:I.value,disabled:E||R.length===0,children:[a.jsx(mt,{children:a.jsx(ma,{id:g,className:"w-full max-w-full overflow-hidden",children:a.jsx(ha,{className:"truncate",placeholder:"Select a destination",children:I.value&&R.length>0&&(()=>{const K=R.find($=>$.id===I.value);if(K){const ee=oa.getInfo(K.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(ee,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:K.title})})]})}return null})()})})}),a.jsx(pa,{children:R.map(K=>{const ee=oa.getInfo(K.type).icon;return a.jsx(Gn,{value:K.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(ee,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:K.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(k1(K.credentials)&&c1(K.credentials.serviceAccount))??"No email found"})]})]})},K.id)})})]}),R.length===0&&!E&&a.jsxs(gC,{className:"mt-2",children:[a.jsx(Sh,{className:"h-4 w-4"}),a.jsx(P6,{children:"No destinations available"}),a.jsxs(xC,{children:["You need to create a Destination before you can create a report."," ",a.jsx(Xr,{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"})]})]}),I.value&&R.length>0&&(()=>{const K=R.find($=>$.id===I.value);return K?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(ut,{children:"Service Account Email"}),a.jsx(zM,{value:k1(K.credentials)?c1(K.credentials.serviceAccount)??"No email found":"",children:k1(K.credentials)?c1(K.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(St,{})]})}),a.jsx(yt,{control:z.control,name:"documentUrl",render:({field:I})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),a.jsx(mt,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(dt,{id:x,placeholder:"Document URL",className:"flex-1",...I}),a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${V?"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:()=>{V&&window.open(q.trim(),"_blank","noopener,noreferrer")},disabled:!V,"aria-label":V?"Open document in new tab":"Document link is not valid",children:a.jsx(ci,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(jt,{side:"top",align:"center",role:"tooltip",children:V?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(Jt,{children:a.jsx(Mde,{})}),a.jsx(St,{})]})})]}),a.jsx(Mr,{title:"Automate Report Runs",children:y!=null&&y.id?a.jsx(OC,{ref:_,dataMartId:y.id,reportId:t===Nn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:A}):a.jsx(SC,{})})]}),a.jsx(FM,{mode:t,isSubmitting:L,isDirty:M,triggersDirty:O,onRunAndSave:()=>{D.current=!0,z.handleSubmit(B)()},onCancel:i})]})})});function Ude({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:x}=zc(t);return kl(e),a.jsxs(a.Fragment,{children:[a.jsx(mi,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(pi,{children:[a.jsxs(gi,{children:[a.jsx(xi,{children:r===Nn.CREATE?"Create new report":"Edit report"}),a.jsx(bl,{children:r===Nn.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx($h,{children:a.jsx(Pde,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:x,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(Cr,{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 zde=en({cacheLifetime:CY().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Fde({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,i]=h.useState(null),{createReport:c,updateReport:u}=ns(),f=Do({resolver:Ci(zde),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&$O(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async x=>{try{i(null);const{cacheLifetime:g}=x,y={type:kr.LOOKER_STUDIO_CONFIG,cacheLifetime:g};e?await u(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:y}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:y}),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 Hde(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"cache-lifetime-details",children:[a.jsx(Nt,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(At,{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 Vde=[{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"}],$de=h.forwardRef(({initialReport:e,mode:t=Nn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c},u)=>{const f="looker-studio-edit-form",{dataMart:m}=Cs(),{isDirty:x,reset:g,form:y,isSubmitting:v,formError:S,onSubmit:b}=Fde({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return h.useEffect(()=>{r&&r(S)},[S,r]),h.useEffect(()=>{t===Nn.EDIT&&e&&$O(e.destinationConfig)?g({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Nn.CREATE&&g({cacheLifetime:300})},[e,t,g]),h.useEffect(()=>{n==null||n(x)},[x,n]),a.jsx(Dl,{...y,children:a.jsxs(Si,{id:f,ref:u,noValidate:!0,onSubmit:E=>void y.handleSubmit(b)(E),children:[a.jsx(Ol,{children:a.jsx(Mr,{title:"Cache Configuration",children:a.jsx(yt,{control:y.control,name:"cacheLifetime",render:({field:E})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),a.jsxs(fa,{onValueChange:R=>{E.onChange(parseInt(R,10))},value:E.value.toString(),defaultValue:"300",children:[a.jsx(mt,{children:a.jsx(ma,{className:"w-full",children:a.jsx(ha,{placeholder:"Select cache time"})})}),a.jsx(pa,{children:Vde.map(R=>a.jsx(Gn,{value:R.value.toString(),children:R.label},R.value))})]}),a.jsx(St,{}),a.jsx(Jt,{children:a.jsx(Hde,{})})]})})})}),a.jsxs(Uc,{children:[a.jsx(we,{variant:"default",type:"submit",className:"w-full","aria-label":t===Nn.CREATE?"Create":"Save changes",disabled:!x||v,children:v?t===Nn.CREATE?"Creating...":"Saving...":t===Nn.CREATE?"Create":"Save changes"}),i&&a.jsx(we,{variant:"outline",type:"button",onClick:i,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Bde({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const{showUnsavedDialog:i,setShowUnsavedDialog:c,handleClose:u,confirmClose:f,handleFormDirtyChange:m,handleFormSubmitSuccess:x}=zc(t);return kl(e),a.jsxs(a.Fragment,{children:[a.jsx(mi,{open:e,onOpenChange:g=>{g||u()},children:a.jsxs(pi,{children:[a.jsxs(gi,{children:[a.jsx(xi,{children:(s==null?void 0:s.title)??"Looker Studio"}),a.jsx(bl,{children:r===Nn.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx($h,{children:a.jsx($de,{initialReport:n,mode:r,onDirtyChange:m,onSubmit:x,onCancel:u,preSelectedDestination:s})})]})}),a.jsx(Cr,{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 PN=({destination:e})=>{const n=oa.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 Gde(e){return"to"in e}const qde=({destination:e})=>{if(!e)return null;const t=e.credentials,n=Gde(t)&&t.to.length?t.to.join(", "):"";return a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(ut,{children:"Recipients of this report"}),a.jsx(zM,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var lc=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(lc||{});const Kde=en({title:gt().min(1,"Title is required"),dataDestinationId:gt().min(1,"Destination is required"),reportCondition:Tx(lc),subject:gt().min(1,"Subject is required"),messageTemplate:gt().min(1,"Message body is required")});function Wde({initialReport:e,mode:t,dataMartId:n,onAfterSubmit:r,onSuccess:s,preSelectedDestination:i}){const[c,u]=h.useState(null),[f,m]=h.useState(!1),{updateReport:x,createReport:g,error:y,clearError:v}=ns();h.useEffect(()=>{f&&y&&(u(y),m(!1))},[y,f]);const S=Do({resolver:Ci(Kde),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&&d1(e.destinationConfig)?e.destinationConfig.reportCondition:lc.ALWAYS,subject:e!=null&&e.destinationConfig&&d1(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&d1(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:b,formState:E,reset:R}=S,{isDirty:j,errors:_}=E,D=h.useCallback(async O=>{try{u(null),v(),m(!0);let A;const T={type:kr.EMAIL_CONFIG,reportCondition:O.reportCondition,subject:O.subject,messageTemplate:O.messageTemplate};if(t===Nn.CREATE)A=await g({title:O.title,dataMartId:n,dataDestinationId:O.dataDestinationId,destinationConfig:T});else{if(!e){u("Initial report is required for edit mode");return}A=await x(e.id,{title:O.title,dataDestinationId:O.dataDestinationId,destinationConfig:T})}if(!A||y){u(y??"An error occurred while submitting the form");return}try{await(r==null?void 0:r(A))}catch(M){console.error("onAfterSubmit failed",M)}s==null||s()}catch(A){console.error("Error submitting form:",A),u("An error occurred while submitting the form")}},[t,e,n,g,x,r,s,v,y]);return{form:S,handleSubmit:b,errors:_,isDirty:j,reset:R,formError:c,isSubmitting:f,setFormError:u,onSubmit:D}}const Yde=()=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx($r,{className:"h-6 w-3/4"}),a.jsx($r,{className:"h-4 w-1/2"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx($r,{className:"h-4 w-full"}),a.jsx($r,{className:"h-4 w-5/6"}),a.jsx($r,{className:"h-4 w-4/5"}),a.jsx($r,{className:"h-4 w-3/4"})]})]});function HM({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}=Hh(),[u,f]=h.useState({bg:"#fff",fg:"#000"});return h.useEffect(()=>{if(typeof window>"u")return;let m;const x=requestAnimationFrame(()=>{m=requestAnimationFrame(()=>{const g=getComputedStyle(document.documentElement),y=g.getPropertyValue("--background").trim()||"#fff",v=g.getPropertyValue("--foreground").trim()||"#000";f({bg:y,fg:v})})});return()=>{cancelAnimationFrame(x),cancelAnimationFrame(m)}},[c]),a.jsxs("div",{className:`bg-background overflow-auto rounded-md pl-2 ${s??""}`,style:{height:r},children:[t&&a.jsx(Yde,{}),!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>
831
+ <html lang='en' style="background:${u.bg};color:${u.fg}">
832
+ <head>
833
+ <meta charset='utf-8'/>
834
+ <base target='_blank'>
835
+ </head>
836
+ <body>${e}</body>
837
+ </html>`,className:"h-full w-full border-0"})]})}function Zde({value:e,onChange:t}){return a.jsx(Wx,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(Yx,{children:[a.jsx(Ec,{value:"markdown",children:"Markdown"}),a.jsx(Ec,{value:"preview",children:"Preview"})]})})}function Xde({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),x=h.useRef(null);return h.useEffect(()=>{var S;if(!t)return;const g=e;if(!g.trim()){i(""),m(null),u(!1);return}const y=new AbortController;(S=x.current)==null||S.abort(),x.current=y,u(!0),m(null);const v=setTimeout(()=>{r(g,y.signal).then(b=>{i(b)}).catch(b=>{if(y.signal.aborted)return;const E=b instanceof Error?b.message:"Failed to load preview";m(E)}).finally(()=>{y.signal.aborted||u(!1)})},n);return()=>{clearTimeout(v),y.abort()}},[e,t,n,r]),{html:s,loading:c,error:f}}function Qde(e,t){return ja.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function VM(e){const t=h.useCallback(Qde,[]);return Xde({...e,toHtml:t})}const Jde={list:[],listLoadingStatus:Ot.IDLE,activeInsight:null,activeInsightLoadingStatus:Ot.IDLE,executionStatus:Ot.IDLE,executionTriggerId:null,error:null};var xt=(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))(xt||{});class efe extends El{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 co=new efe,Pu=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)}),tfe=e=>e.data.map(Pu),nfe=e=>({title:e.title,template:e.template??null}),rfe=e=>({title:e.title,template:e.template??null}),$M=h.createContext(void 0);function BM(){const e=h.useContext($M);if(!e)throw new Error("useInsightsContext must be used within InsightsProvider");return e}function xy(){const{state:e,dispatch:t}=BM(),{dataMart:n}=Rs();if(!n)throw new Error("useInsights must be used within a DataMart context");const r=h.useCallback(async()=>{t({type:xt.FETCH_INSIGHTS_START});try{const S=await co.getInsights(n.id),b=tfe(S);t({type:xt.FETCH_INSIGHTS_SUCCESS,payload:b})}catch(S){throw t({type:xt.FETCH_INSIGHTS_ERROR,payload:mn(S)}),S}},[n.id,t]),s=h.useCallback(async S=>{t({type:xt.GET_INSIGHT_START});try{const b=await co.getInsightById(n.id,S),E=Pu(b);return t({type:xt.GET_INSIGHT_SUCCESS,payload:E}),E}catch(b){throw t({type:xt.GET_INSIGHT_ERROR,payload:mn(b)}),b}},[n.id,t]),i=h.useCallback(async S=>{const b=await co.getInsightById(n.id,S);return Pu(b)},[n.id]),c=h.useCallback(async S=>{t({type:xt.CREATE_INSIGHT_START});try{const b=nfe(S),E=await co.createInsight(n.id,b),R=Pu(E);return t({type:xt.CREATE_INSIGHT_SUCCESS,payload:R}),De({event:"insight_created",category:"Insights",action:"Create",label:R.id,details:R.title,context:n.id,value:n.title}),kt.success("Insight created"),R}catch(b){const E=mn(b);return t({type:xt.CREATE_INSIGHT_ERROR,payload:E}),De({event:"insight_error",category:"Insights",action:"CreateError",label:S.title,context:n.id,error:E.message}),null}},[n.id,n.title,t]),u=h.useCallback(async(S,b)=>{t({type:xt.UPDATE_INSIGHT_START});try{const E=rfe(b),R=await co.updateInsight(n.id,S,E),j=Pu(R);return t({type:xt.UPDATE_INSIGHT_SUCCESS,payload:j}),De({event:"insight_updated",category:"Insights",action:"Update",label:j.id,context:n.id,details:j.title}),kt.success("Insight updated"),j}catch(E){return t({type:xt.UPDATE_INSIGHT_ERROR,payload:mn(E)}),null}},[n.id,t]),f=h.useCallback(async S=>{t({type:xt.DELETE_INSIGHT_START});try{await co.deleteInsight(n.id,S),t({type:xt.DELETE_INSIGHT_SUCCESS,payload:S}),De({event:"insight_deleted",category:"Insights",action:"Delete",label:S}),kt.success("Insight deleted")}catch(b){throw t({type:xt.DELETE_INSIGHT_ERROR,payload:mn(b)}),b}},[n.id,t]),m=h.useCallback(async(S,b)=>{t({type:xt.UPDATE_INSIGHT_START});try{const E=await co.updateInsightTitle(n.id,S,{title:b}),R=Pu(E),j=e.list.find(D=>D.id===S)??e.activeInsight,_=j?{...R,template:j.template}:R;return t({type:xt.UPDATE_INSIGHT_SUCCESS,payload:_}),De({event:"insight_title_updated",category:"Insights",action:"Update title",label:_.id,context:n.id,details:_.title}),kt.success("Title updated"),_}catch(E){return t({type:xt.UPDATE_INSIGHT_ERROR,payload:mn(E)}),null}},[n.id,t,e.activeInsight,e.list]),x=h.useCallback(async S=>{t({type:xt.RUN_INSIGHT_START});try{const b=await co.startInsightExecution(n.id,S);t({type:xt.RUN_INSIGHT_STARTED,payload:{triggerId:b.triggerId}}),De({event:"insight_run",category:"Insights",action:"Run",label:S})}catch(b){t({type:xt.RUN_INSIGHT_ERROR,payload:mn(b)})}},[t,n.id]),g=h.useCallback(()=>{t({type:xt.RUN_INSIGHT_SUCCESS,payload:{triggerId:""}})},[t]),y=h.useCallback(S=>{t({type:xt.RUN_INSIGHT_STARTED,payload:{triggerId:S}})},[t]),v=h.useCallback(async()=>{const S=e.activeInsight;if(!(!S||!n.id)&&!e.executionTriggerId&&!(!S.lastRun||$J(S.lastRun.status)))try{const E=(await co.getInsightRunTriggers(n.id,S.id,{skipLoadingIndicator:!0})).data.sort((R,j)=>new Date(j.modifiedAt).getTime()-new Date(R.modifiedAt).getTime()).find(R=>!BJ(R.status));E!=null&&E.id&&(t({type:xt.RUN_INSIGHT_START}),t({type:xt.RUN_INSIGHT_STARTED,payload:{triggerId:E.id}}))}catch(b){t({type:xt.RUN_INSIGHT_ERROR,payload:mn(b)})}},[e.activeInsight,e.executionTriggerId,n.id,t]);return{insights:e.list,activeInsight:e.activeInsight,listLoading:e.listLoadingStatus===Ot.LOADING,insightLoading:e.activeInsightLoadingStatus===Ot.LOADING,isRunning:e.executionStatus===Ot.LOADING,triggerId:e.executionTriggerId,error:e.error,fetchInsights:r,getInsight:s,getInsightSilently:i,createInsight:c,updateInsight:u,updateInsightTitle:m,deleteInsight:f,runInsight:x,setTriggerId:y,resetTriggerId:g,ensureActiveRunPolling:v}}function GM(){const{state:e}=BM(),t=h.useMemo(()=>e.list,[e.list]),n=h.useMemo(()=>e.listLoadingStatus===Ot.LOADING,[e.listLoadingStatus]),r=h.useMemo(()=>e.listLoadingStatus===Ot.LOADED||e.listLoadingStatus===Ot.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 xt.FETCH_INSIGHTS_START:return{...e,listLoadingStatus:Ot.LOADING,error:null};case xt.GET_INSIGHT_START:return{...e,activeInsightLoadingStatus:Ot.LOADING,error:null};case xt.CREATE_INSIGHT_START:return{...e,activeInsightLoadingStatus:Ot.LOADING,error:null};case xt.UPDATE_INSIGHT_START:return{...e,error:null};case xt.DELETE_INSIGHT_START:return{...e,listLoadingStatus:Ot.LOADING,error:null};case xt.FETCH_INSIGHTS_SUCCESS:return{...e,list:t.payload,listLoadingStatus:Ot.LOADED,error:null};case xt.GET_INSIGHT_SUCCESS:return{...e,activeInsight:t.payload,activeInsightLoadingStatus:Ot.LOADED,error:null};case xt.CREATE_INSIGHT_SUCCESS:return{...e,list:[...e.list,t.payload],listLoadingStatus:Ot.LOADED,activeInsightLoadingStatus:Ot.LOADED,error:null};case xt.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:Ot.LOADED,error:null};case xt.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:Ot.LOADED,error:null};case xt.FETCH_INSIGHTS_ERROR:return{...e,listLoadingStatus:Ot.ERROR,error:t.payload};case xt.GET_INSIGHT_ERROR:return{...e,activeInsightLoadingStatus:Ot.ERROR,error:t.payload};case xt.CREATE_INSIGHT_ERROR:return{...e,listLoadingStatus:Ot.ERROR,activeInsightLoadingStatus:Ot.ERROR,error:t.payload};case xt.UPDATE_INSIGHT_ERROR:case xt.DELETE_INSIGHT_ERROR:return{...e,listLoadingStatus:Ot.ERROR,error:t.payload};case xt.RUN_INSIGHT_START:return{...e,executionStatus:Ot.LOADING,error:null};case xt.RUN_INSIGHT_STARTED:return{...e,executionTriggerId:t.payload.triggerId,error:null};case xt.RUN_INSIGHT_SUCCESS:return{...e,executionStatus:Ot.LOADED,executionTriggerId:null,error:null};case xt.CLEAR_ERROR:return{...e,error:null};default:return e}}function IC({children:e,initialState:t}){const[n,r]=h.useReducer(afe,t??Jde);return a.jsx($M.Provider,{value:{state:n,dispatch:r},children:e})}const sfe=[{label:"New prompt",insertText:`{{#prompt}}
838
+ $0
839
+ {{/prompt}}`,documentation:"Insert a {{#prompt}} template for generative queries"}],L1=new WeakMap,P1=new WeakMap,UN="insight.copyTemplate";let eg=null;function zN(e){eg=e}function ofe(e,t){const n=L1.get(e)??new Set;if(L1.has(e)||L1.set(e,n),n.has(t))return;e.editor.registerCommand(UN,()=>{eg==null||eg()});const r=e.languages.registerCompletionItemProvider(t,{triggerCharacters:["/"],provideCompletionItems:(i,c)=>{const u=c.lineNumber,f=c.column,m=i.getValueInRange({startLineNumber:u,startColumn:1,endLineNumber:u,endColumn:f}),x=m.lastIndexOf("/");if(x!==-1){const g=m.substring(x+1),y={startLineNumber:u,endLineNumber:u,startColumn:x+2,endColumn:f},v={range:{startLineNumber:u,endLineNumber:u,startColumn:x+1,endColumn:x+2},text:""},S=[];return sfe.forEach((b,E)=>{b.label.startsWith(g)&&S.push({label:b.label,insertText:b.insertText,documentation:{value:b.documentation,isTrusted:!0},detail:b.documentation,kind:e.languages.CompletionItemKind.Field,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:y,additionalTextEdits:[v],sortText:`${String(E)}_${b.label}`})}),S.push({label:"Copy template…",kind:e.languages.CompletionItemKind.Reference,detail:"Copy template from an existing Insight",insertText:"",range:y,additionalTextEdits:[v],command:{id:UN,title:"Copy template…"},sortText:"999_copy_template"}),{suggestions:S}}return{suggestions:[]}}}),s=P1.get(e)??new Map;P1.has(e)||P1.set(e,s),s.set(t,r),n.add(t)}function aS({value:e,onChange:t,height:n="60vh",className:r,readOnly:s,showLineNumbers:i=!0,excludeInsightId:c}){const{resolvedTheme:u}=Hh(),f=h.useRef(null),m=h.useRef(null),x=h.useRef(null),[g,y]=h.useState(!1),[v,S]=h.useState({top:0,left:0}),[b,E]=h.useState(320),[R,j]=h.useState(""),_=h.useRef(null),{insights:D,isLoading:O}=GM(),{fetchInsights:A,getInsightSilently:T}=xy(),M=()=>{const L=m.current,G=x.current;if(!L||!G)return;const B=L.getLayoutInfo(),q=B.contentLeft,V=B.contentWidth,I=8,K=288,$=16,ee=q+(V-K)/2,me=q+I,U=q+Math.max(0,V-K-I),F=Math.min(Math.max(ee,me),U);S({top:I,left:F});const H=B.height,W=Math.max(120,H-$);E(W),y(!0),De({event:"insight_editor_open_copy_template_menu",category:"InsightEditor",action:"OpenMenu"})},k=async L=>{const G=m.current;if(!G||!G.getModel())return;const q=G.getPosition();if(!q)return;const V={startLineNumber:q.lineNumber,startColumn:q.column,endLineNumber:q.lineNumber,endColumn:q.column};let I=L.template??"";if(!I||I.length===0)try{const $=await T(L.id);if(I=($==null?void 0:$.template)??"",I.length===0){_n.error("Insight template is empty"),y(!1);return}}catch{console.error("[InsightEditor] Failed to fetch insight template - skipping")}const K=I.concat(`
840
+
841
+ <!-- Copied from Insight: ${L.title} (${L.id}) -->
842
+ `);G.executeEdits("insight-editor",[{range:V,text:K,forceMoveMarkers:!0}]),De({event:"insight_editor_copy_template",category:"InsightEditor",action:"CopyTemplate",label:L.title,details:L.id}),G.focus(),y(!1)},z=(L,G)=>{m.current=L,x.current=G,ofe(G,"markdown");const B=()=>{zN(()=>{O||A(),j(""),M()})};B();const q=L.onDidFocusEditorText(()=>{B()}),V=L.onDidScrollChange(()=>{y(!1)}),I=L.onMouseDown(()=>{y(!1)}),K="insight-editor-inline-placeholder",$=document.createElement("div");$.textContent="Press '/' for commands";const ee=()=>{try{const Re=L.getOption(G.editor.EditorOption.fontInfo),Ke=`${String(Re.fontSize)}px`,nt=`${String(Re.lineHeight)}px`,Gt=Re.fontFamily;Object.assign($.style,{color:"inherit",opacity:"0.55",fontStyle:"italic",fontSize:Ke,lineHeight:nt,fontFamily:Gt,pointerEvents:"none",whiteSpace:"pre",userSelect:"none"})}catch{Object.assign($.style,{color:"inherit",opacity:"0.55",fontStyle:"italic",pointerEvents:"none",whiteSpace:"pre",userSelect:"none"})}};ee();let me=null,U=null;const F={getId:()=>K,getDomNode:()=>$,getPosition:()=>me};L.addContentWidget(F);const H=Re=>{me={position:{lineNumber:Re,column:1},preference:[G.editor.ContentWidgetPositionPreference.EXACT]},$.style.display="",L.layoutContentWidget(F)},W=()=>{me=null,$.style.display="none",L.layoutContentWidget(F)},Q=()=>{const Re=L.getModel(),Ke=L.getPosition()??U;if(!Re||!Ke){W();return}const nt=Re.getLineCount(),Gt=Math.min(Math.max(1,Ke.lineNumber),Math.max(1,nt));Re.getLineContent(Gt).trim().length===0?H(Gt):W()};Q();const le=L.onDidChangeCursorPosition(()=>{const Re=L.getPosition();Re&&(U=Re),Q()}),J=L.onDidChangeModelContent(()=>{Q()}),ie=L.onDidChangeModel(()=>{Q()}),ye=L.onDidBlurEditorText(()=>{Q()}),Ee=L.onDidFocusEditorText(()=>{const Re=L.getPosition();Re&&(U=Re),Q()}),He=L.onDidChangeConfiguration(()=>{ee(),Q()});_.current={scroll:V,mouse:I,layout:q,cursor:le,content:J,model:ie,blur:ye,focusText:Ee,config:He,placeholderWidget:{dispose:()=>{try{L.removeContentWidget(F)}catch{}}}}};return h.useEffect(()=>()=>{var G,B,q,V,I,K,$,ee,me,U;zN(null);const L=_.current;if(L){try{(G=L.scroll)==null||G.dispose(),(B=L.mouse)==null||B.dispose(),(q=L.layout)==null||q.dispose(),(V=L.cursor)==null||V.dispose(),(I=L.content)==null||I.dispose(),(K=L.model)==null||K.dispose(),($=L.blur)==null||$.dispose(),(ee=L.focusText)==null||ee.dispose(),(me=L.config)==null||me.dispose(),(U=L.placeholderWidget)==null||U.dispose()}catch{}_.current=null}},[]),h.useEffect(()=>{if(!g)return;const L=B=>{const q=B.target,V=f.current;V&&q&&!V.contains(q)&&y(!1)},G=B=>{var q;B.key==="Escape"&&(B.preventDefault(),B.stopPropagation(),y(!1),j(""),(q=m.current)==null||q.focus())};return document.addEventListener("mousedown",L),document.addEventListener("keydown",G,!0),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",G,!0)}},[g]),a.jsxs("div",{ref:f,className:r,style:{position:"relative"},children:[a.jsx(m6,{height:n,language:"markdown",theme:u==="dark"?"vs-dark":"light",className:"overflow-hidden rounded-tl-md",value:e,onChange:L=>{t(L??"")},onMount:z,options:{minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"on",overviewRulerBorder:!1,automaticLayout:!0,overviewRulerLanes:0,readOnly:!!s,lineNumbers:i?"on":"off"}}),g&&a.jsx("div",{style:{position:"absolute",top:v.top,left:v.left,zIndex:60},onMouseDown:L=>{L.stopPropagation()},children:a.jsx("div",{className:"bg-popover text-popover-foreground flex w-72 flex-col rounded-md border shadow-md outline-none",style:{maxHeight:b},children:a.jsxs(iC,{className:"flex min-h-0 flex-col",children:[a.jsx(lC,{autoFocus:!0,placeholder:"Search insights…",value:R,onValueChange:j}),a.jsxs(E6,{className:"flex-1 overflow-auto",children:[O&&a.jsx("div",{className:"p-2 text-sm opacity-60",children:"Loading…"}),!O&&D.filter(L=>c?L.id!==c:!0).filter(L=>(R||"").length?L.title.toLowerCase().includes(R.toLowerCase()):!0).map(L=>a.jsx(cC,{value:`${L.id}:${L.title}`,onSelect:()=>{k(L)},children:a.jsx("span",{className:"block w-full truncate whitespace-nowrap",children:L.title})},L.id)),!O&&D.filter(L=>c?L.id!==c:!0).length===0&&a.jsxs("div",{className:"flex items-start gap-2 p-2 text-sm opacity-60",children:[a.jsx(XU,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:"No insights yet. Create them on the Insights tab, then you can copy their templates into the email report."})]})]})]})})})]})}function ife(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"message-details",children:[a.jsx(Nt,{children:"How can I format my message?"}),a.jsxs(At,{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($t,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function lfe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"sending-condition-details",children:[a.jsx(Nt,{children:"What are Data Mart Run results?"}),a.jsxs(At,{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 cfe(){return a.jsxs(_t,{value:"sheets-api-details",children:[a.jsx(Nt,{children:"How do I enable the Google Sheets API?"}),a.jsxs(At,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx($t,{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 ufe(){return a.jsxs(_t,{value:"looker-studio-details",children:[a.jsx(Nt,{children:"How do I connect to Looker Studio?"}),a.jsxs(At,{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($t,{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($t,{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 dfe(){return a.jsxs(_t,{value:"odata-details",children:[a.jsx(Nt,{children:"How do I use OData?"}),a.jsxs(At,{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 ffe(){return a.jsxs(_t,{value:"email-details",children:[a.jsx(Nt,{children:"How do I start sending Email?"}),a.jsxs(At,{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($t,{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 hfe(){return a.jsxs(_t,{value:"slack-details",children:[a.jsx(Nt,{children:"How do I start sending to Slack?"}),a.jsxs(At,{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($t,{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 mfe(){return a.jsxs(_t,{value:"msteams-details",children:[a.jsx(Nt,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(At,{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($t,{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 pfe(){return a.jsxs(_t,{value:"googlechat-details",children:[a.jsx(Nt,{children:"How do I start sending to Google Chat?"}),a.jsxs(At,{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($t,{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 gfe={[Oe.GOOGLE_SHEETS]:cfe,[Oe.LOOKER_STUDIO]:ufe,[Oe.ODATA]:dfe,[Oe.EMAIL]:ffe,[Oe.SLACK]:hfe,[Oe.MS_TEAMS]:mfe,[Oe.GOOGLE_CHAT]:pfe};function xfe({destinationType:e}){const t=gfe[e];return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function yfe({form:e,isEditMode:t,allowedDestinationTypes:n}){const{flags:r}=yd();return a.jsx(yt,{control:e.control,name:"type",render:({field:s})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Select the destination to send your data",children:"Destination Type"}),a.jsxs(fa,{onValueChange:s.onChange,defaultValue:s.value,disabled:!!t,children:[a.jsx(mt,{children:a.jsx(ma,{className:"w-full",children:a.jsx(ha,{placeholder:"Select a destination type"})})}),a.jsx(pa,{children:a.jsx(Gx,{children:oa.getAllTypes().filter(({type:i})=>n&&n.length>0?n.includes(i):!0).map(({type:i,displayName:c,icon:u,status:f})=>{const m=f===Os.COMING_SOON,x=f===Os.CLOUD_ONLY&&EJ(r);return a.jsx(a.Fragment,{children:x?a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{children:a.jsx(Gn,{value:i,disabled:!0,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,a.jsx(Dr,{variant:"secondary",children:"Cloud & Enterprise"})]})},i)})}),a.jsxs(jt,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",a.jsxs(Xr,{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(ci,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(Xr,{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(ci,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Gn,{value:i,disabled:m,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(u,{size:18}),c,m&&a.jsx(Dr,{variant:"outline",children:f})]})},i)})})})})]}),a.jsx(Jt,{children:a.jsx(xfe,{destinationType:s.value})}),a.jsx(St,{})]})})}const qM="credentials.to",vfe=/[,;\n]/,bfe=", ",KM="Enter emails separated by comma, semicolon or newline",Sfe="Emails list";function FN(e){const t=new Set,n=[];for(const r of e.split(vfe)){const s=r.trim();if(!s)continue;const i=s.toLowerCase();t.has(i)||(t.add(i),n.push(s))}return n}function U1(e){return e.join(bfe)}function HN(e,t){e.setValue(qM,t,{shouldDirty:!0,shouldTouch:!0})}function Cfe({field:e,form:t}){const n=Array.isArray(e.value)?U1(e.value):"",[r,s]=h.useState(n),[i,c]=h.useState(!1),u=Array.isArray(e.value)?U1(e.value):"";h.useEffect(()=>{i||s(u)},[u,i]);const f=g=>{const y=g.target.value;s(y),HN(t,FN(y))},m=()=>{c(!0)},x=g=>{c(!1),e.onBlur();const y=FN(g.target.value);HN(t,y),s(U1(y))};return a.jsx(Ao,{name:e.name,ref:e.ref,onFocus:m,onBlur:x,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:KM})}function zp({form:e,emailsFieldTitle:t=Sfe}){return a.jsx(yt,{control:e.control,name:qM,render:({field:n})=>a.jsxs(ht,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(ut,{tooltip:KM,children:t})}),a.jsx(mt,{children:a.jsx(Cfe,{field:n,form:e})}),a.jsx(St,{})]})})}function Efe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"service-account-details",children:[a.jsx(Nt,{children:"How do I get a Service Account JSON key?"}),a.jsxs(At,{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($t,{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 wfe({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?LO(i):null;return a.jsx(yt,{control:e.control,name:"credentials.serviceAccount",render:({field:u})=>a.jsxs(ht,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(ut,{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(mt,{children:!t&&c?a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx($t,{href:c.url,children:c.email})}),a.jsx(jt,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Ao,{...u,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(Jt,{children:a.jsx(Efe,{})}),a.jsx(St,{})]})})}function MC(e){return"destinationSecretKey"in e}function Rfe(){return a.jsx(Bt,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(_t,{value:"json-config-details",children:[a.jsx(Nt,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(At,{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 jfe({form:e}){const t=e.getValues("credentials"),n=h.useMemo(()=>t&&MC(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=h.useMemo(()=>g2(n),[n]);return a.jsx(a.Fragment,{children:n.destinationSecretKey&&a.jsx(yt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>a.jsxs(ht,{children:[a.jsx(ut,{children:"JSON Config"}),a.jsx(mt,{children:a.jsx(FD,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(St,{}),a.jsx(Jt,{children:a.jsx(Rfe,{})})]})})})}function Tfe({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r,isEditMode:s,allowedDestinationTypes:i}){const c=Do({resolver:Ci(iJ),defaultValues:e??{title:"New Destination",type:Oe.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:x}=c.formState,g=kO(m);return x.credentials||delete g.credentials,t(g)};return a.jsx(Dl,{...c,children:a.jsxs(Si,{onSubmit:m=>{c.handleSubmit(f)(m)},children:[a.jsxs(Ol,{children:[a.jsx(yt,{control:c.control,name:"title",render:({field:m})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),a.jsx(mt,{children:a.jsx(dt,{placeholder:"Enter title",...m})}),a.jsx(St,{})]})}),a.jsx(yfe,{form:c,isEditMode:s,allowedDestinationTypes:i}),u===Oe.GOOGLE_SHEETS&&a.jsx(wfe,{form:c}),u===Oe.LOOKER_STUDIO&&a.jsx(jfe,{form:c}),u===Oe.EMAIL&&a.jsx(zp,{form:c,emailsFieldTitle:"Enter user emails list"}),u===Oe.SLACK&&a.jsx(zp,{form:c,emailsFieldTitle:"Enter Slack channel emails list"}),u===Oe.MS_TEAMS&&a.jsx(zp,{form:c,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),u===Oe.GOOGLE_CHAT&&a.jsx(zp,{form:c,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(Uc,{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(Nc,{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 WM({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r,initialFormData:s,allowedDestinationTypes:i}){const{updateDataDestination:c,createDataDestination:u}=Bh(),{showUnsavedDialog:f,setShowUnsavedDialog:m,handleClose:x,confirmClose:g,handleFormDirtyChange:y,handleFormSubmitSuccess:v}=zc(t);kl(e);const S=async E=>{const R=OO.getMapper(E.type);if(n){const j=R.mapToUpdateRequest(E),_=await c(n.id,j);_&&r(_)}else{const j=R.mapToCreateRequest(E),_=await u(j);_&&r(_)}v()},b=h.useRef(!1);return h.useEffect(()=>{const E=n?"Edit":"Create";e&&!b.current?(De({event:"data_destination_config_open",category:"DataDestination",action:E,label:n==null?void 0:n.type}),b.current=!0):!e&&b.current&&(De({event:"data_destination_config_close",category:"DataDestination",action:E,label:n==null?void 0:n.type}),b.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx(mi,{open:e,onOpenChange:E=>{E||x()},children:a.jsxs(pi,{children:[a.jsxs(gi,{children:[a.jsx(xi,{children:"Configure destination"}),a.jsx(bl,{children:"Customize settings for your destination"})]}),a.jsx(Tfe,{initialData:n??s??null,onSubmit:S,onCancel:x,onDirtyChange:y,isEditMode:!!n,allowedDestinationTypes:i})]})}),a.jsx(Cr,{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 _fe=[Oe.EMAIL,Oe.SLACK,Oe.GOOGLE_CHAT,Oe.MS_TEAMS],YM=h.forwardRef(({initialReport:e,mode:t=Nn.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:i,preSelectedDestination:c,prefill:u,allowedDestinationTypes:f},m)=>{const x="email-report-edit-form",{dataMart:g}=Rs(),y=h.useRef(null),v=h.useRef(!1),[S,b]=h.useState(!1),{runReport:E}=ns(),{dataDestinations:R,fetchDataDestinations:j,loading:_}=Bh(),[D,O]=h.useState([]),[A,T]=h.useState(!1);h.useEffect(()=>{g&&j()},[g,j]),h.useEffect(()=>{if(R.length>0){const H=f??(c!=null&&c.type?[c.type]:_fe),W=R.filter(Q=>H.includes(Q.type));O(W)}},[R,c==null?void 0:c.type,f]);const{isDirty:M,reset:k,form:z,isSubmitting:L,formError:G,onSubmit:B}=Wde({initialReport:e,mode:t,dataMartId:(g==null?void 0:g.id)??"",onAfterSubmit:async H=>{var W;try{await((W=y.current)==null?void 0:W.persist(H.id))}catch(Q){console.error("Failed to persist schedule for report",Q)}if(v.current)try{await E(H.id)}catch(Q){throw console.error("Failed to run report",Q),Q}finally{v.current=!1}},onSuccess:()=>{s==null||s()},preSelectedDestination:c});h.useEffect(()=>{r&&r(G)},[G,r]),h.useEffect(()=>{if(!(t===Nn.EDIT&&e)){if(t===Nn.CREATE){const H=(c==null?void 0:c.id)??"";k({title:(u==null?void 0:u.title)??"",dataDestinationId:H,reportCondition:lc.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(M||S)},[M,S,n]);const q=h.useMemo(()=>[{value:lc.ALWAYS,label:"Send always"},{value:lc.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:lc.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),[V,I]=h.useState("markdown"),K=z.watch("messageTemplate"),{html:$,loading:ee,error:me}=VM({markdown:K,enabled:V==="preview"}),U=z.watch("dataDestinationId"),F=h.useMemo(()=>U&&D.length>0?D.find(H=>H.id===U)??null:null,[U,D]);return a.jsxs(a.Fragment,{children:[a.jsx(Dl,{...z,children:a.jsxs(Si,{id:x,ref:m,noValidate:!0,onSubmit:H=>{z.handleSubmit(B)(H)},children:[a.jsxs(Ol,{children:[a.jsxs(Mr,{title:"General",children:[a.jsx(yt,{control:z.control,name:"title",render:({field:H})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(mt,{children:a.jsx(dt,{placeholder:"Enter a report title",...H})}),a.jsx(St,{})]})}),a.jsx(yt,{control:z.control,name:"dataDestinationId",render:({field:H})=>a.jsxs(ht,{children:[a.jsx("div",{className:"flex items-center justify-between gap-2",children:a.jsx(ut,{tooltip:"Select one of your existing destinations",children:"Destination"})}),a.jsxs(fa,{onValueChange:W=>{if(W==="__create_new__"){T(!0);return}H.onChange(W)},value:H.value,disabled:_,children:[a.jsx(mt,{children:a.jsx(ma,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ha,{className:"truncate",placeholder:"Select a destination",children:F&&a.jsx(PN,{destination:F})})})}),a.jsxs(pa,{children:[D.map(W=>a.jsx(Gn,{value:W.id,children:a.jsx(PN,{destination:W})},W.id)),D.length>0&&a.jsx(vI,{}),!c&&a.jsx(Gn,{value:"__create_new__",children:"+ Create new"})]})]}),a.jsx(qde,{destination:F}),a.jsx(St,{})]})})]}),a.jsxs(Mr,{title:"Template",children:[a.jsx(yt,{control:z.control,name:"subject",render:({field:H})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),a.jsx(mt,{children:a.jsx(dt,{placeholder:"Enter a message title",...H})}),a.jsx(St,{})]})}),a.jsx(yt,{control:z.control,name:"messageTemplate",render:({field:H})=>a.jsxs(ht,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(ut,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),a.jsx(Zde,{value:V,onChange:I})]}),a.jsx(mt,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:V==="markdown"?a.jsx(IC,{children:a.jsx(aS,{value:H.value,onChange:W=>{H.onChange(W)},height:240,showLineNumbers:!1})}):a.jsx(HM,{html:$,loading:ee,error:me,height:240})})}),a.jsx(Jt,{children:a.jsx(ife,{})}),a.jsx(St,{})]})})]}),a.jsx(Mr,{title:"Sending conditions",children:a.jsx(yt,{control:z.control,name:"reportCondition",render:({field:H})=>a.jsxs(ht,{children:[a.jsx(ut,{tooltip:"Define when the report should be sent based on your Data Mart’s execution result",children:"Data Mart Run results"}),a.jsxs(fa,{onValueChange:H.onChange,value:H.value,children:[a.jsx(mt,{children:a.jsx(ma,{className:"w-full max-w-full overflow-hidden",children:a.jsx(ha,{})})}),a.jsx(pa,{children:q.map(W=>a.jsx(Gn,{value:W.value,children:W.label},W.value))})]}),a.jsx(Jt,{children:a.jsx(lfe,{})}),a.jsx(St,{})]})})}),a.jsx(Mr,{title:"Automate Report Runs",children:g!=null&&g.id?a.jsx(OC,{ref:y,dataMartId:g.id,reportId:t===Nn.EDIT?(e==null?void 0:e.id)??null:null,onDirtyChange:b}):a.jsx(SC,{})})]}),a.jsx(FM,{mode:t,isSubmitting:L,isDirty:M,triggersDirty:S,onRunAndSave:()=>{v.current=!0,z.handleSubmit(B)()},onCancel:i})]})}),a.jsx(WM,{isOpen:A,onClose:()=>{T(!1)},dataDestination:null,initialFormData:{title:"New Destination",type:(f==null?void 0:f[0])??Oe.EMAIL},allowedDestinationTypes:f,onSaveSuccess:H=>{j().then(()=>{z.setValue("dataDestinationId",H.id,{shouldDirty:!0,shouldTouch:!0}),T(!1)})}})]})});YM.displayName="EmailReportEditForm";function ZM({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c}){const{projectId:u,id:f}=Xg(),{pathname:m}=Ks(),{showUnsavedDialog:x,setShowUnsavedDialog:g,handleClose:y,confirmClose:v,handleFormDirtyChange:S,handleFormSubmitSuccess:b}=zc(t),E=h.useCallback(()=>{const R=u&&f?`/ui/${u}/data-marts/${f}/reports`:"/";m.includes("/reports")||R_("Report has been created",{closeButton:!0,description:a.jsxs(a.Fragment,{children:["You can view it in"," ",a.jsx(Xr,{to:R,className:"underline underline-offset-4",onClick:()=>R_.dismiss(),children:"Destinations"})," ","page"]}),duration:1/0}),b()},[b,u,f,m]);return kl(e),a.jsxs(a.Fragment,{children:[a.jsx(mi,{open:e,onOpenChange:R=>{R||y()},children:a.jsxs(pi,{children:[a.jsxs(gi,{children:[a.jsx(xi,{children:(s==null?void 0:s.title)??"Report"}),a.jsx(bl,{children:r===Nn.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx($h,{children:a.jsx(YM,{initialReport:n,mode:r,onDirtyChange:S,onSubmit:E,onCancel:y,preSelectedDestination:s,prefill:i,allowedDestinationTypes:c})})]})}),a.jsx(Cr,{open:x,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 Nfe({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Oe.GOOGLE_SHEETS:return a.jsx(Ude,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Oe.LOOKER_STUDIO:return a.jsx(Bde,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Oe.EMAIL:case Oe.SLACK:case Oe.GOOGLE_CHAT:case Oe.MS_TEAMS:return a.jsx(ZM,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function Afe({destination:e,onEditReport:t}){switch(e.type){case Oe.GOOGLE_SHEETS:return a.jsx(ude,{destination:e,onEditReport:t});case Oe.EMAIL:case Oe.SLACK:case Oe.GOOGLE_CHAT:case Oe.MS_TEAMS:return a.jsx(mde,{destinationType:e.type,destination:e,onEditReport:t});case Oe.LOOKER_STUDIO:return a.jsx(Cde,{destination:e,onEditReport:t});default:return null}}function XM(){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($r,{className:"h-4 w-4 rounded-full"}),a.jsx($r,{className:"h-4 w-40"}),a.jsx($r,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($r,{className:"h-6 w-16 rounded-full"}),a.jsx($r,{className:"h-4 w-4"})]})]})},t))})})}function kC({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 Dfe({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=Cs(),{fetchReportsByDataMartId:r}=ns(),s=n==null?void 0:n.id;h.useEffect(()=>{s&&r(s)},[s,r]),kC({enabled:!!s&&e,intervalMs:t,onTick:()=>{s&&r(s,{silent:!0})}})}function Ofe(){const{dataMart:e}=Cs(),{dataDestinations:t,isLoading:n}=mJ();return Dfe({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(XM,{}):t.length===0?a.jsx(Ede,{}):t.map(r=>a.jsx(jde,{destination:r,dataMartStatus:e.status},r.id))}):null}function Ife(){return a.jsx($h,{children:a.jsx(m2,{children:a.jsx(Ofe,{})})})}function VN(){return a.jsxs(hl,{children:[a.jsx(Co,{children:a.jsx(So,{icon:HP,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(Eo,{children:a.jsx(Nae,{})}),a.jsx(li,{})]})}function Mfe(){const{dataMart:e}=Rs(),[t,n]=h.useState(!1),r=h.useCallback(()=>{n(!0)},[]),s=h.useCallback(()=>{n(!1)},[]);return a.jsxs(hl,{children:[a.jsxs(Co,{children:[a.jsx(So,{icon:ES,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(em,{children:a.jsxs(we,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(ga,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(Eo,{children:a.jsx(ld,{children:a.jsx(Lie,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(Cle,{dataMartId:e.id}),a.jsx(bC,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),a.jsx(li,{})]})}function kfe(){return a.jsx(IC,{children:a.jsx(yS,{})})}function Lfe({status:e}){switch(e){case qn.RUNNING:return a.jsx(Dr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case qn.SUCCESS:return a.jsx(Dr,{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(Dr,{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(Dr,{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(Dr,{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(Dr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return a.jsx(Dr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var ia=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(ia||{}),Is=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(Is||{});const $N=(e,t,n=!1)=>{var c,u,f,m;const r=e.split(`
843
+ `).filter(x=>x.trim()!=="");if(r.length>=3){const x=r[0],g=r[1],y=r.slice(2).join(`
844
+ `);if(x.includes("T")&&x.includes("Z")){const v=z1(y);return{id:`log-${t.toString()}`,timestamp:Ru(x),level:n?ia.ERROR:ia.INFO,message:v.message,metadata:{at:(c=v.metadata)!=null&&c.at?Ru(v.metadata.at):Ru(x),type:((u=v.metadata)==null?void 0:u.type)??(g!=="unknown"?g:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const x=z1(s[3]);return{id:`log-${t.toString()}`,timestamp:Ru(s[1]),level:n?ia.ERROR:s[2],message:x.message,metadata:(f=x.metadata)!=null&&f.at?{...x.metadata,at:Ru(x.metadata.at)}:x.metadata}}const i=z1(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?ia.ERROR:ia.INFO,message:i.message,metadata:(m=i.metadata)!=null&&m.at?{...i.metadata,at:Ru(i.metadata.at)}:i.metadata}},z1=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}},QM=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},Pfe=(e,t)=>{var i,c;let n="",r="";switch(e.type){case Vr.CONNECTOR:n=t??"",r="connector";break;case Vr.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Vr.GOOGLE_SHEETS_EXPORT:case Vr.EMAIL:case Vr.SLACK:case Vr.MS_TEAMS:case Vr.GOOGLE_CHAT:n=((i=e.reportDefinition)==null?void 0:i.title)??"",r="report";break;case Vr.INSIGHT:n=((c=e.insightDefinition)==null?void 0:c.title)??"",r="insight";break}return[CJ(`${e.triggerType} ${r} run`.trim()),n]},Ufe=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)},zfe=e=>{const t=e.startedAt??e.createdAt;return Ox(t.toISOString())},Ffe=e=>{const t=BN(e.startedAt),n=BN(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=bJ(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},BN=e=>e?Ox(e.toISOString()):"N/A";function Hfe({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:i,dataMartId:c}){const u=x=>{x.stopPropagation()},f=async x=>{if(x.stopPropagation(),c)try{await i(c,s.id),_n.success("Data mart run cancelled successfully")}catch(g){_n.error(g instanceof Error?g.message:"Failed to cancel data mart run")}},m=x=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${x?"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:x=>{x.stopPropagation(),t(Is.STRUCTURED)},className:`${m(e===Is.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:x=>{x.stopPropagation(),t(Is.RAW)},className:`${m(e===Is.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:x=>{x.stopPropagation(),t(Is.CONFIGURATION)},className:`${m(e===Is.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==Is.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(Ac,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),a.jsx(dt,{type:"text",placeholder:"Search logs...",value:n,onChange:x=>{r(x.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:x=>void f(x),children:[a.jsx(hc,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(we,{variant:"outline",size:"sm",onClick:x=>{x.stopPropagation(),Ufe(s)},className:"flex items-center gap-2",children:[a.jsx(pU,{className:"h-4 w-4"}),"JSON"]})]})]})}function Vfe(e){switch(e){case ia.INFO:return a.jsx(Or,{className:"h-3 w-3 text-blue-500"});case ia.WARNING:return a.jsx(Eh,{className:"h-3 w-3 text-yellow-500"});case ia.ERROR:return a.jsx(og,{className:"h-3 w-3 text-red-500"});case ia.SYSTEM:return a.jsx(Sh,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(Or,{className:"text-muted-foreground h-3 w-3"})}}function $fe(e){switch(e){case ia.INFO:return"text-blue-600 dark:text-blue-400";case ia.WARNING:return"text-yellow-600 dark:text-yellow-400";case ia.ERROR:return"text-red-600 dark:text-red-400";case ia.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function Bfe(e){return e===dO.SCHEDULED?a.jsx(ES,{size:18}):a.jsx(BA,{size:18})}function Gfe({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:[Vfe(r.level),a.jsx("span",{className:`text-xs font-medium ${$fe(r.level)}`,children:QM(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===ia.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
845
+ `)?a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):a.jsx("span",{children:r.message})})]},r.id))})})}var Vg=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Vg||{});function $g({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:x=>{s(e,t),x.stopPropagation()},className:`${f} ${m}`,title:`Copy ${t} to clipboard`,children:i?a.jsx(a.Fragment,{children:u?a.jsx(la,{className:"h-3 w-3"}):a.jsx(ed,{className:"h-3 w-3"})}):u?a.jsxs(a.Fragment,{children:[a.jsx(la,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(ed,{className:"h-3 w-3"}),"Copy"]})})}function yy(){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 qfe({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=yy(),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(Sh,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx($g,{text:t.join(`
846
+ `),section:"errors",variant:Vg.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(Or,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx($g,{text:e.join(`
847
+ `),section:"logs",variant:Vg.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 Kfe({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:s}=yy(),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($g,{text:JSON.stringify(e,null,2),section:"configuration",variant:Vg.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 oo=18;function Wfe({type:e,base64Icon:t}){switch(e){case Vr.CONNECTOR:return t?a.jsx(Mc,{base64:t,size:oo}):a.jsx(fc,{className:"text-muted-foreground",size:oo});case Vr.GOOGLE_SHEETS_EXPORT:{const n=oa.getInfo(Oe.GOOGLE_SHEETS).icon;return a.jsx(n,{size:oo})}case Vr.LOOKER_STUDIO:{const n=oa.getInfo(Oe.LOOKER_STUDIO).icon;return a.jsx(n,{size:oo})}case Vr.EMAIL:{const n=oa.getInfo(Oe.EMAIL).icon;return a.jsx(n,{size:oo})}case Vr.SLACK:{const n=oa.getInfo(Oe.SLACK).icon;return a.jsx(n,{size:oo})}case Vr.MS_TEAMS:{const n=oa.getInfo(Oe.MS_TEAMS).icon;return a.jsx(n,{size:oo})}case Vr.GOOGLE_CHAT:{const n=oa.getInfo(Oe.GOOGLE_CHAT).icon;return a.jsx(n,{size:oo})}case Vr.INSIGHT:return a.jsx(uo,{className:"text-brand-blue-500",size:oo});default:return a.jsx(fc,{className:"text-muted-foreground",size:oo})}}function Yfe({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,cancelDataMartRun:u,dataMartId:f,dataMartConnectorInfo:m}){const{copiedSection:x,handleCopy:g}=yy(),y=h.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const j=e.logs.map((O,A)=>$N(O,A)),_=e.errors.map((O,A)=>$N(O,e.logs.length+A,!0));return[...j,..._].filter(O=>{const A=QM(O);return i===""||O.message.toLowerCase().includes(i.toLowerCase())||A.toLowerCase().includes(i.toLowerCase())})},[e.logs,e.errors,i]),v=h.useCallback(()=>r===Is.STRUCTURED?a.jsx(Gfe,{logs:y}):r===Is.RAW?a.jsx(qfe,{logs:e.logs,errors:e.errors}):a.jsx(Kfe,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,y,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),S=zfe(e),b=Ffe(e),[E,R]=Pfe(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(Wfe,{type:e.type,base64Icon:m==null?void 0:m.logoBase64})}),a.jsxs(wt,{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:S})}),a.jsx(jt,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{children:["Started At: ",b.startedAt]}),a.jsxs("div",{children:["Finished At: ",b.finishedAt]}),b.duration&&a.jsxs("div",{children:["Duration: ",b.duration]})]})})]}),a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[Bfe(e.triggerType),a.jsxs("span",{className:"inline-flex items-center",children:[E,e.createdByUser&&a.jsxs(a.Fragment,{children:[" by ",a.jsx(E5,{userProjection:e.createdByUser})]}),R&&a.jsxs(a.Fragment,{children:[" • ",R]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Lfe,{status:e.status}),a.jsx(Da,{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($g,{text:e.id,section:"run-id",onCopy:g,copiedSection:x,iconOnly:!0})]}),a.jsx(Hfe,{logViewType:r,setLogViewType:s,searchTerm:i,setSearchTerm:c,run:e,cancelDataMartRun:u,dataMartId:f}),v()]})]})}function Zfe(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:i=[],isLoading:c}=Cs(),[u,f]=h.useState(!1),[m,x]=h.useState(!0),[g,y]=h.useState(0),[v,S]=h.useState(null),[b,E]=h.useState(Is.STRUCTURED),[R,j]=h.useState(""),_=h.useCallback(async()=>{if(!(t!=null&&t.id))return;const T=await n(t.id,20,0);y(T.length),x(T.length===20)},[t==null?void 0:t.id,n,20]),D=h.useCallback(async()=>{if(!(t!=null&&t.id)||u)return;f(!0);const T=await r(t.id,g,20);y(M=>M+T.length),x(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 O=h.useMemo(()=>(t==null?void 0:t.definitionType)===$e.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),A=T=>{S(v===T?null:T)};return c?a.jsx(XM,{}):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(Yfe,{run:T,isExpanded:v===T.id,onToggle:A,logViewType:b,setLogViewType:E,searchTerm:R,setSearchTerm:j,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:O},T.id)),m&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(Wu,{variant:"outline",size:"sm",onClick:()=>void D(),disabled:u,className:"flex items-center gap-2",children:u?a.jsxs(a.Fragment,{children:[a.jsx(_z,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const Xfe=5e3,Qfe=20;function Jfe(){const{dataMart:e,getDataMartRuns:t}=Rs();return kC({enabled:!!(e!=null&&e.id),intervalMs:Xfe,onTick:()=>{e!=null&&e.id&&t(e.id,Qfe,0,{silent:!0})}}),a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(hl,{collapsible:!1,name:"run-history",children:[a.jsx(Co,{children:a.jsx(So,{icon:GU,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(Eo,{children:a.jsx(Zfe,{})})]})})}function ehe(){const e=Q6(),{navigate:t}=vi(),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(K2,{children:a.jsx(N5,{children:a.jsx(Mre,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function JM({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:i,clearCurrentDataStorage:c}=qx();h.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const u=()=>{c(),t()};return a.jsx(N2,{open:e,onOpenChange:f=>{f||u()},children:a.jsxs(A2,{children:[a.jsxs(D2,{children:[a.jsx(O2,{children:"Storage Details"}),a.jsx(I2,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(oQ,{dataStorage:s,isLoading:i})})]})})}const the=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,i]=h.useState(!1);return a.jsx("div",{className:"text-right",children:a.jsxs(wr,{open:s,onOpenChange:i,children:[a.jsx(Rr,{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(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(jr,{align:"end",children:[a.jsxs(Tt,{onClick:()=>t==null?void 0:t(e),children:[a.jsx(PA,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"View details"})]}),a.jsxs(Tt,{onClick:()=>void(n==null?void 0:n(e)),children:[a.jsx(dd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),a.jsx(ua,{}),a.jsxs(Tt,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(ts,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})},nhe=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(br,{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(br,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=wl.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(br,{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(Cd,{table:r}),cell:({row:r})=>a.jsx(the,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function rhe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(kA,{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(ga,{className:"h-4 w-4"}),"New Storage"]})]})}function ahe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Lc({columns:e,storageKeyPrefix:"data-storage-list"}),[f,m]=h.useState([]),[x,g]=h.useState({}),[y,v]=h.useState(!1),[S]=h.useState(null),b=jl({data:t,columns:[...e],getCoreRowModel:Rl(),getPaginationRowModel:Gh(),onSortingChange:i,getSortedRowModel:kc(),onColumnFiltersChange:m,getFilteredRowModel:Sd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:x},enableRowSelection:!0}),E=(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:[S&&a.jsx(JM,{isOpen:y,onClose:()=>{v(!1)},id:S.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(Ac,{className:"dm-card-toolbar-search-icon"}),a.jsx(dt,{placeholder:"Search by title",value:(R=b.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:j=>{var _;return(_=b.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(ga,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Tl,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(_l,{className:"dm-card-table-header",children:b.getHeaderGroups().map(j=>a.jsx(Hn,{className:"dm-card-table-header-row",children:j.headers.map(_=>a.jsx(Al,{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:id(_.column.columnDef.header,_.getContext())},_.id))},j.id))}),a.jsx(Nl,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map(j=>a.jsx(Hn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const D=j.original.id;E(D,_)},children:j.getVisibleCells().map(_=>a.jsx(Gr,{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:id(_.column.columnDef.cell,_.getContext())},_.id))},j.id)):a.jsx(Hn,{children:a.jsx(Gr,{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:()=>{b.previousPage()},disabled:!b.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{b.nextPage()},disabled:!b.getCanNextPage(),children:"Next"})]})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(rhe,{onOpenTypeDialog:r})})}const she=({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:x,deleteDataStorage:g,createDataStorage:y}=qx();h.useEffect(()=>{m()},[m]),h.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[S,b]=h.useState(!1),[E,R]=h.useState(!1),[j,_]=h.useState(null),[D,O]=h.useState(!1),[A,T]=h.useState(null),M=async $=>{i(!0);try{const ee=await y($);v(),ee!=null&&ee.id&&(await x(ee.id),b(!0),i(!1))}catch(ee){console.error("Failed to create storage:",ee)}},k=$=>{T($),O(!0)},z=()=>{O(!1),T(null)},L=async $=>{await x($),b(!0)},G=$=>{_($),R(!0)},B=async()=>{if(j)try{await g(j),await m()}catch($){console.error("Failed to delete storage:",$)}finally{R(!1),_(null)}},q=async()=>{try{b(!1),await m()}catch($){console.error("Failed to save storage:",$)}},V=()=>{b(!1),f()},I=c.map($=>({id:$.id,title:$.title,type:$.type,createdAt:$.createdAt,modifiedAt:$.modifiedAt})),K=nhe({onViewDetails:k,onEdit:L,onDelete:G});return a.jsxs("div",{children:[a.jsx(ahe,{columns:K,data:I,onEdit:L,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(JM,{isOpen:D,onClose:z,id:A??""}),a.jsx(TI,{isOpen:n,onClose:v,onSelect:M,isCreatingDataStorage:s}),a.jsx(L6,{isOpen:S,onClose:V,dataStorage:u,onSaveSuccess:()=>void q()}),a.jsx(Cr,{open:E,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"})]})},ohe=()=>{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(K2,{children:a.jsx(she,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function ihe({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(CS,{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(ga,{className:"h-4 w-4"}),"New Destination"]})]})}function lhe({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var S;const{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Lc({columns:e,storageKeyPrefix:"data-destination-list"}),[f,m]=h.useState([]),[x,g]=h.useState({}),y=jl({data:t,columns:[...e],getCoreRowModel:Rl(),getPaginationRowModel:Gh(),onSortingChange:i,getSortedRowModel:kc(),onColumnFiltersChange:m,getFilteredRowModel:Sd(),onColumnVisibilityChange:u,onRowSelectionChange:g,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:x},enableRowSelection:!0}),v=(b,E)=>{E.target instanceof HTMLElement&&(E.target.closest('[role="checkbox"]')||E.target.closest(".actions-cell")||E.target.closest('[role="menuitem"]'))||n==null||n(b)};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(Ac,{className:"dm-card-toolbar-search-icon"}),a.jsx(dt,{placeholder:"Search by title",value:(S=y.getColumn("title"))==null?void 0:S.getFilterValue(),onChange:b=>{var E;return(E=y.getColumn("title"))==null?void 0:E.setFilterValue(b.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(ga,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Tl,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(_l,{className:"dm-card-table-header",children:y.getHeaderGroups().map(b=>a.jsx(Hn,{className:"dm-card-table-header-row",children:b.headers.map(E=>a.jsx(Al,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.getSize())}%`},children:E.isPlaceholder?null:id(E.column.columnDef.header,E.getContext())},E.id))},b.id))}),a.jsx(Nl,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map(b=>a.jsx(Hn,{"data-state":b.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:E=>{const R=b.original.id;v(R,E)},children:b.getVisibleCells().map(E=>a.jsx(Gr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${E.column.id==="actions"?"actions-cell":""} ${E.column.id==="createdAt"?"whitespace-nowrap":""}`,style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},children:id(E.column.columnDef.cell,E.getContext())},E.id))},b.id)):a.jsx(Hn,{children:a.jsx(Gr,{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:()=>{y.previousPage()},disabled:!y.getCanPreviousPage(),children:"Previous"}),a.jsx(we,{variant:"outline",size:"sm",onClick:()=>{y.nextPage()},disabled:!y.getCanNextPage(),children:"Next"})]})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(ihe,{onOpenTypeDialog:r})})}const che=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:i})=>{const[c,u]=h.useState(!1),f=()=>{if(n&&MC(n)){const g=g2(n);navigator.clipboard.writeText(g),kt.success("JSON Config copied to clipboard")}},m=t===Oe.LOOKER_STUDIO,x=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return a.jsx(a.Fragment,{children:a.jsx("div",{className:"text-right",children:a.jsxs(wr,{open:c,onOpenChange:u,children:[a.jsx(Rr,{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(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(jr,{align:"end",children:[a.jsxs(Tt,{onClick:()=>void(r==null?void 0:r(e)),children:[a.jsx(dd,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),m&&x&&a.jsxs(a.Fragment,{children:[a.jsx(ua,{}),a.jsxs(Tt,{onClick:f,children:[a.jsx(ed,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Copy JSON Config"})]}),a.jsxs(Tt,{onClick:()=>{i==null||i(e)},children:[a.jsx(Q1,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(ua,{}),a.jsxs(Tt,{onClick:()=>s==null?void 0:s(e),children:[a.jsx(ts,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})},uhe=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(br,{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(br,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:i,icon:c}=oa.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(br,{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(Cd,{table:r}),cell:({row:r})=>a.jsx(che,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}],dhe=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:i,getDataDestinationById:c,deleteDataDestination:u,rotateSecretKey:f}=Bh(),m=h.useCallback(()=>{s(),g(!0),t==null||t()},[s,t]),[x,g]=h.useState(!1),[y,v]=h.useState(!1),[S,b]=h.useState(!1),[E,R]=h.useState(null),[j,_]=h.useState(null);h.useEffect(()=>{i()},[i]),h.useEffect(()=>{e&&m()},[e,m]);const D=async B=>{await c(B),g(!0)},O=B=>{R(B),v(!0)},A=B=>{_(B),b(!0)},T=async()=>{if(j)try{const B=await f(j);if(MC(B.credentials)){kt.success("New JSON Config copied to clipboard");const q=g2(B.credentials);navigator.clipboard.writeText(q)}await i()}catch(B){console.error("Failed to rotate secret key:",B)}finally{b(!1),_(null)}},M=async()=>{if(E)try{await u(E),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)}},z=()=>{g(!1),s()},L=n.map(B=>({id:B.id,title:B.title,type:B.type,createdAt:B.createdAt,modifiedAt:B.modifiedAt,credentials:B.credentials})),G=uhe({onEdit:D,onDelete:O,onRotateSecretKey:A});return a.jsxs("div",{children:[a.jsx(lhe,{columns:G,data:L,onEdit:D,onDelete:O,onRotateSecretKey:A,onOpenTypeDialog:m}),a.jsx(WM,{isOpen:x,onClose:z,dataDestination:r,onSaveSuccess:()=>void k()}),a.jsx(Cr,{open:y,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:()=>{M()},onCancel:()=>{R(null)},variant:"destructive"}),a.jsx(Cr,{open:S,onOpenChange:b,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void T(),onCancel:()=>{b(!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?"})]})})]})},fhe=()=>{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($h,{children:a.jsx(dhe,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function sS({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 oS({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 hhe=_c("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 iS({className:e,variant:t="default",...n}){return a.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:se(hhe({variant:t,className:e})),...n})}function lS({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 cS({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 mhe({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 phe=()=>{const e=Tc(),{createInsight:t,insightLoading:n}=xy(),r=()=>{(async()=>{const s=await t({title:"Untitled insight"});s&&e(s.id)})()};return a.jsxs(sS,{children:[a.jsxs(oS,{children:[a.jsx(iS,{variant:"icon",children:a.jsx(uo,{})}),a.jsx(lS,{children:"Create your first Insight"}),a.jsx(cS,{children:"Create an Insight to prompt your Data Mart and discover the story behind your data."})]}),a.jsx(mhe,{children:a.jsxs(we,{variant:"outline",onClick:r,disabled:n,children:[a.jsx(ga,{className:"h-4 w-4"}),"New Insight"]})})]})};function ghe({id:e,onDelete:t}){const[n,r]=h.useState(!1);return a.jsx("div",{className:"text-right",onClick:s=>{s.stopPropagation()},children:a.jsxs(wr,{open:n,onOpenChange:r,children:[a.jsx(Rr,{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(Ws,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(jr,{align:"end",children:a.jsxs(Tt,{className:"text-destructive",onClick:()=>t==null?void 0:t(e),children:[a.jsx(ts,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete insight"})]})})]})})}const xhe=({onDelete:e}={})=>[{accessorKey:"title",size:50,header:({column:t})=>a.jsx(br,{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(br,{column:t,children:"Last run"}),cell:({row:t})=>{const n=t.getValue("lastRun");return a.jsx("div",{className:"text-muted-foreground",children:IO(n)})},meta:{title:"Last run"}},{id:"actions",size:80,header:({table:t})=>a.jsx(Cd,{table:t}),cell:({row:t})=>a.jsx(ghe,{id:t.original.id,onDelete:e}),meta:{title:"Actions"}}];function yhe({items:e,onRowClick:t,onDelete:n}){const r=h.useMemo(()=>xhe({onDelete:n}),[n]),{sorting:s,setSorting:i,columnVisibility:c,setColumnVisibility:u}=Lc({columns:r,storageKeyPrefix:"data-mart-insights",defaultSortingColumn:"lastRun"}),f=jl({data:e,columns:r,getCoreRowModel:Rl(),getPaginationRowModel:Gh(),onSortingChange:i,getSortedRowModel:kc(),getFilteredRowModel:Sd(),state:{sorting:s,columnVisibility:c},onColumnVisibilityChange:u,enableGlobalFilter:!0,enableColumnResizing:!1}),m=h.useCallback(()=>{f.previousPage()},[f]),x=h.useCallback(()=>{f.nextPage()},[f]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(Tl,{id:"insights-table",className:"dm-card-table",role:"table","aria-label":"Insights",children:[a.jsx(_l,{className:"dm-card-table-header",children:f.getHeaderGroups().map(y=>a.jsx(Hn,{className:"dm-card-table-header-row",children:y.headers.map(v=>a.jsx(Al,{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))},y.id))}),a.jsx(Nl,{className:"dm-card-table-body",children:f.getRowModel().rows.length?f.getRowModel().rows.map((y,v)=>a.jsx(Hn,{onClick:()=>{t(y.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":v+1,children:y.getVisibleCells().map((S,b)=>a.jsx(Gr,{className:`px-6 whitespace-normal ${S.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":b+1,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},y.id)):a.jsx(Hn,{children:a.jsx(Gr,{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:x,disabled:!f.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})]})}function vhe(){const e=Tc(),{fetchInsights:t,deleteInsight:n,createInsight:r,insightLoading:s}=xy(),{insights:i,isLoading:c,error:u,hasInsights:f}=GM(),[m,x]=h.useState(null);h.useEffect(()=>{t()},[t]);const g=S=>{e(S)},y=()=>{(async()=>{const S=await r({title:"Untitled insight"});S&&e(S.id)})()},v=()=>{(async()=>{if(m)try{await n(m)}finally{x(null)}})()};return a.jsxs(hl,{children:[a.jsxs(Co,{children:[a.jsx(So,{tooltip:"Manage and review your insights",icon:uo,children:"Insights"}),f&&a.jsx(em,{children:a.jsxs(we,{variant:"outline","aria-label":"Add new insight",disabled:s,onClick:y,children:[a.jsx(ga,{className:"h-4 w-4","aria-hidden":"true"}),"New insight"]})})]}),a.jsxs(Eo,{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(yhe,{items:i.map(S=>({id:S.id,title:S.title,lastRun:S.outputUpdatedAt})),onRowClick:g,onDelete:S=>{x(S)}}):a.jsx(phe,{}),a.jsx(Cr,{open:!!m,onOpenChange:S=>{S||x(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(li,{})]})}function bhe(){return a.jsx(IC,{children:a.jsx(vhe,{})})}const vy=h.createContext(null);vy.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"},LC=10,dc=h.useLayoutEffect,GN=ph.useId,She=typeof GN=="function"?GN:()=>null;let Che=0;function PC(e=null){const t=She(),n=h.useRef(e||t||null);return n.current===null&&(n.current=""+Che++),e??n.current}function e8({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:c,maxSize:u,minSize:f,onCollapse:m,onExpand:x,onResize:g,order:y,style:v,tagName:S="div",...b}){const E=h.useContext(vy);if(E===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:R,expandPanel:j,getPanelSize:_,getPanelStyle:D,groupId:O,isPanelCollapsed:A,reevaluatePanelConstraints:T,registerPanel:M,resizePanel:k,unregisterPanel:z}=E,L=PC(c),G=h.useRef({callbacks:{onCollapse:m,onExpand:x,onResize:g},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:u,minSize:f},id:L,idIsFromProps:c!==void 0,order:y});h.useRef({didLogMissingDefaultSizeWarning:!1}),dc(()=>{const{callbacks:q,constraints:V}=G.current,I={...V};G.current.id=L,G.current.idIsFromProps=c!==void 0,G.current.order=y,q.onCollapse=m,q.onExpand=x,q.onResize=g,V.collapsedSize=n,V.collapsible=r,V.defaultSize=s,V.maxSize=u,V.minSize=f,(I.collapsedSize!==V.collapsedSize||I.collapsible!==V.collapsible||I.maxSize!==V.maxSize||I.minSize!==V.minSize)&&T(G.current,I)}),dc(()=>{const q=G.current;return M(q),()=>{z(q)}},[y,L,M,z]),h.useImperativeHandle(i,()=>({collapse:()=>{R(G.current)},expand:q=>{j(G.current,q)},getId(){return L},getSize(){return _(G.current)},isCollapsed(){return A(G.current)},isExpanded(){return!A(G.current)},resize:q=>{k(G.current,q)}}),[R,j,_,A,L,k]);const B=D(G.current,s);return h.createElement(S,{...b,children:e,className:t,id:L,style:{...B,...v},[Qn.groupId]:O,[Qn.panel]:"",[Qn.panelCollapsible]:r||void 0,[Qn.panelId]:L,[Qn.panelSize]:parseFloat(""+B.flexGrow).toFixed(1)})}const t8=h.forwardRef((e,t)=>h.createElement(e8,{...e,forwardedRef:t}));e8.displayName="Panel";t8.displayName="forwardRef(Panel)";let uS=null,tg=-1,tl=null;function Ehe(e,t,n){const r=(t&o8)!==0,s=(t&i8)!==0,i=(t&l8)!==0,c=(t&c8)!==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 whe(){tl!==null&&(document.head.removeChild(tl),uS=null,tl=null,tg=-1)}function F1(e,t,n){var r,s;const i=Ehe(e,t);if(uS!==i){if(uS=i,tl===null&&(tl=document.createElement("style"),document.head.appendChild(tl)),tg>=0){var c;(c=tl.sheet)===null||c===void 0||c.removeRule(tg)}tg=(r=(s=tl.sheet)===null||s===void 0?void 0:s.insertRule(`*{cursor: ${i} !important;}`))!==null&&r!==void 0?r:-1}}function n8(e){return e.type==="keydown"}function r8(e){return e.type.startsWith("pointer")}function a8(e){return e.type.startsWith("mouse")}function by(e){if(r8(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(a8(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function Rhe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function jhe(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 The(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:WN(e),b:WN(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Pt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:KN(qN(n.a)),b:KN(qN(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 _he=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Nhe(e){var t;const n=getComputedStyle((t=s8(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function Ahe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Nhe(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"||_he.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function qN(e){let t=e.length;for(;t--;){const n=e[t];if(Pt(n,"Missing node"),Ahe(n))return n}return null}function KN(e){return e&&Number(getComputedStyle(e).zIndex)||0}function WN(e){const t=[];for(;e;)t.push(e),e=s8(e);return t}function s8(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const o8=1,i8=2,l8=4,c8=8,Dhe=Rhe()==="coarse";let Hs=[],Qu=!1,nl=new Map,Sy=new Map;const hh=new Set;function Ohe(e,t,n,r,s){var i;const{ownerDocument:c}=t,u={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:s},f=(i=nl.get(c))!==null&&i!==void 0?i:0;return nl.set(c,f+1),hh.add(u),Bg(),function(){var x;Sy.delete(e),hh.delete(u);const g=(x=nl.get(c))!==null&&x!==void 0?x:1;if(nl.set(c,g-1),Bg(),g===1&&nl.delete(c),Hs.includes(u)){const y=Hs.indexOf(u);y>=0&&Hs.splice(y,1),Cy(),s("up",!0,null)}}}function Ihe(e){const{target:t}=e,{x:n,y:r}=by(e);Qu=!0,UC({target:t,x:n,y:r}),Bg(),Hs.length>0&&(Gg("down",e),Cy(),e.preventDefault(),u8(t)||e.stopImmediatePropagation())}function H1(e){const{x:t,y:n}=by(e);if(Qu&&e.type!=="pointerleave"&&e.buttons===0&&(Qu=!1,Gg("up",e)),!Qu){const{target:r}=e;UC({target:r,x:t,y:n})}Gg("move",e),Cy(),Hs.length>0&&e.preventDefault()}function V1(e){const{target:t}=e,{x:n,y:r}=by(e);Sy.clear(),Qu=!1,Hs.length>0&&(e.preventDefault(),u8(t)||e.stopImmediatePropagation()),Gg("up",e),UC({target:t,x:n,y:r}),Cy(),Bg()}function u8(e){let t=e;for(;t;){if(t.hasAttribute(Qn.resizeHandle))return!0;t=t.parentElement}return!1}function UC({target:e,x:t,y:n}){Hs.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),hh.forEach(s=>{const{element:i,hitAreaMargins:c}=s,u=i.getBoundingClientRect(),{bottom:f,left:m,right:x,top:g}=u,y=Dhe?c.coarse:c.fine;if(t>=m-y&&t<=x+y&&n>=g-y&&n<=f+y){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&The(r,i)>0){let S=r,b=!1;for(;S&&!S.contains(i);){if(jhe(S.getBoundingClientRect(),u)){b=!0;break}S=S.parentElement}if(b)return}Hs.push(s)}})}function $1(e,t){Sy.set(e,t)}function Cy(){let e=!1,t=!1;Hs.forEach(r=>{const{direction:s}=r;s==="horizontal"?e=!0:t=!0});let n=0;Sy.forEach(r=>{n|=r}),e&&t?F1("intersection",n):e?F1("horizontal",n):t?F1("vertical",n):whe()}let B1;function Bg(){var e;(e=B1)===null||e===void 0||e.abort(),B1=new AbortController;const t={capture:!0,signal:B1.signal};hh.size&&(Qu?(Hs.length>0&&nl.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("contextmenu",V1,t),s.addEventListener("pointerleave",H1,t),s.addEventListener("pointermove",H1,t))}),nl.forEach((n,r)=>{const{body:s}=r;s.addEventListener("pointerup",V1,t),s.addEventListener("pointercancel",V1,t)})):nl.forEach((n,r)=>{const{body:s}=r;n>0&&(s.addEventListener("pointerdown",Ihe,t),s.addEventListener("pointermove",H1,t))}))}function Gg(e,t){hh.forEach(n=>{const{setResizeHandlerState:r}=n,s=Hs.includes(n);r(e,s,t)})}function Mhe(){const[e,t]=h.useState(0);return h.useCallback(()=>t(n=>n+1),[])}function Pt(e,t){if(!e)throw console.error(t),Error(t)}function Rc(e,t,n=LC){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function ai(e,t,n=LC){return Rc(e,t,n)===0}function Ga(e,t,n){return Rc(e,t,n)===0}function khe(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(!Ga(s,i,n))return!1}return!0}function Hu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Pt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:s=0,collapsible:i,maxSize:c=100,minSize:u=0}=r;if(Rc(n,u)<0)if(i){const f=(s+u)/2;Rc(n,f)<0?n=s:n=u}else n=u;return n=Math.min(c,n),n=parseFloat(n.toFixed(LC)),n}function Ff({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:i}){if(Ga(e,0))return t;const c=[...t],[u,f]=r;Pt(u!=null,"Invalid first pivot index"),Pt(f!=null,"Invalid second pivot index");let m=0;if(i==="keyboard"){{const g=e<0?f:u,y=n[g];Pt(y,`Panel constraints not found for index ${g}`);const{collapsedSize:v=0,collapsible:S,minSize:b=0}=y;if(S){const E=t[g];if(Pt(E!=null,`Previous layout not found for panel index ${g}`),Ga(E,v)){const R=b-E;Rc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}{const g=e<0?u:f,y=n[g];Pt(y,`No panel constraints found for index ${g}`);const{collapsedSize:v=0,collapsible:S,minSize:b=0}=y;if(S){const E=t[g];if(Pt(E!=null,`Previous layout not found for panel index ${g}`),Ga(E,b)){const R=E-v;Rc(R,Math.abs(e))>0&&(e=e<0?0-R:R)}}}}{const g=e<0?1:-1;let y=e<0?f:u,v=0;for(;;){const b=t[y];Pt(b!=null,`Previous layout not found for panel index ${y}`);const R=Hu({panelConstraints:n,panelIndex:y,size:100})-b;if(v+=R,y+=g,y<0||y>=n.length)break}const S=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-S:S}{let y=e<0?u:f;for(;y>=0&&y<n.length;){const v=Math.abs(e)-Math.abs(m),S=t[y];Pt(S!=null,`Previous layout not found for panel index ${y}`);const b=S-v,E=Hu({panelConstraints:n,panelIndex:y,size:b});if(!Ga(S,E)&&(m+=S-E,c[y]=E,m.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?y--:y++}}if(khe(s,c))return s;{const g=e<0?f:u,y=t[g];Pt(y!=null,`Previous layout not found for panel index ${g}`);const v=y+m,S=Hu({panelConstraints:n,panelIndex:g,size:v});if(c[g]=S,!Ga(S,v)){let b=v-S,R=e<0?f:u;for(;R>=0&&R<n.length;){const j=c[R];Pt(j!=null,`Previous layout not found for panel index ${R}`);const _=j+b,D=Hu({panelConstraints:n,panelIndex:R,size:_});if(Ga(j,D)||(b-=D-j,c[R]=D),Ga(b,0))break;e>0?R--:R++}}}const x=c.reduce((g,y)=>y+g,0);return Ga(x,100)?c:s}function Lhe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,s=100,i=0,c=0;const u=n[0];Pt(u!=null,"No pivot index found"),t.forEach((g,y)=>{const{constraints:v}=g,{maxSize:S=100,minSize:b=0}=v;y===u?(r=b,s=S):(i+=b,c+=S)});const f=Math.min(s,100-i),m=Math.max(r,100-c),x=e[u];return{valueMax:f,valueMin:m,valueNow:x}}function mh(e,t=document){return Array.from(t.querySelectorAll(`[${Qn.resizeHandleId}][data-panel-group-id="${e}"]`))}function d8(e,t,n=document){const s=mh(e,n).findIndex(i=>i.getAttribute(Qn.resizeHandleId)===t);return s??null}function f8(e,t,n){const r=d8(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function Phe(e){return e instanceof HTMLElement?!0:typeof e=="object"&&e!==null&&"tagName"in e&&"getAttribute"in e}function h8(e,t=document){if(Phe(t)&&t.dataset.panelGroupId==e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function Ey(e,t=document){const n=t.querySelector(`[${Qn.resizeHandleId}="${e}"]`);return n||null}function Uhe(e,t,n,r=document){var s,i,c,u;const f=Ey(t,r),m=mh(e,r),x=f?m.indexOf(f):-1,g=(s=(i=n[x])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,y=(c=(u=n[x+1])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null;return[g,y]}function zhe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:c}){h.useRef({didWarnAboutMissingResizeHandle:!1}),dc(()=>{if(!i)return;const u=mh(n,i);for(let f=0;f<s.length-1;f++){const{valueMax:m,valueMin:x,valueNow:g}=Lhe({layout:r,panelsArray:s,pivotIndices:[f,f+1]}),y=u[f];if(y!=null){const v=s[f];Pt(v,`No panel data found for index "${f}"`),y.setAttribute("aria-controls",v.id),y.setAttribute("aria-valuemax",""+Math.round(m)),y.setAttribute("aria-valuemin",""+Math.round(x)),y.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;Pt(u,"Eager values not found");const{panelDataArray:f}=u,m=h8(n,i);Pt(m!=null,`No group found for id "${n}"`);const x=mh(n,i);Pt(x,`No resize handles found for group id "${n}"`);const g=x.map(y=>{const v=y.getAttribute(Qn.resizeHandleId);Pt(v,"Resize handle element has no handle id attribute");const[S,b]=Uhe(n,v,f,i);if(S==null||b==null)return()=>{};const E=R=>{if(!R.defaultPrevented)switch(R.key){case"Enter":{R.preventDefault();const j=f.findIndex(_=>_.id===S);if(j>=0){const _=f[j];Pt(_,`No panel data found for index ${j}`);const D=r[j],{collapsedSize:O=0,collapsible:A,minSize:T=0}=_.constraints;if(D!=null&&A){const M=Ff({delta:Ga(D,O)?T-O:O-D,initialLayout:r,panelConstraints:f.map(k=>k.constraints),pivotIndices:f8(n,v,i),prevLayout:r,trigger:"keyboard"});r!==M&&c(M)}}break}}};return y.addEventListener("keydown",E),()=>{y.removeEventListener("keydown",E)}});return()=>{g.forEach(y=>y())}},[i,e,t,n,r,s,c])}function YN(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 m8(e,t){const n=e==="horizontal",{x:r,y:s}=by(t);return n?r:s}function Fhe(e,t,n,r,s){const i=n==="horizontal",c=Ey(t,s);Pt(c,`No resize handle element found for id "${t}"`);const u=c.getAttribute(Qn.groupId);Pt(u,"Resize handle element has no group id attribute");let{initialCursorPosition:f}=r;const m=m8(n,e),x=h8(u,s);Pt(x,`No group element found for id "${u}"`);const g=x.getBoundingClientRect(),y=i?g.width:g.height;return(m-f)/y*100}function Hhe(e,t,n,r,s,i){if(n8(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:Fhe(e,t,n,r,i)}function Vhe({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];Pt(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];Pt(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 Nu(e,t,n){t.forEach((r,s)=>{const i=e[s];Pt(i,`Panel data not found for index ${s}`);const{callbacks:c,constraints:u,id:f}=i,{collapsedSize:m=0,collapsible:x}=u,g=n[f];if(g==null||r!==g){n[f]=r;const{onCollapse:y,onExpand:v,onResize:S}=c;S&&S(r,g),x&&(y||v)&&(v&&(g==null||ai(g,m))&&!ai(r,m)&&v(),y&&(g==null||!ai(g,m))&&ai(r,m)&&y())}})}function Fp(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 $he({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 Bhe(e,t=10){let n=null;return(...s)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}}function ZN(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 p8(e){return`react-resizable-panels:${e}`}function g8(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 x8(e,t){try{const n=p8(e),r=t.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function Ghe(e,t,n){var r,s;const i=(r=x8(e,n))!==null&&r!==void 0?r:{},c=g8(t);return(s=i[c])!==null&&s!==void 0?s:null}function qhe(e,t,n,r,s){var i;const c=p8(e),u=g8(t),f=(i=x8(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 XN({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(!Ga(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const c=n[i];Pt(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];Pt(c!=null,`No layout data found for index ${i}`);const u=Hu({panelConstraints:t,panelIndex:i,size:c});c!=u&&(s+=c-u,n[i]=u)}if(!Ga(s,0))for(let i=0;i<t.length;i++){const c=n[i];Pt(c!=null,`No layout data found for index ${i}`);const u=c+s,f=Hu({panelConstraints:t,panelIndex:i,size:u});if(c!==f&&(s-=f-c,n[i]=f,Ga(s,0)))break}return n}const Khe=100,Hf={getItem:e=>(ZN(Hf),Hf.getItem(e)),setItem:(e,t)=>{ZN(Hf),Hf.setItem(e,t)}},QN={};function y8({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:c=null,keyboardResizeBy:u=null,storage:f=Hf,style:m,tagName:x="div",...g}){const y=PC(i),v=h.useRef(null),[S,b]=h.useState(null),[E,R]=h.useState([]),j=Mhe(),_=h.useRef({}),D=h.useRef(new Map),O=h.useRef(0),A=h.useRef({autoSaveId:e,direction:r,dragState:S,id:y,keyboardResizeBy:u,onLayout:c,storage:f}),T=h.useRef({layout:E,panelDataArray:[],panelDataArrayChanged:!1});h.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),h.useImperativeHandle(s,()=>({getId:()=>A.current.id,getLayout:()=>{const{layout:H}=T.current;return H},setLayout:H=>{const{onLayout:W}=A.current,{layout:Q,panelDataArray:le}=T.current,J=XN({layout:H,panelConstraints:le.map(ie=>ie.constraints)});YN(Q,J)||(R(J),T.current.layout=J,W&&W(J),Nu(le,J,_.current))}}),[]),dc(()=>{A.current.autoSaveId=e,A.current.direction=r,A.current.dragState=S,A.current.id=y,A.current.onLayout=c,A.current.storage=f}),zhe({committedValuesRef:A,eagerValuesRef:T,groupId:y,layout:E,panelDataArray:T.current.panelDataArray,setLayout:R,panelGroupElement:v.current}),h.useEffect(()=>{const{panelDataArray:H}=T.current;if(e){if(E.length===0||E.length!==H.length)return;let W=QN[e];W==null&&(W=Bhe(qhe,Khe),QN[e]=W);const Q=[...H],le=new Map(D.current);W(e,Q,le,E,f)}},[e,E,f]),h.useEffect(()=>{});const M=h.useCallback(H=>{const{onLayout:W}=A.current,{layout:Q,panelDataArray:le}=T.current;if(H.constraints.collapsible){const J=le.map(He=>He.constraints),{collapsedSize:ie=0,panelSize:ye,pivotIndices:Ee}=tc(le,H,Q);if(Pt(ye!=null,`Panel size not found for panel "${H.id}"`),!ai(ye,ie)){D.current.set(H.id,ye);const Re=Uu(le,H)===le.length-1?ye-ie:ie-ye,Ke=Ff({delta:Re,initialLayout:Q,panelConstraints:J,pivotIndices:Ee,prevLayout:Q,trigger:"imperative-api"});Fp(Q,Ke)||(R(Ke),T.current.layout=Ke,W&&W(Ke),Nu(le,Ke,_.current))}}},[]),k=h.useCallback((H,W)=>{const{onLayout:Q}=A.current,{layout:le,panelDataArray:J}=T.current;if(H.constraints.collapsible){const ie=J.map(nt=>nt.constraints),{collapsedSize:ye=0,panelSize:Ee=0,minSize:He=0,pivotIndices:Re}=tc(J,H,le),Ke=W??He;if(ai(Ee,ye)){const nt=D.current.get(H.id),Gt=nt!=null&&nt>=Ke?nt:Ke,On=Uu(J,H)===J.length-1?Ee-Gt:Gt-Ee,vn=Ff({delta:On,initialLayout:le,panelConstraints:ie,pivotIndices:Re,prevLayout:le,trigger:"imperative-api"});Fp(le,vn)||(R(vn),T.current.layout=vn,Q&&Q(vn),Nu(J,vn,_.current))}}},[]),z=h.useCallback(H=>{const{layout:W,panelDataArray:Q}=T.current,{panelSize:le}=tc(Q,H,W);return Pt(le!=null,`Panel size not found for panel "${H.id}"`),le},[]),L=h.useCallback((H,W)=>{const{panelDataArray:Q}=T.current,le=Uu(Q,H);return $he({defaultSize:W,dragState:S,layout:E,panelData:Q,panelIndex:le})},[S,E]),G=h.useCallback(H=>{const{layout:W,panelDataArray:Q}=T.current,{collapsedSize:le=0,collapsible:J,panelSize:ie}=tc(Q,H,W);return Pt(ie!=null,`Panel size not found for panel "${H.id}"`),J===!0&&ai(ie,le)},[]),B=h.useCallback(H=>{const{layout:W,panelDataArray:Q}=T.current,{collapsedSize:le=0,collapsible:J,panelSize:ie}=tc(Q,H,W);return Pt(ie!=null,`Panel size not found for panel "${H.id}"`),!J||Rc(ie,le)>0},[]),q=h.useCallback(H=>{const{panelDataArray:W}=T.current;W.push(H),W.sort((Q,le)=>{const J=Q.order,ie=le.order;return J==null&&ie==null?0:J==null?-1:ie==null?1:J-ie}),T.current.panelDataArrayChanged=!0,j()},[j]);dc(()=>{if(T.current.panelDataArrayChanged){T.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:W,storage:Q}=A.current,{layout:le,panelDataArray:J}=T.current;let ie=null;if(H){const Ee=Ghe(H,J,Q);Ee&&(D.current=new Map(Object.entries(Ee.expandToSizes)),ie=Ee.layout)}ie==null&&(ie=Vhe({panelDataArray:J}));const ye=XN({layout:ie,panelConstraints:J.map(Ee=>Ee.constraints)});YN(le,ye)||(R(ye),T.current.layout=ye,W&&W(ye),Nu(J,ye,_.current))}}),dc(()=>{const H=T.current;return()=>{H.layout=[]}},[]);const V=h.useCallback(H=>{let W=!1;const Q=v.current;return Q&&window.getComputedStyle(Q,null).getPropertyValue("direction")==="rtl"&&(W=!0),function(J){J.preventDefault();const ie=v.current;if(!ie)return()=>null;const{direction:ye,dragState:Ee,id:He,keyboardResizeBy:Re,onLayout:Ke}=A.current,{layout:nt,panelDataArray:Gt}=T.current,{initialLayout:Ft}=Ee??{},On=f8(He,H,ie);let vn=Hhe(J,H,ye,Ee,Re,ie);const ke=ye==="horizontal";ke&&W&&(vn=-vn);const Y=Gt.map(Ie=>Ie.constraints),re=Ff({delta:vn,initialLayout:Ft??nt,panelConstraints:Y,pivotIndices:On,prevLayout:nt,trigger:n8(J)?"keyboard":"mouse-or-touch"}),ce=!Fp(nt,re);(r8(J)||a8(J))&&O.current!=vn&&(O.current=vn,!ce&&vn!==0?ke?$1(H,vn<0?o8:i8):$1(H,vn<0?l8:c8):$1(H,0)),ce&&(R(re),T.current.layout=re,Ke&&Ke(re),Nu(Gt,re,_.current))}},[]),I=h.useCallback((H,W)=>{const{onLayout:Q}=A.current,{layout:le,panelDataArray:J}=T.current,ie=J.map(nt=>nt.constraints),{panelSize:ye,pivotIndices:Ee}=tc(J,H,le);Pt(ye!=null,`Panel size not found for panel "${H.id}"`);const Re=Uu(J,H)===J.length-1?ye-W:W-ye,Ke=Ff({delta:Re,initialLayout:le,panelConstraints:ie,pivotIndices:Ee,prevLayout:le,trigger:"imperative-api"});Fp(le,Ke)||(R(Ke),T.current.layout=Ke,Q&&Q(Ke),Nu(J,Ke,_.current))},[]),K=h.useCallback((H,W)=>{const{layout:Q,panelDataArray:le}=T.current,{collapsedSize:J=0,collapsible:ie}=W,{collapsedSize:ye=0,collapsible:Ee,maxSize:He=100,minSize:Re=0}=H.constraints,{panelSize:Ke}=tc(le,H,Q);Ke!=null&&(ie&&Ee&&ai(Ke,J)?ai(J,ye)||I(H,ye):Ke<Re?I(H,Re):Ke>He&&I(H,He))},[I]),$=h.useCallback((H,W)=>{const{direction:Q}=A.current,{layout:le}=T.current;if(!v.current)return;const J=Ey(H,v.current);Pt(J,`Drag handle element not found for id "${H}"`);const ie=m8(Q,W);b({dragHandleId:H,dragHandleRect:J.getBoundingClientRect(),initialCursorPosition:ie,initialLayout:le})},[]),ee=h.useCallback(()=>{b(null)},[]),me=h.useCallback(H=>{const{panelDataArray:W}=T.current,Q=Uu(W,H);Q>=0&&(W.splice(Q,1),delete _.current[H.id],T.current.panelDataArrayChanged=!0,j())},[j]),U=h.useMemo(()=>({collapsePanel:M,direction:r,dragState:S,expandPanel:k,getPanelSize:z,getPanelStyle:L,groupId:y,isPanelCollapsed:G,isPanelExpanded:B,reevaluatePanelConstraints:K,registerPanel:q,registerResizeHandle:V,resizePanel:I,startDragging:$,stopDragging:ee,unregisterPanel:me,panelGroupElement:v.current}),[M,S,r,k,z,L,y,G,B,K,q,V,I,$,ee,me]),F={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return h.createElement(vy.Provider,{value:U},h.createElement(x,{...g,children:t,className:n,id:i,ref:v,style:{...F,...m},[Qn.group]:"",[Qn.groupDirection]:r,[Qn.groupId]:y}))}const v8=h.forwardRef((e,t)=>h.createElement(y8,{...e,forwardedRef:t}));y8.displayName="PanelGroup";v8.displayName="forwardRef(PanelGroup)";function Uu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function tc(e,t,n){const r=Uu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],c=n[r];return{...t.constraints,panelSize:c,pivotIndices:i}}function Whe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){h.useEffect(()=>{if(e||n==null||r==null)return;const s=Ey(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);Pt(u,`No group element found for id "${u}"`);const f=mh(u,r),m=d8(u,t,r);Pt(m!==null,`No resize element found for id "${t}"`);const x=c.shiftKey?m>0?m-1:f.length-1:m+1<f.length?m+1:0;f[x].focus();break}}};return s.addEventListener("keydown",i),()=>{s.removeEventListener("keydown",i)}},[r,e,t,n])}function b8({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onClick:c,onDragging:u,onFocus:f,onPointerDown:m,onPointerUp:x,style:g={},tabIndex:y=0,tagName:v="div",...S}){var b,E;const R=h.useRef(null),j=h.useRef({onClick:c,onDragging:u,onPointerDown:m,onPointerUp:x});h.useEffect(()=>{j.current.onClick=c,j.current.onDragging=u,j.current.onPointerDown=m,j.current.onPointerUp=x});const _=h.useContext(vy);if(_===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:D,groupId:O,registerResizeHandle:A,startDragging:T,stopDragging:M,panelGroupElement:k}=_,z=PC(s),[L,G]=h.useState("inactive"),[B,q]=h.useState(!1),[V,I]=h.useState(null),K=h.useRef({state:L});dc(()=>{K.current.state=L}),h.useEffect(()=>{if(n)I(null);else{const U=A(z);I(()=>U)}},[n,z,A]);const $=(b=r==null?void 0:r.coarse)!==null&&b!==void 0?b:15,ee=(E=r==null?void 0:r.fine)!==null&&E!==void 0?E:5;h.useEffect(()=>{if(n||V==null)return;const U=R.current;Pt(U,"Element ref not attached");let F=!1;return Ohe(z,U,D,{coarse:$,fine:ee},(W,Q,le)=>{if(!Q){G("inactive");return}switch(W){case"down":{G("drag"),F=!1,Pt(le,'Expected event to be defined for "down" action'),T(z,le);const{onDragging:J,onPointerDown:ie}=j.current;J==null||J(!0),ie==null||ie();break}case"move":{const{state:J}=K.current;F=!0,J!=="drag"&&G("hover"),Pt(le,'Expected event to be defined for "move" action'),V(le);break}case"up":{G("hover"),M();const{onClick:J,onDragging:ie,onPointerUp:ye}=j.current;ie==null||ie(!1),ye==null||ye(),F||J==null||J();break}}})},[$,D,n,ee,A,z,V,T,M]),Whe({disabled:n,handleId:z,resizeHandler:V,panelGroupElement:k});const me={touchAction:"none",userSelect:"none"};return h.createElement(v,{...S,children:e,className:t,id:s,onBlur:()=>{q(!1),i==null||i()},onFocus:()=>{q(!0),f==null||f()},ref:R,role:"separator",style:{...me,...g},tabIndex:y,[Qn.groupDirection]:D,[Qn.groupId]:O,[Qn.resizeHandle]:"",[Qn.resizeHandleActive]:L==="drag"?"pointer":B?"keyboard":void 0,[Qn.resizeHandleEnabled]:!n,[Qn.resizeHandleId]:z,[Qn.resizeHandleState]:L})}b8.displayName="PanelResizeHandle";function Yhe({className:e,...t}){return a.jsx(v8,{"data-slot":"resizable-panel-group",className:se("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function JN({...e}){return a.jsx(t8,{"data-slot":"resizable-panel",...e})}function Zhe({withHandle:e,className:t,...n}){return a.jsx(b8,{"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(UA,{className:"size-2.5"})})})}function Xhe({storageKey:e,left:t,right:n,initialRatio:r=.5,minWidth:s=240,className:i}){const c=h.useMemo(()=>{const y=xs.get(e);if(y!==null){const v=Number(y);if(!Number.isNaN(v))return G1(v,.1,.9)}return G1(r,.1,.9)},[e,r]),u=Math.round(c*100),f=100-u,x=Math.min(45,Math.max(5,Math.round(s/1200*100)));function g(y){const v=y[0],S=G1(v/100,.1,.9);xs.set(e,S)}return a.jsxs(Yhe,{direction:"horizontal",onLayout:g,className:se("relative flex h-full w-full items-stretch overflow-hidden",i),children:[a.jsx(JN,{defaultSize:u,minSize:x,className:"overflow-auto",children:t}),a.jsx(Zhe,{withHandle:!0}),a.jsx(JN,{defaultSize:f,minSize:x,className:"overflow-auto",children:n})]})}function G1(e,t,n){return Math.max(t,Math.min(n,e))}function Qhe({...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 eA({className:e,...t}){return a.jsx("li",{"data-slot":"breadcrumb-item",className:se("inline-flex items-center gap-1.5",e),...t})}function eme({asChild:e,className:t,...n}){const r=e?bh:"a";return a.jsx(r,{"data-slot":"breadcrumb-link",className:se("hover:text-foreground transition-colors",t),...n})}function tme({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(Da,{})})}function nme({dataMartId:e,triggerId:t,insightId:n,onRunFinished:r,onError:s}){const i=h.useCallback(async c=>{if(!(!e||!t))try{const u=await co.checkInsightExecutionStatus(e,t,n,{skipLoadingIndicator:!0,signal:c});[Ja.SUCCESS,Ja.ERROR,Ja.CANCELLED].includes(u.status)&&r()}catch(u){s(u)}},[e,t,n,r,s]);kC({enabled:!!(e&&t),intervalMs:2500,onlyWhenVisible:!0,onTick:i})}const rme=en({title:gt().min(1,"Title cannot be empty"),template:gt().optional()}),ame=(e,t,n)=>{const{register:r,watch:s,handleSubmit:i,reset:c,resetField:u,setValue:f,formState:{isSubmitting:m,dirtyFields:x}}=Do({resolver:Ci(rme),defaultValues:{title:(e==null?void 0:e.title)??"",template:(e==null?void 0:e.template)??""}}),g=s("title"),y=s("template"),v=!!x.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 S=h.useCallback(async E=>{if(!e)return;const R=E.trim();f("title",R,{shouldDirty:!0,shouldValidate:!0}),await n(e.id,R),u("title",{defaultValue:R})},[e,u,f,n]),b=h.useCallback(async E=>{if(!e)return;const R={title:E.title.trim(),template:E.template&&E.template.trim().length>0?E.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:y,handleTitleUpdate:S,onSubmit:b}},q1=[{icon:uo,text:"Initializing intelligence..."},{icon:kA,text:"Connecting to data sources..."},{icon:pz,text:"Mapping data relationships..."},{icon:DU,text:"Exploring dataset structure..."},{icon:Uz,text:"Scanning available fields..."},{icon:Gz,text:"Analyzing data patterns..."},{icon:Oz,text:"Selecting optimal insight path..."},{icon:qA,text:"Preparing aggregated tables..."},{icon:YU,text:"Building visual model..."},{icon:EU,text:"Finalizing insight output..."},{icon:Xz,text:"Validating field consistency..."},{icon:Lz,text:"Checking for missing values..."},{icon:NU,text:"Detecting anomalies in data..."},{icon:JU,text:"Cross-referencing data sources..."},{icon:Kz,text:"Verifying aggregation results..."},{icon:$U,text:"Ensuring data relationships are correct..."},{icon:zP,text:"Refining visual model parameters..."},{icon:UU,text:"Confirming data integrity..."},{icon:RU,text:"Preparing final output for insights..."},{icon:MU,text:"Performing final quality checks..."}],sme=()=>{const[e,t]=h.useState(0);h.useEffect(()=>{const r=setInterval(()=>{t(s=>(s+1)%q1.length)},5e3);return()=>{clearInterval(r)}},[]);const n=q1[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:q1[e].text},`${String(e)}-text`)]})})};function ome(){const e=Tc(),{insightId:t}=Xg(),n=h.useMemo(()=>"insight_details_split",[]),[r,s]=h.useState(!1),{dataMart:i}=Rs(),c=(i==null?void 0:i.status.code)===Ir.DRAFT,{activeInsight:u,insightLoading:f,isRunning:m,triggerId:x,updateInsight:g,updateInsightTitle:y,getInsight:v,runInsight:S,deleteInsight:b,resetTriggerId:E,ensureActiveRunPolling:R}=xy(),{handleSubmit:j,setValue:_,isTemplateDirty:D,isSubmitting:O,titleValue:A,templateValue:T,handleTitleUpdate:M,onSubmit:k}=ame(u,g,y),z=VM({markdown:(u==null?void 0:u.output)??"",enabled:!!(u!=null&&u.output),debounceMs:0}),[L,G]=h.useState(!1),[B,q]=h.useState(!1),{copyToClipboard:V}=yy(),I=h.useCallback(async()=>{const U=(u==null?void 0:u.output)??"";if(!U)return;await V(U,"insight-output")?kt.success("Markdown copied to clipboard"):kt.error("Failed to copy to clipboard"),De({event:"insight_output_copied",category:"Insights",action:"Copy"})},[u==null?void 0:u.output,V]);h.useEffect(()=>{const U=F=>{(F.metaKey||F.ctrlKey)&&F.shiftKey&&(F.key==="M"||F.key==="m")&&(F.preventDefault(),G(W=>!W),De({event:"insight_raw_output_toggle",category:"Insights",action:"ToggleRawOutput"}))};return window.addEventListener("keydown",U),()=>{window.removeEventListener("keydown",U)}},[]);const K=h.useCallback(async()=>{u&&(await b(u.id),e(".."))},[u,b,e]),$=!f&&!(u!=null&&u.output);h.useEffect(()=>{t&&v(t)},[t,v]),h.useEffect(()=>{u!=null&&u.id&&R()},[u==null?void 0:u.id,R]),nme({triggerId:x,dataMartId:(i==null?void 0:i.id)??"",insightId:(u==null?void 0:u.id)??"",onRunFinished:h.useCallback(()=>{E(),u!=null&&u.id&&v(u.id)},[u==null?void 0:u.id,v,E]),onError:h.useCallback(()=>{E()},[E])});const ee=h.useCallback(async()=>{if(!(u!=null&&u.id)){console.error("Insight ID is not available");return}try{await S(u.id)}catch(U){throw console.error("Failed to run insight"),U}},[u==null?void 0:u.id,S]),me=h.useCallback(()=>j(async U=>{if(await k(U),!(u!=null&&u.id)){console.error("Insight ID is not available");return}try{await S(u.id)}catch(F){throw console.error("Failed to run insight"),F}})(),[j,u==null?void 0:u.id,k,S]);return f?a.jsx("div",{className:"text-muted-foreground flex flex-col gap-2 text-sm",children:"Loading..."}):!u||!i?a.jsxs(sS,{children:[a.jsx(oS,{children:a.jsx(iS,{variant:"icon",children:a.jsx(uo,{})})}),a.jsx(lS,{children:"Insight not found"}),a.jsx(cS,{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(Qhe,{children:a.jsxs(Jhe,{children:[a.jsx(eA,{children:a.jsx(eme,{asChild:!0,children:a.jsx(Xr,{to:"..",children:"Insights"})})}),a.jsx(tme,{}),a.jsx(eA,{children:a.jsx("span",{"aria-current":"page",className:"block max-w-[480px] truncate",children:a.jsx(_I,{title:A||"Untitled insight",onUpdate:M,className:"font-medium",errorMessage:"Title cannot be empty",minWidth:"200px"})})})]})}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs(wr,{children:[a.jsx(Rr,{asChild:!0,children:a.jsx(we,{variant:"ghost",size:"icon","aria-label":"Insight actions",children:a.jsx(LA,{className:"h-4 w-4"})})}),a.jsx(jr,{align:"end",children:a.jsxs(Tt,{onClick:()=>{s(!0)},className:"text-destructive",children:[a.jsx(ts,{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(Xhe,{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(aS,{value:T??"",onChange:U=>{_("template",U,{shouldDirty:!0})},height:"calc(100vh - 275px)",placeholder:"Type / to view available commands...",readOnly:m,excludeInsightId:t})}),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:[c?a.jsxs(wt,{delayDuration:150,children:[a.jsx(Rt,{asChild:!0,children:a.jsx("span",{className:"inline-flex",tabIndex:0,children:a.jsx(we,{variant:"default",size:"default",disabled:O||m||!D,onClick:()=>{D&&j(async U=>{await k(U)})()},children:D?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(uo,{})," Save Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(uo,{})," Run Insight"]})})})}),a.jsx(jt,{side:"top",children:a.jsx("p",{children:"To run an insight, publish the Data Mart first"})})]}):a.jsx(we,{variant:"default",size:"default",disabled:O||m,onClick:()=>void(D?me():ee()),children:m?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(Nc,{className:"h-3 w-3 animate-spin"})," Running…"]}):D?a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(uo,{})," Save & Run Insight"]}):a.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.jsx(uo,{})," Run Insight"]})}),a.jsxs(wt,{delayDuration:1500,children:[a.jsx(Rt,{asChild:!0,children:a.jsx("span",{className:"inline-flex",tabIndex:0,children:a.jsxs(we,{variant:"outline",size:"default",onClick:()=>{De({event:"insight_send_schedule",category:"Insights",action:"SendSchedule",label:t}),c||q(!0)},disabled:c,className:"gap-2",children:[a.jsx(Hz,{className:"text-muted-foreground h-4 w-4"}),"Send & Schedule ..."]})})}),a.jsx(jt,{side:"top",children:c?a.jsx("p",{children:"You can schedule and send reports only after publishing the Data Mart"}):a.jsx("p",{children:"You can schedule this insight to run at a specific time or send it to a recipient"})})]})]}),u.outputUpdatedAt&&a.jsx(Xa,{children:a.jsxs(wt,{children:[a.jsx(Rt,{asChild:!0,children:a.jsx("div",{className:"text-muted-foreground/75 text-sm",children:a.jsx(Gs,{date:u.outputUpdatedAt})})}),a.jsx(jt,{side:"top",children:a.jsxs("p",{children:["Last run: ",IO(u.outputUpdatedAt)]})})]})})]})]}),right:a.jsx("div",{className:"h-full",children:m?a.jsx(sme,{}):$?a.jsx(sS,{className:"h-full",children:a.jsxs(oS,{children:[a.jsx(iS,{variant:"icon",children:a.jsx(uo,{})}),a.jsx(lS,{children:"Even data needs a little spark"}),a.jsx(cS,{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:L?a.jsx(aS,{value:u.output??"",onChange:()=>{},height:"100%",className:"h-full",readOnly:!0,excludeInsightId:t}):z.error?a.jsx("div",{className:"text-destructive",children:z.error}):a.jsxs(a.Fragment,{children:[a.jsx(HM,{html:z.html,loading:z.loading,error:z.error,height:"100%"}),!!u.output&&!z.loading&&!z.error&&a.jsx("div",{className:"absolute top-2 right-2 z-10",children:a.jsx(Xa,{children:a.jsxs(wt,{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 I(),children:a.jsx(ed,{className:"h-4 w-4"})})}),a.jsx(jt,{side:"left",children:a.jsx("p",{children:"Copy markdown to clipboard"})})]})})})]})})})})})}),a.jsx(Cr,{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:()=>{K()}}),a.jsx(m2,{children:a.jsx(ZM,{isOpen:B,onClose:()=>{q(!1)},mode:Nn.CREATE,preSelectedDestination:null,prefill:{title:u.title||A||"New report",subject:`Insight: ${u.title||A||""}`.trim(),messageTemplate:T??""},allowedDestinationTypes:[Oe.EMAIL,Oe.SLACK,Oe.MS_TEAMS,Oe.GOOGLE_CHAT]})})]})}const ime=[{path:"overview",element:a.jsx(VN,{})},{path:"data-setup",element:a.jsx(sde,{})},{path:"insights",element:a.jsx(kfe,{}),children:[{index:!0,element:a.jsx(bhe,{})},{path:":insightId",element:a.jsx(ome,{})}]},{path:"reports",element:a.jsx(Ife,{})},{path:"triggers",element:a.jsx(Mfe,{})},{path:"run-history",element:a.jsx(Jfe,{})},{index:!0,element:a.jsx(VN,{})}];function lme({to:e="/data-marts"}){const{user:t,status:n}=yi();if(n===Zr.LOADING)return a.jsx(Gu,{fullScreen:!0,message:"Loading..."});if(n===Zr.UNAUTHENTICATED||!t)return a.jsx(Gu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=gg(t.projectId,e);return a.jsx(D7,{to:r,replace:!0})}return a.jsx(Gu,{fullScreen:!0,message:"Project not found"})}const cme=[{index:!0,path:"/",element:a.jsx(lme,{})},{path:"/ui/:projectId",element:a.jsx(HX,{}),children:[{path:"about",element:a.jsx(VX,{})},{index:!0,element:a.jsx(k_,{})},{path:"data-marts",element:a.jsx(k_,{})},{path:"data-marts/create",element:a.jsx(ehe,{})},{path:"data-marts/:id",element:a.jsx(Que,{}),children:ime},{path:"data-storages",element:a.jsx(ohe,{})},{path:"data-destinations",element:a.jsx(fhe,{})},{path:"*",element:a.jsx(N_,{})}]},{path:"*",element:a.jsx(N_,{})}],S8="gtm-script",C8="gtm-noscript",ume="GOOGLE_TAG_MANAGER_CONTAINER_ID";function dme(){return!!document.getElementById(S8)}function fme(e){const t=document.createElement("script");return t.id=S8,t.innerHTML=`
848
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
849
+ new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
850
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
851
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
852
+ })(window,document,'script','dataLayer','${e}');
853
+ `,t}function hme(e){const t=document.createElement("noscript");return t.id=C8,t.innerHTML=`
854
+ <iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
855
+ height="0"
856
+ width="0"
857
+ style="display:none;visibility:hidden">
858
+ </iframe>
859
+ `,t}function mme(e){if(dme())return;const t=fme(e);document.head.prepend(t)}function pme(e){if(document.getElementById(C8))return;const t=hme(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function gme(e){try{mme(e),pme(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function xme(e){return(e[ume]??"").trim()}function yme(){const{flags:e,callState:t}=yd();return h.useEffect(()=>{if(t!==Ot.LOADED||!e)return;const n=xme(e);n&&gme(n)},[e,t]),null}const vme="INTERCOM_APP_ID",E8="intercom-widget-script";function bme(){return!!document.getElementById(E8)}function Sme(e,t){if(bme()){t();return}const n=document.createElement("script");n.id=E8,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Cme(){try{return(await ja.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function Eme(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 wme(e,t){if(!t)return;const n=Eme(e,t),r=await Cme();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function Rme(){const{flags:e,callState:t}=yd(),{user:n}=yi(),r=h.useRef(!1);return h.useEffect(()=>{if(r.current||t!==Ot.LOADED||!e)return;const s=e[vme],i=(typeof s=="string"?s:"").trim();i&&Sme(i,()=>{wme(i,n).then(()=>{r.current=!0,jb()})})},[e,t,n]),null}function jme({initialState:e,reducer:t,children:n}){const[r,s]=h.useReducer(t,e),i=h.useMemo(()=>s,[s]);return a.jsx(aD.Provider,{value:r,children:a.jsx(sD.Provider,{value:i,children:n})})}function Tme(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 tA={id:null,title:null},w8="project/SET_PROJECT",_me="project/CLEAR_PROJECT";function Nme(e){return{type:w8,payload:e}}function Ame(e=tA,t){switch(t.type){case w8:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case _me:return{...tA};default:return e}}class Dme extends El{getFlags(){return this.get("/flags")}}const Ome=new Dme(""),R8={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"},Ime={data:{...R8},callState:Ot.IDLE},j8="settings/LOAD_FLAGS",T8="settings/LOAD_FLAGS_SUCCESS",_8="settings/LOAD_FLAGS_ERROR";function Mme(){return{type:j8}}function kme(e){return{type:T8,payload:e}}function Lme(e){return{type:_8,payload:e}}function Pme(e=Ime,t){switch(t.type){case j8:return{...e,callState:Ot.LOADING,error:void 0};case T8:return{...e,callState:Ot.LOADED,data:{...R8,...t.payload}};case _8:return{...e,callState:Ot.ERROR,error:t.payload};default:return e}}async function Ume(e){try{e(Mme());const t=await Ome.getFlags();e(kme(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Lme(n))}}const N8="app/SET_READY";function zme(e={ready:!1},t){switch(t.type){case N8:return{...e,ready:!!t.payload};default:return e}}const Fme=Tme({project:Ame,flags:Pme,contentPopovers:eX,app:zme});function Hme({children:e}){return a.jsx(jme,{reducer:Fme,initialState:{project:{id:null,title:null},flags:{data:null,callState:Ot.IDLE},contentPopovers:sO,app:{ready:!1}},children:e})}function Vme({children:e}){const t=oD(),{user:n,status:r}=yi(),s=sh(f=>f.flags),i=s.callState,c=sh(f=>f.app.ready);h.useEffect(()=>{r===Zr.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(Nme({id:n.projectId,title:n.projectTitle??null})),i===Ot.IDLE&&Ume(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===Ot.LOADED;t({type:N8,payload:f})},[r,n==null?void 0:n.projectId,i,t]);const u=h.useMemo(()=>a.jsx(Gu,{fullScreen:!0,message:"Loading application..."}),[]);return c?a.jsx(a.Fragment,{children:e}):i===Ot.ERROR?a.jsx(Gu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):u}const $me={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 Bme({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",$me[n]),style:{width:e,height:t},"data-slot":"floating-popover",children:a.jsx("div",{className:"flex h-full flex-col",children:r})})}function Gme({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(hc,{className:"size-4"})})]})}function qme({children:e}){return a.jsx("h2",{className:"text-md font-semibold","data-slot":"floating-popover-title",children:e})}function Kme({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 Wme(){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 Yme(){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."})})}function Zme(){return a.jsx(a.Fragment,{children:a.jsx("video",{src:"https://github.com/user-attachments/assets/dcb60ce1-dd7b-4783-b19c-f2fd85079e1f",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 Xme={"video-1-google-sheets":{width:500,height:410,position:"bottom-left",title:"SQL to Google Sheets in Minutes",content:Wme},"video-2-looker":{width:500,height:410,position:"bottom-left",title:"Looker Studio Setup",content:Yme},"video-3-getting-started-with-data-marts":{width:500,height:355,position:"bottom-left",title:"Getting Started with Data Marts",content:Zme}};function Qme(){const{activePopoverId:e,isOpen:t,close:n}=f2();if(!t||!e)return null;const r=Xme[e],{width:s=500,height:i=400,position:c="center",title:u,content:f}=r;return a.jsxs(Bme,{width:s,height:i,position:c,onClose:n,children:[a.jsx(Gme,{onClose:n,children:u&&a.jsx(qme,{children:u})}),a.jsx(Kme,{children:a.jsx(f,{onClose:n})})]})}function Jme(){const e=nP(cme);return a.jsx(TW,{children:a.jsx(Hme,{children:a.jsxs(Vme,{children:[a.jsx(yme,{}),a.jsx(Rme,{}),a.jsx(Qme,{}),a.jsx(mP,{router:e})]})})})}const A8=document.getElementById("root");if(!A8)throw new Error("Root element not found");W9.createRoot(A8).render(a.jsx(h.StrictMode,{children:a.jsx(Jme,{})}));